AWSSigner
AWSSigner copied to clipboard
FileProfileImporter breaks if profile names contain whitespace
https://github.com/NetSPI/AWSSigner/blob/204a457a7d6225ae1d20088325a783968e55060d/src/main/java/com/netspi/awssigner/model/persistence/FileProfileImporter.java#L25
The above line is used during the import process for profile files (either exported by AWS Signer, or from the ~/.aws/config
file locally). The former supports profile names with spaces in them. However, importing these files breaks, with AWS Signer detecting no profiles in the file:
[DEBUG] Import Profile Button Clicked.
[DEBUG] Selected path from file dialog: /fake_path/aws_signer.ini
[INFO] Imported 0 profile(s) from file: /fake_path/aws_signer.ini
Here's an example export file from AWS Signer that causes this:
[profile Foo: Bar]
signer_enabled=true
signer_in_scope_only=true
credential_process=/fake_path/bin/gimme --account foo --role bar
duration_seconds=60
[profile Foo external]
signer_enabled=true
signer_in_scope_only=true
role_arn=arn:aws:iam::123456789012:role/external
source_profile=Foo: Bar
role_session_name=aph3rson_external
[profile Foo: Baz]
signer_enabled=true
signer_in_scope_only=true
credential_process=/fake_path/bin/gimme --account foo --role baz
duration_seconds=60
[profile Creds: OhYes]
signer_enabled=true
signer_in_scope_only=true
credential_process=/fake_path/bin/gimme --account creds --role ohyes
duration_seconds=60
It may be more appropriate to use an INI library for this - the ~/.aws/config
file is INI-formatted, as mentioned here if that's what AWS Signer is shooting for.