Skip to content

Commit

Permalink
Add more #[\SensitiveParameter]
Browse files Browse the repository at this point in the history
  • Loading branch information
fancyweb committed Nov 21, 2022
1 parent 2fd8656 commit 12d6ef4
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CsrfTokenManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public function getToken(string $tokenId): CsrfToken
return new CsrfToken($tokenId, $this->randomize($value));
}

public function refreshToken(#[\SensitiveParameter] string $tokenId): CsrfToken
public function refreshToken(string $tokenId): CsrfToken
{
$namespacedId = $this->getNamespace().$tokenId;
$value = $this->generator->generateToken();
Expand Down
2 changes: 1 addition & 1 deletion TokenStorage/NativeSessionTokenStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function getToken(string $tokenId): string
return (string) $_SESSION[$this->namespace][$tokenId];
}

public function setToken(string $tokenId, string $token)
public function setToken(string $tokenId, #[\SensitiveParameter] string $token)
{
if (!$this->sessionStarted) {
$this->startSession();
Expand Down
2 changes: 1 addition & 1 deletion TokenStorage/SessionTokenStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function getToken(string $tokenId): string
return (string) $session->get($this->namespace.'/'.$tokenId);
}

public function setToken(string $tokenId, string $token)
public function setToken(string $tokenId, #[\SensitiveParameter] string $token)
{
$session = $this->getSession();
if (!$session->isStarted()) {
Expand Down
2 changes: 1 addition & 1 deletion TokenStorage/TokenStorageInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function getToken(string $tokenId): string;
/**
* Stores a CSRF token.
*/
public function setToken(string $tokenId, string $token);
public function setToken(string $tokenId, #[\SensitiveParameter] string $token);

/**
* Removes a CSRF token.
Expand Down

0 comments on commit 12d6ef4

Please sign in to comment.