Download tasks/aws__aws-cli-10249/solution/patch.diff from Ktanmay21/aws-cli-diff: direct link, hf CLI and curl.
- Browser
- Download file 2.26 kB
-
https://huggingface.co/datasets/Ktanmay21/aws-cli-diff/resolve/f50dbbb4f8bb7e071cea947b3db06ddb842934f4/tasks/aws__aws-cli-10249/solution/patch.diff
- Command line
-
hf download hf://datasets/Ktanmay21/aws-cli-diff@f50dbbb4f8bb7e071cea947b3db06ddb842934f4/tasks/aws__aws-cli-10249/solution/patch.diff
-
curl -L -o patch.diff https://huggingface.co/datasets/Ktanmay21/aws-cli-diff/resolve/f50dbbb4f8bb7e071cea947b3db06ddb842934f4/tasks/aws__aws-cli-10249/solution/patch.diff
2.26 kB
| diff --git a/.changes/next-release/enhancement-configure-59283.json b/.changes/next-release/enhancement-configure-59283.json | |
| new file mode 100644 | |
| index 000000000000..9392d6e0f5db | |
| --- /dev/null | |
| +++ b/.changes/next-release/enhancement-configure-59283.json | |
| +{ | |
| + "type": "enhancement", | |
| + "category": "configure", | |
| + "description": "Added aws_security_token to the list of keys that are written to the shared credentials file when using aws configure set." | |
| +} | |
| diff --git a/awscli/customizations/configure/set.py b/awscli/customizations/configure/set.py | |
| index 9d4c441ac697..81a0d3d66618 100644 | |
| --- a/awscli/customizations/configure/set.py | |
| +++ b/awscli/customizations/configure/set.py | |
| class ConfigureSetCommand(BasicCommand): | |
| # Any variables specified in this list will be written to | |
| # the ~/.aws/credentials file instead of ~/.aws/config. | |
| _WRITE_TO_CREDS_FILE = ['aws_access_key_id', 'aws_secret_access_key', | |
| - 'aws_session_token'] | |
| + 'aws_session_token', 'aws_security_token'] | |
| def __init__(self, session, config_writer=None): | |
| super(ConfigureSetCommand, self).__init__(session) | |
| diff --git a/tests/unit/customizations/configure/test_set.py b/tests/unit/customizations/configure/test_set.py | |
| index 27576a7ba8b4..2b8f5c0d7dfe 100644 | |
| --- a/tests/unit/customizations/configure/test_set.py | |
| +++ b/tests/unit/customizations/configure/test_set.py | |
| def test_session_token_written_to_shared_credentials_file(self): | |
| {'__section__': 'default', | |
| 'aws_session_token': 'foo'}, self.fake_credentials_filename) | |
| + def test_security_token_written_to_shared_credentials_file(self): | |
| + set_command = ConfigureSetCommand( | |
| + self.session, self.config_writer) | |
| + set_command(args=['aws_security_token', 'foo'], | |
| + parsed_globals=None) | |
| + self.config_writer.update_config.assert_called_with( | |
| + {'__section__': 'default', | |
| + 'aws_security_token': 'foo'}, self.fake_credentials_filename) | |
| + | |
| def test_access_key_written_to_shared_credentials_file_profile(self): | |
| set_command = ConfigureSetCommand( | |
| self.session, self.config_writer) | |