-
Notifications
You must be signed in to change notification settings - Fork 185
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
Add custom headers in s3 #4400
Add custom headers in s3 #4400
Conversation
This pull request has been linked to Shortcut Story #31648: Capability to add headers to cURL requests for S3. |
Functionality was validated locally, with findings here |
We should not expect anyone to find this issue or a gist in order to be able to replicate the test. All the relevant files should be checked in somewhere, probably in a |
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.
Mostly good, thanks! Left some small comments.
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.
Was there a reason to go with the subclass here rather than PutObject::SetAdditionalCustomHeaderValue
discussed previously?
(also, as mentioned elsewhere: this should have a test harness; an approach was previously discussed, and outlined in the original ticket, which should take a small amount of python using the built-in HTTP server)
Also, we should specifically make sure this works for setting a custom |
It's gives a designated point of construction and makes C.41 compliance easier. Even though it's not done in the version I looked at, it provide a single place to parse and validate configuration values. |
It was my idea, after being asked offline. I hadn't noticed that One other advantage of the subclass is that the custom headers automatically apply to all kinds of S3 requests. |
👍 Thanks |
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.
Looks pretty good. Once you fix the syntax error and remove the unneeded config entry changes this will be good to go.
794b555
to
8d46801
Compare
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.
Thanks!
dfe0725
to
8d46801
Compare
@bekadavis9 can you update the title and description of the PR to account for the new config option and not mention curl? |
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.
+1
[SC-49141](https://app.shortcut.com/tiledb-inc/story/49141/add-support-for-custom-rest-headers-via-config) Similar to S3 custom header support (#4400) this PR adds support for custom headers in REST request. This allows users to set header via a config parameter instead of the current `tildb_context_set_tag`. The context set tag does not work in all cases because its not always possible to use the same context, i.e SOMA and VCF python APIs can't pass a TileDB-Py ctx to their respective C++ code. Big thanks to @Shelnutt2 for implementing this. I added a test and documentation. --- TYPE: CONFIG DESC: Add `rest.custom_headers.*` config option to set custom headers on REST requests. --------- Co-authored-by: Seth Shelnutt <[email protected]> Co-authored-by: KiterLuc <[email protected]> Co-authored-by: eric-hughes-tiledb <[email protected]> Co-authored-by: Luc Rancourt <[email protected]>
[SC-49141](https://app.shortcut.com/tiledb-inc/story/49141/add-support-for-custom-rest-headers-via-config) Similar to S3 custom header support (#4400) this PR adds support for custom headers in REST request. This allows users to set header via a config parameter instead of the current `tildb_context_set_tag`. The context set tag does not work in all cases because its not always possible to use the same context, i.e SOMA and VCF python APIs can't pass a TileDB-Py ctx to their respective C++ code. Big thanks to @Shelnutt2 for implementing this. I added a test and documentation. --- TYPE: CONFIG DESC: Add `rest.custom_headers.*` config option to set custom headers on REST requests. --------- Co-authored-by: Seth Shelnutt <[email protected]> Co-authored-by: KiterLuc <[email protected]> Co-authored-by: eric-hughes-tiledb <[email protected]> Co-authored-by: Luc Rancourt <[email protected]>
[SC-49141](https://app.shortcut.com/tiledb-inc/story/49141/add-support-for-custom-rest-headers-via-config) Similar to S3 custom header support (#4400) this PR adds support for custom headers in REST request. This allows users to set header via a config parameter instead of the current `tildb_context_set_tag`. The context set tag does not work in all cases because its not always possible to use the same context, i.e SOMA and VCF python APIs can't pass a TileDB-Py ctx to their respective C++ code. Big thanks to @Shelnutt2 for implementing this. I added a test and documentation. --- TYPE: CONFIG DESC: Add `rest.custom_headers.*` config option to set custom headers on REST requests. --------- Co-authored-by: Seth Shelnutt <[email protected]> Co-authored-by: KiterLuc <[email protected]> Co-authored-by: eric-hughes-tiledb <[email protected]> Co-authored-by: Luc Rancourt <[email protected]>
Allow users to input custom headers using a new config option,
vfs.s3.custom_headers.*
with formatconfig["vfs.s3.custom_headers.key_name"] = "header_value"
TYPE: FEATURE
DESC: Support custom headers on s3 requests