├── vendor
├── league
│ ├── oauth2-google
│ │ ├── examples
│ │ │ ├── server.sh
│ │ │ ├── reset.php
│ │ │ ├── provider.php
│ │ │ ├── user.php
│ │ │ └── index.php
│ │ ├── src
│ │ │ └── Exception
│ │ │ │ └── HostedDomainException.php
│ │ ├── phpunit.xml.dist
│ │ ├── LICENSE
│ │ ├── composer.json
│ │ └── CONTRIBUTING.md
│ ├── oauth2-github
│ │ ├── .gitignore
│ │ ├── .travis.yml
│ │ ├── .scrutinizer.yml
│ │ ├── test
│ │ │ └── src
│ │ │ │ └── Provider
│ │ │ │ └── GithubResourceOwnerTest.php
│ │ ├── LICENSE
│ │ ├── composer.json
│ │ ├── phpunit.xml
│ │ ├── CHANGELOG.md
│ │ ├── src
│ │ │ └── Provider
│ │ │ │ ├── Exception
│ │ │ │ └── GithubIdentityProviderException.php
│ │ │ │ └── GithubResourceOwner.php
│ │ └── CONTRIBUTING.md
│ ├── oauth2-linkedin
│ │ ├── .gitignore
│ │ ├── .travis.yml
│ │ ├── .scrutinizer.yml
│ │ ├── LICENSE
│ │ ├── composer.json
│ │ ├── phpunit.xml
│ │ └── CONTRIBUTING.md
│ ├── oauth2-instagram
│ │ ├── .gitignore
│ │ ├── .travis.yml
│ │ ├── .scrutinizer.yml
│ │ ├── LICENSE
│ │ ├── composer.json
│ │ ├── phpunit.xml
│ │ ├── src
│ │ │ └── Provider
│ │ │ │ ├── Exception
│ │ │ │ └── InstagramIdentityProviderException.php
│ │ │ │ └── InstagramResourceOwner.php
│ │ ├── CONTRIBUTING.md
│ │ └── CHANGELOG.md
│ ├── oauth2-facebook
│ │ ├── src
│ │ │ ├── Provider
│ │ │ │ ├── Exception
│ │ │ │ │ └── FacebookProviderException.php
│ │ │ │ └── AppSecretProof.php
│ │ │ └── Grant
│ │ │ │ └── FbExchangeToken.php
│ │ ├── composer.json
│ │ └── LICENSE
│ └── oauth2-client
│ │ ├── CREDITS.md
│ │ ├── src
│ │ ├── Grant
│ │ │ ├── Exception
│ │ │ │ └── InvalidGrantException.php
│ │ │ ├── ClientCredentials.php
│ │ │ ├── RefreshToken.php
│ │ │ ├── AuthorizationCode.php
│ │ │ ├── Password.php
│ │ │ └── AbstractGrant.php
│ │ ├── Tool
│ │ │ ├── QueryBuilderTrait.php
│ │ │ ├── BearerAuthorizationTrait.php
│ │ │ ├── ArrayAccessorTrait.php
│ │ │ ├── RequiredParameterTrait.php
│ │ │ ├── RequestFactory.php
│ │ │ └── MacAuthorizationTrait.php
│ │ └── Provider
│ │ │ ├── ResourceOwnerInterface.php
│ │ │ ├── Exception
│ │ │ └── IdentityProviderException.php
│ │ │ └── GenericResourceOwner.php
│ │ ├── LICENSE
│ │ ├── composer.json
│ │ └── CONTRIBUTING.md
├── jakeasmith
│ └── http_build_url
│ │ ├── .gitignore
│ │ ├── .travis.yml
│ │ ├── composer.json
│ │ ├── tests
│ │ └── bootstrap.php
│ │ ├── phpunit.xml.dist
│ │ ├── LICENSE
│ │ └── readme.md
├── omines
│ └── oauth2-gitlab
│ │ ├── .gitignore
│ │ ├── CONTRIBUTING.md
│ │ ├── .travis.yml
│ │ ├── .php_cs
│ │ ├── .scrutinizer.yml
│ │ ├── LICENSE
│ │ ├── phpunit.xml.dist
│ │ ├── composer.json
│ │ ├── CHANGELOG.md
│ │ └── src
│ │ └── Provider
│ │ └── Exception
│ │ └── GitlabIdentityProviderException.php
├── guzzlehttp
│ ├── guzzle
│ │ ├── src
│ │ │ ├── Exception
│ │ │ │ ├── TooManyRedirectsException.php
│ │ │ │ ├── TransferException.php
│ │ │ │ ├── ClientException.php
│ │ │ │ ├── ServerException.php
│ │ │ │ ├── GuzzleException.php
│ │ │ │ ├── SeekException.php
│ │ │ │ ├── ConnectException.php
│ │ │ │ └── BadResponseException.php
│ │ │ ├── functions_include.php
│ │ │ ├── Handler
│ │ │ │ ├── CurlFactoryInterface.php
│ │ │ │ ├── CurlHandler.php
│ │ │ │ └── Proxy.php
│ │ │ └── Cookie
│ │ │ │ └── SessionCookieJar.php
│ │ ├── LICENSE
│ │ └── composer.json
│ ├── psr7
│ │ ├── src
│ │ │ ├── functions_include.php
│ │ │ ├── NoSeekStream.php
│ │ │ ├── LazyOpenStream.php
│ │ │ ├── DroppingStream.php
│ │ │ └── InflateStream.php
│ │ ├── LICENSE
│ │ └── composer.json
│ └── promises
│ │ ├── src
│ │ ├── functions_include.php
│ │ ├── CancellationException.php
│ │ ├── PromisorInterface.php
│ │ ├── AggregateException.php
│ │ ├── TaskQueueInterface.php
│ │ ├── RejectionException.php
│ │ ├── TaskQueue.php
│ │ ├── FulfilledPromise.php
│ │ └── RejectedPromise.php
│ │ ├── Makefile
│ │ ├── composer.json
│ │ ├── LICENSE
│ │ └── CHANGELOG.md
├── wohali
│ └── oauth2-discord-new
│ │ ├── .gitignore
│ │ ├── .scrutinizer.yml
│ │ ├── LICENSE
│ │ ├── .travis.yml
│ │ ├── composer.json
│ │ ├── phpunit.xml
│ │ ├── src
│ │ └── Provider
│ │ │ ├── Exception
│ │ │ └── DiscordIdentityProviderException.php
│ │ │ └── DiscordResourceOwner.php
│ │ └── CONTRIBUTING.md
├── paragonie
│ └── random_compat
│ │ ├── build-phar.sh
│ │ ├── dist
│ │ ├── random_compat.phar.pubkey
│ │ └── random_compat.phar.pubkey.asc
│ │ ├── psalm-autoload.php
│ │ ├── psalm.xml
│ │ ├── composer.json
│ │ ├── LICENSE
│ │ ├── other
│ │ └── build_phar.php
│ │ └── lib
│ │ ├── error_polyfill.php
│ │ ├── random_bytes_mcrypt.php
│ │ └── cast_to_int.php
├── autoload.php
├── composer
│ ├── autoload_classmap.php
│ ├── autoload_namespaces.php
│ ├── autoload_files.php
│ ├── autoload_psr4.php
│ ├── LICENSE
│ └── autoload_real.php
└── psr
│ └── http-message
│ ├── README.md
│ ├── composer.json
│ ├── LICENSE
│ ├── CHANGELOG.md
│ └── src
│ └── ResponseInterface.php
├── templates
└── login-oauth2
│ ├── providers
│ ├── google.html.twig
│ ├── github.html.twig
│ ├── gitlab.html.twig
│ ├── discord.html.twig
│ ├── facebook.html.twig
│ ├── linkedin.html.twig
│ └── instagram.html.twig
│ └── login-oauth2.html.twig
├── media
├── gitlab.svg
├── google.svg
├── facebook.svg
├── linkedin.svg
├── github.svg
├── discord.svg
└── instagram.svg
├── composer.json
├── classes
├── ProviderFactory.php
├── OAuth2.php
└── Providers
│ ├── ProviderInterface.php
│ ├── InstagramProvider.php
│ ├── LinkedinProvider.php
│ ├── FacebookProvider.php
│ ├── DiscordProvider.php
│ ├── GoogleProvider.php
│ ├── GitlabProvider.php
│ ├── BaseProvider.php
│ └── GithubProvider.php
├── watch.sh
├── CHANGELOG.md
├── LICENSE
├── languages
└── en.yaml
├── login-oauth2.yaml
└── css
└── login-oauth2.css
/vendor/league/oauth2-google/examples/server.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | php -S localhost:8080
4 |
--------------------------------------------------------------------------------
/vendor/jakeasmith/http_build_url/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | .idea
3 | build
4 | composer.lock
5 | vendor
--------------------------------------------------------------------------------
/vendor/league/oauth2-github/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 | /vendor
3 | composer.phar
4 | composer.lock
5 | .DS_Store
6 |
--------------------------------------------------------------------------------
/vendor/league/oauth2-linkedin/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 | /vendor
3 | composer.phar
4 | composer.lock
5 | .DS_Store
6 |
--------------------------------------------------------------------------------
/vendor/omines/oauth2-gitlab/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 | /vendor
3 | .php_cs.cache
4 | composer.phar
5 | composer.lock
6 |
--------------------------------------------------------------------------------
/vendor/league/oauth2-instagram/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 | /vendor
3 | composer.phar
4 | composer.lock
5 | .DS_Store
6 | .idea
7 |
--------------------------------------------------------------------------------
/vendor/guzzlehttp/guzzle/src/Exception/TooManyRedirectsException.php:
--------------------------------------------------------------------------------
1 |
2 | {% include('@oauth2-media/google.svg') %}
3 | Google
4 |
--------------------------------------------------------------------------------
/templates/login-oauth2/providers/github.html.twig:
--------------------------------------------------------------------------------
1 |
5 |
--------------------------------------------------------------------------------
/templates/login-oauth2/providers/gitlab.html.twig:
--------------------------------------------------------------------------------
1 |
5 |
--------------------------------------------------------------------------------
/templates/login-oauth2/providers/discord.html.twig:
--------------------------------------------------------------------------------
1 |
5 |
--------------------------------------------------------------------------------
/templates/login-oauth2/providers/facebook.html.twig:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/templates/login-oauth2/providers/linkedin.html.twig:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/templates/login-oauth2/providers/instagram.html.twig:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/vendor/autoload.php:
--------------------------------------------------------------------------------
1 |
GitLab icon
--------------------------------------------------------------------------------
/vendor/psr/http-message/README.md:
--------------------------------------------------------------------------------
1 | PSR Http Message
2 | ================
3 |
4 | This repository holds all interfaces/classes/traits related to
5 | [PSR-7](http://www.php-fig.org/psr/psr-7/).
6 |
7 | Note that this is not a HTTP message implementation of its own. It is merely an
8 | interface that describes a HTTP message. See the specification for more details.
9 |
10 | Usage
11 | -----
12 |
13 | We'll certainly need some stuff in here.
--------------------------------------------------------------------------------
/media/google.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/vendor/guzzlehttp/promises/src/AggregateException.php:
--------------------------------------------------------------------------------
1 | Facebook icon
--------------------------------------------------------------------------------
/vendor/league/oauth2-google/src/Exception/HostedDomainException.php:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/media/linkedin.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/vendor/league/oauth2-client/CREDITS.md:
--------------------------------------------------------------------------------
1 | # OAuth 2.0 Client
2 |
3 | ## Authors
4 |
5 | Also see .
6 |
7 | ### Current Maintainer
8 |
9 | - [Ben Ramsey](https://github.com/ramsey)
10 |
11 | ### Contributors
12 |
13 | - [Alex Bilbie](https://github.com/alexbilbie)
14 | - [Ben Corlett](https://github.com/bencorlett)
15 | - [Ben Ramsey](https://github.com/ramsey)
16 | - [James Mills](https://github.com/jamesmills)
17 | - [Phil Sturgeon](https://github.com/philsturgeon)
18 | - [Rudi Theunissen](https://github.com/rtheunissen)
19 | - [Tom Anderson](https://github.com/TomHAnderson)
20 | - [Woody Gilk](https://github.com/shadowhand)
21 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # v1.0.2
2 | ## mm/dd/2019
3 |
4 | 1. [](#new)
5 | * Implemented built-in support for GitLab Provider [#3](https://github.com/trilbymedia/grav-plugin-login-oauth2/issues/3)
6 | 1. [](#improved)
7 | * Updated vendor libraries
8 | 1. [](#bugfix)
9 | * Fix bad redirect on login error
10 | 1. [](#new)
11 | * Added a setting to enable plugin in admin
12 |
13 | # v1.0.1
14 | ## 06/07/2018
15 |
16 | 1. [](#new)
17 | * Added new Hosted Domain option for Google Provider that allows to limit the login per domain [#1](https://github.com/trilbymedia/grav-plugin-login-oauth2/issues/1)
18 |
19 | # v1.0.0
20 | ## 05/18/2018
21 |
22 | 1. [](#new)
23 | * Plugin released
24 |
--------------------------------------------------------------------------------
/templates/login-oauth2/login-oauth2.html.twig:
--------------------------------------------------------------------------------
1 | {% set providers = grav.oauth2.providers %}
2 | {% set style_class = grav.oauth2.config.button_style == 'row' ? 'row-style' : 'square-style' %}
3 |
17 |
--------------------------------------------------------------------------------
/vendor/composer/autoload_files.php:
--------------------------------------------------------------------------------
1 | $vendorDir . '/guzzlehttp/promises/src/functions_include.php',
10 | 'a0edc8309cc5e1d60e3047b5df6b7052' => $vendorDir . '/guzzlehttp/psr7/src/functions_include.php',
11 | '37a3dc5111fe8f707ab4c132ef1dbc62' => $vendorDir . '/guzzlehttp/guzzle/src/functions_include.php',
12 | '5255c38a0faeba867671b61dfda6d864' => $vendorDir . '/paragonie/random_compat/lib/random.php',
13 | 'b45b351e6b6f7487d819961fef2fda77' => $vendorDir . '/jakeasmith/http_build_url/src/http_build_url.php',
14 | );
15 |
--------------------------------------------------------------------------------
/vendor/league/oauth2-github/.travis.yml:
--------------------------------------------------------------------------------
1 | language: php
2 |
3 | sudo: false
4 |
5 | php:
6 | - 5.6
7 | - 7.0
8 | - 7.1
9 | - hhvm
10 |
11 | matrix:
12 | include:
13 | - php: 5.6
14 | env: 'COMPOSER_FLAGS="--prefer-stable --prefer-lowest"'
15 |
16 | before_script:
17 | - travis_retry composer self-update
18 | - travis_retry composer install --no-interaction --prefer-source --dev
19 | - travis_retry phpenv rehash
20 |
21 | script:
22 | - ./vendor/bin/phpcs --standard=psr2 src/
23 | - ./vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover
24 |
25 | after_script:
26 | - wget https://scrutinizer-ci.com/ocular.phar
27 | - php ocular.phar code-coverage:upload --format=php-clover coverage.clover
28 |
--------------------------------------------------------------------------------
/vendor/league/oauth2-instagram/.travis.yml:
--------------------------------------------------------------------------------
1 | language: php
2 |
3 | sudo: false
4 |
5 | php:
6 | - 5.6
7 | - 7.0
8 | - 7.1
9 | - hhvm
10 |
11 | matrix:
12 | include:
13 | - php: 5.6
14 | env: 'COMPOSER_FLAGS="--prefer-stable --prefer-lowest"'
15 |
16 | before_script:
17 | - travis_retry composer self-update
18 | - travis_retry composer install --no-interaction --prefer-source --dev
19 | - travis_retry phpenv rehash
20 |
21 | script:
22 | - ./vendor/bin/phpcs --standard=psr2 src/
23 | - ./vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover
24 |
25 | after_script:
26 | - wget https://scrutinizer-ci.com/ocular.phar
27 | - php ocular.phar code-coverage:upload --format=php-clover coverage.clover
28 |
--------------------------------------------------------------------------------
/vendor/league/oauth2-linkedin/.travis.yml:
--------------------------------------------------------------------------------
1 | language: php
2 |
3 | sudo: false
4 |
5 | php:
6 | - 5.6
7 | - 7.0
8 | - 7.1
9 | - hhvm
10 |
11 | matrix:
12 | include:
13 | - php: 5.6
14 | env: 'COMPOSER_FLAGS="--prefer-stable --prefer-lowest"'
15 |
16 | before_script:
17 | - travis_retry composer self-update
18 | - travis_retry composer install --no-interaction --prefer-source --dev
19 | - travis_retry phpenv rehash
20 |
21 | script:
22 | - ./vendor/bin/phpcs --standard=psr2 src/
23 | - ./vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover
24 |
25 | after_script:
26 | - wget https://scrutinizer-ci.com/ocular.phar
27 | - php ocular.phar code-coverage:upload --format=php-clover coverage.clover
28 |
--------------------------------------------------------------------------------
/vendor/omines/oauth2-gitlab/.travis.yml:
--------------------------------------------------------------------------------
1 | language: php
2 |
3 | matrix:
4 | include:
5 | - php: 5.6
6 | - php: 7.0
7 | - php: 7.1
8 | - php: 5.6
9 | env: COMPOSER_FLAGS="--prefer-lowest"
10 | # - hhvm # HHVM works fine but disabled as it conflicts with PHP-CS-Fixer
11 |
12 | before_script:
13 | - travis_retry composer self-update --no-progress
14 | - travis_retry composer update --no-interaction --no-progress $COMPOSER_FLAGS
15 | - travis_retry phpenv rehash
16 |
17 | script:
18 | - ./vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover
19 |
20 | after_script:
21 | - wget https://scrutinizer-ci.com/ocular.phar
22 | - php ocular.phar code-coverage:upload --format=php-clover coverage.clover
23 |
--------------------------------------------------------------------------------
/vendor/guzzlehttp/guzzle/src/Exception/SeekException.php:
--------------------------------------------------------------------------------
1 | stream = $stream;
16 | $msg = $msg ?: 'Could not seek the stream to position ' . $pos;
17 | parent::__construct($msg);
18 | }
19 |
20 | /**
21 | * @return StreamInterface
22 | */
23 | public function getStream()
24 | {
25 | return $this->stream;
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/vendor/psr/http-message/composer.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "psr/http-message",
3 | "description": "Common interface for HTTP messages",
4 | "keywords": ["psr", "psr-7", "http", "http-message", "request", "response"],
5 | "homepage": "https://github.com/php-fig/http-message",
6 | "license": "MIT",
7 | "authors": [
8 | {
9 | "name": "PHP-FIG",
10 | "homepage": "http://www.php-fig.org/"
11 | }
12 | ],
13 | "require": {
14 | "php": ">=5.3.0"
15 | },
16 | "autoload": {
17 | "psr-4": {
18 | "Psr\\Http\\Message\\": "src/"
19 | }
20 | },
21 | "extra": {
22 | "branch-alias": {
23 | "dev-master": "1.0.x-dev"
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/vendor/league/oauth2-google/examples/provider.php:
--------------------------------------------------------------------------------
1 | =' ) ) {
6 | class_alias( 'PHPUnit\Framework\Assert', 'PHPUnit_Framework_Assert' );
7 | class_alias( 'PHPUnit\Framework\TestCase', 'PHPUnit_Framework_TestCase' );
8 | class_alias( 'PHPUnit\Framework\Error\Error', 'PHPUnit_Framework_Error' );
9 | class_alias( 'PHPUnit\Framework\Error\Notice', 'PHPUnit_Framework_Error_Notice' );
10 | class_alias( 'PHPUnit\Framework\Error\Warning', 'PHPUnit_Framework_Error_Warning' );
11 | }
12 |
13 | // Past this point, tests will start
14 |
--------------------------------------------------------------------------------
/vendor/jakeasmith/http_build_url/phpunit.xml.dist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | ./tests
6 |
7 |
8 |
9 |
10 | ./src
11 |
12 |
13 |
14 |
17 |
18 |
20 |
21 |
--------------------------------------------------------------------------------
/vendor/guzzlehttp/guzzle/src/Handler/CurlFactoryInterface.php:
--------------------------------------------------------------------------------
1 | GitHub icon
--------------------------------------------------------------------------------
/vendor/guzzlehttp/guzzle/src/Exception/ConnectException.php:
--------------------------------------------------------------------------------
1 |
9 | * @license http://opensource.org/licenses/MIT MIT
10 | * @link http://thephpleague.com/oauth2-client/ Documentation
11 | * @link https://packagist.org/packages/league/oauth2-client Packagist
12 | * @link https://github.com/thephpleague/oauth2-client GitHub
13 | */
14 |
15 | namespace League\OAuth2\Client\Grant\Exception;
16 |
17 | use InvalidArgumentException;
18 |
19 | /**
20 | * Exception thrown if the grant does not extend from AbstractGrant.
21 | *
22 | * @see League\OAuth2\Client\Grant\AbstractGrant
23 | */
24 | class InvalidGrantException extends InvalidArgumentException
25 | {
26 | }
27 |
--------------------------------------------------------------------------------
/vendor/guzzlehttp/promises/composer.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "guzzlehttp/promises",
3 | "description": "Guzzle promises library",
4 | "keywords": ["promise"],
5 | "license": "MIT",
6 | "authors": [
7 | {
8 | "name": "Michael Dowling",
9 | "email": "mtdowling@gmail.com",
10 | "homepage": "https://github.com/mtdowling"
11 | }
12 | ],
13 | "require": {
14 | "php": ">=5.5.0"
15 | },
16 | "require-dev": {
17 | "phpunit/phpunit": "^4.0"
18 | },
19 | "autoload": {
20 | "psr-4": {
21 | "GuzzleHttp\\Promise\\": "src/"
22 | },
23 | "files": ["src/functions_include.php"]
24 | },
25 | "scripts": {
26 | "test": "vendor/bin/phpunit",
27 | "test-ci": "vendor/bin/phpunit --coverage-text"
28 | },
29 | "extra": {
30 | "branch-alias": {
31 | "dev-master": "1.4-dev"
32 | }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/vendor/omines/oauth2-gitlab/.php_cs:
--------------------------------------------------------------------------------
1 | files()
13 | ->name('*.php')
14 | ->name('*.php')
15 | ->in(__DIR__.'/src')
16 | ->in(__DIR__.'/test')
17 | ;
18 |
19 | return PhpCsFixer\Config::create()
20 | ->setRules([
21 | '@Symfony' => true,
22 | 'array_syntax' => ['syntax' => 'short'],
23 | 'concat_space' => ['spacing' => 'one'],
24 | 'header_comment' => ['header' => $header],
25 |
26 | 'blank_line_before_return' => false,
27 | 'phpdoc_align' => false,
28 | 'phpdoc_separation' => false,
29 | 'phpdoc_var_without_name' => false,
30 | ])
31 | ->setFinder($finder)
32 | ;
33 |
--------------------------------------------------------------------------------
/vendor/composer/autoload_psr4.php:
--------------------------------------------------------------------------------
1 | array($vendorDir . '/psr/http-message/src'),
10 | 'Omines\\OAuth2\\Client\\' => array($vendorDir . '/omines/oauth2-gitlab/src'),
11 | 'League\\OAuth2\\Client\\' => array($vendorDir . '/league/oauth2-client/src', $vendorDir . '/league/oauth2-facebook/src', $vendorDir . '/league/oauth2-github/src', $vendorDir . '/league/oauth2-google/src', $vendorDir . '/league/oauth2-instagram/src', $vendorDir . '/league/oauth2-linkedin/src'),
12 | 'GuzzleHttp\\Psr7\\' => array($vendorDir . '/guzzlehttp/psr7/src'),
13 | 'GuzzleHttp\\Promise\\' => array($vendorDir . '/guzzlehttp/promises/src'),
14 | 'GuzzleHttp\\' => array($vendorDir . '/guzzlehttp/guzzle/src'),
15 | 'Grav\\Plugin\\Login\\OAuth2\\' => array($baseDir . '/classes'),
16 | );
17 |
--------------------------------------------------------------------------------
/vendor/guzzlehttp/guzzle/src/Exception/BadResponseException.php:
--------------------------------------------------------------------------------
1 | getResourceOwner($token);
18 |
19 | // Use these details to create a new profile
20 | printf('Hello %s!
', $userDetails->getFirstname());
21 |
22 | } catch (Exception $e) {
23 |
24 | // Failed to get user details
25 | exit('Something went wrong: ' . $e->getMessage());
26 |
27 | }
28 |
29 | // Use this to interact with an API on the users behalf
30 | echo $token->getToken()."
";
31 |
32 | // Use this to get a new access token if the old one expires
33 | echo $token->getRefreshToken()."
";
34 |
35 | // Number of seconds until the access token will expire, and need refreshing
36 | echo $token->getExpires()."
";
37 |
--------------------------------------------------------------------------------
/vendor/league/oauth2-google/phpunit.xml.dist:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
15 | ./test
16 |
17 |
18 |
19 |
20 | src/
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/media/discord.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/vendor/guzzlehttp/psr7/src/LazyOpenStream.php:
--------------------------------------------------------------------------------
1 | filename = $filename;
27 | $this->mode = $mode;
28 | }
29 |
30 | /**
31 | * Creates the underlying stream lazily when required.
32 | *
33 | * @return StreamInterface
34 | */
35 | protected function createStream()
36 | {
37 | return stream_for(try_fopen($this->filename, $this->mode));
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/vendor/league/oauth2-github/.scrutinizer.yml:
--------------------------------------------------------------------------------
1 | filter:
2 | excluded_paths: [test/*]
3 | checks:
4 | php:
5 | code_rating: true
6 | remove_extra_empty_lines: true
7 | remove_php_closing_tag: true
8 | remove_trailing_whitespace: true
9 | fix_use_statements:
10 | remove_unused: true
11 | preserve_multiple: false
12 | preserve_blanklines: true
13 | order_alphabetically: true
14 | fix_php_opening_tag: true
15 | fix_linefeed: true
16 | fix_line_ending: true
17 | fix_identation_4spaces: true
18 | fix_doc_comments: true
19 | tools:
20 | external_code_coverage:
21 | timeout: 600
22 | runs: 3
23 | php_analyzer: true
24 | php_code_coverage: false
25 | php_code_sniffer:
26 | config:
27 | standard: PSR2
28 | filter:
29 | paths: ['src']
30 | php_loc:
31 | enabled: true
32 | excluded_dirs: [vendor, test]
33 | php_cpd:
34 | enabled: true
35 | excluded_dirs: [vendor, test]
36 |
--------------------------------------------------------------------------------
/vendor/paragonie/random_compat/composer.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "paragonie/random_compat",
3 | "description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7",
4 | "keywords": [
5 | "csprng",
6 | "random",
7 | "pseudorandom"
8 | ],
9 | "license": "MIT",
10 | "type": "library",
11 | "authors": [
12 | {
13 | "name": "Paragon Initiative Enterprises",
14 | "email": "security@paragonie.com",
15 | "homepage": "https://paragonie.com"
16 | }
17 | ],
18 | "support": {
19 | "issues": "https://github.com/paragonie/random_compat/issues",
20 | "email": "info@paragonie.com",
21 | "source": "https://github.com/paragonie/random_compat"
22 | },
23 | "require": {
24 | "php": ">=5.2.0"
25 | },
26 | "require-dev": {
27 | "phpunit/phpunit": "4.*|5.*"
28 | },
29 | "suggest": {
30 | "ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes."
31 | },
32 | "autoload": {
33 | "files": [
34 | "lib/random.php"
35 | ]
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/vendor/league/oauth2-client/src/Tool/QueryBuilderTrait.php:
--------------------------------------------------------------------------------
1 |
9 | * @license http://opensource.org/licenses/MIT MIT
10 | * @link http://thephpleague.com/oauth2-client/ Documentation
11 | * @link https://packagist.org/packages/league/oauth2-client Packagist
12 | * @link https://github.com/thephpleague/oauth2-client GitHub
13 | */
14 |
15 | namespace League\OAuth2\Client\Tool;
16 |
17 | /**
18 | * Provides a standard way to generate query strings.
19 | */
20 | trait QueryBuilderTrait
21 | {
22 | /**
23 | * Build a query string from an array.
24 | *
25 | * @param array $params
26 | *
27 | * @return string
28 | */
29 | protected function buildQueryString(array $params)
30 | {
31 | return http_build_query($params, null, '&', \PHP_QUERY_RFC3986);
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/vendor/league/oauth2-instagram/.scrutinizer.yml:
--------------------------------------------------------------------------------
1 | filter:
2 | excluded_paths: [test/*]
3 | checks:
4 | php:
5 | code_rating: true
6 | remove_extra_empty_lines: true
7 | remove_php_closing_tag: true
8 | remove_trailing_whitespace: true
9 | fix_use_statements:
10 | remove_unused: true
11 | preserve_multiple: false
12 | preserve_blanklines: true
13 | order_alphabetically: true
14 | fix_php_opening_tag: true
15 | fix_linefeed: true
16 | fix_line_ending: true
17 | fix_identation_4spaces: true
18 | fix_doc_comments: true
19 | tools:
20 | external_code_coverage:
21 | timeout: 600
22 | runs: 2
23 | php_analyzer: true
24 | php_code_coverage: false
25 | php_code_sniffer:
26 | config:
27 | standard: PSR2
28 | filter:
29 | paths: ['src']
30 | php_loc:
31 | enabled: true
32 | excluded_dirs: [vendor, test]
33 | php_cpd:
34 | enabled: true
35 | excluded_dirs: [vendor, test]
36 |
--------------------------------------------------------------------------------
/vendor/league/oauth2-linkedin/.scrutinizer.yml:
--------------------------------------------------------------------------------
1 | filter:
2 | excluded_paths: [test/*]
3 | checks:
4 | php:
5 | code_rating: true
6 | remove_extra_empty_lines: true
7 | remove_php_closing_tag: true
8 | remove_trailing_whitespace: true
9 | fix_use_statements:
10 | remove_unused: true
11 | preserve_multiple: false
12 | preserve_blanklines: true
13 | order_alphabetically: true
14 | fix_php_opening_tag: true
15 | fix_linefeed: true
16 | fix_line_ending: true
17 | fix_identation_4spaces: true
18 | fix_doc_comments: true
19 | tools:
20 | external_code_coverage:
21 | timeout: 600
22 | runs: 3
23 | php_analyzer: true
24 | php_code_coverage: false
25 | php_code_sniffer:
26 | config:
27 | standard: PSR2
28 | filter:
29 | paths: ['src']
30 | php_loc:
31 | enabled: true
32 | excluded_dirs: [vendor, test]
33 | php_cpd:
34 | enabled: true
35 | excluded_dirs: [vendor, test]
36 |
--------------------------------------------------------------------------------
/vendor/omines/oauth2-gitlab/.scrutinizer.yml:
--------------------------------------------------------------------------------
1 | filter:
2 | excluded_paths: [test/*]
3 | checks:
4 | php:
5 | code_rating: true
6 | remove_extra_empty_lines: true
7 | remove_php_closing_tag: true
8 | remove_trailing_whitespace: true
9 | fix_use_statements:
10 | remove_unused: true
11 | preserve_multiple: false
12 | preserve_blanklines: true
13 | order_alphabetically: true
14 | fix_php_opening_tag: true
15 | fix_linefeed: true
16 | fix_line_ending: true
17 | fix_identation_4spaces: true
18 | fix_doc_comments: true
19 | tools:
20 | external_code_coverage:
21 | timeout: 600
22 | runs: 3
23 | php_analyzer: true
24 | php_code_coverage: false
25 | php_code_sniffer:
26 | config:
27 | standard: PSR2
28 | filter:
29 | paths: ['src', 'test']
30 | php_loc:
31 | enabled: true
32 | excluded_dirs: [vendor, test]
33 | php_cpd:
34 | enabled: true
35 | excluded_dirs: [vendor, test]
36 |
--------------------------------------------------------------------------------
/vendor/wohali/oauth2-discord-new/.scrutinizer.yml:
--------------------------------------------------------------------------------
1 | filter:
2 | excluded_paths: [test/*]
3 | checks:
4 | php:
5 | code_rating: true
6 | remove_extra_empty_lines: true
7 | remove_php_closing_tag: true
8 | remove_trailing_whitespace: true
9 | fix_use_statements:
10 | remove_unused: true
11 | preserve_multiple: false
12 | preserve_blanklines: true
13 | order_alphabetically: true
14 | fix_php_opening_tag: true
15 | fix_linefeed: true
16 | fix_line_ending: true
17 | fix_identation_4spaces: true
18 | fix_doc_comments: true
19 | tools:
20 | external_code_coverage:
21 | timeout: 600
22 | runs: 3
23 | php_analyzer: true
24 | php_code_coverage: false
25 | php_code_sniffer:
26 | config:
27 | standard: PSR2
28 | filter:
29 | paths: ['src']
30 | php_loc:
31 | enabled: true
32 | excluded_dirs: [vendor, test]
33 | php_cpd:
34 | enabled: true
35 | excluded_dirs: [vendor, test]
36 |
37 |
--------------------------------------------------------------------------------
/vendor/league/oauth2-github/test/src/Provider/GithubResourceOwnerTest.php:
--------------------------------------------------------------------------------
1 | getUrl();
12 |
13 | $this->assertNull($url);
14 | }
15 |
16 | public function testUrlIsDomainWithoutNickname()
17 | {
18 | $domain = uniqid();
19 | $user = new \League\OAuth2\Client\Provider\GithubResourceOwner;
20 | $user->setDomain($domain);
21 |
22 | $url = $user->getUrl();
23 |
24 | $this->assertEquals($domain, $url);
25 | }
26 |
27 | public function testUrlIsNicknameWithoutDomain()
28 | {
29 | $nickname = uniqid();
30 | $user = new \League\OAuth2\Client\Provider\GithubResourceOwner(['login' => $nickname]);
31 |
32 | $url = $user->getUrl();
33 |
34 | $this->assertEquals($nickname, $url);
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/vendor/league/oauth2-facebook/composer.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "league/oauth2-facebook",
3 | "description": "Facebook OAuth 2.0 Client Provider for The PHP League OAuth2-Client",
4 | "license": "MIT",
5 | "authors": [
6 | {
7 | "name": "Sammy Kaye Powers",
8 | "email": "me@sammyk.me",
9 | "homepage": "http://www.sammyk.me"
10 | }
11 | ],
12 | "keywords": [
13 | "oauth",
14 | "oauth2",
15 | "client",
16 | "authorization",
17 | "authentication",
18 | "facebook"
19 | ],
20 | "require": {
21 | "php": "^5.6 || ^7.0",
22 | "league/oauth2-client": "^2.0"
23 | },
24 | "require-dev": {
25 | "phpunit/phpunit": "~4.0",
26 | "mockery/mockery": "~0.9",
27 | "squizlabs/php_codesniffer": "~2.0"
28 | },
29 | "autoload": {
30 | "psr-4": {
31 | "League\\OAuth2\\Client\\": "src/"
32 | }
33 | },
34 | "autoload-dev": {
35 | "psr-4": {
36 | "League\\OAuth2\\Client\\Test\\": "tests/src/"
37 | }
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2018 Trilby Media, LLC
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/vendor/composer/LICENSE:
--------------------------------------------------------------------------------
1 |
2 | Copyright (c) Nils Adermann, Jordi Boggiano
3 |
4 | Permission is hereby granted, free of charge, to any person obtaining a copy
5 | of this software and associated documentation files (the "Software"), to deal
6 | in the Software without restriction, including without limitation the rights
7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | copies of the Software, and to permit persons to whom the Software is furnished
9 | to do so, subject to the following conditions:
10 |
11 | The above copyright notice and this permission notice shall be included in all
12 | copies or substantial portions of the Software.
13 |
14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 | THE SOFTWARE.
21 |
22 |
--------------------------------------------------------------------------------
/vendor/psr/http-message/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2014 PHP Framework Interoperability Group
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy
4 | of this software and associated documentation files (the "Software"), to deal
5 | in the Software without restriction, including without limitation the rights
6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 | copies of the Software, and to permit persons to whom the Software is
8 | furnished to do so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in
11 | all copies or substantial portions of the Software.
12 |
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19 | THE SOFTWARE.
20 |
--------------------------------------------------------------------------------
/vendor/league/oauth2-github/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2015 Steven Maguire
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in
13 | all copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | THE SOFTWARE.
22 |
--------------------------------------------------------------------------------
/vendor/jakeasmith/http_build_url/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2015 Jake A. Smith
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/vendor/league/oauth2-instagram/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2015 Steven Maguire
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in
13 | all copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | THE SOFTWARE.
22 |
--------------------------------------------------------------------------------
/vendor/league/oauth2-linkedin/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2015 Steven Maguire
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in
13 | all copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | THE SOFTWARE.
22 |
--------------------------------------------------------------------------------
/vendor/guzzlehttp/psr7/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2015 Michael Dowling, https://github.com/mtdowling
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy
4 | of this software and associated documentation files (the "Software"), to deal
5 | in the Software without restriction, including without limitation the rights
6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 | copies of the Software, and to permit persons to whom the Software is
8 | furnished to do so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in
11 | all copies or substantial portions of the Software.
12 |
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19 | THE SOFTWARE.
20 |
--------------------------------------------------------------------------------
/vendor/league/oauth2-google/examples/index.php:
--------------------------------------------------------------------------------
1 | getAuthorizationUrl();
14 | $_SESSION['oauth2state'] = $provider->getState();
15 | header('Location: ' . $authUrl);
16 | exit;
17 |
18 | } elseif (empty($_GET['state']) || ($_GET['state'] !== $_SESSION['oauth2state'])) {
19 |
20 | // State is invalid, possible CSRF attack in progress
21 | unset($_SESSION['oauth2state']);
22 | exit('Invalid state');
23 |
24 | } else {
25 |
26 | // Try to get an access token (using the authorization code grant)
27 | $token = $provider->getAccessToken('authorization_code', [
28 | 'code' => $_GET['code']
29 | ]);
30 |
31 | $_SESSION['token'] = serialize($token);
32 |
33 | // Optional: Now you have a token you can look up a users profile data
34 | header('Location: /user.php');
35 | }
36 |
--------------------------------------------------------------------------------
/vendor/guzzlehttp/psr7/composer.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "guzzlehttp/psr7",
3 | "type": "library",
4 | "description": "PSR-7 message implementation that also provides common utility methods",
5 | "keywords": ["request", "response", "message", "stream", "http", "uri", "url"],
6 | "license": "MIT",
7 | "authors": [
8 | {
9 | "name": "Michael Dowling",
10 | "email": "mtdowling@gmail.com",
11 | "homepage": "https://github.com/mtdowling"
12 | },
13 | {
14 | "name": "Tobias Schultze",
15 | "homepage": "https://github.com/Tobion"
16 | }
17 | ],
18 | "require": {
19 | "php": ">=5.4.0",
20 | "psr/http-message": "~1.0"
21 | },
22 | "require-dev": {
23 | "phpunit/phpunit": "~4.0"
24 | },
25 | "provide": {
26 | "psr/http-message-implementation": "1.0"
27 | },
28 | "autoload": {
29 | "psr-4": {
30 | "GuzzleHttp\\Psr7\\": "src/"
31 | },
32 | "files": ["src/functions_include.php"]
33 | },
34 | "extra": {
35 | "branch-alias": {
36 | "dev-master": "1.4-dev"
37 | }
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/vendor/league/oauth2-facebook/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2015 Sammy Kaye Powers
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in
13 | all copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | THE SOFTWARE.
22 |
--------------------------------------------------------------------------------
/vendor/league/oauth2-google/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2015 Woody Gilk
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in
13 | all copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | THE SOFTWARE.
22 |
--------------------------------------------------------------------------------
/vendor/guzzlehttp/guzzle/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2011-2018 Michael Dowling, https://github.com/mtdowling
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy
4 | of this software and associated documentation files (the "Software"), to deal
5 | in the Software without restriction, including without limitation the rights
6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 | copies of the Software, and to permit persons to whom the Software is
8 | furnished to do so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in
11 | all copies or substantial portions of the Software.
12 |
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19 | THE SOFTWARE.
20 |
--------------------------------------------------------------------------------
/vendor/guzzlehttp/promises/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2015-2016 Michael Dowling, https://github.com/mtdowling
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy
4 | of this software and associated documentation files (the "Software"), to deal
5 | in the Software without restriction, including without limitation the rights
6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 | copies of the Software, and to permit persons to whom the Software is
8 | furnished to do so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in
11 | all copies or substantial portions of the Software.
12 |
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19 | THE SOFTWARE.
20 |
--------------------------------------------------------------------------------
/vendor/league/oauth2-client/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2013-2018 Alex Bilbie
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in
13 | all copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | THE SOFTWARE.
22 |
--------------------------------------------------------------------------------
/vendor/league/oauth2-client/src/Grant/ClientCredentials.php:
--------------------------------------------------------------------------------
1 |
9 | * @license http://opensource.org/licenses/MIT MIT
10 | * @link http://thephpleague.com/oauth2-client/ Documentation
11 | * @link https://packagist.org/packages/league/oauth2-client Packagist
12 | * @link https://github.com/thephpleague/oauth2-client GitHub
13 | */
14 |
15 | namespace League\OAuth2\Client\Grant;
16 |
17 | /**
18 | * Represents a client credentials grant.
19 | *
20 | * @link http://tools.ietf.org/html/rfc6749#section-1.3.4 Client Credentials (RFC 6749, §1.3.4)
21 | */
22 | class ClientCredentials extends AbstractGrant
23 | {
24 | /**
25 | * @inheritdoc
26 | */
27 | protected function getName()
28 | {
29 | return 'client_credentials';
30 | }
31 |
32 | /**
33 | * @inheritdoc
34 | */
35 | protected function getRequiredRequestParameters()
36 | {
37 | return [];
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/vendor/paragonie/random_compat/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2015 Paragon Initiative Enterprises
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
23 |
--------------------------------------------------------------------------------
/vendor/omines/oauth2-gitlab/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2017 Omines Internetbureau B.V. / Steven Maguire
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in
13 | all copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | THE SOFTWARE.
22 |
--------------------------------------------------------------------------------
/vendor/wohali/oauth2-discord-new/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2017 Joan Touzet
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in
13 | all copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | THE SOFTWARE.
22 |
23 |
--------------------------------------------------------------------------------
/vendor/league/oauth2-github/composer.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "league/oauth2-github",
3 | "description": "Github OAuth 2.0 Client Provider for The PHP League OAuth2-Client",
4 | "license": "MIT",
5 | "authors": [
6 | {
7 | "name": "Steven Maguire",
8 | "email": "stevenmaguire@gmail.com",
9 | "homepage": "https://github.com/stevenmaguire"
10 | }
11 | ],
12 | "keywords": [
13 | "oauth",
14 | "oauth2",
15 | "client",
16 | "authorization",
17 | "authorisation",
18 | "github"
19 | ],
20 | "require": {
21 | "league/oauth2-client": "^2.0"
22 | },
23 | "require-dev": {
24 | "phpunit/phpunit": "~4.0",
25 | "mockery/mockery": "~0.9",
26 | "squizlabs/php_codesniffer": "~2.0"
27 | },
28 | "autoload": {
29 | "psr-4": {
30 | "League\\OAuth2\\Client\\": "src/"
31 | }
32 | },
33 | "autoload-dev": {
34 | "psr-4": {
35 | "League\\OAuth2\\Client\\Test\\": "test/src/"
36 | }
37 | },
38 | "extra": {
39 | "branch-alias": {
40 | "dev-master": "1.0.x-dev"
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/vendor/league/oauth2-client/src/Provider/ResourceOwnerInterface.php:
--------------------------------------------------------------------------------
1 |
9 | * @license http://opensource.org/licenses/MIT MIT
10 | * @link http://thephpleague.com/oauth2-client/ Documentation
11 | * @link https://packagist.org/packages/league/oauth2-client Packagist
12 | * @link https://github.com/thephpleague/oauth2-client GitHub
13 | */
14 |
15 | namespace League\OAuth2\Client\Provider;
16 |
17 | /**
18 | * Classes implementing `ResourceOwnerInterface` may be used to represent
19 | * the resource owner authenticated with a service provider.
20 | */
21 | interface ResourceOwnerInterface
22 | {
23 | /**
24 | * Returns the identifier of the authorized resource owner.
25 | *
26 | * @return mixed
27 | */
28 | public function getId();
29 |
30 | /**
31 | * Return all of the owner details available as an array.
32 | *
33 | * @return array
34 | */
35 | public function toArray();
36 | }
37 |
--------------------------------------------------------------------------------
/vendor/league/oauth2-linkedin/composer.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "league/oauth2-linkedin",
3 | "description": "LinkedIn OAuth 2.0 Client Provider for The PHP League OAuth2-Client",
4 | "license": "MIT",
5 | "authors": [
6 | {
7 | "name": "Steven Maguire",
8 | "email": "stevenmaguire@gmail.com",
9 | "homepage": "https://github.com/stevenmaguire"
10 | }
11 | ],
12 | "keywords": [
13 | "oauth",
14 | "oauth2",
15 | "client",
16 | "authorization",
17 | "authorisation",
18 | "linkedin"
19 | ],
20 | "require": {
21 | "league/oauth2-client": "^2.0"
22 | },
23 | "require-dev": {
24 | "phpunit/phpunit": "~4.0",
25 | "mockery/mockery": "~0.9",
26 | "squizlabs/php_codesniffer": "~2.0"
27 | },
28 | "autoload": {
29 | "psr-4": {
30 | "League\\OAuth2\\Client\\": "src/"
31 | }
32 | },
33 | "autoload-dev": {
34 | "psr-4": {
35 | "League\\OAuth2\\Client\\Test\\": "test/src/"
36 | }
37 | },
38 | "extra": {
39 | "branch-alias": {
40 | "dev-master": "1.0.x-dev"
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/vendor/league/oauth2-client/src/Grant/RefreshToken.php:
--------------------------------------------------------------------------------
1 |
9 | * @license http://opensource.org/licenses/MIT MIT
10 | * @link http://thephpleague.com/oauth2-client/ Documentation
11 | * @link https://packagist.org/packages/league/oauth2-client Packagist
12 | * @link https://github.com/thephpleague/oauth2-client GitHub
13 | */
14 |
15 | namespace League\OAuth2\Client\Grant;
16 |
17 | /**
18 | * Represents a refresh token grant.
19 | *
20 | * @link http://tools.ietf.org/html/rfc6749#section-6 Refreshing an Access Token (RFC 6749, §6)
21 | */
22 | class RefreshToken extends AbstractGrant
23 | {
24 | /**
25 | * @inheritdoc
26 | */
27 | protected function getName()
28 | {
29 | return 'refresh_token';
30 | }
31 |
32 | /**
33 | * @inheritdoc
34 | */
35 | protected function getRequiredRequestParameters()
36 | {
37 | return [
38 | 'refresh_token',
39 | ];
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/classes/OAuth2.php:
--------------------------------------------------------------------------------
1 | config = Grav::instance()['config']->get('plugins.login-oauth2');
14 | }
15 |
16 | public function getConfig()
17 | {
18 | return $this->config;
19 | }
20 |
21 | public function addEnabledProviders()
22 | {
23 | $providers = isset($this->config['providers']) ? (array)$this->config['providers'] : [];
24 |
25 | foreach ($providers as $provider => $options) {
26 | if ($options['enabled']) {
27 | $this->addProvider($provider);
28 | }
29 | }
30 | }
31 |
32 | public function addProvider($provider = null)
33 | {
34 | $this->providers[] = $provider;
35 | }
36 |
37 | public function getProviders()
38 | {
39 | return $this->providers;
40 | }
41 |
42 | public function isValidProvider($provider)
43 | {
44 | if (in_array($provider, $this->providers,true)) {
45 | return true;
46 | }
47 | return false;
48 | }
49 | }
--------------------------------------------------------------------------------
/vendor/league/oauth2-client/src/Tool/BearerAuthorizationTrait.php:
--------------------------------------------------------------------------------
1 |
9 | * @license http://opensource.org/licenses/MIT MIT
10 | * @link http://thephpleague.com/oauth2-client/ Documentation
11 | * @link https://packagist.org/packages/league/oauth2-client Packagist
12 | * @link https://github.com/thephpleague/oauth2-client GitHub
13 | */
14 |
15 | namespace League\OAuth2\Client\Tool;
16 |
17 | /**
18 | * Enables `Bearer` header authorization for providers.
19 | *
20 | * @link http://tools.ietf.org/html/rfc6750 Bearer Token Usage (RFC 6750)
21 | */
22 | trait BearerAuthorizationTrait
23 | {
24 | /**
25 | * Returns authorization headers for the 'bearer' grant.
26 | *
27 | * @param mixed|null $token Either a string or an access token instance
28 | * @return array
29 | */
30 | protected function getAuthorizationHeaders($token = null)
31 | {
32 | return ['Authorization' => 'Bearer ' . $token];
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/vendor/league/oauth2-client/src/Grant/AuthorizationCode.php:
--------------------------------------------------------------------------------
1 |
9 | * @license http://opensource.org/licenses/MIT MIT
10 | * @link http://thephpleague.com/oauth2-client/ Documentation
11 | * @link https://packagist.org/packages/league/oauth2-client Packagist
12 | * @link https://github.com/thephpleague/oauth2-client GitHub
13 | */
14 |
15 | namespace League\OAuth2\Client\Grant;
16 |
17 | /**
18 | * Represents an authorization code grant.
19 | *
20 | * @link http://tools.ietf.org/html/rfc6749#section-1.3.1 Authorization Code (RFC 6749, §1.3.1)
21 | */
22 | class AuthorizationCode extends AbstractGrant
23 | {
24 | /**
25 | * @inheritdoc
26 | */
27 | protected function getName()
28 | {
29 | return 'authorization_code';
30 | }
31 |
32 | /**
33 | * @inheritdoc
34 | */
35 | protected function getRequiredRequestParameters()
36 | {
37 | return [
38 | 'code',
39 | ];
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/vendor/psr/http-message/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Changelog
2 |
3 | All notable changes to this project will be documented in this file, in reverse chronological order by release.
4 |
5 | ## 1.0.1 - 2016-08-06
6 |
7 | ### Added
8 |
9 | - Nothing.
10 |
11 | ### Deprecated
12 |
13 | - Nothing.
14 |
15 | ### Removed
16 |
17 | - Nothing.
18 |
19 | ### Fixed
20 |
21 | - Updated all `@return self` annotation references in interfaces to use
22 | `@return static`, which more closelly follows the semantics of the
23 | specification.
24 | - Updated the `MessageInterface::getHeaders()` return annotation to use the
25 | value `string[][]`, indicating the format is a nested array of strings.
26 | - Updated the `@link` annotation for `RequestInterface::withRequestTarget()`
27 | to point to the correct section of RFC 7230.
28 | - Updated the `ServerRequestInterface::withUploadedFiles()` parameter annotation
29 | to add the parameter name (`$uploadedFiles`).
30 | - Updated a `@throws` annotation for the `UploadedFileInterface::moveTo()`
31 | method to correctly reference the method parameter (it was referencing an
32 | incorrect parameter name previously).
33 |
34 | ## 1.0.0 - 2016-05-18
35 |
36 | Initial stable release; reflects accepted PSR-7 specification.
37 |
--------------------------------------------------------------------------------
/vendor/wohali/oauth2-discord-new/.travis.yml:
--------------------------------------------------------------------------------
1 | language: php
2 |
3 | sudo: false
4 |
5 | matrix:
6 | include:
7 | - php: 5.6
8 | env: 'COMPOSER_FLAGS="--prefer-stable --prefer-lowest"'
9 | - php: 7.0
10 | - php: 7.1
11 | - php: nightly
12 | - php: hhvm
13 | sudo: required
14 | dist: trusty
15 | group: edge
16 | - php: hhvm-nightly
17 | sudo: required
18 | dist: trusty
19 | group: edge
20 | fast_finish: true
21 | allow_failures:
22 | - php: nightly
23 | - php: hhvm-nightly
24 |
25 |
26 | before_script:
27 | - travis_retry composer self-update
28 | - travis_retry composer install --no-interaction --prefer-source --dev
29 | - travis_retry phpenv rehash
30 |
31 | script:
32 | - ./vendor/bin/parallel-lint src test
33 | - ./vendor/bin/phpcs src --standard=psr2 -sp
34 | - ./vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover
35 |
36 | after_success:
37 | - wget https://scrutinizer-ci.com/ocular.phar
38 | - php ocular.phar code-coverage:upload --format=php-clover coverage.clover
39 | - mkdir -p build/logs
40 | - wget https://github.com/satooshi/php-coveralls/releases/download/v1.0.2/coveralls.phar
41 | - travis_retry php coveralls.phar -x coverage.clover
42 |
--------------------------------------------------------------------------------
/vendor/league/oauth2-client/src/Grant/Password.php:
--------------------------------------------------------------------------------
1 |
9 | * @license http://opensource.org/licenses/MIT MIT
10 | * @link http://thephpleague.com/oauth2-client/ Documentation
11 | * @link https://packagist.org/packages/league/oauth2-client Packagist
12 | * @link https://github.com/thephpleague/oauth2-client GitHub
13 | */
14 |
15 | namespace League\OAuth2\Client\Grant;
16 |
17 | /**
18 | * Represents a resource owner password credentials grant.
19 | *
20 | * @link http://tools.ietf.org/html/rfc6749#section-1.3.3 Resource Owner Password Credentials (RFC 6749, §1.3.3)
21 | */
22 | class Password extends AbstractGrant
23 | {
24 | /**
25 | * @inheritdoc
26 | */
27 | protected function getName()
28 | {
29 | return 'password';
30 | }
31 |
32 | /**
33 | * @inheritdoc
34 | */
35 | protected function getRequiredRequestParameters()
36 | {
37 | return [
38 | 'username',
39 | 'password',
40 | ];
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/vendor/league/oauth2-instagram/composer.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "league/oauth2-instagram",
3 | "description": "Instagram OAuth 2.0 Client Provider for The PHP League OAuth2-Client",
4 | "license": "MIT",
5 | "authors": [
6 | {
7 | "name": "Steven Maguire",
8 | "email": "stevenmaguire@gmail.com",
9 | "homepage": "https://github.com/stevenmaguire"
10 | }
11 | ],
12 | "keywords": [
13 | "oauth",
14 | "oauth2",
15 | "client",
16 | "authorization",
17 | "authorisation",
18 | "instagram"
19 | ],
20 | "require": {
21 | "league/oauth2-client": "^2.0",
22 | "jakeasmith/http_build_url": "^1.0"
23 | },
24 | "require-dev": {
25 | "phpunit/phpunit": "~4.0",
26 | "mockery/mockery": "~0.9",
27 | "squizlabs/php_codesniffer": "~2.0"
28 | },
29 | "autoload": {
30 | "psr-4": {
31 | "League\\OAuth2\\Client\\": "src/"
32 | }
33 | },
34 | "autoload-dev": {
35 | "psr-4": {
36 | "League\\OAuth2\\Client\\Test\\": "test/src/"
37 | }
38 | },
39 | "extra": {
40 | "branch-alias": {
41 | "dev-master": "1.0.x-dev"
42 | }
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/vendor/league/oauth2-google/composer.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "league/oauth2-google",
3 | "description": "Google OAuth 2.0 Client Provider for The PHP League OAuth2-Client",
4 | "license": "MIT",
5 | "authors": [
6 | {
7 | "name": "Woody Gilk",
8 | "email": "woody.gilk@gmail.com",
9 | "homepage": "http://shadowhand.me"
10 | }
11 | ],
12 | "keywords": [
13 | "oauth",
14 | "oauth2",
15 | "client",
16 | "authorization",
17 | "authentication",
18 | "google"
19 | ],
20 | "minimum-stability": "stable",
21 | "require": {
22 | "league/oauth2-client": "^2.0"
23 | },
24 | "require-dev": {
25 | "eloquent/phony": "^0.14.6",
26 | "phpunit/phpunit": "^5.7",
27 | "satooshi/php-coveralls": "^2.0",
28 | "squizlabs/php_codesniffer": "^2.0"
29 | },
30 | "autoload": {
31 | "psr-4": {
32 | "League\\OAuth2\\Client\\": "src/"
33 | }
34 | },
35 | "autoload-dev": {
36 | "psr-4": {
37 | "League\\OAuth2\\Client\\Test\\": "tests/src/"
38 | }
39 | },
40 | "scripts": {
41 | "test": "phpunit",
42 | "check": "phpcs src --standard=psr2 -sp"
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/vendor/guzzlehttp/psr7/src/DroppingStream.php:
--------------------------------------------------------------------------------
1 | stream = $stream;
23 | $this->maxLength = $maxLength;
24 | }
25 |
26 | public function write($string)
27 | {
28 | $diff = $this->maxLength - $this->stream->getSize();
29 |
30 | // Begin returning 0 when the underlying stream is too large.
31 | if ($diff <= 0) {
32 | return 0;
33 | }
34 |
35 | // Write the stream or a subset of the stream if needed.
36 | if (strlen($string) < $diff) {
37 | return $this->stream->write($string);
38 | }
39 |
40 | return $this->stream->write(substr($string, 0, $diff));
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/vendor/jakeasmith/http_build_url/readme.md:
--------------------------------------------------------------------------------
1 | # http_build_url() for PHP
2 |
3 | [](https://travis-ci.org/jakeasmith/http_build_url)
4 | [](https://codeclimate.com/github/jakeasmith/http_build_url)
5 | [](https://packagist.org/packages/jakeasmith/http_build_url)
6 | [](https://packagist.org/packages/jakeasmith/http_build_url)
7 |
8 | This simple library provides functionality for [`http_build_url()`](http://us2.php.net/manual/en/function.http-build-url.php) to environments without pecl_http. It aims to mimic the functionality of the pecl function in every way and ships with a full suite of tests that have been run against both the original function and the one in this package.
9 |
10 | ## Installation
11 |
12 | The easiest way to install this library is to use [Composer](https://getcomposer.org/) from the command line.
13 |
14 | ```
15 | $ composer require jakeasmith/http_build_url ^1
16 | ```
17 |
18 | ## License
19 |
20 | This project is licensed under the MIT License - see the LICENSE file for details.
21 |
--------------------------------------------------------------------------------
/vendor/guzzlehttp/guzzle/composer.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "guzzlehttp/guzzle",
3 | "type": "library",
4 | "description": "Guzzle is a PHP HTTP client library",
5 | "keywords": ["framework", "http", "rest", "web service", "curl", "client", "HTTP client"],
6 | "homepage": "http://guzzlephp.org/",
7 | "license": "MIT",
8 | "authors": [
9 | {
10 | "name": "Michael Dowling",
11 | "email": "mtdowling@gmail.com",
12 | "homepage": "https://github.com/mtdowling"
13 | }
14 | ],
15 | "require": {
16 | "php": ">=5.5",
17 | "guzzlehttp/psr7": "^1.4",
18 | "guzzlehttp/promises": "^1.0"
19 | },
20 | "require-dev": {
21 | "ext-curl": "*",
22 | "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0",
23 | "psr/log": "^1.0"
24 | },
25 | "autoload": {
26 | "files": ["src/functions_include.php"],
27 | "psr-4": {
28 | "GuzzleHttp\\": "src/"
29 | }
30 | },
31 | "autoload-dev": {
32 | "psr-4": {
33 | "GuzzleHttp\\Tests\\": "tests/"
34 | }
35 | },
36 | "suggest": {
37 | "psr/log": "Required for using the Log middleware"
38 | },
39 | "extra": {
40 | "branch-alias": {
41 | "dev-master": "6.3-dev"
42 | }
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/vendor/wohali/oauth2-discord-new/composer.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "wohali/oauth2-discord-new",
3 | "description": "Discord OAuth 2.0 Client Provider for The PHP League OAuth2-Client",
4 | "license": "MIT",
5 | "authors": [
6 | {
7 | "name": "Joan Touzet",
8 | "email": "wohali@gmail.com",
9 | "homepage": "https://github.com/wohali"
10 | }
11 | ],
12 | "keywords": [
13 | "oauth",
14 | "oauth2",
15 | "client",
16 | "authorization",
17 | "authorisation",
18 | "discord"
19 | ],
20 | "require": {
21 | "league/oauth2-client": "^2.0"
22 | },
23 | "require-dev": {
24 | "phpunit/phpunit": "^5.0",
25 | "mockery/mockery": "~0.9",
26 | "squizlabs/php_codesniffer": "^2.0",
27 | "jakub-onderka/php-parallel-lint": "~0.9"
28 | },
29 | "autoload": {
30 | "psr-4": {
31 | "Wohali\\OAuth2\\Client\\": "src/"
32 | }
33 | },
34 | "autoload-dev": {
35 | "psr-4": {
36 | "Wohali\\OAuth2\\Client\\Test\\": "test/src/"
37 | }
38 | },
39 | "extra": {
40 | "branch-alias": {
41 | "dev-master": "1.0.x-dev"
42 | }
43 | },
44 | "conflict": {
45 | "team-reflex/oauth2-discord": ">=1.0"
46 | }
47 | }
48 |
49 |
--------------------------------------------------------------------------------
/vendor/league/oauth2-github/phpunit.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
20 |
22 |
23 |
24 |
25 | ./test/
26 |
27 |
28 |
29 |
30 | ./
31 |
32 | ./vendor
33 | ./test
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/vendor/league/oauth2-instagram/phpunit.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
20 |
22 |
23 |
24 |
25 | ./test/
26 |
27 |
28 |
29 |
30 | ./
31 |
32 | ./vendor
33 | ./test
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/vendor/league/oauth2-linkedin/phpunit.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
20 |
22 |
23 |
24 |
25 | ./test/
26 |
27 |
28 |
29 |
30 | ./
31 |
32 | ./vendor
33 | ./test
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/vendor/omines/oauth2-gitlab/phpunit.xml.dist:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
20 |
22 |
23 |
24 |
25 | ./test/
26 |
27 |
28 |
29 |
30 | ./
31 |
32 | ./vendor
33 | ./test
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/vendor/wohali/oauth2-discord-new/phpunit.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
20 |
22 |
23 |
24 |
25 | ./test/
26 |
27 |
28 |
29 |
30 | ./
31 |
32 | ./vendor
33 | ./test
34 |
35 |
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/languages/en.yaml:
--------------------------------------------------------------------------------
1 | PLUGIN_LOGIN_OAUTH2:
2 | CONFIGURATION: "Configuration"
3 | DOCUMENTATION: "Instructions"
4 | PROVIDERS: "OAuth2 Providers"
5 | BUILTIN_CSS: "Enable built-in CSS"
6 | BUILTIN_CSS_HELP: "If you want to provide your own custom CSS, feel free to disable the CSS provided by the plugin"
7 | BUTTON_STYLE: "Button Style"
8 | BUTTON_STYLE_HELLP: "If using built-in CSS, you can pick from either row or square display types for the OAUTH buttons"
9 | CALLBACK_URI: "Callback URI"
10 | CALLBACK_URI_HELP: "This is the URI that the provider will call when it has authenticated the user remotely. You shouldn't need to change this"
11 | SAVE_GRAV_USER: "Save Grav user"
12 | SAVE_GRAV_USER_DESC: "Saves the logged in user as a local Grav account"
13 | STORE_OAUTH2_USER: "Store Provider data"
14 | STORE_OAUTH2_USER_DESC: "You can also store Provider data on the logged in user object to use in Grav"
15 | DEFAULT_ACCESS_LEVELS: "Default Access Levels"
16 | DEFAULT_ACCESS_LEVELS_DESC: "You can find more information on access levels in the [Grav Groups & Permissions](https://learn.getgrav.org/advanced/groups-and-permissions#permissions) documentation"
17 | CLIENT_ID: "Client ID"
18 | CLIENT_SECRET: "Client Secret"
19 | SCOPE: "Scope"
20 | HOST: "Host"
21 | APP_ID: "App ID"
22 | APP_SECRET: "App Secret"
23 | GRAPH_API_VERSION: "Graph API Version"
24 | AVATAR_SIZE: "Avatar Size"
25 | RESTRICT_DOMAIN: "Hosted Domain"
--------------------------------------------------------------------------------
/vendor/guzzlehttp/promises/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # CHANGELOG
2 |
3 |
4 | ## 1.3.1 - 2016-12-20
5 |
6 | ### Fixed
7 |
8 | - `wait()` foreign promise compatibility
9 |
10 |
11 | ## 1.3.0 - 2016-11-18
12 |
13 | ### Added
14 |
15 | - Adds support for custom task queues.
16 |
17 | ### Fixed
18 |
19 | - Fixed coroutine promise memory leak.
20 |
21 |
22 | ## 1.2.0 - 2016-05-18
23 |
24 | ### Changed
25 |
26 | - Update to now catch `\Throwable` on PHP 7+
27 |
28 |
29 | ## 1.1.0 - 2016-03-07
30 |
31 | ### Changed
32 |
33 | - Update EachPromise to prevent recurring on a iterator when advancing, as this
34 | could trigger fatal generator errors.
35 | - Update Promise to allow recursive waiting without unwrapping exceptions.
36 |
37 |
38 | ## 1.0.3 - 2015-10-15
39 |
40 | ### Changed
41 |
42 | - Update EachPromise to immediately resolve when the underlying promise iterator
43 | is empty. Previously, such a promise would throw an exception when its `wait`
44 | function was called.
45 |
46 |
47 | ## 1.0.2 - 2015-05-15
48 |
49 | ### Changed
50 |
51 | - Conditionally require functions.php.
52 |
53 |
54 | ## 1.0.1 - 2015-06-24
55 |
56 | ### Changed
57 |
58 | - Updating EachPromise to call next on the underlying promise iterator as late
59 | as possible to ensure that generators that generate new requests based on
60 | callbacks are not iterated until after callbacks are invoked.
61 |
62 |
63 | ## 1.0.0 - 2015-05-12
64 |
65 | - Initial release
66 |
--------------------------------------------------------------------------------
/vendor/guzzlehttp/promises/src/RejectionException.php:
--------------------------------------------------------------------------------
1 | reason = $reason;
21 |
22 | $message = 'The promise was rejected';
23 |
24 | if ($description) {
25 | $message .= ' with reason: ' . $description;
26 | } elseif (is_string($reason)
27 | || (is_object($reason) && method_exists($reason, '__toString'))
28 | ) {
29 | $message .= ' with reason: ' . $this->reason;
30 | } elseif ($reason instanceof \JsonSerializable) {
31 | $message .= ' with reason: '
32 | . json_encode($this->reason, JSON_PRETTY_PRINT);
33 | }
34 |
35 | parent::__construct($message);
36 | }
37 |
38 | /**
39 | * Returns the rejection reason.
40 | *
41 | * @return mixed
42 | */
43 | public function getReason()
44 | {
45 | return $this->reason;
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/vendor/omines/oauth2-gitlab/composer.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "omines/oauth2-gitlab",
3 | "description": "GitLab OAuth 2.0 Client Provider for The PHP League OAuth2-Client",
4 | "license": "MIT",
5 | "authors": [
6 | {
7 | "name": "Niels Keurentjes",
8 | "email": "niels.keurentjes@omines.com",
9 | "homepage": "https://www.omines.nl/"
10 | }
11 | ],
12 | "keywords": [
13 | "oauth",
14 | "oauth2",
15 | "client",
16 | "authorization",
17 | "authorisation",
18 | "gitlab"
19 | ],
20 | "require": {
21 | "php": ">=5.6",
22 | "league/oauth2-client": "^2.2"
23 | },
24 | "require-dev": {
25 | "friendsofphp/php-cs-fixer": "^2.0",
26 | "mockery/mockery": "^1.0",
27 | "m4tthumphrey/php-gitlab-api": "^9.0.0",
28 | "php-http/guzzle6-adapter": "^1.1.1",
29 | "phpunit/phpunit": "^5.7 || ^6.0"
30 | },
31 | "suggest": {
32 | "m4tthumphrey/php-gitlab-api": "For further API usage using the acquired OAuth2 token"
33 | },
34 | "autoload": {
35 | "psr-4": {
36 | "Omines\\OAuth2\\Client\\": "src/"
37 | }
38 | },
39 | "autoload-dev": {
40 | "psr-4": {
41 | "Omines\\OAuth2\\Client\\Test\\": "test/src/"
42 | }
43 | },
44 | "extra": {
45 | "branch-alias": {
46 | "dev-master": "2.x-dev"
47 | }
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/vendor/league/oauth2-client/src/Provider/Exception/IdentityProviderException.php:
--------------------------------------------------------------------------------
1 |
9 | * @license http://opensource.org/licenses/MIT MIT
10 | * @link http://thephpleague.com/oauth2-client/ Documentation
11 | * @link https://packagist.org/packages/league/oauth2-client Packagist
12 | * @link https://github.com/thephpleague/oauth2-client GitHub
13 | */
14 |
15 | namespace League\OAuth2\Client\Provider\Exception;
16 |
17 | /**
18 | * Exception thrown if the provider response contains errors.
19 | */
20 | class IdentityProviderException extends \Exception
21 | {
22 | /**
23 | * @var mixed
24 | */
25 | protected $response;
26 |
27 | /**
28 | * @param string $message
29 | * @param int $code
30 | * @param array|string $response The response body
31 | */
32 | public function __construct($message, $code, $response)
33 | {
34 | $this->response = $response;
35 |
36 | parent::__construct($message, $code);
37 | }
38 |
39 | /**
40 | * Returns the exception's response body.
41 | *
42 | * @return array|string
43 | */
44 | public function getResponseBody()
45 | {
46 | return $this->response;
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/vendor/guzzlehttp/guzzle/src/Handler/CurlHandler.php:
--------------------------------------------------------------------------------
1 | factory = isset($options['handle_factory'])
29 | ? $options['handle_factory']
30 | : new CurlFactory(3);
31 | }
32 |
33 | public function __invoke(RequestInterface $request, array $options)
34 | {
35 | if (isset($options['delay'])) {
36 | usleep($options['delay'] * 1000);
37 | }
38 |
39 | $easy = $this->factory->create($request, $options);
40 | curl_exec($easy->handle);
41 | $easy->errno = curl_errno($easy->handle);
42 |
43 | return CurlFactory::finish($this, $easy, $this->factory);
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/login-oauth2.yaml:
--------------------------------------------------------------------------------
1 | enabled: true
2 | enable_in_admin: false
3 | built_in_css: true
4 | button_style: row
5 | save_grav_user: false
6 | store_provider_data: true
7 | default_access_levels:
8 | access:
9 | site:
10 | login: 'true'
11 | callback_uri: '/task:callback.oauth2'
12 |
13 | providers:
14 | discord:
15 | enabled: true
16 | client_id: ''
17 | client_secret: ''
18 | options:
19 | scope: ['user', 'email', 'guilds']
20 |
21 | github:
22 | enabled: true
23 | client_id: ''
24 | client_secret: ''
25 | options:
26 | scope: ['user', 'user:email', 'repo']
27 |
28 | instagram:
29 | enabled: true
30 | client_id: ''
31 | client_secret: ''
32 | options:
33 | scope: ['basic', 'likes', 'comments']
34 | host: 'https://api.instagram.com'
35 |
36 | facebook:
37 | enabled: true
38 | app_id: ''
39 | app_secret: ''
40 | options:
41 | scope: ['email', 'public_profile', 'user_hometown']
42 | graph_api_version: 'v2.10'
43 |
44 | google:
45 | enabled: true
46 | client_id: ''
47 | client_secret: ''
48 | hd: '*'
49 | options:
50 | scope: ['email', 'profile']
51 | avatar_size: 200
52 |
53 | linkedin:
54 | enabled: true
55 | client_id: ''
56 | client_secret: ''
57 | options:
58 | scope: ['r_basicprofile','r_emailaddress']
59 |
60 | gitlab:
61 | enabled: true
62 | client_id: ''
63 | client_secret: ''
64 | options:
65 | scope: ['read_user', 'openid']
66 |
--------------------------------------------------------------------------------
/classes/Providers/ProviderInterface.php:
--------------------------------------------------------------------------------
1 |
9 | * @license http://opensource.org/licenses/MIT MIT
10 | * @link http://thephpleague.com/oauth2-client/ Documentation
11 | * @link https://packagist.org/packages/league/oauth2-client Packagist
12 | * @link https://github.com/thephpleague/oauth2-client GitHub
13 | */
14 |
15 | namespace League\OAuth2\Client\Tool;
16 |
17 | /**
18 | * Provides generic array navigation tools.
19 | */
20 | trait ArrayAccessorTrait
21 | {
22 | /**
23 | * Returns a value by key using dot notation.
24 | *
25 | * @param array $data
26 | * @param string $key
27 | * @param mixed|null $default
28 | * @return mixed
29 | */
30 | private function getValueByKey(array $data, $key, $default = null)
31 | {
32 | if (!is_string($key) || empty($key) || !count($data)) {
33 | return $default;
34 | }
35 |
36 | if (strpos($key, '.') !== false) {
37 | $keys = explode('.', $key);
38 |
39 | foreach ($keys as $innerKey) {
40 | if (!is_array($data) || !array_key_exists($innerKey, $data)) {
41 | return $default;
42 | }
43 |
44 | $data = $data[$innerKey];
45 | }
46 |
47 | return $data;
48 | }
49 |
50 | return array_key_exists($key, $data) ? $data[$key] : $default;
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/vendor/league/oauth2-client/src/Provider/GenericResourceOwner.php:
--------------------------------------------------------------------------------
1 |
9 | * @license http://opensource.org/licenses/MIT MIT
10 | * @link http://thephpleague.com/oauth2-client/ Documentation
11 | * @link https://packagist.org/packages/league/oauth2-client Packagist
12 | * @link https://github.com/thephpleague/oauth2-client GitHub
13 | */
14 |
15 | namespace League\OAuth2\Client\Provider;
16 |
17 | /**
18 | * Represents a generic resource owner for use with the GenericProvider.
19 | */
20 | class GenericResourceOwner implements ResourceOwnerInterface
21 | {
22 | /**
23 | * @var array
24 | */
25 | protected $response;
26 |
27 | /**
28 | * @var string
29 | */
30 | protected $resourceOwnerId;
31 |
32 | /**
33 | * @param array $response
34 | * @param string $resourceOwnerId
35 | */
36 | public function __construct(array $response, $resourceOwnerId)
37 | {
38 | $this->response = $response;
39 | $this->resourceOwnerId = $resourceOwnerId;
40 | }
41 |
42 | /**
43 | * Returns the identifier of the authorized resource owner.
44 | *
45 | * @return mixed
46 | */
47 | public function getId()
48 | {
49 | return $this->response[$this->resourceOwnerId];
50 | }
51 |
52 | /**
53 | * Returns the raw resource owner response.
54 | *
55 | * @return array
56 | */
57 | public function toArray()
58 | {
59 | return $this->response;
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/vendor/league/oauth2-github/src/Provider/Exception/GithubIdentityProviderException.php:
--------------------------------------------------------------------------------
1 | getReasonPhrase()
22 | );
23 | }
24 |
25 | /**
26 | * Creates oauth exception from response.
27 | *
28 | * @param ResponseInterface $response
29 | * @param string $data Parsed response data
30 | *
31 | * @return IdentityProviderException
32 | */
33 | public static function oauthException(ResponseInterface $response, $data)
34 | {
35 | return static::fromResponse(
36 | $response,
37 | isset($data['error']) ? $data['error'] : $response->getReasonPhrase()
38 | );
39 | }
40 |
41 | /**
42 | * Creates identity exception from response.
43 | *
44 | * @param ResponseInterface $response
45 | * @param string $message
46 | *
47 | * @return IdentityProviderException
48 | */
49 | protected static function fromResponse(ResponseInterface $response, $message = null)
50 | {
51 | return new static($message, $response->getStatusCode(), (string) $response->getBody());
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/vendor/league/oauth2-client/src/Tool/RequiredParameterTrait.php:
--------------------------------------------------------------------------------
1 |
9 | * @license http://opensource.org/licenses/MIT MIT
10 | * @link http://thephpleague.com/oauth2-client/ Documentation
11 | * @link https://packagist.org/packages/league/oauth2-client Packagist
12 | * @link https://github.com/thephpleague/oauth2-client GitHub
13 | */
14 |
15 | namespace League\OAuth2\Client\Tool;
16 |
17 | use BadMethodCallException;
18 |
19 | /**
20 | * Provides functionality to check for required parameters.
21 | */
22 | trait RequiredParameterTrait
23 | {
24 | /**
25 | * Checks for a required parameter in a hash.
26 | *
27 | * @throws BadMethodCallException
28 | * @param string $name
29 | * @param array $params
30 | * @return void
31 | */
32 | private function checkRequiredParameter($name, array $params)
33 | {
34 | if (!isset($params[$name])) {
35 | throw new BadMethodCallException(sprintf(
36 | 'Required parameter not passed: "%s"',
37 | $name
38 | ));
39 | }
40 | }
41 |
42 | /**
43 | * Checks for multiple required parameters in a hash.
44 | *
45 | * @throws InvalidArgumentException
46 | * @param array $names
47 | * @param array $params
48 | * @return void
49 | */
50 | private function checkRequiredParameters(array $names, array $params)
51 | {
52 | foreach ($names as $name) {
53 | $this->checkRequiredParameter($name, $params);
54 | }
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/vendor/wohali/oauth2-discord-new/src/Provider/Exception/DiscordIdentityProviderException.php:
--------------------------------------------------------------------------------
1 |
9 | * @license http://opensource.org/licenses/MIT MIT
10 | * @link https://packagist.org/packages/wohali/oauth2-discord-new Packagist
11 | * @link https://github.com/wohali/oauth2-discord-new GitHub
12 | */
13 |
14 | namespace Wohali\OAuth2\Client\Provider\Exception;
15 |
16 | use League\OAuth2\Client\Provider\Exception\IdentityProviderException;
17 | use Psr\Http\Message\ResponseInterface;
18 |
19 | class DiscordIdentityProviderException extends IdentityProviderException
20 | {
21 | /**
22 | * Creates client exception from response
23 | *
24 | * @param ResponseInterface $response
25 | * @param array $data Parsed response data
26 | *
27 | * @return IdentityProviderException
28 | */
29 | public static function clientException(ResponseInterface $response, $data)
30 | {
31 | return static::fromResponse(
32 | $response,
33 | isset($data['message']) ? $data['message'] : json_encode($data)
34 | );
35 | }
36 |
37 | /**
38 | * Creates identity exception from response
39 | *
40 | * @param ResponseInterface $response
41 | * @param string $message
42 | *
43 | * @return IdentityProviderException
44 | */
45 | protected static function fromResponse(ResponseInterface $response, $message = null)
46 | {
47 | return new static($message, $response->getStatusCode(), (string) $response->getBody());
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/media/instagram.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/classes/Providers/InstagramProvider.php:
--------------------------------------------------------------------------------
1 | config = Grav::instance()['config'];
20 |
21 | $options += [
22 | 'clientId' => $this->config->get('plugins.login-oauth2.providers.instagram.client_id'),
23 | 'clientSecret' => $this->config->get('plugins.login-oauth2.providers.instagram.client_secret'),
24 | 'redirectUri' => $this->getCallbackUri(),
25 | 'host' => $this->config->get('plugins.login-oauth2.providers.instagram.options.host')
26 | ];
27 |
28 | parent::__construct($options);
29 | }
30 |
31 | public function getAuthorizationUrl()
32 | {
33 | $options = ['state' => $this->state];
34 | $options['scope'] = $this->config->get('plugins.login-oauth2.providers.instagram.options.scope');
35 |
36 | return $this->provider->getAuthorizationUrl($options);
37 | }
38 |
39 | public function getUserData($user)
40 | {
41 | $data = $user->toArray();
42 |
43 | $data_user = [
44 | 'id' => $user->getId(),
45 | 'login' => $user->getNickname(),
46 | 'fullname' => $user->getName(),
47 | 'instagram' => [
48 | 'avatar_url' => $user->getImageurl(),
49 | ]
50 | ];
51 |
52 | return $data_user;
53 | }
54 | }
--------------------------------------------------------------------------------
/vendor/league/oauth2-instagram/src/Provider/Exception/InstagramIdentityProviderException.php:
--------------------------------------------------------------------------------
1 | getReasonPhrase();
20 | $code = $response->getStatusCode();
21 | $body = (string) $response->getBody();
22 |
23 | if (isset($data['meta'], $data['meta']['error_message'])) {
24 | $message = $data['meta']['error_message'];
25 | }
26 | if (isset($data['meta'], $data['meta']['code'])) {
27 | $code = $data['meta']['code'];
28 | }
29 |
30 | return new static($message, $code, $body);
31 | }
32 |
33 | /**
34 | * Creates oauth exception from response.
35 | *
36 | * @param ResponseInterface $response
37 | * @param string $data Parsed response data
38 | *
39 | * @return IdentityProviderException
40 | */
41 | public static function oauthException(ResponseInterface $response, $data)
42 | {
43 | $message = $response->getReasonPhrase();
44 | $code = $response->getStatusCode();
45 | $body = (string) $response->getBody();
46 |
47 | if (isset($data['error_message'])) {
48 | $message = $data['error_message'];
49 | }
50 | if (isset($data['code'])) {
51 | $code = $data['code'];
52 | }
53 |
54 | return new static($message, $code, $body);
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/vendor/league/oauth2-instagram/src/Provider/InstagramResourceOwner.php:
--------------------------------------------------------------------------------
1 | response = $response;
20 | }
21 |
22 | /**
23 | * Get resource owner id
24 | *
25 | * @return string|null
26 | */
27 | public function getId()
28 | {
29 | return $this->response['data']['id'] ?: null;
30 | }
31 |
32 | /**
33 | * Get user imageurl
34 | *
35 | * @return string|null
36 | */
37 | public function getImageurl()
38 | {
39 | return $this->response['data']['profile_picture'] ?: null;
40 | }
41 |
42 | /**
43 | * Get user name
44 | *
45 | * @return string|null
46 | */
47 | public function getName()
48 | {
49 | return $this->response['data']['full_name'] ?: null;
50 | }
51 |
52 | /**
53 | * Get user nickname
54 | *
55 | * @return string|null
56 | */
57 | public function getNickname()
58 | {
59 | return $this->response['data']['username'] ?: null;
60 | }
61 |
62 | /**
63 | * Get user description
64 | *
65 | * @return string|null
66 | */
67 | public function getDescription()
68 | {
69 | return $this->response['data']['bio'] ?: null;
70 | }
71 |
72 | /**
73 | * Return all of the owner details available as an array.
74 | *
75 | * @return array
76 | */
77 | public function toArray()
78 | {
79 | return $this->response['data'];
80 | }
81 | }
82 |
--------------------------------------------------------------------------------
/vendor/paragonie/random_compat/other/build_phar.php:
--------------------------------------------------------------------------------
1 | buildFromDirectory(dirname(__DIR__).'/lib');
19 | rename(
20 | dirname(__DIR__).'/lib/index.php',
21 | dirname(__DIR__).'/lib/random.php'
22 | );
23 |
24 | /**
25 | * If we pass an (optional) path to a private key as a second argument, we will
26 | * sign the Phar with OpenSSL.
27 | *
28 | * If you leave this out, it will produce an unsigned .phar!
29 | */
30 | if ($argc > 1) {
31 | if (!@is_readable($argv[1])) {
32 | echo 'Could not read the private key file:', $argv[1], "\n";
33 | exit(255);
34 | }
35 | $pkeyFile = file_get_contents($argv[1]);
36 |
37 | $private = openssl_get_privatekey($pkeyFile);
38 | if ($private !== false) {
39 | $pkey = '';
40 | openssl_pkey_export($private, $pkey);
41 | $phar->setSignatureAlgorithm(Phar::OPENSSL, $pkey);
42 |
43 | /**
44 | * Save the corresponding public key to the file
45 | */
46 | if (!@is_readable($dist.'/random_compat.phar.pubkey')) {
47 | $details = openssl_pkey_get_details($private);
48 | file_put_contents(
49 | $dist.'/random_compat.phar.pubkey',
50 | $details['key']
51 | );
52 | }
53 | } else {
54 | echo 'An error occurred reading the private key from OpenSSL.', "\n";
55 | exit(255);
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/classes/Providers/LinkedinProvider.php:
--------------------------------------------------------------------------------
1 | config = Grav::instance()['config'];
20 |
21 | $options += [
22 | 'clientId' => $this->config->get('plugins.login-oauth2.providers.linkedin.client_id'),
23 | 'clientSecret' => $this->config->get('plugins.login-oauth2.providers.linkedin.client_secret'),
24 | 'redirectUri' => $this->getCallbackUri(),
25 | ];
26 |
27 | parent::__construct($options);
28 | }
29 |
30 | public function getAuthorizationUrl()
31 | {
32 | $options = ['state' => $this->state];
33 | $options['scope'] = $this->config->get('plugins.login-oauth2.providers.linkedin.options.scope');
34 |
35 | return $this->provider->getAuthorizationUrl($options);
36 | }
37 |
38 | public function getUserData($user)
39 | {
40 | $data_user = [
41 | 'id' => $user->getId(),
42 | 'login' => $user->getEmail(),
43 | 'fullname' => $user->getFirstName() . ' ' . $user->getLastName(),
44 | 'email' => $user->getEmail(),
45 | 'linkedin' => [
46 | 'avatar_url' => $user->getImageurl(),
47 | 'headline' => $user->getDescription(),
48 | 'location' => $user->getLocation(),
49 | ]
50 | ];
51 |
52 | return $data_user;
53 | }
54 | }
--------------------------------------------------------------------------------
/vendor/paragonie/random_compat/lib/error_polyfill.php:
--------------------------------------------------------------------------------
1 | config = Grav::instance()['config'];
20 |
21 | $options += [
22 | 'clientId' => $this->config->get('plugins.login-oauth2.providers.facebook.app_id'),
23 | 'clientSecret' => $this->config->get('plugins.login-oauth2.providers.facebook.app_secret'),
24 | 'redirectUri' => $this->getCallbackUri(),
25 | 'graphApiVersion' => $this->config->get('plugins.login-oauth2.providers.facebook.options.graph_api_version')
26 | ];
27 |
28 | parent::__construct($options);
29 | }
30 |
31 | public function getAuthorizationUrl()
32 | {
33 | $options = ['state' => $this->state];
34 | $options['scope'] = $this->config->get('plugins.login-oauth2.providers.facebook.options.scope');
35 |
36 | return $this->provider->getAuthorizationUrl($options);
37 | }
38 |
39 | public function getUserData($user)
40 | {
41 | $data_user = [
42 | 'id' => $user->getId(),
43 | 'login' => $user->getEmail(),
44 | 'fullname' => $user->getName(),
45 | 'email' => $user->getEmail(),
46 | 'facebook' => [
47 | 'avatar_url' => $user->getPictureUrl(),
48 | 'location' => $user->getHometown() ? $user->getHometown()['name'] : ''
49 | ]
50 | ];
51 |
52 | return $data_user;
53 | }
54 | }
--------------------------------------------------------------------------------
/vendor/guzzlehttp/psr7/src/InflateStream.php:
--------------------------------------------------------------------------------
1 | read(10);
25 | $filenameHeaderLength = $this->getLengthOfPossibleFilenameHeader($stream, $header);
26 | // Skip the header, that is 10 + length of filename + 1 (nil) bytes
27 | $stream = new LimitStream($stream, -1, 10 + $filenameHeaderLength);
28 | $resource = StreamWrapper::getResource($stream);
29 | stream_filter_append($resource, 'zlib.inflate', STREAM_FILTER_READ);
30 | $this->stream = new Stream($resource);
31 | }
32 |
33 | /**
34 | * @param StreamInterface $stream
35 | * @param $header
36 | * @return int
37 | */
38 | private function getLengthOfPossibleFilenameHeader(StreamInterface $stream, $header)
39 | {
40 | $filename_header_length = 0;
41 |
42 | if (substr(bin2hex($header), 6, 2) === '08') {
43 | // we have a filename, read until nil
44 | $filename_header_length = 1;
45 | while ($stream->read(1) !== chr(0)) {
46 | $filename_header_length++;
47 | }
48 | }
49 |
50 | return $filename_header_length;
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/classes/Providers/DiscordProvider.php:
--------------------------------------------------------------------------------
1 | config = Grav::instance()['config'];
18 |
19 | $options += [
20 | 'clientId' => $this->config->get('plugins.login-oauth2.providers.discord.client_id'),
21 | 'clientSecret' => $this->config->get('plugins.login-oauth2.providers.discord.client_secret'),
22 | 'redirectUri' => $this->getCallbackUri(),
23 | ];
24 |
25 | parent::__construct($options);
26 | }
27 |
28 | public function getAuthorizationUrl()
29 | {
30 | $options = ['state' => $this->state];
31 | $options['scope'] = $this->config->get('plugins.login-oauth2-discord.options.scope');
32 |
33 | return $this->provider->getAuthorizationUrl($options);
34 | }
35 |
36 | public function getUserData($user)
37 | {
38 | $data = $user->toArray();
39 |
40 | $avatar_url = "https://cdn.discordapp.com/avatars/{$data['id']}/{$data['avatar']}.jpg";
41 |
42 | $data_user = [
43 | 'id' => $user->getId(),
44 | 'login' => $user->getUsername(),
45 | 'fullname' => $user->getUsername(),
46 | 'email' => $user->getEmail(),
47 | 'discord' => [
48 | 'discriminator' => $data['discriminator'],
49 | 'verified' => $data['verified'],
50 | 'locale' => $data['locale'],
51 | 'mfa_enabled' => $data['mfa_enabled'],
52 | 'avatar_url' => $avatar_url,
53 | ]
54 | ];
55 |
56 | return $data_user;
57 | }
58 | }
--------------------------------------------------------------------------------
/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php:
--------------------------------------------------------------------------------
1 | config = Grav::instance()['config'];
20 |
21 | $options += [
22 | 'clientId' => $this->config->get('plugins.login-oauth2.providers.google.client_id'),
23 | 'clientSecret' => $this->config->get('plugins.login-oauth2.providers.google.client_secret'),
24 | 'redirectUri' => $this->getCallbackUri(),
25 | 'hostedDomain' => $this->config->get('plugins.login-oauth2.providers.google.options.hd', '*')
26 | ];
27 |
28 | parent::__construct($options);
29 | }
30 |
31 | public function getAuthorizationUrl()
32 | {
33 | $options = ['state' => $this->state];
34 | $options['scope'] = $this->config->get('plugins.login-oauth2.providers.google.options.scope');
35 |
36 | return $this->provider->getAuthorizationUrl($options);
37 | }
38 |
39 | public function getUserData($user)
40 | {
41 | $data_user = [
42 | 'id' => $user->getId(),
43 | 'login' => $user->getEmail(),
44 | 'fullname' => $user->getName(),
45 | 'email' => $user->getEmail(),
46 | 'google' => [
47 | 'avatar_url' => $this->getAvatar($user),
48 | ]
49 | ];
50 |
51 | return $data_user;
52 | }
53 |
54 | public function getAvatar($user)
55 | {
56 | $avatar = $user->getAvatar();
57 | $avatarSize = $this->config->get('plugins.login-oauth2.providers.google.options.avatar_size', 200);
58 | $avatar = preg_replace("/\?sz=\d{1,}$/", '?sz=' . $avatarSize, $avatar);
59 |
60 | return $avatar;
61 | }
62 | }
--------------------------------------------------------------------------------
/vendor/guzzlehttp/promises/src/TaskQueue.php:
--------------------------------------------------------------------------------
1 | run();
12 | */
13 | class TaskQueue implements TaskQueueInterface
14 | {
15 | private $enableShutdown = true;
16 | private $queue = [];
17 |
18 | public function __construct($withShutdown = true)
19 | {
20 | if ($withShutdown) {
21 | register_shutdown_function(function () {
22 | if ($this->enableShutdown) {
23 | // Only run the tasks if an E_ERROR didn't occur.
24 | $err = error_get_last();
25 | if (!$err || ($err['type'] ^ E_ERROR)) {
26 | $this->run();
27 | }
28 | }
29 | });
30 | }
31 | }
32 |
33 | public function isEmpty()
34 | {
35 | return !$this->queue;
36 | }
37 |
38 | public function add(callable $task)
39 | {
40 | $this->queue[] = $task;
41 | }
42 |
43 | public function run()
44 | {
45 | /** @var callable $task */
46 | while ($task = array_shift($this->queue)) {
47 | $task();
48 | }
49 | }
50 |
51 | /**
52 | * The task queue will be run and exhausted by default when the process
53 | * exits IFF the exit is not the result of a PHP E_ERROR error.
54 | *
55 | * You can disable running the automatic shutdown of the queue by calling
56 | * this function. If you disable the task queue shutdown process, then you
57 | * MUST either run the task queue (as a result of running your event loop
58 | * or manually using the run() method) or wait on each outstanding promise.
59 | *
60 | * Note: This shutdown will occur before any destructors are triggered.
61 | */
62 | public function disableShutdown()
63 | {
64 | $this->enableShutdown = false;
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/vendor/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php:
--------------------------------------------------------------------------------
1 | sessionKey = $sessionKey;
26 | $this->storeSessionCookies = $storeSessionCookies;
27 | $this->load();
28 | }
29 |
30 | /**
31 | * Saves cookies to session when shutting down
32 | */
33 | public function __destruct()
34 | {
35 | $this->save();
36 | }
37 |
38 | /**
39 | * Save cookies to the client session
40 | */
41 | public function save()
42 | {
43 | $json = [];
44 | foreach ($this as $cookie) {
45 | /** @var SetCookie $cookie */
46 | if (CookieJar::shouldPersist($cookie, $this->storeSessionCookies)) {
47 | $json[] = $cookie->toArray();
48 | }
49 | }
50 |
51 | $_SESSION[$this->sessionKey] = json_encode($json);
52 | }
53 |
54 | /**
55 | * Load the contents of the client session into the data array
56 | */
57 | protected function load()
58 | {
59 | if (!isset($_SESSION[$this->sessionKey])) {
60 | return;
61 | }
62 | $data = json_decode($_SESSION[$this->sessionKey], true);
63 | if (is_array($data)) {
64 | foreach ($data as $cookie) {
65 | $this->setCookie(new SetCookie($cookie));
66 | }
67 | } elseif (strlen($data)) {
68 | throw new \RuntimeException("Invalid cookie data");
69 | }
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/vendor/omines/oauth2-gitlab/src/Provider/Exception/GitlabIdentityProviderException.php:
--------------------------------------------------------------------------------
1 |
20 | */
21 | class GitlabIdentityProviderException extends IdentityProviderException
22 | {
23 | /**
24 | * Creates client exception from response.
25 | *
26 | * @param ResponseInterface $response
27 | * @param string $data Parsed response data
28 | * @return IdentityProviderException
29 | */
30 | public static function clientException(ResponseInterface $response, $data)
31 | {
32 | return static::fromResponse(
33 | $response,
34 | isset($data['message']) ? $data['message'] : $response->getReasonPhrase()
35 | );
36 | }
37 |
38 | /**
39 | * Creates oauth exception from response.
40 | *
41 | * @param ResponseInterface $response Response received from upstream
42 | * @param string $data Parsed response data
43 | * @return IdentityProviderException
44 | */
45 | public static function oauthException(ResponseInterface $response, $data)
46 | {
47 | return static::fromResponse(
48 | $response,
49 | isset($data['error']) ? $data['error'] : $response->getReasonPhrase()
50 | );
51 | }
52 |
53 | /**
54 | * Creates identity exception from response.
55 | *
56 | * @param ResponseInterface $response Response received from upstream
57 | * @param string|null $message Parsed message
58 | * @return IdentityProviderException
59 | */
60 | protected static function fromResponse(ResponseInterface $response, $message = null)
61 | {
62 | return new static($message, $response->getStatusCode(), (string) $response->getBody());
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/classes/Providers/GitlabProvider.php:
--------------------------------------------------------------------------------
1 | config = Grav::instance()['config'];
20 | $domain = $this->config->get('plugins.login-oauth2.providers.gitlab.domain', false);
21 |
22 | $options += [
23 | 'clientId' => $this->config->get('plugins.login-oauth2.providers.gitlab.client_id'),
24 | 'clientSecret' => $this->config->get('plugins.login-oauth2.providers.gitlab.client_secret'),
25 | 'redirectUri' => $this->getCallbackUri(),
26 | ];
27 |
28 | if ($domain) {
29 | $options += ['domain' => $domain];
30 | }
31 |
32 | parent::__construct($options);
33 | }
34 |
35 | public function getAuthorizationUrl()
36 | {
37 | $options = ['state' => $this->state];
38 | $options['scope'] = $this->config->get('plugins.login-oauth2.providers.gitlab.options.scope');
39 |
40 | return $this->provider->getAuthorizationUrl($options);
41 | }
42 |
43 | public function getUserData($user)
44 | {
45 | $data = $user->toArray();
46 |
47 | $data_user = [
48 | 'id' => $user->getId(),
49 | 'login' => $user->getUsername(),
50 | 'fullname' => $user->getName(),
51 | 'email' => $user->getEmail(),
52 | 'gitlab' => [
53 | 'domain' => $user->getDomain(),
54 | 'location' => $data['location'],
55 | 'web_url' => $user->getProfileUrl(),
56 | 'avatar_url' => $user->getAvatarUrl(),
57 | 'active' => $user->isActive(),
58 | 'external' => $user->isExternal(),
59 | 'admin' => $user->isAdmin()
60 | ]
61 | ];
62 |
63 | return $data_user;
64 | }
65 | }
--------------------------------------------------------------------------------
/vendor/guzzlehttp/promises/src/FulfilledPromise.php:
--------------------------------------------------------------------------------
1 | value = $value;
22 | }
23 |
24 | public function then(
25 | callable $onFulfilled = null,
26 | callable $onRejected = null
27 | ) {
28 | // Return itself if there is no onFulfilled function.
29 | if (!$onFulfilled) {
30 | return $this;
31 | }
32 |
33 | $queue = queue();
34 | $p = new Promise([$queue, 'run']);
35 | $value = $this->value;
36 | $queue->add(static function () use ($p, $value, $onFulfilled) {
37 | if ($p->getState() === self::PENDING) {
38 | try {
39 | $p->resolve($onFulfilled($value));
40 | } catch (\Throwable $e) {
41 | $p->reject($e);
42 | } catch (\Exception $e) {
43 | $p->reject($e);
44 | }
45 | }
46 | });
47 |
48 | return $p;
49 | }
50 |
51 | public function otherwise(callable $onRejected)
52 | {
53 | return $this->then(null, $onRejected);
54 | }
55 |
56 | public function wait($unwrap = true, $defaultDelivery = null)
57 | {
58 | return $unwrap ? $this->value : null;
59 | }
60 |
61 | public function getState()
62 | {
63 | return self::FULFILLED;
64 | }
65 |
66 | public function resolve($value)
67 | {
68 | if ($value !== $this->value) {
69 | throw new \LogicException("Cannot resolve a fulfilled promise");
70 | }
71 | }
72 |
73 | public function reject($reason)
74 | {
75 | throw new \LogicException("Cannot reject a fulfilled promise");
76 | }
77 |
78 | public function cancel()
79 | {
80 | // pass
81 | }
82 | }
83 |
--------------------------------------------------------------------------------
/vendor/league/oauth2-instagram/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Changelog
2 | All Notable changes to `oauth2-instagram` will be documented in this file
3 |
4 | ## 2.0.0 - 2017-01-25
5 |
6 | ### Added
7 | - PHP 7.1 Support
8 |
9 | ### Deprecated
10 | - Nothing
11 |
12 | ### Fixed
13 | - Nothing
14 |
15 | ### Removed
16 | - PHP 5.5 Support
17 |
18 | ### Security
19 | - Nothing
20 |
21 | ## 1.0.0 - 2017-01-25
22 |
23 | Bump for base package parity
24 |
25 | ## 0.2.3 - 2016-12-22
26 |
27 | ### Added
28 | - Custom host configuration
29 |
30 | ### Deprecated
31 | - Nothing
32 |
33 | ### Fixed
34 | - Nothing
35 |
36 | ### Removed
37 | - Nothing
38 |
39 | ### Security
40 | - Nothing
41 |
42 | ## 0.2.2 - 2016-04-13
43 |
44 | ### Added
45 | - Refactored exception handling
46 |
47 | ### Deprecated
48 | - Nothing
49 |
50 | ### Fixed
51 | - Nothing
52 |
53 | ### Removed
54 | - Nothing
55 |
56 | ### Security
57 | - Nothing
58 |
59 | ## 0.2.1 - 2015-11-23
60 |
61 | ### Added
62 | - A properly functioning `getAuthenticatedRequest()` for Instagram.com
63 | - Modification for data returned by InstagramResourceOwner::toArray
64 |
65 | ### Deprecated
66 | - Nothing
67 |
68 | ### Fixed
69 | - Nothing
70 |
71 | ### Removed
72 | - Nothing
73 |
74 | ### Security
75 | - Nothing
76 |
77 | ## 0.2.0 - 2015-08-20
78 |
79 | ### Added
80 | - Upgrade to support version 1.0 release of core client
81 |
82 | ### Deprecated
83 | - Nothing
84 |
85 | ### Fixed
86 | - Nothing
87 |
88 | ### Removed
89 | - Nothing
90 |
91 | ### Security
92 | - Nothing
93 |
94 | ## 0.1.2 - 2015-06-17
95 |
96 | ### Added
97 | - Using abstract provider scope separator to format scopes
98 |
99 | ### Deprecated
100 | - Nothing
101 |
102 | ### Fixed
103 | - Nothing
104 |
105 | ### Removed
106 | - Nothing
107 |
108 | ### Security
109 | - Nothing
110 |
111 | ## 0.1.1 - 2015-06-17
112 |
113 | ### Added
114 | - Improved clarity to README around expectation of managing scopes
115 |
116 | ### Deprecated
117 | - Nothing
118 |
119 | ### Fixed
120 | - Nothing
121 |
122 | ### Removed
123 | - Nothing
124 |
125 | ### Security
126 | - Nothing
127 |
128 | ## 0.1.0 - 2015-04-08
129 |
130 | ### Added
131 | - Initial release!
132 |
133 | ### Deprecated
134 | - Nothing
135 |
136 | ### Fixed
137 | - Nothing
138 |
139 | ### Removed
140 | - Nothing
141 |
142 | ### Security
143 | - Nothing
144 |
--------------------------------------------------------------------------------
/vendor/league/oauth2-github/src/Provider/GithubResourceOwner.php:
--------------------------------------------------------------------------------
1 | response = $response;
31 | }
32 |
33 | /**
34 | * Get resource owner id
35 | *
36 | * @return string|null
37 | */
38 | public function getId()
39 | {
40 | return $this->getValueByKey($this->response, 'id');
41 | }
42 |
43 | /**
44 | * Get resource owner email
45 | *
46 | * @return string|null
47 | */
48 | public function getEmail()
49 | {
50 | return $this->getValueByKey($this->response, 'email');
51 | }
52 |
53 | /**
54 | * Get resource owner name
55 | *
56 | * @return string|null
57 | */
58 | public function getName()
59 | {
60 | return $this->getValueByKey($this->response, 'name');
61 | }
62 |
63 | /**
64 | * Get resource owner nickname
65 | *
66 | * @return string|null
67 | */
68 | public function getNickname()
69 | {
70 | return $this->getValueByKey($this->response, 'login');
71 | }
72 |
73 | /**
74 | * Get resource owner url
75 | *
76 | * @return string|null
77 | */
78 | public function getUrl()
79 | {
80 | $urlParts = array_filter([$this->domain, $this->getNickname()]);
81 |
82 | return count($urlParts) ? implode('/', $urlParts) : null;
83 | }
84 |
85 | /**
86 | * Set resource owner domain
87 | *
88 | * @param string $domain
89 | *
90 | * @return ResourceOwner
91 | */
92 | public function setDomain($domain)
93 | {
94 | $this->domain = $domain;
95 |
96 | return $this;
97 | }
98 |
99 | /**
100 | * Return all of the owner details available as an array.
101 | *
102 | * @return array
103 | */
104 | public function toArray()
105 | {
106 | return $this->response;
107 | }
108 | }
109 |
--------------------------------------------------------------------------------
/css/login-oauth2.css:
--------------------------------------------------------------------------------
1 | .form-oauth2 p {
2 | font-size: inherit !important; }
3 |
4 | .form-oauth2 button {
5 | background: none;
6 | color: #fff;
7 | border: 0;
8 | font-family: inherit;
9 | cursor: pointer;
10 | outline: inherit;
11 | text-align: center;
12 | margin-bottom: 4px; }
13 | .form-oauth2 button svg {
14 | fill: #fff; }
15 |
16 | .form-oauth2 button.facebook {
17 | background: #3B5998; }
18 | .form-oauth2 button.facebook:hover {
19 | background: #2d4373; }
20 |
21 | .form-oauth2 button.github {
22 | background: #181717; }
23 | .form-oauth2 button.github:hover {
24 | background: #323030; }
25 |
26 | .form-oauth2 button.google {
27 | background: #4285F4; }
28 | .form-oauth2 button.google:hover {
29 | background: #1266f1; }
30 |
31 | .form-oauth2 button.instagram {
32 | background: #E4405F; }
33 | .form-oauth2 button.instagram:hover {
34 | background: #d31e40; }
35 |
36 | .form-oauth2 button.linkedin {
37 | background: #0077B5; }
38 | .form-oauth2 button.linkedin:hover {
39 | background: #005582; }
40 |
41 | .form-oauth2 button.gitlab {
42 | background: #fc6c26; }
43 | .form-oauth2 button.gitlab:hover {
44 | background: #ec4f03; }
45 |
46 | .form-oauth2.square-style button {
47 | padding: 10px;
48 | min-width: 100px; }
49 |
50 | .form-oauth2.square-style svg {
51 | width: 48px;
52 | height: 48px; }
53 |
54 | .form-oauth2.square-style span {
55 | display: block;
56 | font-size: 110%;
57 | font-weight: 100;
58 | margin: 0.5rem 0 0; }
59 |
60 | .form-oauth2.button-style button, .form-oauth2.row-style button {
61 | min-width: 150px;
62 | padding: 10px; }
63 |
64 | .form-oauth2.button-style svg, .form-oauth2.row-style svg {
65 | width: 32px;
66 | height: 32px;
67 | vertical-align: middle; }
68 |
69 | .form-oauth2.button-style span, .form-oauth2.row-style span {
70 | display: inline-block;
71 | font-size: 110%;
72 | font-weight: 100;
73 | margin: 0 0 0 10px;
74 | vertical-align: middle;
75 | min-width: 100px;
76 | text-align: left; }
77 |
78 | .form-oauth2.row-style button {
79 | min-width: 350px; }
80 |
81 | .form-oauth2 .oauth2-or {
82 | display: flex;
83 | margin: 1rem 0; }
84 | .form-oauth2 .oauth2-or span {
85 | display: block;
86 | margin: 0; }
87 | .form-oauth2 .oauth2-or span.line {
88 | border-bottom: 2px solid #eee;
89 | flex-grow: 1; }
90 | .form-oauth2 .oauth2-or span.or {
91 | padding: 0 15px;
92 | margin-bottom: -15px;
93 | font-size: 150%;
94 | color: #999;
95 | text-align: center; }
96 |
97 | #admin-login .form-oauth2 {
98 | text-align: center; }
99 |
--------------------------------------------------------------------------------
/vendor/guzzlehttp/promises/src/RejectedPromise.php:
--------------------------------------------------------------------------------
1 | reason = $reason;
22 | }
23 |
24 | public function then(
25 | callable $onFulfilled = null,
26 | callable $onRejected = null
27 | ) {
28 | // If there's no onRejected callback then just return self.
29 | if (!$onRejected) {
30 | return $this;
31 | }
32 |
33 | $queue = queue();
34 | $reason = $this->reason;
35 | $p = new Promise([$queue, 'run']);
36 | $queue->add(static function () use ($p, $reason, $onRejected) {
37 | if ($p->getState() === self::PENDING) {
38 | try {
39 | // Return a resolved promise if onRejected does not throw.
40 | $p->resolve($onRejected($reason));
41 | } catch (\Throwable $e) {
42 | // onRejected threw, so return a rejected promise.
43 | $p->reject($e);
44 | } catch (\Exception $e) {
45 | // onRejected threw, so return a rejected promise.
46 | $p->reject($e);
47 | }
48 | }
49 | });
50 |
51 | return $p;
52 | }
53 |
54 | public function otherwise(callable $onRejected)
55 | {
56 | return $this->then(null, $onRejected);
57 | }
58 |
59 | public function wait($unwrap = true, $defaultDelivery = null)
60 | {
61 | if ($unwrap) {
62 | throw exception_for($this->reason);
63 | }
64 | }
65 |
66 | public function getState()
67 | {
68 | return self::REJECTED;
69 | }
70 |
71 | public function resolve($value)
72 | {
73 | throw new \LogicException("Cannot resolve a rejected promise");
74 | }
75 |
76 | public function reject($reason)
77 | {
78 | if ($reason !== $this->reason) {
79 | throw new \LogicException("Cannot reject a rejected promise");
80 | }
81 | }
82 |
83 | public function cancel()
84 | {
85 | // pass
86 | }
87 | }
88 |
--------------------------------------------------------------------------------
/classes/Providers/BaseProvider.php:
--------------------------------------------------------------------------------
1 | provider = new $this->classname($options);
30 | $this->state = 'LOGIN_OAUTH2_' . Utils::generateRandomString(15);
31 | }
32 |
33 | /**
34 | * @return string
35 | */
36 | public function getName()
37 | {
38 | return $this->name;
39 | }
40 |
41 | /**
42 | * @return string
43 | */
44 | public function getState()
45 | {
46 | return $this->state;
47 | }
48 |
49 | /**
50 | * @param string $state
51 | * @return $this
52 | */
53 | public function setState($state)
54 | {
55 | $this->state = $state;
56 |
57 | return $this;
58 | }
59 |
60 | /**
61 | * @return AbstractProvider
62 | */
63 | public function getProvider()
64 | {
65 | return $this->provider;
66 | }
67 |
68 | public function getCallbackUri()
69 | {
70 | $callback_uri = Grav::instance()['config']->get('plugins.login-oauth2.callback_uri');
71 | $base_url = Grav::instance()['base_url_absolute'];
72 |
73 | return $base_url . '/' . ltrim($callback_uri, '/');
74 | }
75 |
76 | /**
77 | * Requests an access token using a specified grant and option set.
78 | *
79 | * @param mixed $grant
80 | * @param array $options
81 | * @return AccessToken
82 | */
83 | public function getAccessToken($grant, array $options = [])
84 | {
85 | $this->token = $this->provider->getAccessToken($grant, $options);
86 | return $this->token;
87 | }
88 |
89 | /**
90 | * Requests and returns the resource owner of given access token.
91 | *
92 | * @param AccessToken $token
93 | * @return ResourceOwnerInterface
94 | */
95 | public function getResourceOwner(AccessToken $token)
96 | {
97 | return $this->provider->getResourceOwner($token);
98 | }
99 | }
--------------------------------------------------------------------------------
/vendor/composer/autoload_real.php:
--------------------------------------------------------------------------------
1 | = 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
27 | if ($useStaticLoader) {
28 | require_once __DIR__ . '/autoload_static.php';
29 |
30 | call_user_func(\Composer\Autoload\ComposerStaticInitcc61c3bf48907c3dd4f2a55c10334eb3::getInitializer($loader));
31 | } else {
32 | $map = require __DIR__ . '/autoload_namespaces.php';
33 | foreach ($map as $namespace => $path) {
34 | $loader->set($namespace, $path);
35 | }
36 |
37 | $map = require __DIR__ . '/autoload_psr4.php';
38 | foreach ($map as $namespace => $path) {
39 | $loader->setPsr4($namespace, $path);
40 | }
41 |
42 | $classMap = require __DIR__ . '/autoload_classmap.php';
43 | if ($classMap) {
44 | $loader->addClassMap($classMap);
45 | }
46 | }
47 |
48 | $loader->register(true);
49 |
50 | if ($useStaticLoader) {
51 | $includeFiles = Composer\Autoload\ComposerStaticInitcc61c3bf48907c3dd4f2a55c10334eb3::$files;
52 | } else {
53 | $includeFiles = require __DIR__ . '/autoload_files.php';
54 | }
55 | foreach ($includeFiles as $fileIdentifier => $file) {
56 | composerRequirecc61c3bf48907c3dd4f2a55c10334eb3($fileIdentifier, $file);
57 | }
58 |
59 | return $loader;
60 | }
61 | }
62 |
63 | function composerRequirecc61c3bf48907c3dd4f2a55c10334eb3($fileIdentifier, $file)
64 | {
65 | if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
66 | require $file;
67 |
68 | $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
69 | }
70 | }
71 |
--------------------------------------------------------------------------------
/vendor/league/oauth2-client/src/Tool/RequestFactory.php:
--------------------------------------------------------------------------------
1 |
9 | * @license http://opensource.org/licenses/MIT MIT
10 | * @link http://thephpleague.com/oauth2-client/ Documentation
11 | * @link https://packagist.org/packages/league/oauth2-client Packagist
12 | * @link https://github.com/thephpleague/oauth2-client GitHub
13 | */
14 |
15 | namespace League\OAuth2\Client\Tool;
16 |
17 | use GuzzleHttp\Psr7\Request;
18 |
19 | /**
20 | * Used to produce PSR-7 Request instances.
21 | *
22 | * @link https://github.com/guzzle/guzzle/pull/1101
23 | */
24 | class RequestFactory
25 | {
26 | /**
27 | * Creates a PSR-7 Request instance.
28 | *
29 | * @param null|string $method HTTP method for the request.
30 | * @param null|string $uri URI for the request.
31 | * @param array $headers Headers for the message.
32 | * @param string|resource|StreamInterface $body Message body.
33 | * @param string $version HTTP protocol version.
34 | *
35 | * @return Request
36 | */
37 | public function getRequest(
38 | $method,
39 | $uri,
40 | array $headers = [],
41 | $body = null,
42 | $version = '1.1'
43 | ) {
44 | return new Request($method, $uri, $headers, $body, $version);
45 | }
46 |
47 | /**
48 | * Parses simplified options.
49 | *
50 | * @param array $options Simplified options.
51 | *
52 | * @return array Extended options for use with getRequest.
53 | */
54 | protected function parseOptions(array $options)
55 | {
56 | // Should match default values for getRequest
57 | $defaults = [
58 | 'headers' => [],
59 | 'body' => null,
60 | 'version' => '1.1',
61 | ];
62 |
63 | return array_merge($defaults, $options);
64 | }
65 |
66 | /**
67 | * Creates a request using a simplified array of options.
68 | *
69 | * @param null|string $method
70 | * @param null|string $uri
71 | * @param array $options
72 | *
73 | * @return Request
74 | */
75 | public function getRequestWithOptions($method, $uri, array $options = [])
76 | {
77 | $options = $this->parseOptions($options);
78 |
79 | return $this->getRequest(
80 | $method,
81 | $uri,
82 | $options['headers'],
83 | $options['body'],
84 | $options['version']
85 | );
86 | }
87 | }
88 |
--------------------------------------------------------------------------------
/vendor/league/oauth2-client/src/Tool/MacAuthorizationTrait.php:
--------------------------------------------------------------------------------
1 |
9 | * @license http://opensource.org/licenses/MIT MIT
10 | * @link http://thephpleague.com/oauth2-client/ Documentation
11 | * @link https://packagist.org/packages/league/oauth2-client Packagist
12 | * @link https://github.com/thephpleague/oauth2-client GitHub
13 | */
14 |
15 | namespace League\OAuth2\Client\Tool;
16 |
17 | use League\OAuth2\Client\Token\AccessToken;
18 |
19 | /**
20 | * Enables `MAC` header authorization for providers.
21 | *
22 | * @link http://tools.ietf.org/html/draft-ietf-oauth-v2-http-mac-05 Message Authentication Code (MAC) Tokens
23 | */
24 | trait MacAuthorizationTrait
25 | {
26 | /**
27 | * Returns the id of this token for MAC generation.
28 | *
29 | * @param AccessToken $token
30 | * @return string
31 | */
32 | abstract protected function getTokenId(AccessToken $token);
33 |
34 | /**
35 | * Returns the MAC signature for the current request.
36 | *
37 | * @param string $id
38 | * @param integer $ts
39 | * @param string $nonce
40 | * @return string
41 | */
42 | abstract protected function getMacSignature($id, $ts, $nonce);
43 |
44 | /**
45 | * Returns a new random string to use as the state parameter in an
46 | * authorization flow.
47 | *
48 | * @param int $length Length of the random string to be generated.
49 | * @return string
50 | */
51 | abstract protected function getRandomState($length);
52 |
53 | /**
54 | * Returns the authorization headers for the 'mac' grant.
55 | *
56 | * @param AccessToken $token
57 | * @return array
58 | * @codeCoverageIgnore
59 | *
60 | * @todo This is currently untested and provided only as an example. If you
61 | * complete the implementation, please create a pull request for
62 | * https://github.com/thephpleague/oauth2-client
63 | */
64 | protected function getAuthorizationHeaders($token)
65 | {
66 | $ts = time();
67 | $id = $this->getTokenId($token);
68 | $nonce = $this->getRandomState(16);
69 | $mac = $this->getMacSignature($id, $ts, $nonce);
70 |
71 | $parts = [];
72 | foreach (compact('id', 'ts', 'nonce', 'mac') as $key => $value) {
73 | $parts[] = sprintf('%s="%s"', $key, $value);
74 | }
75 |
76 | return ['Authorization' => 'MAC ' . implode(', ', $parts)];
77 | }
78 | }
79 |
--------------------------------------------------------------------------------
/vendor/league/oauth2-client/src/Grant/AbstractGrant.php:
--------------------------------------------------------------------------------
1 |
9 | * @license http://opensource.org/licenses/MIT MIT
10 | * @link http://thephpleague.com/oauth2-client/ Documentation
11 | * @link https://packagist.org/packages/league/oauth2-client Packagist
12 | * @link https://github.com/thephpleague/oauth2-client GitHub
13 | */
14 |
15 | namespace League\OAuth2\Client\Grant;
16 |
17 | use League\OAuth2\Client\Tool\RequiredParameterTrait;
18 |
19 | /**
20 | * Represents a type of authorization grant.
21 | *
22 | * An authorization grant is a credential representing the resource
23 | * owner's authorization (to access its protected resources) used by the
24 | * client to obtain an access token. OAuth 2.0 defines four
25 | * grant types -- authorization code, implicit, resource owner password
26 | * credentials, and client credentials -- as well as an extensibility
27 | * mechanism for defining additional types.
28 | *
29 | * @link http://tools.ietf.org/html/rfc6749#section-1.3 Authorization Grant (RFC 6749, §1.3)
30 | */
31 | abstract class AbstractGrant
32 | {
33 | use RequiredParameterTrait;
34 |
35 | /**
36 | * Returns the name of this grant, eg. 'grant_name', which is used as the
37 | * grant type when encoding URL query parameters.
38 | *
39 | * @return string
40 | */
41 | abstract protected function getName();
42 |
43 | /**
44 | * Returns a list of all required request parameters.
45 | *
46 | * @return array
47 | */
48 | abstract protected function getRequiredRequestParameters();
49 |
50 | /**
51 | * Returns this grant's name as its string representation. This allows for
52 | * string interpolation when building URL query parameters.
53 | *
54 | * @return string
55 | */
56 | public function __toString()
57 | {
58 | return $this->getName();
59 | }
60 |
61 | /**
62 | * Prepares an access token request's parameters by checking that all
63 | * required parameters are set, then merging with any given defaults.
64 | *
65 | * @param array $defaults
66 | * @param array $options
67 | * @return array
68 | */
69 | public function prepareRequestParameters(array $defaults, array $options)
70 | {
71 | $defaults['grant_type'] = $this->getName();
72 |
73 | $required = $this->getRequiredRequestParameters();
74 | $provided = array_merge($defaults, $options);
75 |
76 | $this->checkRequiredParameters($required, $provided);
77 |
78 | return $provided;
79 | }
80 | }
81 |
--------------------------------------------------------------------------------
/vendor/paragonie/random_compat/lib/random_bytes_mcrypt.php:
--------------------------------------------------------------------------------
1 | config = Grav::instance()['config'];
20 |
21 | $options += [
22 | 'clientId' => $this->config->get('plugins.login-oauth2.providers.github.client_id'),
23 | 'clientSecret' => $this->config->get('plugins.login-oauth2.providers.github.client_secret'),
24 | 'redirectUri' => $this->getCallbackUri(),
25 | ];
26 |
27 | parent::__construct($options);
28 | }
29 |
30 | public function getAuthorizationUrl()
31 | {
32 | $options = ['state' => $this->state];
33 | $options['scope'] = $this->config->get('plugins.login-oauth2.providers.github.options.scope');
34 |
35 | return $this->provider->getAuthorizationUrl($options);
36 | }
37 |
38 | public function getUserData($user)
39 | {
40 | $data = $user->toArray();
41 |
42 | $data_user = [
43 | 'id' => $user->getId(),
44 | 'login' => $data['login'],
45 | 'fullname' => $user->getName(),
46 | 'email' => $this->getEmail($user),
47 | 'github' => [
48 | 'location' => $data['location'],
49 | 'company' => $data['company'],
50 | 'avatar_url' => $data['avatar_url'],
51 | ]
52 | ];
53 |
54 | return $data_user;
55 | }
56 |
57 | /**
58 | * Handle regular email
59 | *
60 | * @param $user
61 | * @return null
62 | */
63 | public function getEmail($user)
64 | {
65 | $email = $user->getEmail();
66 |
67 | if (is_null($email)) {
68 | $url = $this->provider->getResourceOwnerDetailsUrl($this->token);
69 | $request = $this->provider->getAuthenticatedRequest(
70 | 'GET',
71 | $url . '/emails',
72 | $this->token
73 | );
74 |
75 | $response = $this->provider->getResponse($request);
76 | $emails = json_decode($response->getBody()->getContents());
77 |
78 | $filtered = array_filter($emails, function($email) {
79 | return $email->primary && $email->verified;
80 | });
81 |
82 | $email = $filtered ? array_shift($filtered)->email : null;
83 | }
84 |
85 |
86 |
87 | return $email;
88 | }
89 | }
--------------------------------------------------------------------------------
/vendor/psr/http-message/src/ResponseInterface.php:
--------------------------------------------------------------------------------
1 | operators might accidentally let a float
38 | * through.
39 | *
40 | * @param int|float $number The number we want to convert to an int
41 | * @param bool $fail_open Set to true to not throw an exception
42 | *
43 | * @return float|int
44 | * @psalm-suppress InvalidReturnType
45 | *
46 | * @throws TypeError
47 | */
48 | function RandomCompat_intval($number, $fail_open = false)
49 | {
50 | if (is_int($number) || is_float($number)) {
51 | $number += 0;
52 | } elseif (is_numeric($number)) {
53 | $number += 0;
54 | }
55 |
56 | if (
57 | is_float($number)
58 | &&
59 | $number > ~PHP_INT_MAX
60 | &&
61 | $number < PHP_INT_MAX
62 | ) {
63 | $number = (int) $number;
64 | }
65 |
66 | if (is_int($number)) {
67 | return (int) $number;
68 | } elseif (!$fail_open) {
69 | throw new TypeError(
70 | 'Expected an integer.'
71 | );
72 | }
73 | return $number;
74 | }
75 | }
76 |
--------------------------------------------------------------------------------
/vendor/wohali/oauth2-discord-new/src/Provider/DiscordResourceOwner.php:
--------------------------------------------------------------------------------
1 |
9 | * @license http://opensource.org/licenses/MIT MIT
10 | * @link https://packagist.org/packages/wohali/oauth2-discord-new Packagist
11 | * @link https://github.com/wohali/oauth2-discord-new GitHub
12 | */
13 |
14 | namespace Wohali\OAuth2\Client\Provider;
15 |
16 | use League\OAuth2\Client\Provider\ResourceOwnerInterface;
17 | use League\OAuth2\Client\Tool\ArrayAccessorTrait;
18 |
19 | class DiscordResourceOwner implements ResourceOwnerInterface
20 | {
21 | use ArrayAccessorTrait;
22 |
23 | /**
24 | * Raw response
25 | *
26 | * @var array
27 | */
28 | protected $response;
29 |
30 | /**
31 | * Creates new resource owner.
32 | *
33 | * @param array $response
34 | */
35 | public function __construct(array $response = array())
36 | {
37 | $this->response = $response;
38 | }
39 |
40 | /**
41 | * Get resource owner ID
42 | *
43 | * @return string|null
44 | */
45 | public function getId()
46 | {
47 | return $this->getValueByKey($this->response, 'id');
48 | }
49 |
50 | /**
51 | * Get resource owner username
52 | *
53 | * @return string|null
54 | */
55 | public function getUsername()
56 | {
57 | return $this->getValueByKey($this->response, 'username');
58 | }
59 |
60 | /**
61 | * Get resource owner discriminator
62 | *
63 | * @return string|null
64 | */
65 | public function getDiscriminator()
66 | {
67 | return $this->getValueByKey($this->response, 'discriminator');
68 | }
69 |
70 | /**
71 | * Get resource owner avatar hash
72 | *
73 | * @return string|null
74 | */
75 | public function getAvatarHash()
76 | {
77 | return $this->getValueByKey($this->response, 'avatar');
78 | }
79 |
80 | /**
81 | * Get resource owner verified flag
82 | *
83 | * @return bool
84 | */
85 | public function getVerified()
86 | {
87 | return $this->getValueByKey($this->response, 'verified', false);
88 | }
89 |
90 | /**
91 | * Get resource owner email
92 | *
93 | * @return string|null
94 | */
95 | public function getEmail()
96 | {
97 | return $this->getValueByKey($this->response, 'email');
98 | }
99 |
100 | /**
101 | * Returns the raw resource owner response.
102 | *
103 | * @return array
104 | */
105 | public function toArray()
106 | {
107 | return $this->response;
108 | }
109 | }
110 |
--------------------------------------------------------------------------------