-
Notifications
You must be signed in to change notification settings - Fork 32
RSCBC-200: Add support for JWT authentication #401
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
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.
Pull request overview
This PR adds support for JWT authentication in the Couchbase SDK by introducing a new JwtAuthenticator variant alongside the existing PasswordAuthenticator and CertificateAuthenticator.
Key Changes:
- Added
JwtAuthenticatorenum variant and implementation with OAuth Bearer token support - Refactored HTTP authentication to use an
Authenum that supports both BasicAuth and BearerAuth - Modified authentication mechanism handling to automatically derive supported mechanisms from authenticator types
- Simplified TLS configuration by auto-creating default TLS config when using
couchbases://scheme
Reviewed changes
Copilot reviewed 30 out of 30 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| sdk/couchbase/src/authenticator.rs | Added JwtAuthenticator struct and enum variant, removed unused UserPassPair and get_credentials method |
| sdk/couchbase/src/options/cluster_options.rs | Updated TLS config handling to support JWT auth and auto-create TLS config for secure connections |
| sdk/couchbase/src/clients/cluster_client.rs | Added automatic TLS config creation for couchbases:// scheme |
| sdk/couchbase-core/src/authenticator.rs | Added JwtAuthenticator with auth mechanism support |
| sdk/couchbase-core/src/auth_mechanism.rs | Added OAuthBearer authentication mechanism |
| sdk/couchbase-core/src/httpx/request.rs | Added BearerAuth struct and Auth enum variant for JWT tokens |
| sdk/couchbase-core/src/httpcomponent.rs | Refactored to use Auth enum, extracted auth_from_authenticator helper function |
| sdk/couchbase-core/src/memdx/* | Added SASL OAuth Bearer operation support and refactored credential handling |
| sdk/couchbase-core/src/kvclient.rs | Updated bootstrap authentication to derive mechanisms from authenticator type |
| sdk/couchbase-core/src/agent.rs | Simplified auth mechanism default logic and updated HTTP config fetching to use Auth enum |
| Multiple management/query/search files | Replaced separate username/password fields with unified auth field |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
fac759c to
e6585fd
Compare
afe635b to
b320cdd
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.
Pull request overview
Copilot reviewed 45 out of 45 changed files in this pull request and generated 6 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
No description provided.