Skip to content

Commit d122d84

Browse files
authored
Add aws_security_token to credentials file keys (aws#10152)
1 parent 23cd2b4 commit d122d84

3 files changed

Lines changed: 14 additions & 0 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"type": "enhancement",
3+
"category": "configure",
4+
"description": "Added aws_security_token to the list of keys that are written to the shared credentials file when using aws configure set."
5+
}

awscli/customizations/configure/set.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ class ConfigureSetCommand(BasicCommand):
7070
'aws_access_key_id',
7171
'aws_secret_access_key',
7272
'aws_session_token',
73+
'aws_security_token',
7374
]
7475

7576
def __init__(self, session, config_writer=None):

tests/unit/customizations/configure/test_set.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,14 @@ def test_session_token_written_to_shared_credentials_file(self):
136136
self.fake_credentials_filename,
137137
)
138138

139+
def test_security_token_written_to_shared_credentials_file(self):
140+
set_command = ConfigureSetCommand(self.session, self.config_writer)
141+
set_command(args=['aws_security_token', 'foo'], parsed_globals=None)
142+
self.config_writer.update_config.assert_called_with(
143+
{'__section__': 'default', 'aws_security_token': 'foo'},
144+
self.fake_credentials_filename,
145+
)
146+
139147
def test_access_key_written_to_shared_credentials_file_profile(self):
140148
set_command = ConfigureSetCommand(self.session, self.config_writer)
141149
set_command(

0 commit comments

Comments
 (0)