Package org.apache.iceberg.rest.auth
Class OAuth2Util
- java.lang.Object
-
- org.apache.iceberg.rest.auth.OAuth2Util
-
public class OAuth2Util extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
OAuth2Util.AuthSession
Class to handle authorization headers and token refresh.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.Map<java.lang.String,java.lang.String>
authHeaders(java.lang.String token)
static java.util.Map<java.lang.String,java.lang.String>
basicAuthHeaders(java.lang.String credential)
static OAuthTokenResponse
exchangeToken(RESTClient client, java.util.Map<java.lang.String,java.lang.String> headers, java.lang.String subjectToken, java.lang.String subjectTokenType, java.lang.String actorToken, java.lang.String actorTokenType, java.lang.String scope)
static OAuthTokenResponse
exchangeToken(RESTClient client, java.util.Map<java.lang.String,java.lang.String> headers, java.lang.String subjectToken, java.lang.String subjectTokenType, java.lang.String actorToken, java.lang.String actorTokenType, java.lang.String scope, java.lang.String oauth2ServerUri)
static OAuthTokenResponse
fetchToken(RESTClient client, java.util.Map<java.lang.String,java.lang.String> headers, java.lang.String credential, java.lang.String scope)
static OAuthTokenResponse
fetchToken(RESTClient client, java.util.Map<java.lang.String,java.lang.String> headers, java.lang.String credential, java.lang.String scope, java.lang.String oauth2ServerUri)
static boolean
isValidScopeToken(java.lang.String scopeToken)
static java.util.List<java.lang.String>
parseScope(java.lang.String scope)
static OAuthTokenResponse
tokenResponseFromJson(com.fasterxml.jackson.databind.JsonNode json)
static OAuthTokenResponse
tokenResponseFromJson(java.lang.String json)
static java.lang.String
tokenResponseToJson(OAuthTokenResponse response)
static void
tokenResponseToJson(OAuthTokenResponse response, com.fasterxml.jackson.core.JsonGenerator gen)
static java.lang.String
toScope(java.lang.Iterable<java.lang.String> scopes)
-
-
-
Method Detail
-
authHeaders
public static java.util.Map<java.lang.String,java.lang.String> authHeaders(java.lang.String token)
-
basicAuthHeaders
public static java.util.Map<java.lang.String,java.lang.String> basicAuthHeaders(java.lang.String credential)
-
isValidScopeToken
public static boolean isValidScopeToken(java.lang.String scopeToken)
-
parseScope
public static java.util.List<java.lang.String> parseScope(java.lang.String scope)
-
toScope
public static java.lang.String toScope(java.lang.Iterable<java.lang.String> scopes)
-
exchangeToken
public static OAuthTokenResponse exchangeToken(RESTClient client, java.util.Map<java.lang.String,java.lang.String> headers, java.lang.String subjectToken, java.lang.String subjectTokenType, java.lang.String actorToken, java.lang.String actorTokenType, java.lang.String scope, java.lang.String oauth2ServerUri)
-
exchangeToken
public static OAuthTokenResponse exchangeToken(RESTClient client, java.util.Map<java.lang.String,java.lang.String> headers, java.lang.String subjectToken, java.lang.String subjectTokenType, java.lang.String actorToken, java.lang.String actorTokenType, java.lang.String scope)
-
fetchToken
public static OAuthTokenResponse fetchToken(RESTClient client, java.util.Map<java.lang.String,java.lang.String> headers, java.lang.String credential, java.lang.String scope, java.lang.String oauth2ServerUri)
-
fetchToken
public static OAuthTokenResponse fetchToken(RESTClient client, java.util.Map<java.lang.String,java.lang.String> headers, java.lang.String credential, java.lang.String scope)
-
tokenResponseToJson
public static java.lang.String tokenResponseToJson(OAuthTokenResponse response)
-
tokenResponseToJson
public static void tokenResponseToJson(OAuthTokenResponse response, com.fasterxml.jackson.core.JsonGenerator gen) throws java.io.IOException
- Throws:
java.io.IOException
-
tokenResponseFromJson
public static OAuthTokenResponse tokenResponseFromJson(java.lang.String json)
-
tokenResponseFromJson
public static OAuthTokenResponse tokenResponseFromJson(com.fasterxml.jackson.databind.JsonNode json)
-
-