Skip to content

sts PresignGetCallerIdentity - lack of customisation options #1137

@RafPe

Description

@RafPe

Confirm by changing [ ] to [x] below to ensure that it's a bug:

Describe the bug
When calling sts PresignGetCallerIdentity I could not find how to customise the request to specific headers would be additionaly signed ( x-k8s-aws-id ) / certain Amazon headers would not be added to request ( X-Amz-User-Agent )

Version of AWS SDK for Go?

	github.com/aws/aws-sdk-go-v2 v1.2.0
	github.com/aws/aws-sdk-go-v2/config v1.1.1
	github.com/aws/aws-sdk-go-v2/credentials v1.1.1
	github.com/aws/aws-sdk-go-v2/service/eks v1.1.1
	github.com/aws/aws-sdk-go-v2/service/sts v1.1.1

Version of Go (go version)?
1.15.2

To Reproduce (observed behavior)

// -------- ...

stsSvc := sts.NewFromConfig(cfg)

getCallerIdentity, err := presignClient.PresignGetCallerIdentity(context.Background(), &sts.GetCallerIdentityInput{})
if err != nil {
	panic(err)
}

// -------- ...

fmt.Println(getCallerIdentity.URL)

Which in turn produces

https://sts.eu-central-1.amazonaws.com/?Action=GetCallerIdentity
&Version=2011-06-15&
X-Amz-Algorithm=AWS4-HMAC-SHA256&
X-Amz-Credential=A**********7/20210216/eu-central-1/sts/aws4_request&
X-Amz-Date=20210216T005611Z&
X-Amz-SignedHeaders=host&
X-Amz-User-Agent=aws-sdk-go-v2/1.2.0 os/other lang/go/1.15.2 md/GOOS/darwin md/GOARCH/amd64&
X-Amz-Signature=cd8****************************************ac2

Expected behavior
I would expect a easy form to provide headers to be signed / headers to be not included in the signing process.

Additional context
Idea here was generating code to create EKS token value.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions