Skip to content

Commit

Permalink
removed empty aws/azure client credentials (#1071)
Browse files Browse the repository at this point in the history
* fixes #1062 : removed empty aws client credentials and set default region

* Removed default values from AWS/Azure streams

---------

Co-authored-by: Julien Guittard <julien.guittard@me.com>
  • Loading branch information
norberttech and jguittard committed May 9, 2024
1 parent a0e4413 commit 45474bb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,23 +37,10 @@ protected function filesystem() : Filesystem
*/
$contextOptions = \stream_context_get_options($this->context);

/**
* @var array{credentials: array{key: string, secret: string}, region: string, version: string} $clientOptions
*/
$clientOptions = \array_merge(
[
'credentials' => [
'key' => '',
'secret' => '',
],
'region' => '',
'version' => 'latest',
],
$contextOptions[self::PROTOCOL]['client'] ?? []
);
$clientOptions = $contextOptions[self::PROTOCOL]['client'];

/** @var string $bucket */
$bucket = $contextOptions[self::PROTOCOL]['bucket'] ?? '';
$bucket = $contextOptions[self::PROTOCOL]['bucket'];

/**
* @psalm-suppress PossiblyNullArrayAccess
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,10 @@ protected function filesystem() : Filesystem
/**
* @var array{connection-string: string} $clientOptions
*/
$clientOptions = \array_merge(
['connection-string' => ''],
/** @phpstan-ignore-next-line */
['connection-string' => $contextOptions[self::PROTOCOL]['connection-string']] ?? []
);
$clientOptions = ['connection-string' => $contextOptions[self::PROTOCOL]['connection-string']];

/** @var string $container */
$container = $contextOptions[self::PROTOCOL]['container'] ?? '';
$container = $contextOptions[self::PROTOCOL]['container'];

/**
* @psalm-suppress PossiblyNullArrayAccess
Expand Down

0 comments on commit 45474bb

Please sign in to comment.