Skip to content

Commit

Permalink
ci: commit oat-sa/environment-management#
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions committed Apr 29, 2022
1 parent 7a3892a commit f1511d9
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 5 deletions.
19 changes: 15 additions & 4 deletions src/Http/AuthorizationDetailsHeaderMarker.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,20 @@ final class AuthorizationDetailsHeaderMarker implements AuthorizationDetailsMark
{
private const DEFAULT_HEADER_NAME = 'X-OAT-WITH-AUTH-DETAILS';

public function withAuthDetails(ResponseInterface $response, string $clientId, string $refreshTokenId): ResponseInterface
{
$withAuthDetails = array('clientId' => $clientId, 'refreshTokenId' => $refreshTokenId);
return $response->withHeader(self::DEFAULT_HEADER_NAME, json_encode($withAuthDetails));
public function withAuthDetails(
ResponseInterface $response,
string $clientId,
string $refreshTokenId,
string $userIdentifier = null,
string $userRole = null,
string $mode = self::MODE_COOKIE,
): ResponseInterface {
return $response->withHeader(self::DEFAULT_HEADER_NAME, json_encode([
'clientId' => $clientId,
'refreshTokenId' => $refreshTokenId,
'userIdentifier' => $userIdentifier,
'userRole' => $userRole,
'mode' => $mode,
]));
}
}
12 changes: 11 additions & 1 deletion src/Http/AuthorizationDetailsMarkerInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,15 @@

interface AuthorizationDetailsMarkerInterface
{
public function withAuthDetails(ResponseInterface $response, string $clientId, string $refreshTokenId): ResponseInterface;
public const MODE_COOKIE = 'cookie';
public const MODE_QUERY_PARAMETER = 'queryParameter';

public function withAuthDetails(
ResponseInterface $response,
string $clientId,
string $refreshTokenId,
string $userIdentifier = null,
string $userRole = null,
string $mode = self::MODE_COOKIE,
): ResponseInterface;
}

0 comments on commit f1511d9

Please sign in to comment.