From 8ad964261361ce3cb2f06e5507d71cc68dc65132 Mon Sep 17 00:00:00 2001 From: Thomas Calvet Date: Mon, 21 Nov 2022 19:36:40 +0100 Subject: [PATCH] Add more #[\SensitiveParameter] --- src/Symfony/Bundle/FrameworkBundle/Secrets/SodiumVault.php | 2 +- src/Symfony/Component/Security/Csrf/CsrfTokenManager.php | 2 +- .../Security/Csrf/TokenStorage/NativeSessionTokenStorage.php | 2 +- .../Security/Csrf/TokenStorage/SessionTokenStorage.php | 2 +- .../Security/Csrf/TokenStorage/TokenStorageInterface.php | 2 +- .../Security/Http/AccessToken/AccessTokenHandlerInterface.php | 2 +- .../Http/Authenticator/Passport/Badge/CsrfTokenBadge.php | 2 +- .../Http/Authenticator/Passport/Badge/PasswordUpgradeBadge.php | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/Secrets/SodiumVault.php b/src/Symfony/Bundle/FrameworkBundle/Secrets/SodiumVault.php index e8ce7d8f95eec..b6bb058b3f170 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Secrets/SodiumVault.php +++ b/src/Symfony/Bundle/FrameworkBundle/Secrets/SodiumVault.php @@ -30,7 +30,7 @@ class SodiumVault extends AbstractVault implements EnvVarLoaderInterface * @param $decryptionKey A string or a stringable object that defines the private key to use to decrypt the vault * or null to store generated keys in the provided $secretsDir */ - public function __construct(string $secretsDir, string|\Stringable $decryptionKey = null) + public function __construct(string $secretsDir, #[\SensitiveParameter] string|\Stringable $decryptionKey = null) { $this->pathPrefix = rtrim(strtr($secretsDir, '/', \DIRECTORY_SEPARATOR), \DIRECTORY_SEPARATOR).\DIRECTORY_SEPARATOR.basename($secretsDir).'.'; $this->decryptionKey = $decryptionKey; diff --git a/src/Symfony/Component/Security/Csrf/CsrfTokenManager.php b/src/Symfony/Component/Security/Csrf/CsrfTokenManager.php index 7d6dbda5489f4..7cefe8b0a0572 100644 --- a/src/Symfony/Component/Security/Csrf/CsrfTokenManager.php +++ b/src/Symfony/Component/Security/Csrf/CsrfTokenManager.php @@ -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(); diff --git a/src/Symfony/Component/Security/Csrf/TokenStorage/NativeSessionTokenStorage.php b/src/Symfony/Component/Security/Csrf/TokenStorage/NativeSessionTokenStorage.php index 15bdaaf82046e..cf0ce03e9311d 100644 --- a/src/Symfony/Component/Security/Csrf/TokenStorage/NativeSessionTokenStorage.php +++ b/src/Symfony/Component/Security/Csrf/TokenStorage/NativeSessionTokenStorage.php @@ -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(); diff --git a/src/Symfony/Component/Security/Csrf/TokenStorage/SessionTokenStorage.php b/src/Symfony/Component/Security/Csrf/TokenStorage/SessionTokenStorage.php index bed96fa4c2960..fdbaf135d7654 100644 --- a/src/Symfony/Component/Security/Csrf/TokenStorage/SessionTokenStorage.php +++ b/src/Symfony/Component/Security/Csrf/TokenStorage/SessionTokenStorage.php @@ -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()) { diff --git a/src/Symfony/Component/Security/Csrf/TokenStorage/TokenStorageInterface.php b/src/Symfony/Component/Security/Csrf/TokenStorage/TokenStorageInterface.php index a26439366e2ab..d119d6e977bcb 100644 --- a/src/Symfony/Component/Security/Csrf/TokenStorage/TokenStorageInterface.php +++ b/src/Symfony/Component/Security/Csrf/TokenStorage/TokenStorageInterface.php @@ -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. diff --git a/src/Symfony/Component/Security/Http/AccessToken/AccessTokenHandlerInterface.php b/src/Symfony/Component/Security/Http/AccessToken/AccessTokenHandlerInterface.php index 33a0690d15cc5..8044a371293aa 100644 --- a/src/Symfony/Component/Security/Http/AccessToken/AccessTokenHandlerInterface.php +++ b/src/Symfony/Component/Security/Http/AccessToken/AccessTokenHandlerInterface.php @@ -24,5 +24,5 @@ interface AccessTokenHandlerInterface /** * @throws AuthenticationException */ - public function getUserIdentifierFrom(string $accessToken): string; + public function getUserIdentifierFrom(#[\SensitiveParameter] string $accessToken): string; } diff --git a/src/Symfony/Component/Security/Http/Authenticator/Passport/Badge/CsrfTokenBadge.php b/src/Symfony/Component/Security/Http/Authenticator/Passport/Badge/CsrfTokenBadge.php index b24e2c75f548c..52aeafe858eb1 100644 --- a/src/Symfony/Component/Security/Http/Authenticator/Passport/Badge/CsrfTokenBadge.php +++ b/src/Symfony/Component/Security/Http/Authenticator/Passport/Badge/CsrfTokenBadge.php @@ -33,7 +33,7 @@ class CsrfTokenBadge implements BadgeInterface * Using a different string for each authenticator improves its security. * @param string|null $csrfToken The CSRF token presented in the request, if any */ - public function __construct(string $csrfTokenId, ?string $csrfToken) + public function __construct(string $csrfTokenId, #[\SensitiveParameter] ?string $csrfToken) { $this->csrfTokenId = $csrfTokenId; $this->csrfToken = $csrfToken; diff --git a/src/Symfony/Component/Security/Http/Authenticator/Passport/Badge/PasswordUpgradeBadge.php b/src/Symfony/Component/Security/Http/Authenticator/Passport/Badge/PasswordUpgradeBadge.php index 992b50d0811c1..9cbf6d6e69343 100644 --- a/src/Symfony/Component/Security/Http/Authenticator/Passport/Badge/PasswordUpgradeBadge.php +++ b/src/Symfony/Component/Security/Http/Authenticator/Passport/Badge/PasswordUpgradeBadge.php @@ -32,7 +32,7 @@ class PasswordUpgradeBadge implements BadgeInterface * @param string $plaintextPassword The presented password, used in the rehash * @param PasswordUpgraderInterface|null $passwordUpgrader The password upgrader, defaults to the UserProvider if null */ - public function __construct(string $plaintextPassword, PasswordUpgraderInterface $passwordUpgrader = null) + public function __construct(#[\SensitiveParameter] string $plaintextPassword, PasswordUpgraderInterface $passwordUpgrader = null) { $this->plaintextPassword = $plaintextPassword; $this->passwordUpgrader = $passwordUpgrader; 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