From d6b76e9931ef859ebf7de600f8e564417f9aef86 Mon Sep 17 00:00:00 2001 From: Snigdhajyoti Ghosh Date: Fri, 1 Dec 2023 22:17:31 +0530 Subject: [PATCH] change on how aws creds is being printed --- aws_fusion/commands/iam_user_credentials.py | 6 ++++-- aws_fusion/commands/okta.py | 6 ++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/aws_fusion/commands/iam_user_credentials.py b/aws_fusion/commands/iam_user_credentials.py index ddaec63..4e65d9e 100644 --- a/aws_fusion/commands/iam_user_credentials.py +++ b/aws_fusion/commands/iam_user_credentials.py @@ -45,5 +45,7 @@ def run_get(args): else: command = '$env:' if sys.platform == 'win32' else 'export ' - print(f'{command}AWS_ACCESS_KEY_ID="{args.access_key}"') - print(f'{command}AWS_SECRET_ACCESS_KEY="{secret_key}"') + print('\n'.join([ + f'{command}AWS_ACCESS_KEY_ID="{args.access_key}"', + f'{command}AWS_SECRET_ACCESS_KEY="{secret_key}"' + ])) diff --git a/aws_fusion/commands/okta.py b/aws_fusion/commands/okta.py index bcd013c..20ac308 100644 --- a/aws_fusion/commands/okta.py +++ b/aws_fusion/commands/okta.py @@ -12,16 +12,14 @@ def setup(subparsers, parent_parser): - common_parser = ArgumentParser(add_help=False) - common_parser.add_argument('--org-domain', required=True, help="Full domain hostname of the Okta org e.g. example.okta.com") - summary = 'Generate AWS session credentials from Okta.' parser: ArgumentParser = subparsers.add_parser('okta', description=summary, help=summary, parents=[parent_parser]) okta_subparsers = parser.add_subparsers(dest='okta_command', required=True, help='Available Okta commands') device_auth_summary = 'Generate AWS session credentials using SAML assertion from Okta device authentication.' - device_auth_parser = okta_subparsers.add_parser('device-auth', description=device_auth_summary, help=device_auth_summary, parents=[parent_parser, common_parser]) + device_auth_parser = okta_subparsers.add_parser('device-auth', description=device_auth_summary, help=device_auth_summary, parents=[parent_parser]) device_auth_parser.set_defaults(func=run_device_auth) + device_auth_parser.add_argument('--org-domain', required=True, help="Full domain hostname of the Okta org e.g. example.okta.com") device_auth_parser.add_argument('--oidc-client-id', required=True, help="The ID is the identifier of the client is Okta app acting as the IdP for AWS") device_auth_parser.add_argument('--aws-acct-fed-app-id', required=True, help="The ID for the AWS Account Federation integration app") device_auth_parser.add_argument('--aws-iam-role', required=True, help="The AWS IAM Role ARN to assume")