Skip to content
This repository has been archived by the owner on Nov 2, 2022. It is now read-only.

Support Paths in roles #51

Open
ryanjfrizzell opened this issue Feb 1, 2021 · 0 comments
Open

Support Paths in roles #51

ryanjfrizzell opened this issue Feb 1, 2021 · 0 comments

Comments

@ryanjfrizzell
Copy link

ryanjfrizzell commented Feb 1, 2021

Some folks uses paths in their role naming convention. Ex: 'arn:aws:iam::584999999999:role/some/other/role/withSlashes'

AWS docs for role paths (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html#identifiers-friendly-names)

the current code will fail with an error similar to this one if such role names are implemented.

Traceback (most recent call last):
  File "/usr/local/bin/aws-jumpcloud", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.8/site-packages/aws_jumpcloud/cli.py", line 18, in main
    args.func(args)
  File "/usr/local/lib/python3.8/site-packages/aws_jumpcloud/commands.py", line 118, in rotate_session
    _rotate_single_session(args)
  File "/usr/local/lib/python3.8/site-packages/aws_jumpcloud/commands.py", line 159, in _rotate_single_session
    _login_to_aws(keyring, profile)
  File "/usr/local/lib/python3.8/site-packages/aws_jumpcloud/commands.py", line 307, in _login_to_aws
    r = parse_arn(role.role_arn)
  File "/usr/local/lib/python3.8/site-packages/aws_jumpcloud/aws.py", line 95, in parse_arn
    return ParseResult(*ROLE_ARN_REGEXP.match(role_arn).groups())

PR Here
#50

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant