Skip to content

Conversation

@wty-Bryant
Copy link
Contributor

In a go v2 issue aws/aws-sdk-go-v2#3234 , user reported panic during auth scheme resolving when calling s3 with invalid region like "example_region" (with invalid underscore). The issue is due to some services' auth resolver uses endpoint param binder as well (e.g. s3 and eventbridge) ahead of endpoint resolution. Since region validation was just added to the endpoint param binder in #612 , when invalid region is passed to call s3/eventbridge, their auth scheme resolver doesn't check error from endpoint param binding and causes panic when dereferencing nil endpoint param. This PR fixes the panic after adding the same error check to auth scheme resolution.

for (var resolver: resolvers) {
writer.write("$T(ctx, params, input, options)", resolver.resolver());
if (resolver.resolver().getName().equals("bindAuthEndpointParams")) {
writer.write("err = $T(ctx, params, input, options)", resolver.resolver());
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not exactly fond of the way is this written. We shouldn't need to branch if you change it so all auth param resolvers by design return errors. As written this could have issues in the future if we add additional bindings that return errors.

I'm not going to block on the review though so either fixandship or leave it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I got what you mean, I can change all resolvers from go v2 side to return error considering we only have 2 resolvers for now and that could hide some resolver info

@wty-Bryant wty-Bryant merged commit ed49224 into main Nov 24, 2025
15 checks passed
@wty-Bryant wty-Bryant deleted the fix-region-validation-panic branch November 24, 2025 19:03
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.

2 participants