Add support for parsing and merging AWS config and credentials files#729
Add support for parsing and merging AWS config and credentials files#729ubaskota wants to merge 4 commits into
Conversation
SamRemis
left a comment
There was a problem hiding this comment.
My bad, clicked approve by mistake. Only the test comments are blocking
cb70998 to
27cbdd5
Compare
jonathan343
left a comment
There was a problem hiding this comment.
Thanks Ujjwal. Commenting on a few edge cases that seem like bugs to me. Still getting through others, but this is what I have so far.
jonathan343
left a comment
There was a problem hiding this comment.
Thanks Ujjwal, this pretty much looks good to me. Had one follow up from a previews review and a comment on the missing changelog entry. Can you add a feature entry to smithy-aws-core with something like below:
Add utilities for parsing and merging shared AWS configuration and credentials files. These utilities are not yet integrated into generated clients.
| current_section: str | None = None | ||
| current_key: str | None = None | ||
| in_sub_property: bool = False | ||
| ignore_continuation: bool = False |
There was a problem hiding this comment.
Thanks, this fixes the original example, but it still fails when the invalid property is the first property in the section:
[profile p]
invalid key = ignored
continuationThis currently raises:
ConfigParseError: Line 3: Expected a property definition, found continuation
current_key is checked before ignore_continuation, so the continuation is only ignored when an earlier valid property populated current_key. Could we check ignore_continuation first and reset it when entering a new section? It would also be useful to test this case without a preceding valid property.
Issue #, if available:
Description of changes:
Add support for parsing and merging AWS config and credentials files (
~/.aws/configand~/.aws/credentials) as part of the config resolution pipeline.Changes:
profiles/sso-sessions/services
ParsedConfigFileclass for querying the merged resultconfig-file-parser-tests.jsonandconfig-file-location-tests.json)+ unit tests for the query layer and file I/O edge casesTesting:
~/.aws/configfile to verify end-to-end parsing behaviorBy submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.