shahina-akd opened a new pull request, #11464:
URL: https://github.com/apache/gravitino/pull/11464
### What changes were proposed in this pull request?
Added a new `withSimpleAuth(String userName, String password)` overload to
`GravitinoClientBase.Builder` and a corresponding `SimpleTokenProvider(String,
String)` constructor, allowing callers to supply an explicit password when
using simple authentication.
Previously, `withSimpleAuth` always encoded `username:dummy` as the Basic
auth credential, with no way to pass a real password.
### Why are the changes needed?
The simple auth path hardcoded `"dummy"` as the password in
`SimpleTokenProvider.buildToken()`. There was no API to provide an actual
password on the client side, which blocked use cases where the server or a
proxy expects a real credential in the Basic auth header.
Fix: #7189
### Does this PR introduce _any_ user-facing change?
Yes.
* New builder method: `GravitinoClientBase.Builder.withSimpleAuth(String
userName, String password)`
* Existing `withSimpleAuth()` and `withSimpleAuth(String userName)`
overloads are unchanged and continue to use `"dummy"` as the password for
backwards compatibility.
### How was this patch tested?
Unit tests added to `TestSimpleTokenProvider`:
* `testAuthenticationWithPassword` verifies new
`SimpleTokenProvider("alice", "secret")` encodes `alice:secret`
* `testSingleArgConstructorUsesDummyPassword` verifies the existing
single-arg path still encodes `bob:dummy`
Run with:
`./gradlew :clients:client-java:test -PskipITs`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]