feat: add support for using CDP auth token directly#177
Open
reblem wants to merge 8 commits into
Open
Conversation
Codecov Report❌ Patch coverage is ❌ Your patch check has failed because the patch coverage (58.33%) is below the target coverage (90.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #177 +/- ##
============================================
+ Coverage 82.37% 82.67% +0.30%
- Complexity 1871 1896 +25
============================================
Files 125 126 +1
Lines 5020 5092 +72
Branches 540 548 +8
============================================
+ Hits 4135 4210 +75
+ Misses 642 634 -8
- Partials 243 248 +5
🚀 New features to boost your workflow:
|
KaviarasuSakthivadivel
requested changes
Apr 30, 2026
ae4e585 to
d8e1fac
Compare
…asource Both the OAuth and direct CDP-token flows built identical auth interceptor, gRPC channel, stub provider, and DataCloudConnection wiring. Merge them into a single createConnection that takes the already-constructed collaborators (TokenProcessorSupplier, host, userName, lakehouse supplier, dataspaces supplier).
- TokenProcessorSupplierTest: exercises all three constructors (DataCloudTokenProvider, DirectCdpTokenProcessor, raw supplier) asserting getToken / getAudience delegate correctly. - DataCloudJDBCDriverTest: end-to-end DriverManager.getConnection via the cdpToken/tenantUrl branch, plus a negative case for an invalid JWT.
- DirectCdpTokenProcessorTest: add cases for the rebuild branch (cache cleared, cached-but-expired) and the wrap-on-rebuild-failure path. DirectCdpTokenProcessor is now at 100% line/branch coverage. - TokenProcessorSupplierTest: add cases asserting SneakyThrows propagates supplier SQLExceptions through getToken / getAudience.
- Validate tenantUrl is a bare hostname (reject scheme/port/path/whitespace) so users get a clear error instead of an opaque gRPC connect failure - Drive cached-token TTL from the JWT exp claim instead of a fixed 3600s default, with safe fallback when the JWT can't be parsed - Drop the brittle reflection-based test that forced an unreachable rebuild failure; replace with focused secondsUntilJwtExpiry unit tests - Collapse the duplicate TokenProcessorSupplier delegation test that re-exercised JWT parsing already covered in DirectCdpTokenProcessorTest - Generate JWTs dynamically in tests so exp stays in the future
38f91b6 to
f6a93ac
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds support for using a CDP auth token directly instead of requiring a Core Salesforce token that must be exchanged for a CDP token. The CDP access token is accepted as a Bearer token via new
cdpTokenandtenantUrlconnection properties, and validates the JWT eagerly.