-
Notifications
You must be signed in to change notification settings - Fork 660
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
INI Parsing Failures silently ignored #2276
Comments
This is a good find- after taking a closer look, frankly I'm going to say the tokenization behavior we have today is fundamentally wrong. Basically, in the section where we handle "literals", we first decide whether something is a number, string, or bool, and then parse that type accordingly. There are two issues with this:
Ultimately point (1) above is moot - we need to get rid of typed literal parsing in the first place. The actual config structure we have that consumes the parsed config is responsible for determining whether the config values are actually valid. |
|
Describe the bug
Config INI files with certain strings which look like numbers silently cause the config file to be entirely skipped.
E.g.
Expected Behavior
Either an error should be thrown for corrupted ini files, or in this case the string should be parsed correctly.
Current Behavior
Reproduction Steps
Add the color line to ~/.aws/config under any profile
export AWS_PROFILE=foobar
and attempt to use that profile through
config.LoadDefaultConfig
Possible Solution
Error is thrown here
Ignored here
Leading to the tokenize function simply not iterating over any tokens.
Returning an error from countTokens passes it up the chain:
Additional Information/Context
No response
AWS Go SDK V2 Module Versions Used
ithub.com/google/go-cmp@v0.5.8
github.com/aws/aws-sdk-go-v2/service/sso@v1.13.6 github.com/aws/aws-sdk-go-v2@v1.21.0
github.com/aws/aws-sdk-go-v2/service/sso@v1.13.6 github.com/aws/aws-sdk-go-v2/internal/configsources@v1.1.41
github.com/aws/aws-sdk-go-v2/service/sso@v1.13.6 github.com/aws/aws-sdk-go-v2/internal/endpoints/v2@v2.4.35
github.com/aws/aws-sdk-go-v2/service/sso@v1.13.6 github.com/aws/smithy-go@v1.14.2
github.com/aws/aws-sdk-go-v2/service/sso@v1.13.6 github.com/google/go-cmp@v0.5.8
github.com/aws/aws-sdk-go-v2/service/ssooidc@v1.15.6 github.com/aws/aws-sdk-go-v2@v1.21.0
github.com/aws/aws-sdk-go-v2/service/ssooidc@v1.15.6 github.com/aws/aws-sdk-go-v2/internal/configsources@v1.1.41
github.com/aws/aws-sdk-go-v2/service/ssooidc@v1.15.6 github.com/aws/aws-sdk-go-v2/internal/endpoints/v2@v2.4.35
github.com/aws/aws-sdk-go-v2/service/ssooidc@v1.15.6 github.com/aws/smithy-go@v1.14.2
github.com/aws/aws-sdk-go-v2/service/ssooidc@v1.15.6 github.com/google/go-cmp@v0.5.8
github.com/aws/aws-sdk-go-v2/service/sts@v1.21.5 github.com/aws/aws-sdk-go-v2@v1.21.0
github.com/aws/aws-sdk-go-v2/service/sts@v1.21.5 github.com/aws/aws-sdk-go-v2/internal/configsources@v1.1.41
github.com/aws/aws-sdk-go-v2/service/sts@v1.21.5 github.com/aws/aws-sdk-go-v2/internal/endpoints/v2@v2.4.35
github.com/aws/aws-sdk-go-v2/service/sts@v1.21.5 github.com/aws/aws-sdk-go-v2/service/internal/presigned-url@v1.9.35
github.com/aws/aws-sdk-go-v2/service/sts@v1.21.5 github.com/aws/smithy-go@v1.14.2
github.com/aws/aws-sdk-go-v2/service/sts@v1.21.5 github.com/google/go-cmp@v0.5.8
github.com/aws/smithy-go@v1.14.2 github.com/google/go-cmp@v0.5.8
github.com/aws/smithy-go@v1.14.2 github.com/jmespath/go-jmespath@v0.4.0
Compiler and Version used
go version go1.20.5 darwin/arm64
Operating System and version
OSX 13.5.2 (22G91)
The text was updated successfully, but these errors were encountered: