Skip to content

Commit 2dc0670

Browse files
committed
bug #48274 Add more #[\SensitiveParameter] (fancyweb)
This PR was merged into the 6.2 branch. Discussion ---------- Add more #[\SensitiveParameter] | Q | A | ------------- | --- | Branch? | 6.2 | Bug fix? | no | New feature? | yes | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - Follow-up to #46183 Commits ------- 8ad9642 Add more #[\SensitiveParameter]
2 parents 6d6dedd + 8ad9642 commit 2dc0670

File tree

8 files changed

+8
-8
lines changed

8 files changed

+8
-8
lines changed

src/Symfony/Bundle/FrameworkBundle/Secrets/SodiumVault.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class SodiumVault extends AbstractVault implements EnvVarLoaderInterface
3030
* @param $decryptionKey A string or a stringable object that defines the private key to use to decrypt the vault
3131
* or null to store generated keys in the provided $secretsDir
3232
*/
33-
public function __construct(string $secretsDir, string|\Stringable $decryptionKey = null)
33+
public function __construct(string $secretsDir, #[\SensitiveParameter] string|\Stringable $decryptionKey = null)
3434
{
3535
$this->pathPrefix = rtrim(strtr($secretsDir, '/', \DIRECTORY_SEPARATOR), \DIRECTORY_SEPARATOR).\DIRECTORY_SEPARATOR.basename($secretsDir).'.';
3636
$this->decryptionKey = $decryptionKey;

src/Symfony/Component/Security/Csrf/CsrfTokenManager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public function getToken(string $tokenId): CsrfToken
7979
return new CsrfToken($tokenId, $this->randomize($value));
8080
}
8181

82-
public function refreshToken(#[\SensitiveParameter] string $tokenId): CsrfToken
82+
public function refreshToken(string $tokenId): CsrfToken
8383
{
8484
$namespacedId = $this->getNamespace().$tokenId;
8585
$value = $this->generator->generateToken();

src/Symfony/Component/Security/Csrf/TokenStorage/NativeSessionTokenStorage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public function getToken(string $tokenId): string
5151
return (string) $_SESSION[$this->namespace][$tokenId];
5252
}
5353

54-
public function setToken(string $tokenId, string $token)
54+
public function setToken(string $tokenId, #[\SensitiveParameter] string $token)
5555
{
5656
if (!$this->sessionStarted) {
5757
$this->startSession();

src/Symfony/Component/Security/Csrf/TokenStorage/SessionTokenStorage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public function getToken(string $tokenId): string
5656
return (string) $session->get($this->namespace.'/'.$tokenId);
5757
}
5858

59-
public function setToken(string $tokenId, string $token)
59+
public function setToken(string $tokenId, #[\SensitiveParameter] string $token)
6060
{
6161
$session = $this->getSession();
6262
if (!$session->isStarted()) {

src/Symfony/Component/Security/Csrf/TokenStorage/TokenStorageInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function getToken(string $tokenId): string;
2828
/**
2929
* Stores a CSRF token.
3030
*/
31-
public function setToken(string $tokenId, string $token);
31+
public function setToken(string $tokenId, #[\SensitiveParameter] string $token);
3232

3333
/**
3434
* Removes a CSRF token.

src/Symfony/Component/Security/Http/AccessToken/AccessTokenHandlerInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@ interface AccessTokenHandlerInterface
2424
/**
2525
* @throws AuthenticationException
2626
*/
27-
public function getUserIdentifierFrom(string $accessToken): string;
27+
public function getUserIdentifierFrom(#[\SensitiveParameter] string $accessToken): string;
2828
}

src/Symfony/Component/Security/Http/Authenticator/Passport/Badge/CsrfTokenBadge.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class CsrfTokenBadge implements BadgeInterface
3333
* Using a different string for each authenticator improves its security.
3434
* @param string|null $csrfToken The CSRF token presented in the request, if any
3535
*/
36-
public function __construct(string $csrfTokenId, ?string $csrfToken)
36+
public function __construct(string $csrfTokenId, #[\SensitiveParameter] ?string $csrfToken)
3737
{
3838
$this->csrfTokenId = $csrfTokenId;
3939
$this->csrfToken = $csrfToken;

src/Symfony/Component/Security/Http/Authenticator/Passport/Badge/PasswordUpgradeBadge.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class PasswordUpgradeBadge implements BadgeInterface
3232
* @param string $plaintextPassword The presented password, used in the rehash
3333
* @param PasswordUpgraderInterface|null $passwordUpgrader The password upgrader, defaults to the UserProvider if null
3434
*/
35-
public function __construct(string $plaintextPassword, PasswordUpgraderInterface $passwordUpgrader = null)
35+
public function __construct(#[\SensitiveParameter] string $plaintextPassword, PasswordUpgraderInterface $passwordUpgrader = null)
3636
{
3737
$this->plaintextPassword = $plaintextPassword;
3838
$this->passwordUpgrader = $passwordUpgrader;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy