Skip to content

Commit

Permalink
chore: Use #[\SensitiveParameter] (#112)
Browse files Browse the repository at this point in the history
  • Loading branch information
OskarStark authored Oct 3, 2024
1 parent 0164be2 commit f1e89ab
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/Anthropic/Platform/Anthropic.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

public function __construct(
HttpClientInterface $httpClient,
private string $apiKey,
#[\SensitiveParameter] private string $apiKey,
) {
$this->httpClient = $httpClient instanceof EventSourceHttpClient ? $httpClient : new EventSourceHttpClient($httpClient);
}
Expand Down
4 changes: 2 additions & 2 deletions src/OpenAI/Platform/Azure.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public function __construct(
private string $baseUrl,
private string $deployment,
private string $apiVersion,
private string $key,
#[\SensitiveParameter] private string $apiKey,
) {
$this->httpClient = $httpClient instanceof EventSourceHttpClient ? $httpClient : new EventSourceHttpClient($httpClient);
}
Expand All @@ -29,7 +29,7 @@ protected function rawRequest(string $endpoint, array $body): ResponseInterface

return $this->httpClient->request('POST', $url, [
'headers' => [
'api-key' => $this->key,
'api-key' => $this->apiKey,
'Content-Type' => 'application/json',
],
'query' => ['api-version' => $this->apiVersion],
Expand Down
2 changes: 1 addition & 1 deletion src/OpenAI/Platform/OpenAI.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

public function __construct(
HttpClientInterface $httpClient,
private string $apiKey,
#[\SensitiveParameter] private string $apiKey,
) {
$this->httpClient = $httpClient instanceof EventSourceHttpClient ? $httpClient : new EventSourceHttpClient($httpClient);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Store/Azure/SearchStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
public function __construct(
private HttpClientInterface $httpClient,
private string $endpointUrl,
private string $apiKey,
#[\SensitiveParameter] private string $apiKey,
private string $indexName,
private string $apiVersion,
private string $vectorFieldName = 'vector',
Expand Down
2 changes: 1 addition & 1 deletion src/Voyage/Platform/Voyage.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
{
public function __construct(
private HttpClientInterface $httpClient,
private string $apiKey,
#[\SensitiveParameter] private string $apiKey,
) {
}

Expand Down

0 comments on commit f1e89ab

Please sign in to comment.