Skip to content

Commit 3ce9554

Browse files
committed
Update configuration documentation to support Alibaba Cloud alongside AWS
- Modified CLI argument descriptions to clarify support for both AWS and Alibaba Cloud. - Enhanced documentation for optional parameters related to Alibaba Cloud credentials. - Improved user prompts for credential writing and profile naming to reflect the dual-cloud functionality.
1 parent 43d6685 commit 3ce9554

1 file changed

Lines changed: 24 additions & 24 deletions

File tree

gimme_aws_creds/config.py

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def __init__(self, gac_ui, create_config=True, alicloud_sdk_available=False):
7979
def get_args(self):
8080
"""Get the CLI args"""
8181
parser = argparse.ArgumentParser(
82-
description="Gets a STS token to use for AWS CLI based on a SAML assertion from Okta"
82+
description="Gets a STS token to use for AWS or Alibaba Cloud CLI based on a SAML assertion from Okta"
8383
)
8484
parser.add_argument(
8585
'--username', '-u',
@@ -268,13 +268,13 @@ def update_config_file(self):
268268
okta_auth_server = Server ID for the OAuth authorization server used by gimme-creds-server
269269
write_aws_creds = Option to write creds to ~/.aws/credentials
270270
cred_profile = Use DEFAULT or Role-based name as the profile in ~/.aws/credentials
271-
aws_appname = (optional) Okta AWS App Name
272-
aws_rolename = (optional) Okta Role ARN
271+
aws_appname = (optional) Okta App Name (AWS or Alibaba Cloud)
272+
aws_rolename = (optional) AWS or Alibaba Cloud Role ARN to assume
273273
okta_username = Okta username
274-
aws_default_duration = Default AWS session duration (3600)
275-
preferred_mfa_type = Select this MFA device type automatically
276-
include_path - (optional) includes that full role path to the role name for profile
277-
enable_keychain = (optional) enable the use of the system keychain to store the user's password
274+
aws_default_duration = Default AWS or Alibaba Cloud session duration in seconds (default: 3600)
275+
preferred_mfa_type = (optional, Okta Classic only) Select this MFA device type automatically
276+
include_path - (optional) includes the full role path to the role name for profile
277+
enable_keychain = (optional, Okta Classic only) enable the use of the system keychain to store the user's password
278278
enable_alicloud = (optional, OIE only) y/n — use Native-to-Web SSO scope for Alibaba Cloud RAM
279279
alicloud_saml_url = (optional, Alibaba Cloud only) explicit SAML SSO URL for the Alibaba Cloud app in Okta; falls back to the app link if not set
280280
@@ -502,16 +502,16 @@ def _get_gimme_creds_server_entry(self, default_entry):
502502
return gimme_creds_server
503503

504504
def _get_write_aws_creds(self, default_entry):
505-
""" Option to write to the ~/.aws/credentials, ~/.aliyun/credentials, or to stdour"""
505+
""" Option to write to the ~/.aws/credentials, ~/.aliyun/config.json, or to stdout"""
506506

507507
if self.enable_alicloud:
508508
ui.default.message(
509-
"Do you want to write the temporary Alibaba Cloud to ~/.aliyun/credentials?"
509+
"Do you want to write the temporary Alibaba Cloud credentials to ~/.aliyun/config.json?"
510510
"\nIf no, the credentials will be written to stdout."
511511
"\nPlease answer y or n.")
512512
else:
513513
ui.default.message(
514-
"Do you want to write the temporary AWS to ~/.aws/credentials?"
514+
"Do you want to write the temporary AWS credentials to ~/.aws/credentials?"
515515
"\nIf no, the credentials will be written to stdout."
516516
"\nPlease answer y or n.")
517517

@@ -525,7 +525,7 @@ def _get_include_path(self, default_entry):
525525
""" Option to include path from rolename """
526526

527527
ui.default.message(
528-
"Do you want to include full role path to the role name in AWS credential profile name?"
528+
"Do you want to include the full role path to the role name in credential profile name?"
529529
"\nPlease answer y or n.")
530530

531531
while True:
@@ -537,18 +537,18 @@ def _get_include_path(self, default_entry):
537537
def _get_resolve_aws_alias(self, default_entry):
538538
""" Option to resolve account id to alias """
539539
ui.default.message(
540-
"Do you want to resolve aws account id to aws alias ?"
540+
"Do you want to resolve account id to an alias ?"
541541
"\nPlease answer y or n.")
542542
while True:
543543
try:
544-
return self._get_user_input_yes_no("Resolve AWS alias", default_entry)
544+
return self._get_user_input_yes_no("Resolve account alias", default_entry)
545545
except ValueError:
546-
ui.default.warning("Resolve AWS alias must be either y or n.")
546+
ui.default.warning("Resolve account alias must be either y or n.")
547547

548548
def _get_cred_profile(self, default_entry):
549549
"""sets the aws credential profile name"""
550550
ui.default.message(
551-
"The AWS credential profile defines which profile is used to store the temp AWS creds.\n"
551+
"The credential profile defines which profile is used to store the temp credentials.\n"
552552
"If set to 'role' then a new profile will be created matching the role name assumed by the user.\n"
553553
"If set to 'acc' then a new profile will be created matching the account number.\n"
554554
"If set to 'acc-role' then a new profile will be created matching the role name assumed by the user, but prefixed with account number to avoid collisions.\n"
@@ -557,27 +557,27 @@ def _get_cred_profile(self, default_entry):
557557
)
558558

559559
cred_profile = self._get_user_input(
560-
"AWS Credential Profile", default_entry)
560+
"Credential Profile", default_entry)
561561

562562
if cred_profile.lower() in ['default', 'role', 'acc', 'acc-role']:
563563
cred_profile = cred_profile.lower()
564564

565565
return cred_profile
566566

567567
def _get_aws_appname(self, default_entry):
568-
""" Get Okta AWS App name """
568+
""" Get Okta App name (AWS or Alibaba Cloud) """
569569
ui.default.message(
570-
"Enter the AWS Okta App Name."
570+
"Enter the Okta App Name (AWS or Alibaba Cloud)."
571571
"\nThis is optional, you can select the App when you run the CLI.")
572-
aws_appname = self._get_user_input("AWS App Name", default_entry)
572+
aws_appname = self._get_user_input("App Name", default_entry)
573573
return aws_appname
574574

575575
def _get_aws_rolename(self, default_entry):
576-
""" Get the AWS Role ARN"""
576+
""" Get the Role ARN (AWS or Alibaba Cloud)"""
577577
ui.default.message(
578-
"Enter the ARN for the AWS role you want credentials for. 'all' will retrieve all roles."
578+
"Enter the ARN for the role you want credentials for. 'all' will retrieve all roles."
579579
"\nThis is optional, you can select the role when you run the CLI.")
580-
aws_rolename = self._get_user_input("AWS Role ARN", default_entry)
580+
aws_rolename = self._get_user_input("Role ARN", default_entry)
581581
return aws_rolename
582582

583583
def _get_conf_profile_name(self, default_entry):
@@ -603,9 +603,9 @@ def _get_aws_default_duration(self, default_entry):
603603
"""Get and validate the aws default session duration. [Optional]"""
604604
ui.default.message(
605605
"If you'd like to set the default session duration, specify it (in seconds).\n"
606-
"This is optional.")
606+
"This is optional and defaults to 3600 seconds.")
607607
aws_default_duration = self._get_user_input(
608-
"AWS Default Session Duration", default_entry)
608+
"Default Session Duration (in seconds)", default_entry)
609609
return aws_default_duration
610610

611611
def _get_preferred_mfa_type(self, default_entry):

0 commit comments

Comments
 (0)