Skip to content

Commit 8277516

Browse files
[5.1] Mark authentication parameters sensitive (#366)
* Mark authentication parameters sensitive * Move changelog entry to 5.1.1 * Require PHP 8.2 polyfill
1 parent 19b4e84 commit 8277516

4 files changed

Lines changed: 9 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ CHANGE LOG
22
==========
33

44

5+
## 5.1.1 (UPCOMING)
6+
7+
* Add sensitive parameter annotations for authentication tokens
8+
9+
510
## 5.1.0 (06/05/2026)
611

712
* Add PHP 8.5 support

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@
2828
"php-http/httplug": "^2.4.1",
2929
"psr/http-client-implementation": "^1.0",
3030
"psr/http-factory-implementation": "^1.0",
31-
"psr/http-message": "^1.1 || ^2.0"
31+
"psr/http-message": "^1.1 || ^2.0",
32+
"symfony/polyfill-php82": "^1.27"
3233
},
3334
"require-dev": {
3435
"bamarni/composer-bin-plugin": "^1.8.2",

src/Client.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ public function vpc(): Vpc
213213
return new Vpc($this);
214214
}
215215

216-
public function authenticate(string $token): void
216+
public function authenticate(#[\SensitiveParameter] string $token): void
217217
{
218218
$this->getHttpClientBuilder()->addPlugin(new Authentication($token));
219219
}

src/HttpClient/Plugin/Authentication.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ final class Authentication implements Plugin
3434
*/
3535
private readonly string $header;
3636

37-
public function __construct(string $token)
37+
public function __construct(#[\SensitiveParameter] string $token)
3838
{
3939
$this->header = \sprintf('Bearer %s', $token);
4040
}

0 commit comments

Comments
 (0)