From e37deaac44d96fb322d122f709a34b8770404123 Mon Sep 17 00:00:00 2001 From: Brad Davidson Date: Sun, 10 Jul 2016 01:37:45 -0700 Subject: [PATCH] Add support for legacy aws_security_token key in credentials file Ansible uses a weird hybrid of boto and boto3 that [doesn't appear to properly support the new AWS_SESSION_TOKEN variable](https://github.com/boto/boto/issues/3298), and instead still looks for AWS_SECURITY_TOKEN. This patch is a monkeypatch for this issue that updates aws-adfs to write the token into the credentials file under both keys. --- aws_adfs/_version.py | 2 +- aws_adfs/login.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/aws_adfs/_version.py b/aws_adfs/_version.py index eead3198634f..fa9c4ec2bced 100644 --- a/aws_adfs/_version.py +++ b/aws_adfs/_version.py @@ -1 +1 @@ -__version__ = '0.0.5' +__version__ = '0.0.6' diff --git a/aws_adfs/login.py b/aws_adfs/login.py index 2b268be83413..d09b834098f1 100644 --- a/aws_adfs/login.py +++ b/aws_adfs/login.py @@ -222,6 +222,7 @@ def credentials_storer(config_file, profile): config_file.set(profile, 'aws_access_key_id', aws_session_token['Credentials']['AccessKeyId']) config_file.set(profile, 'aws_secret_access_key', aws_session_token['Credentials']['SecretAccessKey']) config_file.set(profile, 'aws_session_token', aws_session_token['Credentials']['SessionToken']) + config_file.set(profile, 'aws_security_token', aws_session_token['Credentials']['SessionToken']) def config_storer(config_file, profile): config_file.set(profile, 'region', config.region)