Edward Chernenko has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/251178

Change subject: Pass token parameter (if provided) to S3Client::factory().
......................................................................

Pass token parameter (if provided) to S3Client::factory().

This is needed when temporary IAM credentials are used.
(when Amazon EC2 instance has associated Role that allows S3 access,
and fresh credentials are downloaded from instance metadata).

If temporary IAM credentials are used, URLs created by createPresignedUrl()
in getFileHttpUrl() won't work without the token.

Change-Id: I21c428cf263b2078321aac385c186f2d049b9f58
---
M s3/AmazonS3FileBackend.php
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/AWS 
refs/changes/78/251178/1

diff --git a/s3/AmazonS3FileBackend.php b/s3/AmazonS3FileBackend.php
index 4002544..3614e15 100644
--- a/s3/AmazonS3FileBackend.php
+++ b/s3/AmazonS3FileBackend.php
@@ -94,6 +94,7 @@
                $this->client = S3Client::factory( array(
                        'key' => isset( $config['awsKey'] ) ? $config['awsKey'] 
: $wgAWSCredentials['key'],
                        'secret' => isset( $config['awsSecret'] ) ? 
$config['awsSecret'] : $wgAWSCredentials['secret'],
+                       'token' => isset( $config['awsToken'] ) ? 
$config['awsToken'] : $wgAWSCredentials['token'],
                        'region' => isset( $config['awsRegion'] ) ? 
$config['awsRegion'] : $wgAWSRegion,
                        'scheme' => $this->useHTTPS ? 'https' : 'http',
                        'ssl.certificate_authority' => $this->useHTTPS ?: null

-- 
To view, visit https://gerrit.wikimedia.org/r/251178
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I21c428cf263b2078321aac385c186f2d049b9f58
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/AWS
Gerrit-Branch: master
Gerrit-Owner: Edward Chernenko <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to