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

Custom HTTP transport is not used for STS #2040

Closed
ramondeklein opened this issue Dec 26, 2024 · 0 comments · Fixed by #2041
Closed

Custom HTTP transport is not used for STS #2040

ramondeklein opened this issue Dec 26, 2024 · 0 comments · Fixed by #2041
Assignees

Comments

@ramondeklein
Copy link
Contributor

When MinioClient is using a custom HTTP client and STS, then the custom HTTP client isn't used for performing the STS request. It will always revert to the default HTTP transport when using credentials.NewSTSAssumeRole (source).

Instead of using credentials.NewSTSAssumeRole, the provider can be created by passing the same HTTP client explicitly, like this:

tr := customHTTPTransport()
stsCreds := credentials.New(&credentials.STSAssumeRole{
	Client:      &http.Client{Transport: tr},
	STSEndpoint: stsEndPoint,
	Options: credentials.STSAssumeRoleOptions{/*...*/},
})
client, err := minio.New(endPoint, &minio.Options{
	Creds:     stsCreds,
	Transport: tr,
})

Although a workaround is possible, this behavior is non-intuitive. Most people would expect the MinIO client to use the specified HTTP transport for all requests that are made on behalf of MinioClient.

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 a pull request may close this issue.

1 participant