Skip to content
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

Process config files for profile names containing prefix separator #1100

Merged
merged 6 commits into from
Dec 6, 2023

Conversation

trivikr
Copy link
Contributor

@trivikr trivikr commented Dec 6, 2023

Issue #, if available:

Description of changes:

Validate IniSectionType for profile names containing config prefix separator

Testing:

$ cat test.mjs
import { loadSharedConfigFiles } from "../smithy-typescript/packages/shared-ini-file-loader/dist-cjs/index.js";
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

$ node test.mjs
{
  configFile: {
    'foo.bar': { region: 'eu-west-2' },
    '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'
    }
  }
}

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@trivikr trivikr requested review from a team as code owners December 6, 2023 00:07
@trivikr trivikr requested a review from hpmellema December 6, 2023 00:07
@trivikr trivikr marked this pull request as draft December 6, 2023 00:11
@trivikr trivikr marked this pull request as ready for review December 6, 2023 00:21
@trivikr trivikr changed the title Validate IniSectionType for profile names containing config prefix separator Process config files for profile names containing prefix separator Dec 6, 2023
@trivikr trivikr merged commit 6884910 into smithy-lang:main Dec 6, 2023
@trivikr trivikr deleted the get-config-data branch December 6, 2023 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants