From ebcfb74b94fdf2f81d8a586eb676988b6f4424d7 Mon Sep 17 00:00:00 2001 From: Graham Campbell Date: Wed, 6 May 2026 22:10:10 +0100 Subject: [PATCH 1/3] Mark authentication parameters sensitive --- CHANGELOG.md | 1 + src/Client.php | 2 +- src/HttpClient/Plugin/Authentication.php | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 137db0e..06bad33 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ CHANGE LOG ## 5.1.0 (06/05/2026) * Add PHP 8.5 support +* Add sensitive parameter annotations for authentication tokens * Add support for listing Droplets by name or type * Fixed the `Droplet::create` SSH keys parameter type documentation * Fixed hydration of object-backed App Platform and project resource fields diff --git a/src/Client.php b/src/Client.php index 9f595f8..7898849 100644 --- a/src/Client.php +++ b/src/Client.php @@ -213,7 +213,7 @@ public function vpc(): Vpc return new Vpc($this); } - public function authenticate(string $token): void + public function authenticate(#[\SensitiveParameter] string $token): void { $this->getHttpClientBuilder()->addPlugin(new Authentication($token)); } diff --git a/src/HttpClient/Plugin/Authentication.php b/src/HttpClient/Plugin/Authentication.php index 8cdc95f..7101e51 100644 --- a/src/HttpClient/Plugin/Authentication.php +++ b/src/HttpClient/Plugin/Authentication.php @@ -34,7 +34,7 @@ final class Authentication implements Plugin */ private readonly string $header; - public function __construct(string $token) + public function __construct(#[\SensitiveParameter] string $token) { $this->header = \sprintf('Bearer %s', $token); } From 1e800048dc1d6eb58ccca0b2bb9a4420fec2dec4 Mon Sep 17 00:00:00 2001 From: Graham Campbell Date: Wed, 6 May 2026 22:10:51 +0100 Subject: [PATCH 2/3] Move changelog entry to 5.1.1 --- CHANGELOG.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 06bad33..5d316bc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,10 +2,14 @@ CHANGE LOG ========== +## 5.1.1 (UPCOMING) + +* Add sensitive parameter annotations for authentication tokens + + ## 5.1.0 (06/05/2026) * Add PHP 8.5 support -* Add sensitive parameter annotations for authentication tokens * Add support for listing Droplets by name or type * Fixed the `Droplet::create` SSH keys parameter type documentation * Fixed hydration of object-backed App Platform and project resource fields From 139c6afa13ceaf38921eebd38583ecd93a212518 Mon Sep 17 00:00:00 2001 From: Graham Campbell Date: Wed, 6 May 2026 22:13:01 +0100 Subject: [PATCH 3/3] Require PHP 8.2 polyfill --- composer.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index e4ce9bb..3db83a2 100644 --- a/composer.json +++ b/composer.json @@ -28,7 +28,8 @@ "php-http/httplug": "^2.4.1", "psr/http-client-implementation": "^1.0", "psr/http-factory-implementation": "^1.0", - "psr/http-message": "^1.1 || ^2.0" + "psr/http-message": "^1.1 || ^2.0", + "symfony/polyfill-php82": "^1.27" }, "require-dev": { "bamarni/composer-bin-plugin": "^1.8.2",