Skip to content

Commit

Permalink
PHP: use SensitiveParameters annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
glaubinix committed Dec 9, 2024
1 parent e8691a7 commit 429a9dc
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function __construct(HttpPluginClientBuilder $httpClientBuilder = null, $
* @param string $key
* @param string $secret
*/
public function authenticate($key, $secret)
public function authenticate(#[\SensitiveParameter] $key, #[\SensitiveParameter] $secret)
{
$this->httpClientBuilder->removePlugin(RequestSignature::class);
$this->httpClientBuilder->addPlugin(new RequestSignature($key, $secret));
Expand Down
2 changes: 1 addition & 1 deletion src/HttpClient/Plugin/RequestSignature.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class RequestSignature implements Plugin
* @param string $key
* @param string $secret
*/
public function __construct($key, $secret)
public function __construct(#[\SensitiveParameter] $key, #[\SensitiveParameter] $secret)
{
if (!$key || !$secret) {
throw new \InvalidArgumentException('$key and $secret must be set');
Expand Down
2 changes: 1 addition & 1 deletion src/WebhookSignature.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class WebhookSignature
/** @var string */
private $secret;

public function __construct($secret)
public function __construct(#[\SensitiveParameter] $secret)
{
$this->secret = $secret;
}
Expand Down

0 comments on commit 429a9dc

Please sign in to comment.