Skip to content

Commit

Permalink
ClaimSetRepositoryInterface::getClaimSet returns a ClaimSetInterface
Browse files Browse the repository at this point in the history
  • Loading branch information
marcriemer committed Oct 22, 2024
1 parent 1bdd17d commit 4ab66a7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/Repositories/ClaimSetRepositoryInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace League\OAuth2\Server\Repositories;

use League\OAuth2\Server\Entities\AccessTokenEntityInterface;
use League\OAuth2\Server\Entities\ClaimSetEntryInterface;
use League\OAuth2\Server\Entities\ClaimSetInterface;

/**
* ClaimSetRepositoryInterface resolve claims for id_token.
Expand All @@ -16,5 +16,5 @@
*/
interface ClaimSetRepositoryInterface
{
public function getClaimSetEntry(AccessTokenEntityInterface $authCode): ClaimSetEntryInterface;
public function getClaimSet(AccessTokenEntityInterface $authCode): ClaimSetInterface;
}
6 changes: 3 additions & 3 deletions src/ResponseTypes/IdTokenResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
use League\OAuth2\Server\ClaimExtractor;
use League\OAuth2\Server\ClaimExtractorInterface;
use League\OAuth2\Server\Entities\AccessTokenEntityInterface;
use League\OAuth2\Server\Entities\ClaimSetEntryInterface;
use League\OAuth2\Server\Entities\ClaimSetInterface;
use League\OAuth2\Server\Entities\ScopeEntityInterface;
use League\OAuth2\Server\EventEmitting\EmitterAwarePolyfill;
use League\OAuth2\Server\EventEmitting\EventEmitter;
Expand Down Expand Up @@ -76,11 +76,11 @@ protected function getExtraParams(AccessTokenEntityInterface $accessToken): arra
return [];
}

$claimSet = $this->claimRepository->getClaimSetEntry($accessToken);
$claimSet = $this->claimRepository->getClaimSet($accessToken);

$builder = $this->idTokenRepository->getBuilder($accessToken);

if ($claimSet instanceof ClaimSetEntryInterface) {
if ($claimSet instanceof ClaimSetInterface) {

Check failure on line 83 in src/ResponseTypes/IdTokenResponse.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.1, prefer-lowest, ubuntu-latest)

Instanceof between League\OAuth2\Server\Entities\ClaimSetInterface and League\OAuth2\Server\Entities\ClaimSetInterface will always evaluate to true.

Check failure on line 83 in src/ResponseTypes/IdTokenResponse.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.1, prefer-stable, ubuntu-latest)

Instanceof between League\OAuth2\Server\Entities\ClaimSetInterface and League\OAuth2\Server\Entities\ClaimSetInterface will always evaluate to true.

Check failure on line 83 in src/ResponseTypes/IdTokenResponse.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.3, prefer-lowest, ubuntu-latest)

Instanceof between League\OAuth2\Server\Entities\ClaimSetInterface and League\OAuth2\Server\Entities\ClaimSetInterface will always evaluate to true.

Check failure on line 83 in src/ResponseTypes/IdTokenResponse.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.3, prefer-stable, ubuntu-latest)

Instanceof between League\OAuth2\Server\Entities\ClaimSetInterface and League\OAuth2\Server\Entities\ClaimSetInterface will always evaluate to true.

Check failure on line 83 in src/ResponseTypes/IdTokenResponse.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.2, prefer-lowest, ubuntu-latest)

Instanceof between League\OAuth2\Server\Entities\ClaimSetInterface and League\OAuth2\Server\Entities\ClaimSetInterface will always evaluate to true.

Check failure on line 83 in src/ResponseTypes/IdTokenResponse.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.2, prefer-stable, ubuntu-latest)

Instanceof between League\OAuth2\Server\Entities\ClaimSetInterface and League\OAuth2\Server\Entities\ClaimSetInterface will always evaluate to true.
foreach ($this->extractor->extract($accessToken->getScopes(), $claimSet->getClaims()) as $claimName => $claimValue) {
$builder = $builder->withClaim($claimName, $claimValue);

Check failure on line 85 in src/ResponseTypes/IdTokenResponse.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.1, prefer-lowest, ubuntu-latest)

Parameter #1 $name of method Lcobucci\JWT\Builder::withClaim() expects non-empty-string, string given.

Check failure on line 85 in src/ResponseTypes/IdTokenResponse.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.1, prefer-stable, ubuntu-latest)

Parameter #1 $name of method Lcobucci\JWT\Builder::withClaim() expects non-empty-string, string given.

Check failure on line 85 in src/ResponseTypes/IdTokenResponse.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.3, prefer-lowest, ubuntu-latest)

Parameter #1 $name of method Lcobucci\JWT\Builder::withClaim() expects non-empty-string, string given.

Check failure on line 85 in src/ResponseTypes/IdTokenResponse.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.3, prefer-stable, ubuntu-latest)

Parameter #1 $name of method Lcobucci\JWT\Builder::withClaim() expects non-empty-string, string given.

Check failure on line 85 in src/ResponseTypes/IdTokenResponse.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.2, prefer-lowest, ubuntu-latest)

Parameter #1 $name of method Lcobucci\JWT\Builder::withClaim() expects non-empty-string, string given.

Check failure on line 85 in src/ResponseTypes/IdTokenResponse.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.2, prefer-stable, ubuntu-latest)

Parameter #1 $name of method Lcobucci\JWT\Builder::withClaim() expects non-empty-string, string given.
}
Expand Down
6 changes: 3 additions & 3 deletions tests/ResponseTypes/BearerResponseTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
use League\OAuth2\Server\ClaimExtractor;
use League\OAuth2\Server\CryptKey;
use League\OAuth2\Server\Entities\AccessTokenEntityInterface;
use League\OAuth2\Server\Entities\ClaimSetEntryInterface;
use League\OAuth2\Server\Entities\ClaimSetInterface;
use League\OAuth2\Server\EventEmitting\EventEmitter;
use League\OAuth2\Server\Exception\OAuthServerException;
use League\OAuth2\Server\Repositories\AccessTokenRepositoryInterface;
Expand Down Expand Up @@ -320,9 +320,9 @@ public function testDetermineMissingBearerInHeader(): void
public function testGenerateHttpResponseWithIdToken(): void
{
$claimSetRepository = new class () implements ClaimSetRepositoryInterface {
public function getClaimSetEntry(AccessTokenEntityInterface $accessToken): ClaimSetEntryInterface
public function getClaimSet(AccessTokenEntityInterface $accessToken): ClaimSetInterface
{
$claimSet = new class () implements ClaimSetEntryInterface {
$claimSet = new class() implements ClaimSetInterface {
public string $scope = 'openid';

/**
Expand Down

0 comments on commit 4ab66a7

Please sign in to comment.