Package io.pravega.client.security.auth
Class JwtTokenProviderImpl
- java.lang.Object
-
- io.pravega.client.security.auth.JwtTokenProviderImpl
-
- All Implemented Interfaces:
DelegationTokenProvider
public class JwtTokenProviderImpl extends java.lang.Object implements DelegationTokenProvider
Provides JWT-based delegation tokens.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
populateToken(java.lang.String token)
Populates the object with the specified delegation token.java.util.concurrent.CompletableFuture<java.lang.String>
retrieveToken()
Returns the delegation token.void
signalTokenExpired()
Signals the object that the token it may be holding has expired.
-
-
-
Method Detail
-
retrieveToken
public java.util.concurrent.CompletableFuture<java.lang.String> retrieveToken()
Returns the delegation token. It returns existing delegation token if it is not close to expiry. If the token is close to expiry, it obtains a new delegation token and returns that one instead.- Specified by:
retrieveToken
in interfaceDelegationTokenProvider
- Returns:
- a CompletableFuture that, when completed, will return the delegation token JWT compact value
-
populateToken
public boolean populateToken(java.lang.String token)
Description copied from interface:DelegationTokenProvider
Populates the object with the specified delegation token.- Specified by:
populateToken
in interfaceDelegationTokenProvider
- Parameters:
token
- the token to populate the object with- Returns:
- whether the population was successful
-
signalTokenExpired
public void signalTokenExpired()
Description copied from interface:DelegationTokenProvider
Signals the object that the token it may be holding has expired.- Specified by:
signalTokenExpired
in interfaceDelegationTokenProvider
-
-