Skip to content

Commit

Permalink
Support alternative AWS account types (#29)
Browse files Browse the repository at this point in the history
* support region flag

* revert editor formatting

* tab more
  • Loading branch information
woz5999 authored Oct 30, 2020
1 parent 72762b0 commit 671b264
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 2 deletions.
2 changes: 2 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ role --role AWS_OKTA_ROLE AWS Role ARN
------------- --------------- ---------------------- ----------------------------------------
account_alias --account-alias AWS_OKTA_ACCOUNT_ALIAS AWS Account Filter
------------- --------------- ---------------------- ----------------------------------------
region --region AWS_OKTA_REGION AWS Region
------------- --------------- ---------------------- ----------------------------------------
duration --duration AWS_OKTA_DURATION Duration in seconds for AWS session
------------- --------------- ---------------------- ----------------------------------------
key --key AWS_OKTA_KEY Key used in generating AWS session cache
Expand Down
3 changes: 2 additions & 1 deletion src/aws_okta_processor/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
aws-okta-processor authenticate [--environment] [--organization=<okta_organization>]
[--user=<user_name>] [--pass=<user_pass>]
[--application=<okta_application>]
[--role=<role_name>]
[--role=<role_name>][--region=<region_name>]
[--account-alias=<account_alias>]
[--duration=<duration_seconds>]
[--key=<key>]
Expand All @@ -27,6 +27,7 @@
-o <okta_organization> --organization=<okta_organization> Okta organization domain.
-a <okta_application> --application=<okta_application> Okta application url.
-r <role_name> --role=<role_name> AWS role ARN.
-R <region_name> --region=<region_name> AWS region name.
-A <account> --account-alias=<account> AWS account alias filter (uses wildcards).
-d <duration_seconds> --duration=<duration_seconds> Duration of role session [default: 3600].
-k <key> --key=<key> Key used for generating and accessing cache.
Expand Down
2 changes: 2 additions & 0 deletions src/aws_okta_processor/commands/authenticate.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"--organization": "AWS_OKTA_ORGANIZATION",
"--application": "AWS_OKTA_APPLICATION",
"--role": "AWS_OKTA_ROLE",
"--region": "AWS_OKTA_REGION",
"--duration": "AWS_OKTA_DURATION",
"--key": "AWS_OKTA_KEY",
"--factor": "AWS_OKTA_FACTOR",
Expand All @@ -46,6 +47,7 @@
"AWS_OKTA_ORGANIZATION": "organization",
"AWS_OKTA_APPLICATION": "application",
"AWS_OKTA_ROLE": "role",
"AWS_OKTA_REGION": "region",
"AWS_OKTA_DURATION": "duration",
"AWS_OKTA_KEY": "key",
"AWS_OKTA_FACTOR": "factor",
Expand Down
3 changes: 2 additions & 1 deletion src/aws_okta_processor/core/fetcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ def _get_credentials(self):
'sts',
aws_access_key_id='',
aws_secret_access_key='',
aws_session_token=''
aws_session_token='',
region_name=self._configuration["AWS_OKTA_REGION"]
)

okta = Okta(
Expand Down
1 change: 1 addition & 0 deletions tests/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def setUp(self):
"--organization": "org.okta.com",
"--application": None,
"--role": None,
"--region": None,
"--key": "key",
"--duration": "3600",
"--factor": None,
Expand Down

0 comments on commit 671b264

Please sign in to comment.