Skip to content

Commit

Permalink
only match against the account alias
Browse files Browse the repository at this point in the history
  • Loading branch information
thoward-godaddy committed Dec 10, 2020
1 parent 84c8e80 commit 934983e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/aws_okta_processor/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '1.5.2'
__version__ = '1.5.3'
3 changes: 2 additions & 1 deletion src/aws_okta_processor/core/saml.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ def get_aws_roles(saml_assertion=None, accounts_filter=None):
for account_role in account_roles:
account_name = account_role.account_name
if accounts_filter is not None and len(accounts_filter) > 0:
if fnmatch(account_name, accounts_filter) is False:
account_name_alias = account_name.split(" ")[1]
if not fnmatch(account_name_alias, accounts_filter):
continue

role_arn = account_role.role_arn
Expand Down
2 changes: 1 addition & 1 deletion tests/core/test_fetcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def assume_role_side_effect(*args, **kwargs):
}
raise RuntimeError('invalid RoleArn')

self.OPTIONS["--account-alias"] = '* 1'
self.OPTIONS["--account-alias"] = '1*'
self.OPTIONS["--pass"] = 'testpass'

mock_c = mock.Mock()
Expand Down

0 comments on commit 934983e

Please sign in to comment.