From 91928161bac53afbad0bc8f7077f31e7e32190a9 Mon Sep 17 00:00:00 2001 From: Jakub Dibala Date: Tue, 24 Jun 2025 12:50:26 +0000 Subject: [PATCH 1/2] Add HttpAuthorizationHeader for use in HTTP basic authorization --- src/Headers/HttpAuthorizationHeader.php | 31 +++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 src/Headers/HttpAuthorizationHeader.php diff --git a/src/Headers/HttpAuthorizationHeader.php b/src/Headers/HttpAuthorizationHeader.php new file mode 100644 index 0000000..7c4673c --- /dev/null +++ b/src/Headers/HttpAuthorizationHeader.php @@ -0,0 +1,31 @@ +username, + $this->password, + ), + ); + + return [ + 'Authorization' => sprintf('Basic %s', $key), + ]; + } +} From c076285fdc7828ea6101c660401421bc15429dc2 Mon Sep 17 00:00:00 2001 From: Jakub Dibala Date: Tue, 24 Jun 2025 13:01:49 +0000 Subject: [PATCH 2/2] Add SensitiveParameter attribute --- src/Headers/HttpAuthorizationHeader.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Headers/HttpAuthorizationHeader.php b/src/Headers/HttpAuthorizationHeader.php index 7c4673c..856c102 100644 --- a/src/Headers/HttpAuthorizationHeader.php +++ b/src/Headers/HttpAuthorizationHeader.php @@ -9,8 +9,8 @@ class HttpAuthorizationHeader implements HeadersInterface { public function __construct( - public readonly string $username, - public readonly string $password, + #[\SensitiveParameter] public readonly string $username, + #[\SensitiveParameter] public readonly string $password, ) { }