Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Environment Variable For STS Endpoint #1402

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions S3/Config.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,14 +323,16 @@ def role_config(self):
web_identity_token_file = os.environ.get('AWS_WEB_IDENTITY_TOKEN_FILE')
if web_identity_token_file:
with open(web_identity_token_file) as f:
web_identity_token = f.read()
web_identity_token = f.read().rstrip()
params['Action'] = 'AssumeRoleWithWebIdentity'
params['WebIdentityToken'] = web_identity_token
encoded_params = '&'.join([
'%s=%s' % (k, s3_quote(v, unicode_output=True))
for k, v in params.items()
])
sts_endpoint = "sts.amazonaws.com"
sts_endpoint = os.environ.get("AWS_STS_ENDPOINT")
if sts_endpoint == None:
sts_endpoint = "sts.amazonaws.com"
if os.environ.get("AWS_STS_REGIONAL_ENDPOINTS") == "regional":
# Check if the AWS_REGION variable is available to use as a region.
region = os.environ.get("AWS_REGION")
Expand Down