-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Recent change causes profile names with '.' to not be recognized or found #1053
Comments
This also broke the profiles generated by granted, which contain a single slash: |
This behavior was extremely difficult to trace because profile names containing invalid characters are silently ignored. They work in the AWS CLI, Python SDK and Javascript SDK V2. In Javascript SDK V3, you simply receive a |
@trivikr unfortunately this doesn't fix the problem. This is how it would work in my case but I'm unaware if it introduces more regressions.
|
Reproduction code $ cat test.mjs
import { loadSharedConfigFiles } from "@smithy/shared-ini-file-loader"; // v2.2.6
console.log(await loadSharedConfigFiles());
$ cat ~/.aws/credentials
[foo.bar]
aws_access_key_id = aws_access_key_id
aws_secret_access_key = aws_secret_access_key
[foo@bar]
aws_access_key_id = aws_access_key_id
aws_secret_access_key = aws_secret_access_key
$ cat ~/.aws/config
[profile foo.bar]
region = eu-west-2
[profile foo@bar]
region = eu-west-2 Output $ node test.mjs
{
configFile: { 'foo@bar': { region: 'eu-west-2' } },
credentialsFile: {
'foo.bar': {
aws_access_key_id: 'aws_access_key_id',
aws_secret_access_key: 'aws_secret_access_key'
},
'foo@bar': {
aws_access_key_id: 'aws_access_key_id',
aws_secret_access_key: 'aws_secret_access_key'
}
}
} The value at configFile key should be
|
https://github.com/awslabs/smithy-typescript/blob/d5eacb5153a8473b572919392e0644babd04d983/packages/shared-ini-file-loader/src/parseIni.ts#L5
While the
.
character is not cited in https://docs.aws.amazon.com/sdkref/latest/guide/file-format.html#section-types profile names in the format ofsome-account.some-role
were accepted in the aws-sdk-v2 and up until the last change to the above regular expression.Both the aws cli, aws-sdk-v2 and the Python sdk accept this name pattern. It appears the java SDK was revised to accept these as well via aws/aws-sdk-java-v2#389 and https://github.com/aws/aws-sdk-java-v2/pull/1538/files.
Please revise to improve consistency.
The text was updated successfully, but these errors were encountered: