-
Notifications
You must be signed in to change notification settings - Fork 250
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
Spaces and single quotes in configuration profile names are improperly handled #1097
Comments
Hello and thanks for the detailed bug report! Although this is technically supported by the CLI, you'll note that multi-word quoted strings are not found anywhere in the documentation. When other SDKs implemented support for the shared configuration file, a decision was explicitly made to not support quoted profile names. This decision was made to avoid adding complexity to the parsers written for other languages and because building an identical implementation would be challenging. See this quote from the documentation:
I'd suggest avoiding using this format of profile names—I suspect it won't work in many SDKs. If there's a reason why you explicitly need this functionality in Rust (and other SDKs), we want to understand why. |
Greetings! It looks like this issue hasn’t been active in longer than a week. We encourage you to check if this is still an issue in the latest release. Because it has been longer than a week since the last update on this, and in the absence of more information, we will be closing this issue soon. If you find that this is still a problem, please feel free to provide a comment or add an upvote to prevent automatic closure, or if the issue is already closed, please feel free to open a new one. |
Hello again! It seems that this is a bug in |
Comments on closed issues are hard for our team to see. |
Describe the bug
If a configuration profile name ever includes single quotes, or escapes within the single quotes, the AWS SDK for Rust cannot resolve the profile definition, and all client operations in the SDK immediately fail with a
DispatchFailure
.Expected Behavior
The AWS SDK for Rust should support all of the string escape conventions as the AWS CLI, so I should be able to use profile definitions in
~/.aws/config
like so:And then run my code with
Current Behavior
If my
~/.aws/config
looks likeThen attempting to use the AWS SDK for Rust always fails with a
DispatchError
:Reproduction Steps
I roughly have the following contents in my
~/.aws/config
, with the identifying information removed:These profile names result from using spaces and single quotes in
aws configure sso
.My
Cargo.toml
isAnd
src/main.rs
isAttempting to use
my-macbook-pro
as a profile works:unless I add otherwise unnecessary quotes to the profile name like so
This still functions properly with the AWS CLI:
AWS_PROFILE=my-macbook-pro aws dynamodb list-tables { "TableNames": [] }
but fails when trying to use the AWS SDK for Rust:
The same happens for the
My MacBook Pro
andSomeone's MacBook Pro
profiles:Possible Solution
No response
Additional Information/Context
The profile line parser implementation only strips the first "[" and last "]" from the line, so internally the profile is represented as
profile 'My MacBook Pro'
But the SDK is attempting to resolve
profile My MacBook Pro
, which is not present in thedata
HashMap.Version
Environment details (OS name and version, etc.)
macOS Sonoma 14.2.1
Logs
No response
The text was updated successfully, but these errors were encountered: