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

aws/endpoints: Fix SDK endpoint signing name resolution #181

Merged
merged 3 commits into from May 25, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 15 additions & 2 deletions aws/endpoints.go
Expand Up @@ -32,8 +32,21 @@ func (v ResolveWithEndpoint) ResolveEndpoint(service, region string) (Endpoint,

// Endpoint represents the endpoint a service client should make requests to.
type Endpoint struct {
URL string
SigningName string
// The URL of the endpoint.
URL string

// The service name that should be used for signing the requests to the
// endpoint.
SigningName string

// The region that should be used for signing the request to the endpoint.
SigningRegion string

// States that the signing name for this endpoint was derived from metadata
// passed in, but was not explicitly modeled.
SigningNameDerived bool

// The signing method that should be used for signign the requests to the
// endpoint.
SigningMethod string
}
12 changes: 8 additions & 4 deletions aws/endpoints/v3model.go
Expand Up @@ -229,16 +229,20 @@ func (e endpoint) resolve(service, region, dnsSuffix string, defs []endpoint, op
if len(signingRegion) == 0 {
signingRegion = region
}

signingName := e.CredentialScope.Service
var signingNameDerived bool
if len(signingName) == 0 {
signingName = service
signingNameDerived = true
}

return aws.Endpoint{
URL: u,
SigningRegion: signingRegion,
SigningName: signingName,
SigningMethod: getByPriority(e.SignatureVersions, signerPriority, defaultSigner),
URL: u,
SigningRegion: signingRegion,
SigningName: signingName,
SigningNameDerived: signingNameDerived,
SigningMethod: getByPriority(e.SignatureVersions, signerPriority, defaultSigner),
}
}

Expand Down