Skip to content

Commit

Permalink
Merge branch 'release/1.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
rhukster committed May 18, 2018
2 parents 955cdfc + 694e2be commit 87dc5e3
Show file tree
Hide file tree
Showing 10 changed files with 56 additions and 20 deletions.
6 changes: 3 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# v0.1.0
## 04/20/2018
# v1.0.0
## 05/18/2018

1. [](#new)
* ChangeLog started...
* Plugin released
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion blueprints.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
12 changes: 6 additions & 6 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions vendor/composer/installed.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand All @@ -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": {
Expand Down
17 changes: 17 additions & 0 deletions vendor/league/oauth2-linkedin/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 2 additions & 0 deletions vendor/league/oauth2-linkedin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
1 change: 1 addition & 0 deletions vendor/league/oauth2-linkedin/src/Provider/LinkedIn.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
];

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down
10 changes: 8 additions & 2 deletions vendor/league/oauth2-linkedin/test/src/Provider/LinkedInTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,14 +125,15 @@ public function testUserData()
$location = uniqid();
$url = uniqid();
$description = uniqid();
$summary = uniqid();
$somethingExtra = ['more' => 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.'", "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');
Expand Down Expand Up @@ -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'));
Expand All @@ -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');
Expand All @@ -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']);
}

/**
Expand Down

0 comments on commit 87dc5e3

Please sign in to comment.