From df0f8f36f7ca0d562f3f6dee575eb768574ba3d3 Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 28 Jul 2021 22:02:10 +0200 Subject: [PATCH] Auth --- Authentication.php | 25 +++++++++++++++++++++++++ Plugin.php | 5 +++++ channels/.channels.php.swp | Bin 0 -> 12288 bytes channels/channels.php | 18 ++++++++++++++++++ classes/Authentication.php | 25 +++++++++++++++++++++++++ 5 files changed, 73 insertions(+) create mode 100644 Authentication.php create mode 100644 channels/.channels.php.swp create mode 100644 channels/channels.php create mode 100644 classes/Authentication.php diff --git a/Authentication.php b/Authentication.php new file mode 100644 index 0000000..1c766bf --- /dev/null +++ b/Authentication.php @@ -0,0 +1,25 @@ +input('gql_session') === 'SUPER_SECRET_TOKEN') { + return "false"; + } + else { + return "true"; + } + + return $next($request); + } +} diff --git a/Plugin.php b/Plugin.php index ea7e1f8..d06519b 100644 --- a/Plugin.php +++ b/Plugin.php @@ -34,12 +34,17 @@ class Plugin extends PluginBase public function boot() { App::make('October\Rain\Support\ClassLoader')->addDirectories('graphql'); + $this->bootPackages(); + App::register(GraphqlServiceProvider::class); App::register(SubscriptionServiceProvider::class); + $this->app->singleton(DatabaseManager::class, function ($app) { return $app->make('db'); }); + \Illuminate\Support\Facades\Broadcast::routes(['prefix' => '', 'middleware' => 'GermanAirlinesVA\\Graphql\\Classes\\Authentication']); + require("channels/channels.php"); } public function bootPackages() diff --git a/channels/.channels.php.swp b/channels/.channels.php.swp new file mode 100644 index 0000000000000000000000000000000000000000..b1f0dedbe93b445d4aa48ae15174365ddd33d3c1 GIT binary patch literal 12288 zcmeI2QEL-H5XUDzDN+^flSmn((6ltUR$oeL6s)KL`=sqteVE+sUADRGUHA49qAmRd zei8AT2nq^*13!d5IhS05my(cO{Tu5t;;E{?~vcsM$Kn=1G3(5IP@a&(m0Q_$-GF}J{i(B=9Fwe zUSuil9>$*EC1X^a%|0~JZaVKNCqh67oPt2^!usaI?)`fk>qYdP>TSGnefJcJ5+VeI zfDjM@LO=)z0U;m+guwqoz@-&9;btzB4K0>?<&VAmDw_}x0zyCt2mv7=1cZPP5CTF# z2nYcoa1IGj01z$!d|{3M|1W#^c@^LX>oe;U>m%!gb--F;-C}*c0`QL2W<6s)VQsS( zS(jPg+4I}f`y8^7Ckp`~AOwVf5D)@FKnMr{As__)k-+iF79d*Xa%-@rja$LHd8Tar zp$@RsYE92{P{h4RqGnT@FsW6yCnM4LipQ&?QFX0IJDy*^+dG@9Q@AM0Ntb+=bdlSp8-a z=~Enc$nRxHRqma@d*n$vCIZ8Q+sDl5Npc{md3W uYsMAJUotz>0^TYB6UKHN=Y4IM`2NcY!u_Y@Q=qc_*$cJ+9y}@r>VE-!D+0y< literal 0 HcmV?d00001 diff --git a/channels/channels.php b/channels/channels.php new file mode 100644 index 0000000..5abfaec --- /dev/null +++ b/channels/channels.php @@ -0,0 +1,18 @@ +input('gql_session') === 'SUPER_SECRET_TOKEN') { + return "false"; + } + else { + return "true"; + } + + return $next($request); + } +}