Abhishek Kumar created RANGER-5795:
--------------------------------------
Summary: Support pluggable token supplier in Ranger REST client to
obtain and refresh bearer tokens dynamically
Key: RANGER-5795
URL: https://issues.apache.org/jira/browse/RANGER-5795
Project: Ranger
Issue Type: Improvement
Components: Ranger
Reporter: Abhishek Kumar
Assignee: Abhishek Kumar
Allow a pluggable token supplier for the Ranger REST client, configurable per
plugin, e.g.:
ranger.plugin.hive.policy.rest.client.jwt.provider=com.example.MyJwtSupplier
The configured class must implement the JDK's
java.util.function.Supplier<String>, so custom token suppliers can be plain
lambdas/suppliers with no dependency on Ranger libraries. If the property is
set, the class is instantiated via reflection (preferring a Configuration-arg
constructor, falling back to a no-arg constructor); otherwise the built-in
DefaultJwtProvider is used.
As part of this, the Ranger-specific JwtProvider interface is replaced by
Supplier<String>, and DefaultJwtProvider now implements Supplier<String>.
The supplier's get() is invoked per request, so applications can plug in custom
logic that obtains and refreshes tokens dynamically when the Ranger REST client
makes calls.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)