Skip to content

support sigv4[a] and non-rule endpoint resolution in generic clients - #687

Merged
lucix-aws merged 1 commit into
mainfrom
generic-client-auth-replacement
Jul 16, 2026
Merged

support sigv4[a] and non-rule endpoint resolution in generic clients#687
lucix-aws merged 1 commit into
mainfrom
generic-client-auth-replacement

Conversation

@lucix-aws

Copy link
Copy Markdown
Collaborator
  • new module aws-http-auth-schemes bridges the standalone aws-http-auth signers into smithy-go's client auth interfaces, so generic (non-SDK) clients can sign with SigV4/SigV4A
    without depending on aws-sdk-go-v2
  • @Replaces annotation lets one GoIntegration suppress another, so the SDK can swap in its own auth scheme/HTTP client/endpoint resolver over the generic defaults
  • DefaultEndpointResolverV2 and DefaultHTTPClient integrations give generic clients working defaults (base-endpoint-only resolution, plain http.Client) that were previously never
    wired up

there wil be a downstream PR that adds @Replaces in SDK codegen where necessary, verified that this doesn't affect the output of the generated SDK at all with those.

- add sigv4
- add basic endpoints w/o rules
- add default http client

// AWSCredentialIdentity is the [auth.Identity] carrying AWS credentials
// through the auth pipeline.
type AWSCredentialIdentity struct {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

not sure where to put this nit question: with support of sigv4(a) and non-rule ep resolution for user's own client, should we concern min go version in smithy go like go v2 now?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

these two things wouldn't matter for that, but also i thought we've been enforcing the same minimum version in smithy-go that we have been in the sdk

+ " declares itself as a replacement target.");
}

var existing = replacedBy.get(target);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is it possible integration A and B replaces each other mutually? The answer might be no if replaces type is only used from sdk side

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

if used in the intended way, no. you could have two integrations in a single codebase replacing each other but that wouldn't make sense

// The aws-http-auth signers support implicit payload hashing, but in the
// client pipeline the body is carried on the separate Stream field, so it has
// to be hashed here instead.
func Hash(r *smithyhttp.Request, props *smithy.Properties) ([]byte, error) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

So my understanding is this func collapsed/ported all payload hash workflow originated from go v2's sigv4 and runs unsigned payload only when it presents in prop. Can it cover all unsigned cases? For example dynamicPayloadSigningMiddleware applies unsigned payload only for TLS schemed operations like s3.PutObject

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

no this is just signing the payload all the time no matter what, which should work for sigv4. the dynamic middleware you're referencing is basically for weird unmodeled AWS behavior

@lucix-aws
lucix-aws merged commit 90775c9 into main Jul 16, 2026
15 checks passed
@lucix-aws
lucix-aws deleted the generic-client-auth-replacement branch July 16, 2026 15:08
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