Package org.apache.iceberg.rest.auth
Class OAuth2Util.AuthSession
- java.lang.Object
-
- org.apache.iceberg.rest.auth.OAuth2Util.AuthSession
-
- Enclosing class:
- OAuth2Util
public static class OAuth2Util.AuthSession extends java.lang.ObjectClass to handle authorization headers and token refresh.
-
-
Constructor Summary
Constructors Constructor Description AuthSession(java.util.Map<java.lang.String,java.lang.String> baseHeaders, java.lang.String token, java.lang.String tokenType)Deprecated.will be removed in 1.3.0; useAuthSession(Map, String, String, String, String)instead.AuthSession(java.util.Map<java.lang.String,java.lang.String> baseHeaders, java.lang.String token, java.lang.String tokenType, java.lang.String credential, java.lang.String scope)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Stringcredential()static OAuth2Util.AuthSessionempty()A newOAuth2Util.AuthSessionwith empty headers.java.lang.LongexpiresAtMillis()static OAuth2Util.AuthSessionfromAccessToken(RESTClient client, java.util.concurrent.ScheduledExecutorService executor, java.lang.String token, java.lang.Long defaultExpiresAtMillis, OAuth2Util.AuthSession parent)static OAuth2Util.AuthSessionfromCredential(RESTClient client, java.util.concurrent.ScheduledExecutorService executor, java.lang.String credential, OAuth2Util.AuthSession parent)static OAuth2Util.AuthSessionfromTokenExchange(RESTClient client, java.util.concurrent.ScheduledExecutorService executor, java.lang.String token, java.lang.String tokenType, OAuth2Util.AuthSession parent)static OAuth2Util.AuthSessionfromTokenResponse(RESTClient client, java.util.concurrent.ScheduledExecutorService executor, OAuthTokenResponse response, long startTimeMillis, OAuth2Util.AuthSession parent)java.util.Map<java.lang.String,java.lang.String>headers()Pair<java.lang.Integer,java.util.concurrent.TimeUnit>refresh(RESTClient client)Attempt to refresh the session token using the token exchange flow.java.lang.Stringscope()voidstopRefreshing()java.lang.Stringtoken()java.lang.StringtokenType()
-
-
-
Constructor Detail
-
AuthSession
@Deprecated public AuthSession(java.util.Map<java.lang.String,java.lang.String> baseHeaders, java.lang.String token, java.lang.String tokenType)Deprecated.will be removed in 1.3.0; useAuthSession(Map, String, String, String, String)instead.
-
AuthSession
public AuthSession(java.util.Map<java.lang.String,java.lang.String> baseHeaders, java.lang.String token, java.lang.String tokenType, java.lang.String credential, java.lang.String scope)
-
-
Method Detail
-
headers
public java.util.Map<java.lang.String,java.lang.String> headers()
-
token
public java.lang.String token()
-
tokenType
public java.lang.String tokenType()
-
expiresAtMillis
public java.lang.Long expiresAtMillis()
-
scope
public java.lang.String scope()
-
stopRefreshing
public void stopRefreshing()
-
credential
public java.lang.String credential()
-
empty
public static OAuth2Util.AuthSession empty()
A newOAuth2Util.AuthSessionwith empty headers.- Returns:
- A new
OAuth2Util.AuthSessionwith empty headers.
-
refresh
public Pair<java.lang.Integer,java.util.concurrent.TimeUnit> refresh(RESTClient client)
Attempt to refresh the session token using the token exchange flow.- Parameters:
client- a RESTClient- Returns:
- interval to wait before calling refresh again, or null if no refresh is needed
-
fromAccessToken
public static OAuth2Util.AuthSession fromAccessToken(RESTClient client, java.util.concurrent.ScheduledExecutorService executor, java.lang.String token, java.lang.Long defaultExpiresAtMillis, OAuth2Util.AuthSession parent)
-
fromCredential
public static OAuth2Util.AuthSession fromCredential(RESTClient client, java.util.concurrent.ScheduledExecutorService executor, java.lang.String credential, OAuth2Util.AuthSession parent)
-
fromTokenResponse
public static OAuth2Util.AuthSession fromTokenResponse(RESTClient client, java.util.concurrent.ScheduledExecutorService executor, OAuthTokenResponse response, long startTimeMillis, OAuth2Util.AuthSession parent)
-
fromTokenExchange
public static OAuth2Util.AuthSession fromTokenExchange(RESTClient client, java.util.concurrent.ScheduledExecutorService executor, java.lang.String token, java.lang.String tokenType, OAuth2Util.AuthSession parent)
-
-