Skip to content

Commit

Permalink
Merge branch 'master' of github.com:washingtonpost/clokta
Browse files Browse the repository at this point in the history
  • Loading branch information
rantonucci-washpost committed Mar 19, 2018
2 parents d7eed68 + 5303890 commit 0ca2e64
Show file tree
Hide file tree
Showing 6 changed files with 296 additions and 283 deletions.
15 changes: 15 additions & 0 deletions clokta/cli.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
'''
This is the entry-point to the cli application.
'''
import click

from clokta.role_assumer import RoleAssumer


@click.command()
@click.option('--verbose', '-v', is_flag=True, help='Show detailed')
@click.option('--profile', '-p', required=True, help='Configuration profile')
def assume_role(profile, verbose=False):
''' Click point of entry '''
assumer = RoleAssumer(profile=profile, verbose=verbose)
assumer.assume_role()
6 changes: 5 additions & 1 deletion clokta/profile_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def update_configuration(self, profile_configuration):
''' Update a config file section '''
parser = configparser.ConfigParser()
parser.read(self.config_location)

default_keys = [
'okta_username',
'okta_org'
Expand Down Expand Up @@ -109,6 +109,10 @@ def apply_credentials(self, credentials):
creds = credentials['Credentials']
parser[self.profile_name]['AWS_ACCESS_KEY_ID'] = creds['AccessKeyId']
parser[self.profile_name]['AWS_SECRET_ACCESS_KEY'] = creds['SecretAccessKey']

if 'AWS_SESSION_TOKEN' in parser[self.profile_name]:
del parser[self.profile_name]['AWS_SESSION_TOKEN']

if 'SessionToken' in creds:
parser[self.profile_name]['AWS_SESSION_TOKEN'] = creds['SessionToken']

Expand Down
277 changes: 0 additions & 277 deletions clokta/role.py

This file was deleted.

Loading

0 comments on commit 0ca2e64

Please sign in to comment.