-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[usage] Ensure Content-Type
headers are set for GCP object storage uploads
#11730
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
Conversation
/hold as it's based on #11689 |
/werft run with-preview 👍 started the job as gitpod-build-af-forbidden-bucket-upload.17 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Déjà-vu
Setting '*/*' doesn't work - it needs to be explict about the exact type of content that that the signed URL will receive.
The signed upload URL only accepts requests with this Content-Type.
76a9781
to
6788446
Compare
/unhold |
/hold |
/werft run 👍 started the job as gitpod-build-af-forbidden-bucket-upload.19 |
started the job as gitpod-build-af-forbidden-bucket-upload.20 because the annotations in the pull request description changed |
/unhold |
Description
As part of the move towards usage based pricing (#9036), we'd like for the usage aggregator (
components/usage
) to be able to upload its usage reports to cloud storage. This will provide an audit trail of usage reports, allowing us to cross reference usage entries in the database with the usage reports that provided the data. In future, we may also allow access to these reports to users directly.In order to be able to upload these reports to GCP Cloud Storage, the signed URL can be created for a specific
Content-Type
; onlyPUT
requests to that URL that set the sameContent-Type
header will be accepted.This PR sets the
Content-Type
header when generating the signed URL and sets it on theusage
componentPUT
to that URL.Minio object storage has no such requirements on the
Content-Type
header which is why we only hit this problem in staging/production.Related Issue(s)
Fixes #11688
How to test
This is difficult to test as preview uses minio for object storage, not GCP.
Tested by taking the images built for this branch and hot-patching the images for
content-service
andusage
in staging.Reports are uploaded to the bucket:
Release Notes
Documentation
Werft options: