Skip to content

Commit d7634f9

Browse files
committed
change function name and update changelog
1 parent 8c33b52 commit d7634f9

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
88
### Added
99
- The server will now validate redirect uris according to rfc8252 (PR #1203)
1010
- Events emitted now include the refresh token and access token payloads (PR #1211)
11+
- Use the `revokeRefreshTokens()` function to decide whether refresh tokens are revoked or not upon use (PR #1189)
1112

1213
### Changed
1314
- Keys are now validated using `openssl_pkey_get_private()` and openssl_pkey_get_public()` instead of regex matching (PR #1215)

src/AuthorizationServer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ public function enableGrantType(GrantTypeInterface $grantType, DateInterval $acc
141141
$grantType->setPrivateKey($this->privateKey);
142142
$grantType->setEmitter($this->getEmitter());
143143
$grantType->setEncryptionKey($this->encryptionKey);
144-
$grantType->setRevokeRefreshTokens($this->revokeRefreshTokens);
144+
$grantType->revokeRefreshTokens($this->revokeRefreshTokens);
145145

146146
$this->enabledGrantTypes[$grantType->getIdentifier()] = $grantType;
147147
$this->grantTypeAccessTokenTTL[$grantType->getIdentifier()] = $accessTokenTTL;
@@ -245,7 +245,7 @@ public function setDefaultScope($defaultScope)
245245
*
246246
* @param bool $revokeRefreshTokens
247247
*/
248-
public function setRevokeRefreshTokens(bool $revokeRefreshTokens): void
248+
public function revokeRefreshTokens(bool $revokeRefreshTokens): void
249249
{
250250
$this->revokeRefreshTokens = $revokeRefreshTokens;
251251
}

src/Grant/AbstractGrant.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ public function setDefaultScope($scope)
175175
/**
176176
* @param bool $revokeRefreshTokens
177177
*/
178-
public function setRevokeRefreshTokens(bool $revokeRefreshTokens)
178+
public function revokeRefreshTokens(bool $revokeRefreshTokens)
179179
{
180180
$this->revokeRefreshTokens = $revokeRefreshTokens;
181181
}

tests/Grant/RefreshTokenGrantTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public function testRespondToRequest()
6969
$grant->setAccessTokenRepository($accessTokenRepositoryMock);
7070
$grant->setEncryptionKey($this->cryptStub->getKey());
7171
$grant->setPrivateKey(new CryptKey('file://' . __DIR__ . '/../Stubs/private.key'));
72-
$grant->setRevokeRefreshTokens(true);
72+
$grant->revokeRefreshTokens(true);
7373

7474
$oldRefreshToken = $this->cryptStub->doEncrypt(
7575
\json_encode(
@@ -183,7 +183,7 @@ public function testRespondToReducedScopes()
183183
$grant->setScopeRepository($scopeRepositoryMock);
184184
$grant->setEncryptionKey($this->cryptStub->getKey());
185185
$grant->setPrivateKey(new CryptKey('file://' . __DIR__ . '/../Stubs/private.key'));
186-
$grant->setRevokeRefreshTokens(true);
186+
$grant->revokeRefreshTokens(true);
187187

188188
$oldRefreshToken = $this->cryptStub->doEncrypt(
189189
\json_encode(
@@ -523,7 +523,7 @@ public function testRevokedRefreshToken()
523523
$grant->setAccessTokenRepository($accessTokenRepositoryMock);
524524
$grant->setEncryptionKey($this->cryptStub->getKey());
525525
$grant->setPrivateKey(new CryptKey('file://' . __DIR__ . '/../Stubs/private.key'));
526-
$grant->setRevokeRefreshTokens(true);
526+
$grant->revokeRefreshTokens(true);
527527
$grant->respondToAccessTokenRequest($serverRequest, new StubResponseType(), new DateInterval('PT5M'));
528528

529529
Assert::assertTrue($refreshTokenRepositoryMock->isRefreshTokenRevoked($refreshTokenId));

0 commit comments

Comments
 (0)