Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 7dcc4ac

Browse filesBrowse files
GromNaNfabpot
authored andcommitted
Hide sensitive information with SensitiveParameter attribute
1 parent 25c2bb1 commit 7dcc4ac
Copy full SHA for 7dcc4ac

63 files changed

+93-79Lines changed: 93 additions & 79 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Dismiss banner
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎psalm.xml‎

Copy file name to clipboardExpand all lines: psalm.xml
+6Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,11 @@
3535
<referencedClass name="UnitEnum"/>
3636
</errorLevel>
3737
</UndefinedDocblockClass>
38+
<UndefinedAttributeClass>
39+
<errorLevel type="suppress">
40+
<!-- These classes have been added in PHP 8.2 -->
41+
<referencedClass name="SensitiveParameter"/>
42+
</errorLevel>
43+
</UndefinedAttributeClass>
3844
</issueHandlers>
3945
</psalm>
Collapse file

‎src/Symfony/Bridge/Doctrine/Security/RememberMe/DoctrineTokenProvider.php‎

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Doctrine/Security/RememberMe/DoctrineTokenProvider.php
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public function deleteTokenBySeries(string $series)
8787
/**
8888
* {@inheritdoc}
8989
*/
90-
public function updateToken(string $series, string $tokenValue, \DateTime $lastUsed)
90+
public function updateToken(string $series, #[\SensitiveParameter] string $tokenValue, \DateTime $lastUsed)
9191
{
9292
$sql = 'UPDATE rememberme_token SET value=:value, lastUsed=:lastUsed WHERE series=:series';
9393
$paramValues = [
@@ -140,7 +140,7 @@ public function createNewToken(PersistentTokenInterface $token)
140140
/**
141141
* {@inheritdoc}
142142
*/
143-
public function verifyToken(PersistentTokenInterface $token, string $tokenValue): bool
143+
public function verifyToken(PersistentTokenInterface $token, #[\SensitiveParameter] string $tokenValue): bool
144144
{
145145
// Check if the token value matches the current persisted token
146146
if (hash_equals($token->getTokenValue(), $tokenValue)) {
@@ -177,7 +177,7 @@ public function verifyToken(PersistentTokenInterface $token, string $tokenValue)
177177
/**
178178
* {@inheritdoc}
179179
*/
180-
public function updateExistingToken(PersistentTokenInterface $token, string $tokenValue, \DateTimeInterface $lastUsed): void
180+
public function updateExistingToken(PersistentTokenInterface $token, #[\SensitiveParameter] string $tokenValue, \DateTimeInterface $lastUsed): void
181181
{
182182
if (!$token instanceof PersistentToken) {
183183
return;
Collapse file

‎src/Symfony/Bundle/FrameworkBundle/Controller/AbstractController.php‎

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Controller/AbstractController.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ protected function getUser(): ?UserInterface
374374
* @param string $id The id used when generating the token
375375
* @param string|null $token The actual token sent with the request that should be validated
376376
*/
377-
protected function isCsrfTokenValid(string $id, ?string $token): bool
377+
protected function isCsrfTokenValid(string $id, #[\SensitiveParameter] ?string $token): bool
378378
{
379379
if (!$this->container->has('security.csrf.token_manager')) {
380380
throw new \LogicException('CSRF protection is not enabled in your application. Enable it with the "csrf_protection" key in "config/packages/framework.yaml".');
Collapse file

‎src/Symfony/Component/HttpClient/HttpOptions.php‎

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpClient/HttpOptions.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function toArray(): array
3232
/**
3333
* @return $this
3434
*/
35-
public function setAuthBasic(string $user, string $password = ''): static
35+
public function setAuthBasic(string $user, #[\SensitiveParameter] string $password = ''): static
3636
{
3737
$this->options['auth_basic'] = $user;
3838

@@ -46,7 +46,7 @@ public function setAuthBasic(string $user, string $password = ''): static
4646
/**
4747
* @return $this
4848
*/
49-
public function setAuthBearer(string $token): static
49+
public function setAuthBearer(#[\SensitiveParameter] string $token): static
5050
{
5151
$this->options['auth_bearer'] = $token;
5252

Collapse file

‎src/Symfony/Component/HttpKernel/UriSigner.php‎

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpKernel/UriSigner.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class UriSigner
2727
* @param string $secret A secret
2828
* @param string $parameter Query string parameter to use
2929
*/
30-
public function __construct(string $secret, string $parameter = '_hash')
30+
public function __construct(#[\SensitiveParameter] string $secret, string $parameter = '_hash')
3131
{
3232
$this->secret = $secret;
3333
$this->parameter = $parameter;
Collapse file

‎src/Symfony/Component/Ldap/Adapter/ConnectionInterface.php‎

Copy file name to clipboardExpand all lines: src/Symfony/Component/Ldap/Adapter/ConnectionInterface.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@ public function isBound(): bool;
3232
* @throws ConnectionTimeoutException When the connection can't be created because of an LDAP_TIMEOUT error
3333
* @throws InvalidCredentialsException When the connection can't be created because of an LDAP_INVALID_CREDENTIALS error
3434
*/
35-
public function bind(string $dn = null, string $password = null);
35+
public function bind(string $dn = null, #[\SensitiveParameter] string $password = null);
3636
}
Collapse file

‎src/Symfony/Component/Ldap/Adapter/ExtLdap/Connection.php‎

Copy file name to clipboardExpand all lines: src/Symfony/Component/Ldap/Adapter/ExtLdap/Connection.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public function isBound(): bool
6969
*
7070
* @param string $password WARNING: When the LDAP server allows unauthenticated binds, a blank $password will always be valid
7171
*/
72-
public function bind(string $dn = null, string $password = null)
72+
public function bind(string $dn = null, #[\SensitiveParameter] string $password = null)
7373
{
7474
if (!$this->connection) {
7575
$this->connect();
Collapse file

‎src/Symfony/Component/Ldap/Ldap.php‎

Copy file name to clipboardExpand all lines: src/Symfony/Component/Ldap/Ldap.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function __construct(AdapterInterface $adapter)
3232
/**
3333
* {@inheritdoc}
3434
*/
35-
public function bind(string $dn = null, string $password = null)
35+
public function bind(string $dn = null, #[\SensitiveParameter] string $password = null)
3636
{
3737
$this->adapter->getConnection()->bind($dn, $password);
3838
}
Collapse file

‎src/Symfony/Component/Ldap/LdapInterface.php‎

Copy file name to clipboardExpand all lines: src/Symfony/Component/Ldap/LdapInterface.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ interface LdapInterface
3030
*
3131
* @throws ConnectionException if dn / password could not be bound
3232
*/
33-
public function bind(string $dn = null, string $password = null);
33+
public function bind(string $dn = null, #[\SensitiveParameter] string $password = null);
3434

3535
/**
3636
* Queries a ldap server for entries matching the given criteria.
Collapse file

‎src/Symfony/Component/Ldap/Security/LdapUser.php‎

Copy file name to clipboardExpand all lines: src/Symfony/Component/Ldap/Security/LdapUser.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class LdapUser implements UserInterface, PasswordAuthenticatedUserInterface, Equ
2929
private array $roles;
3030
private array $extraFields;
3131

32-
public function __construct(Entry $entry, string $username, ?string $password, array $roles = [], array $extraFields = [])
32+
public function __construct(Entry $entry, string $username, #[\SensitiveParameter] ?string $password, array $roles = [], array $extraFields = [])
3333
{
3434
if (!$username) {
3535
throw new \InvalidArgumentException('The username cannot be empty.');
@@ -97,7 +97,7 @@ public function getExtraFields(): array
9797
return $this->extraFields;
9898
}
9999

100-
public function setPassword(string $password)
100+
public function setPassword(#[\SensitiveParameter] string $password)
101101
{
102102
$this->password = $password;
103103
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.