]> BookStack Code Mirror - bookstack/commitdiff
Merge branch 'support_for_gitlub_auth' of git://github.com/pixwell-dev/BookStack...
authorDan Brown <redacted>
Sun, 4 Feb 2018 17:51:30 +0000 (17:51 +0000)
committerDan Brown <redacted>
Sun, 4 Feb 2018 17:51:30 +0000 (17:51 +0000)
.env.example
app/Providers/EventServiceProvider.php
app/Services/SocialAuthService.php
composer.json
composer.lock
config/services.php
resources/assets/icons/gitlab.svg [new file with mode: 0644]

index d0a1dbb2638a534dce14042629f7e1d815538384..110b365004842c2ae221ce372f5ac1e2c83ba672 100644 (file)
@@ -50,6 +50,10 @@ OKTA_BASE_URL=false
 OKTA_APP_ID=false
 OKTA_APP_SECRET=false
 
+GITLAB_APP_ID=false
+GITLAB_APP_SECRET=false
+GITLAB_BASE_URI=false
+
 # External services such as Gravatar
 DISABLE_EXTERNAL_SERVICES=false
 
@@ -67,4 +71,4 @@ MAIL_HOST=localhost
 MAIL_PORT=1025
 MAIL_USERNAME=null
 MAIL_PASSWORD=null
-MAIL_ENCRYPTION=null
\ No newline at end of file
+MAIL_ENCRYPTION=null
index 05f9c57c117e2b71111d49fb5308d47d847faeaa..dec7b98c6804a110ebf076130360e912dd9e8ed0 100644 (file)
@@ -18,6 +18,7 @@ class EventServiceProvider extends ServiceProvider
             'SocialiteProviders\Slack\SlackExtendSocialite@handle',
             'SocialiteProviders\Azure\AzureExtendSocialite@handle',
             'SocialiteProviders\Okta\OktaExtendSocialite@handle',
+            'SocialiteProviders\GitLab\GitLabExtendSocialite@handle',
         ],
     ];
 
index 30f7eed0e3dab57a485db4e2b6cd52fcc1d6a964..c31e67d0d95fc8f2af8a126954ec078558191cd0 100644 (file)
@@ -16,7 +16,7 @@ class SocialAuthService
     protected $socialite;
     protected $socialAccount;
 
-    protected $validSocialDrivers = ['google', 'github', 'facebook', 'slack', 'twitter', 'azure', 'okta'];
+    protected $validSocialDrivers = ['google', 'github', 'facebook', 'slack', 'twitter', 'azure', 'okta', 'gitlab'];
 
     /**
      * SocialAuthService constructor.
index 2750b7cb3b26bb5822b29a057785081e888ed17d..10b3592c8b4536234304083d70309cef1743787f 100644 (file)
@@ -18,7 +18,8 @@
         "barryvdh/laravel-snappy": "^0.4.0",
         "socialiteproviders/slack": "^3.0",
         "socialiteproviders/microsoft-azure": "^3.0",
-        "socialiteproviders/okta": "^1.0"
+        "socialiteproviders/okta": "^1.0",
+        "socialiteproviders/gitlab": "^3.0"
     },
     "require-dev": {
         "filp/whoops": "~2.0",
index 9db080babd79fd9b80cf21ba516c7209f337564c..f363557970f134f67ab20bef5c9a9a9a4d6423eb 100644 (file)
@@ -4,7 +4,7 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
         "This file is @generated automatically"
     ],
-    "content-hash": "8ad5cb7acc1115a77404d1be899984ac",
+    "content-hash": "210685bb4ecd91f015682f5cf03ba84d",
     "packages": [
         {
             "name": "aws/aws-sdk-php",
             ],
             "time": "2016-07-19T19:14:21+00:00"
         },
+        {
+            "name": "socialiteproviders/gitlab",
+            "version": "v3.0.1",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/SocialiteProviders/GitLab.git",
+                "reference": "c96dc004563a3caf157608fe9aa9e45c79065d00"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/SocialiteProviders/GitLab/zipball/c96dc004563a3caf157608fe9aa9e45c79065d00",
+                "reference": "c96dc004563a3caf157608fe9aa9e45c79065d00",
+                "shasum": ""
+            },
+            "require": {
+                "php": "^5.6 || ^7.0",
+                "socialiteproviders/manager": "~3.0"
+            },
+            "type": "library",
+            "autoload": {
+                "psr-4": {
+                    "SocialiteProviders\\GitLab\\": ""
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Christoffer Martinsen",
+                    "email": "[email protected]"
+                }
+            ],
+            "description": "GitLab OAuth2 Provider for Laravel Socialite",
+            "time": "2017-01-31T05:06:13+00:00"
+        },
         {
             "name": "socialiteproviders/manager",
             "version": "v3.3.0",
index 18649c093ef379b996ca6fcbb6c96e2fc4891098..31d5a09cf825e42b1cc732307126aece5abe04aa 100644 (file)
@@ -92,7 +92,15 @@ return [
         'redirect' => env('APP_URL') . '/login/service/okta/callback', 
         'base_url' => env('OKTA_BASE_URL'), 
         'name'          => 'Okta',
-    ], 
+    ],
+
+    'gitlab' => [
+        'client_id'     => env('GITLAB_APP_ID'),
+        'client_secret' => env('GITLAB_APP_SECRET'),
+        'redirect'      => env('APP_URL') . '/login/service/gitlab/callback',
+        'instance_uri'  => env('GITLAB_BASE_URI'), // needs only for GitLab self hosted
+        'name'          => 'Gitlab',
+    ],
 
     'ldap' => [
         'server' => env('LDAP_SERVER', false),
diff --git a/resources/assets/icons/gitlab.svg b/resources/assets/icons/gitlab.svg
new file mode 100644 (file)
index 0000000..fa1e92a
--- /dev/null
@@ -0,0 +1 @@
+<svg viewBox="0 0 64 64" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:1.41421;"><g id="Group"><path id="Fill-4" d="M32.134,64.345l11.785,-39.372l-23.569,0l11.784,39.372Z" style="fill:#e24329;"/><path id="Fill-8" d="M32.134,64.345l-11.784,-39.372l-16.515,0l28.299,39.372Z" style="fill:#fc6d26;"/><path id="Fill-12" d="M3.835,24.973l-3.581,11.965c-0.327,1.091 0.031,2.287 0.886,2.961l30.994,24.446l-28.299,-39.372Z" style="fill:#fca326;"/><path id="Fill-16" d="M3.835,24.973l16.515,0l-7.097,-23.713c-0.366,-1.22 -1.956,-1.22 -2.321,0l-7.097,23.713Z" style="fill:#e24329;"/><path id="Fill-18" d="M32.134,64.345l11.785,-39.372l16.515,0l-28.3,39.372Z" style="fill:#fc6d26;"/><path id="Fill-20" d="M60.434,24.973l3.581,11.965c0.326,1.091 -0.031,2.287 -0.886,2.961l-30.995,24.446l28.3,-39.372Z" style="fill:#fca326;"/><path id="Fill-22" d="M60.434,24.973l-16.515,0l7.097,-23.713c0.365,-1.22 1.955,-1.22 2.32,0l7.098,23.713Z" style="fill:#e24329;"/></g></svg>