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

fix: fail to load config if configured profile doesn't exist #2309

Merged
merged 2 commits into from
Oct 11, 2023

Conversation

lucix-aws
Copy link
Contributor

Closes #2058.

This isn't really possible to unit test in a meaningful way since we don't have well-defined os/fs separations in our config loading unit tests. I've verified it manually, however.

@lucix-aws lucix-aws requested a review from a team as a code owner October 10, 2023 19:21
if os.Getenv(awsProfileEnvVar) != "" || options.SharedConfigProfile != "" {
loaders[1] = loadSharedConfig
} else {
loaders[1] = loadSharedConfigIgnoreNotExist
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

am i missing something here? the behavior looks the same: its still using the loadSharedConfigIgnoreNotExist which swallows the error (i.e. doesnt return an error message).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless the check on 204 is true though (which means a profile was specified). That's the change here.

@lucix-aws lucix-aws merged commit bebc232 into main Oct 11, 2023
11 of 19 checks passed
@lucix-aws lucix-aws deleted the fix-loadconfigprofile branch October 11, 2023 19:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Default authentication flow should fail if invalid profile name is passed
3 participants