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

File Validation During Pre-Signed URL Generation #2039

Closed
LSunQQ opened this issue Dec 26, 2024 · 0 comments
Closed

File Validation During Pre-Signed URL Generation #2039

LSunQQ opened this issue Dec 26, 2024 · 0 comments

Comments

@LSunQQ
Copy link

LSunQQ commented Dec 26, 2024

My use case is as follows: the frontend requests to upload a file to the server (including file integrity information such as MD5 and SHA1). The server then generates a pre-signed URL for upload, and the frontend uses this URL to upload the file to object storage.

However, when generating the pre-signed URL, why not set the headers first and then calculate the signature? Wouldn't this ensure that the MD5, SHA1, and other integrity information are included in the signature? Alternatively, if headers are not set, how does the current implementation guarantee that the file requested for upload is the same file actually uploaded?

(I readthe code in the file api.go from line 824 to line 853. If it's about obtaining the upload URL, the newRequest function returns at line 844 and won't reach line 853.)

@LSunQQ LSunQQ closed this as completed Dec 30, 2024
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

No branches or pull requests

1 participant