feat: add middleware support to REST catalog client#1971
feat: add middleware support to REST catalog client#1971rohankmr414 wants to merge 7 commits intoapache:mainfrom
Conversation
Introduces an optional `middleware` feature to enable custom HTTP middleware for the REST catalog client. This integration with `reqwest-middleware` allows users to inject custom logic into HTTP requests, facilitating advanced functionalities such as logging, retry mechanisms, rate limiting, and custom authentication. A `with_middleware_client` method is added to `RestCatalogBuilder` for easy configuration.
Reorders import statements within a middleware test for better consistency and readability.
|
This change is required to support authentication headers in scenarios such as projected Kubernetes service account tokens. These tokens are rotated frequently (typically every hour), so it’s important for clients to be able to watch the token file and update the headers dynamically as the token changes. This middleware support will enable such use cases seamlessly. |
|
This pull request has been marked as stale due to 30 days of inactivity. It will be closed in 1 week if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the dev@iceberg.apache.org list. Thank you for your contributions. |
|
This pull request has been closed due to lack of activity. This is not a judgement on the merit of the PR in any way. It is just a way of keeping the PR queue manageable. If you think that is incorrect, or the pull request requires review, you can revive the PR at any time. |
This pull request adds support for HTTP middleware in the
iceberg-catalog-restcrate, allowing users to inject custom middleware (such as logging, retries, or authentication) into HTTP requests using thereqwest-middlewarecrate. The implementation is feature-gated and includes documentation, configuration options, and tests for middleware support.Middleware support:
middlewarefeature toCargo.tomlthat enables integration with thereqwest-middlewarecrate for custom HTTP middleware capabilities. [1] [2]RestCatalogBuilderandRestCatalogConfigstructs to support amiddleware_clientfield, and provided awith_middleware_clientmethod for configuration. [1] [2] [3]HttpClientto use the middleware client when configured, including logic in theexecutemethod to route requests through middleware if present. [1] [2] [3] [4]Documentation:
README.mdwith usage instructions and examples for enabling and using middleware support.Testing: