Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

Commit

Permalink
Updates to zend-expressive-authentication 0.2.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
weierophinney committed Nov 28, 2017
1 parent 062cab8 commit f05e278
Show file tree
Hide file tree
Showing 5 changed files with 95 additions and 58 deletions.
22 changes: 22 additions & 0 deletions CHANGELOG.md
Expand Up @@ -2,6 +2,28 @@

All notable changes to this project will be documented in this file, in reverse chronological order by release.

## 0.2.0 - 2017-11-28

### Added

- Adds support for zend-expressive-authentication 0.2.0.

### Changed

- Nothing.

### Deprecated

- Nothing.

### Removed

- Removes support for zend-expressive-authentication 0.1.0.

### Fixed

- Nothing.

## 0.1.0 - 2017-11-20

Initial release.
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -26,7 +26,7 @@
"league/oauth2-server": "^6.0",
"psr/container": "^1.0",
"psr/http-message": "^1.0.1",
"zendframework/zend-expressive-authentication": "^0.1 || ^1.0"
"zendframework/zend-expressive-authentication": "^0.2 || ^1.0"
},
"require-dev": {
"phpunit/phpunit": "^6.0.8",
Expand Down
125 changes: 70 additions & 55 deletions composer.lock

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

2 changes: 1 addition & 1 deletion src/OAuth2Adapter.php
Expand Up @@ -51,7 +51,7 @@ public function authenticate(ServerRequestInterface $request) : ?UserInterface
$result = $this->resourceServer->validateAuthenticatedRequest($request);
$userId = $result->getAttribute('oauth_user_id', false);
if (false !== $userId) {
return $this->generateUser($userId, '');
return $this->generateUser($userId, []);
}
} catch (OAuthServerException $exception) {
return null;
Expand Down
2 changes: 1 addition & 1 deletion test/OAuth2AdapterTest.php
Expand Up @@ -89,7 +89,7 @@ public function testAuthenticateReturnsAUserIfTheResourceServerProducesAUserId()

$this->assertInstanceOf(UserInterface::class, $user);
$this->assertSame('some-identifier', $user->getUsername());
$this->assertSame('', $user->getUserRole());
$this->assertSame([], $user->getUserRoles());
}

public function testUnauthorizedResponseProducesAResponseWithAWwwAuthenticateHeader()
Expand Down

0 comments on commit f05e278

Please sign in to comment.