-
Notifications
You must be signed in to change notification settings - Fork 915
Add support for custom OAuth functions #1925
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
🎉 All Contributor License Agreements have been signed. Ready to merge. |
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.
PR Overview
This PR adds support for custom OAuth functionality by introducing a common _BearerFieldProvider interface with implementations for OAuth, static tokens, and custom logic. It also updates existing tests and configuration handling to work with the new provider abstraction while removing legacy OAuth client tests.
Reviewed Changes
File | Description |
---|---|
tests/schema_registry/test_bearer_field_provider.py | Adds tests covering expiration, token retrieval, static and custom OAuth implementations. |
tests/schema_registry/test_config.py | Adds tests to validate custom bearer configuration handling. |
src/confluent_kafka/schema_registry/schema_registry_client.py | Refactors bearer auth handling by introducing _BearerFieldProvider and related classes, and adapts configuration accordingly. |
tests/schema_registry/test_oauth_client.py | Removes legacy OAuth client tests in favor of the new provider approach. |
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (2)
tests/schema_registry/test_bearer_field_provider.py:95
- [nitpick] The test for the custom OAuth client only asserts that get_bearer_fields() returns the same value on successive calls. Consider asserting specific expected fields from the custom function to improve test coverage.
def test_custom_oauth_client():
src/confluent_kafka/schema_registry/schema_registry_client.py:84
- [nitpick] Consider renaming '_OAuthClient' to 'OAuthBearerFieldProvider' to better reflect its role as an implementation of _BearerFieldProvider for OAuth logic.
class _OAuthClient(_BearerFieldProvider):
This comment has been minimized.
This comment has been minimized.
Hi, a potential user of this functionality here 😁 Do you already have a (rough) estimate on when you plan to release this? |
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 @Claimundefine , left some nits, otherwise looking good
HI @Elmerboul, the projected release date is end of March. |
7100cde
to
ffee512
Compare
This comment has been minimized.
This comment has been minimized.
3 similar comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
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 @Claimundefine , LGTM
What
Add custom OAuth implementation. Created new base class for bearer field provider, which will be called to retrieve all fields that need to be modified in the header.
Checklist
References
JIRA:
https://confluentinc.atlassian.net/browse/DGS-17473
Test & Review
Tested locally with OAuth for custom.
Open questions / Follow-ups