mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
feat(object_store): Add support for session token in AWS credentials
- Pass session token, either null or with value, to the AWS Credentials constructor Signed-off-by: Hector Valcarcel <hmvalcarcel@gmail.com>
This commit is contained in:
parent
796055e8b2
commit
6b4c859a41
2 changed files with 5 additions and 2 deletions
1
AUTHORS
1
AUTHORS
|
|
@ -560,6 +560,7 @@
|
|||
- fnuesse <felix.nuesse@t-online.de>
|
||||
- fnuesse <fnuesse@techfak.uni-bielefeld.de>
|
||||
- greta <gretadoci@gmail.com>
|
||||
- Hector Valcarcel <hmvalcarcel@gmail.com>
|
||||
- helix84 <helix84@centrum.sk>
|
||||
- hkjolhede <hkjolhede@gmail.com>
|
||||
- hoellen <dev@hoellen.eu>
|
||||
|
|
|
|||
|
|
@ -128,7 +128,7 @@ trait S3ConnectionTrait {
|
|||
$logger->debug('Bucket "' . $this->bucket . '" This bucket name is not dns compatible, it may contain invalid characters.',
|
||||
['app' => 'objectstore']);
|
||||
}
|
||||
|
||||
|
||||
if ($this->params['verify_bucket_exists'] && !$this->connection->doesBucketExist($this->bucket)) {
|
||||
try {
|
||||
$logger->info('Bucket "' . $this->bucket . '" does not exist - creating it.', ['app' => 'objectstore']);
|
||||
|
|
@ -185,10 +185,12 @@ trait S3ConnectionTrait {
|
|||
return function () {
|
||||
$key = empty($this->params['key']) ? null : $this->params['key'];
|
||||
$secret = empty($this->params['secret']) ? null : $this->params['secret'];
|
||||
$sessionToken = empty($this->params['session_token']) ? null : $this->params['session_token'];
|
||||
|
||||
if ($key && $secret) {
|
||||
return Create::promiseFor(
|
||||
new Credentials($key, $secret)
|
||||
// a null sessionToken match the default signature of the constructor
|
||||
new Credentials($key, $secret, $sessionToken)
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue