Fix parameters passed for GCS URL generation#6940
Conversation
8d195f8 to
bb4fd75
Compare
When GCP support was originally added, the parameters were `response_disposition` and `content_type`. When it was refactored in pulp#4251, the headers were GCS were mistakenly changed and expanded. These parameters get used by `generate_signed_url` method defined in https://github.com/googleapis/python-storage/blob/a8109e0/google/cloud/storage/blob.py#L463, through https://github.com/jschneier/django-storages/blob/758ad6f/storages/backends/gcloud.py#L350 This PR ensures only the supported parameters are passed to that function call. closes pulp#6917 Signed-off-by: Balasankar 'Balu' C <balu@dravidam.net>
bb4fd75 to
f9b8f5b
Compare
| "Content-Encoding": "content_encoding", | ||
| } | ||
| # https://gcloud.readthedocs.io/en/latest/storage-blobs.html | ||
| # https://gcloud.readthedocs.io/en/latest/storage-blobs.html#google.cloud.storage.blob.Blob.generate_signed_url |
There was a problem hiding this comment.
Minor nit - can we get this on its own line? :)
mdellweg
left a comment
There was a problem hiding this comment.
I cannot tell whether this is the right thing to do, and we neither support nor test GCS.
(Some time ago we failed setting up the corresponding test runner in a deterministic way and abandoned the idea.)
So I am going to approve this change with the disclaimer that this does not change our stance on the supported storage backends as stated here:
https://pulpproject.org/pulpcore/docs/admin/reference/settings/#storages
Thank you for your effort.
Backport to 3.89: 💚 backport PR created✅ Backport PR branch: Backported as #6956 🤖 @patchback |
When GCP support was originally added in #3481, the parameters were
response_dispositionandcontent_type. When it was refactored in #4251, the headers for GCS were mistakenly changed and expanded.These parameters get used by
generate_signed_urlmethod defined in https://github.com/googleapis/python-storage/blob/a8109e0/google/cloud/storage/blob.py#L463, throughhttps://github.com/jschneier/django-storages/blob/758ad6f/storages/backends/gcloud.py#L350
This PR ensures only the supported parameters are passed to that function call.
closes #6917