From 694e2be31b64d2a30c53dbbe30af3aa314c09ea8 Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Fri, 18 May 2018 16:45:44 -0600 Subject: [PATCH] prepare for release --- CHANGELOG.md | 6 +++--- README.md | 4 ++-- blueprints.yaml | 2 +- composer.lock | 12 ++++++------ vendor/composer/installed.json | 12 ++++++------ vendor/league/oauth2-linkedin/CHANGELOG.md | 17 +++++++++++++++++ vendor/league/oauth2-linkedin/README.md | 2 ++ .../oauth2-linkedin/src/Provider/LinkedIn.php | 1 + .../src/Provider/LinkedInResourceOwner.php | 10 ++++++++++ .../test/src/Provider/LinkedInTest.php | 10 ++++++++-- 10 files changed, 56 insertions(+), 20 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2727477..92a7a9b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,5 @@ -# v0.1.0 -## 04/20/2018 +# v1.0.0 +## 05/18/2018 1. [](#new) - * ChangeLog started... + * Plugin released diff --git a/README.md b/README.md index 9070a7a..a7337fc 100644 --- a/README.md +++ b/README.md @@ -171,7 +171,7 @@ Once properly configured, the functionality of the OAuth2 plugin is simple for t Any user data available via the `scope` provider options will be retrieved. Core fields like `username`, and `email` will be stored on the Grav user object, and anything else that is provider-specific can be optionally stored as well. By default, the Grav user object **is not** persisted to a physical Grav account YAML file, instead it's just kept in session temporarily. -### Storing Grav User +#### Storing Grav User By default the OAuth2 plugin does not store any local user information. Upon successfully authenticating against the OAuth2 user, a user is created and is available during the session. However, upon returning, the user must re-authenticate and the OAuth2 data is retrieved again. @@ -181,7 +181,7 @@ If you want to be able to set user data (extra fields, or specific user access) > > Also note that the password will never be stored in the Grav user under `accounts/`. -### OAuth2 to Grav Access Mapping +#### OAuth2 to Grav Access Mapping The OAuth2 plugin provides a flexible way to map your OAuth2 users into Grav. diff --git a/blueprints.yaml b/blueprints.yaml index b1b1fae..67589e5 100644 --- a/blueprints.yaml +++ b/blueprints.yaml @@ -1,5 +1,5 @@ name: Login OAuth2 -version: 0.1.0 +version: 1.0.0 description: OAuth2 Client Plugin to integrate with Grav's Login icon: plug author: diff --git a/composer.lock b/composer.lock index 17b754e..f4d585f 100644 --- a/composer.lock +++ b/composer.lock @@ -1,7 +1,7 @@ { "_readme": [ "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], "content-hash": "fc5196fc3e9460d7ccba123aff600680", @@ -502,16 +502,16 @@ }, { "name": "league/oauth2-linkedin", - "version": "3.0.0", + "version": "3.1.0", "source": { "type": "git", "url": "https://github.com/thephpleague/oauth2-linkedin.git", - "reference": "2f26dac99faf48350e7b3ddc1fba179cc62e8a05" + "reference": "7a84f248de6ea3324740269c44aa98e4abcc42f0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/oauth2-linkedin/zipball/2f26dac99faf48350e7b3ddc1fba179cc62e8a05", - "reference": "2f26dac99faf48350e7b3ddc1fba179cc62e8a05", + "url": "https://api.github.com/repos/thephpleague/oauth2-linkedin/zipball/7a84f248de6ea3324740269c44aa98e4abcc42f0", + "reference": "7a84f248de6ea3324740269c44aa98e4abcc42f0", "shasum": "" }, "require": { @@ -553,7 +553,7 @@ "oauth", "oauth2" ], - "time": "2018-03-07T20:52:19+00:00" + "time": "2018-05-04T13:48:28+00:00" }, { "name": "paragonie/random_compat", diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 847c8e6..bdc3f2c 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -513,17 +513,17 @@ }, { "name": "league/oauth2-linkedin", - "version": "3.0.0", - "version_normalized": "3.0.0.0", + "version": "3.1.0", + "version_normalized": "3.1.0.0", "source": { "type": "git", "url": "https://github.com/thephpleague/oauth2-linkedin.git", - "reference": "2f26dac99faf48350e7b3ddc1fba179cc62e8a05" + "reference": "7a84f248de6ea3324740269c44aa98e4abcc42f0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/oauth2-linkedin/zipball/2f26dac99faf48350e7b3ddc1fba179cc62e8a05", - "reference": "2f26dac99faf48350e7b3ddc1fba179cc62e8a05", + "url": "https://api.github.com/repos/thephpleague/oauth2-linkedin/zipball/7a84f248de6ea3324740269c44aa98e4abcc42f0", + "reference": "7a84f248de6ea3324740269c44aa98e4abcc42f0", "shasum": "" }, "require": { @@ -534,7 +534,7 @@ "phpunit/phpunit": "~4.0", "squizlabs/php_codesniffer": "~2.0" }, - "time": "2018-03-07T20:52:19+00:00", + "time": "2018-05-04T13:48:28+00:00", "type": "library", "extra": { "branch-alias": { diff --git a/vendor/league/oauth2-linkedin/CHANGELOG.md b/vendor/league/oauth2-linkedin/CHANGELOG.md index d3b196d..4be0428 100644 --- a/vendor/league/oauth2-linkedin/CHANGELOG.md +++ b/vendor/league/oauth2-linkedin/CHANGELOG.md @@ -1,6 +1,23 @@ # Changelog All Notable changes to `oauth2-linkedin` will be documented in this file +## 3.1.0 - 2018-05-04 + +### Added +- Add a summary field from LinkedIn API - thanks @krainiuk-michael + +### Deprecated +- Nothing + +### Fixed +- Nothing + +### Removed +- Nothing + +### Security +- Nothing + ## 3.0.0 - 2018-03-17 ### Added diff --git a/vendor/league/oauth2-linkedin/README.md b/vendor/league/oauth2-linkedin/README.md index d93274b..b85569e 100644 --- a/vendor/league/oauth2-linkedin/README.md +++ b/vendor/league/oauth2-linkedin/README.md @@ -97,6 +97,8 @@ When fetching resource owner details, the provider allows for an explicit list o A default set of fields is provided. Overriding these defaults and defining a new set of fields is easy using the `withFields` method, which is a fluent method that returns the updated provider. +You can find a complete list of fields on [LinkedIn's Developer Documentation](https://developer.linkedin.com/docs/fields/basic-profile#). + ```php $fields = [ 'id', 'first-name', 'last-name', 'maiden-name', 'formatted-name', diff --git a/vendor/league/oauth2-linkedin/src/Provider/LinkedIn.php b/vendor/league/oauth2-linkedin/src/Provider/LinkedIn.php index cf6dbcb..5c4545c 100644 --- a/vendor/league/oauth2-linkedin/src/Provider/LinkedIn.php +++ b/vendor/league/oauth2-linkedin/src/Provider/LinkedIn.php @@ -28,6 +28,7 @@ class LinkedIn extends AbstractProvider protected $fields = [ 'id', 'email-address', 'first-name', 'last-name', 'headline', 'location', 'industry', 'picture-url', 'public-profile-url', + 'summary', ]; /** diff --git a/vendor/league/oauth2-linkedin/src/Provider/LinkedInResourceOwner.php b/vendor/league/oauth2-linkedin/src/Provider/LinkedInResourceOwner.php index b927489..010e2a2 100644 --- a/vendor/league/oauth2-linkedin/src/Provider/LinkedInResourceOwner.php +++ b/vendor/league/oauth2-linkedin/src/Provider/LinkedInResourceOwner.php @@ -118,6 +118,16 @@ public function getUrl() return $this->getAttribute('publicProfileUrl'); } + /** + * Get user summary + * + * @return string|null + */ + public function getSummary() + { + return $this->getAttribute('summary'); + } + /** * Return all of the owner details available as an array. * diff --git a/vendor/league/oauth2-linkedin/test/src/Provider/LinkedInTest.php b/vendor/league/oauth2-linkedin/test/src/Provider/LinkedInTest.php index 3cc086f..6e80f2a 100644 --- a/vendor/league/oauth2-linkedin/test/src/Provider/LinkedInTest.php +++ b/vendor/league/oauth2-linkedin/test/src/Provider/LinkedInTest.php @@ -125,6 +125,7 @@ public function testUserData() $location = uniqid(); $url = uniqid(); $description = uniqid(); + $summary = uniqid(); $somethingExtra = ['more' => uniqid()]; $postResponse = m::mock('Psr\Http\Message\ResponseInterface'); @@ -132,7 +133,7 @@ public function testUserData() $postResponse->shouldReceive('getHeader')->andReturn(['content-type' => 'json']); $userResponse = m::mock('Psr\Http\Message\ResponseInterface'); - $userResponse->shouldReceive('getBody')->andReturn('{"id": '.$userId.', "firstName": "'.$firstName.'", "lastName": "'.$lastName.'", "emailAddress": "'.$email.'", "location": { "name": "'.$location.'" }, "headline": "'.$description.'", "pictureUrl": "'.$picture.'", "publicProfileUrl": "'.$url.'", "somethingExtra": '.json_encode($somethingExtra).'}'); + $userResponse->shouldReceive('getBody')->andReturn('{"id": '.$userId.', "firstName": "'.$firstName.'", "lastName": "'.$lastName.'", "emailAddress": "'.$email.'", "location": { "name": "'.$location.'" }, "headline": "'.$description.'", "summary": "'.$summary.'", "pictureUrl": "'.$picture.'", "publicProfileUrl": "'.$url.'", "somethingExtra": '.json_encode($somethingExtra).'}'); $userResponse->shouldReceive('getHeader')->andReturn(['content-type' => 'json']); $client = m::mock('GuzzleHttp\ClientInterface'); @@ -160,6 +161,8 @@ public function testUserData() $this->assertEquals($url, $user->toArray()['publicProfileUrl']); $this->assertEquals($description, $user->getDescription()); $this->assertEquals($description, $user->toArray()['headline']); + $this->assertEquals($summary, $user->getSummary()); + $this->assertEquals($summary, $user->toArray()['summary']); $this->assertEquals($somethingExtra, $user->getAttribute('somethingExtra')); $this->assertEquals($somethingExtra, $user->toArray()['somethingExtra']); $this->assertEquals($somethingExtra['more'], $user->getAttribute('somethingExtra.more')); @@ -174,13 +177,14 @@ public function testMissingUserData() $location = uniqid(); $url = uniqid(); $description = uniqid(); + $summary = uniqid(); $postResponse = m::mock('Psr\Http\Message\ResponseInterface'); $postResponse->shouldReceive('getBody')->andReturn('{"access_token": "mock_access_token", "expires_in": 3600}'); $postResponse->shouldReceive('getHeader')->andReturn(['content-type' => 'json']); $userResponse = m::mock('Psr\Http\Message\ResponseInterface'); - $userResponse->shouldReceive('getBody')->andReturn('{"id": '.$userId.', "firstName": "'.$firstName.'", "lastName": "'.$lastName.'", "emailAddress": "'.$email.'", "location": { "name": "'.$location.'" }, "headline": "'.$description.'", "publicProfileUrl": "'.$url.'"}'); + $userResponse->shouldReceive('getBody')->andReturn('{"id": '.$userId.', "firstName": "'.$firstName.'", "lastName": "'.$lastName.'", "emailAddress": "'.$email.'", "location": { "name": "'.$location.'" }, "headline": "'.$description.'", "summary": "'.$summary.'", "publicProfileUrl": "'.$url.'"}'); $userResponse->shouldReceive('getHeader')->andReturn(['content-type' => 'json']); $client = m::mock('GuzzleHttp\ClientInterface'); @@ -207,6 +211,8 @@ public function testMissingUserData() $this->assertEquals($url, $user->toArray()['publicProfileUrl']); $this->assertEquals($description, $user->getDescription()); $this->assertEquals($description, $user->toArray()['headline']); + $this->assertEquals($summary, $user->getSummary()); + $this->assertEquals($summary, $user->toArray()['summary']); } /**