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

Support for custom signed headers as part of Presign URLs #1415

Closed
leungster opened this issue Nov 26, 2020 · 4 comments · Fixed by #1449
Closed

Support for custom signed headers as part of Presign URLs #1415

leungster opened this issue Nov 26, 2020 · 4 comments · Fixed by #1449

Comments

@leungster
Copy link

I'm trying to generate Presigned URLs that require the user to provide matching headers upon usage. The current PresignXXX methods don't allow me to specify extra headers that should be part of the signature.

ReqParams aren't sufficient because the value of the params are included in the returned presign URL. Whereas with headers, only the header key is returned.

@harshavardhana
Copy link
Member

MinIO SDK is not designed for this use @leungster what is the real purpose of using presigned URLs? - you should use AssumeRole with STS credentials of generating odd presigned URLs

@leungster
Copy link
Author

Thanks for the quick reply. Our use case is to add some extra guardrails that the URL is only accessible by the requestor. If the URL were to be copied/passed around, we'd want the header to also be supplied. The value we were going to use is already being rotated / revokable.

The AWS SDK appears to support this capability but the MinIO one has cleaner abstractions for the other use cases we have.
Feel free to close if this is out of scope for MinIO.

@harshavardhana
Copy link
Member

The AWS SDK appears to support this capability but the MinIO one has cleaner abstractions for the other use cases we have.

Can you provide examples where AWS SDK provides this?

@leungster
Copy link
Author

This is what the AWS SDK would look like.

	svc := s3.New(sess)
	req, _ := svc.PutObjectRequest(&s3.PutObjectInput{
		Bucket: aws.String("bucket"),
		Key:    aws.String("key"),
	})
	req.HTTPRequest.Header.Add("my-header", "value")
	url, _ := req.Presign(1 * time.Minute)

@kannappanr kannappanr added this to the Current milestone Jan 28, 2021
donatello added a commit to donatello/minio-go that referenced this issue Feb 4, 2021
donatello added a commit to donatello/minio-go that referenced this issue Feb 4, 2021
donatello added a commit to donatello/minio-go that referenced this issue May 10, 2021
donatello added a commit to donatello/minio-go that referenced this issue Jul 14, 2021
harshavardhana pushed a commit to donatello/minio-go that referenced this issue Nov 2, 2021
harshavardhana pushed a commit to donatello/minio-go that referenced this issue Nov 2, 2021
harshavardhana pushed a commit to donatello/minio-go that referenced this issue Nov 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants