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

Support Paths in roles  #51

@ryanjfrizzell

Description

@ryanjfrizzell

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions