-
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 config option to override the payer namespace for REST requests. #5105
Conversation
test/src/unit-curl.cc
Outdated
// We copy because the [] operator is not const-qualified. | ||
auto extra_headers = resources.rest_client()->extra_headers(); |
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.
vector::at
is const-qualified.
Similar to S3 custom header support this PR adds support for customer header 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.
Co-authored-by: eric-hughes-tiledb <[email protected]>
This is a new config that allows users to set the namespace to charge for requests when it cannot be automatically determined or when the user needs to set a specific override.
Co-authored-by: eric-hughes-tiledb <[email protected]>
86077fe
to
2f929ac
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.
Tested and confirmed -- succeeds with a non-default namespace I have access to, and fails with an invalid namespace (and I see the X-payer
header in logs). Thanks for the quick turnaround.
In [1]: import tiledb, numpy as np, tiledb.cloud
In [2]: tiledb.default_ctx(tiledb.cloud.Ctx().config().dict() | {"rest.payer_namespace": "foobar"})
Out[2]: tiledb.Ctx() [see Ctx.config() for configuration]
In [3]: a = tiledb.open("tiledb://ihnorton/<array>")
TileDBError: [TileDB::REST] Error: Error submitting query to REST; server returned no data. Curl error: Error in libcurl POST operation: libcurl error message 'CURLE_OK'; HTTP code 401; server response data '{"code":147,"message":"You are not allowed to charge queries to foobar","request_id":"965a4a52-c66a-467d-8372-d5556d85d082"}'.
…5105) [SC-49142](https://app.shortcut.com/tiledb-inc/story/49142/add-support-for-rest-x-payer-via-config) This PR introduces a new config option that allows users to set the namespace to charge for REST requests when it cannot be automatically determined or when the user needs to set a specific override. Big thanks to @Shelnutt2 for implementing this. I added a test and made some small changes on top of it. --- TYPE: CONFIG DESC: Add `rest.payer_namespace` config option to set the namespace to be charged for 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]>
…5105) [SC-49142](https://app.shortcut.com/tiledb-inc/story/49142/add-support-for-rest-x-payer-via-config) This PR introduces a new config option that allows users to set the namespace to charge for REST requests when it cannot be automatically determined or when the user needs to set a specific override. Big thanks to @Shelnutt2 for implementing this. I added a test and made some small changes on top of it. --- TYPE: CONFIG DESC: Add `rest.payer_namespace` config option to set the namespace to be charged for 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]>
…pace for REST requests. (#5105) (#5127) Backport bdfc19c from #5105. --- TYPE: CONFIG DESC: Add `rest.payer_namespace` config option to set the namespace to be charged for REST requests. Co-authored-by: Theodore Tsirpanis <[email protected]> Co-authored-by: Seth Shelnutt <[email protected]> Co-authored-by: eric-hughes-tiledb <[email protected]>
…pace for REST requests. (#5105) (#5126) Backport bdfc19c from #5105. --- TYPE: CONFIG DESC: Add `rest.payer_namespace` config option to set the namespace to be charged for REST requests. Co-authored-by: Theodore Tsirpanis <[email protected]> Co-authored-by: Seth Shelnutt <[email protected]> Co-authored-by: eric-hughes-tiledb <[email protected]>
SC-49142
This PR introduces a new config option that allows users to set the namespace to charge for REST requests when it cannot be automatically determined or when the user needs to set a specific override.
Big thanks to @Shelnutt2 for implementing this. I added a test and made some small changes on top of it.
TYPE: CONFIG
DESC: Add
rest.payer_namespace
config option to set the namespace to be charged for REST requests.