Package org.apache.iceberg.rest.auth
Class OAuth2Util
java.lang.Object
org.apache.iceberg.rest.auth.OAuth2Util
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Class to handle authorization headers and token refresh. -
Method Summary
Modifier and TypeMethodDescriptionauthHeaders
(String token) basicAuthHeaders
(String credential) buildOptionalParam
(Map<String, String> properties) static OAuthTokenResponse
exchangeToken
(RESTClient client, Map<String, String> headers, String subjectToken, String subjectTokenType, String actorToken, String actorTokenType, String scope) static OAuthTokenResponse
exchangeToken
(RESTClient client, Map<String, String> headers, String subjectToken, String subjectTokenType, String actorToken, String actorTokenType, String scope, String oauth2ServerUri) static OAuthTokenResponse
exchangeToken
(RESTClient client, Map<String, String> headers, String subjectToken, String subjectTokenType, String actorToken, String actorTokenType, String scope, String oauth2ServerUri, Map<String, String> optionalParams) static OAuthTokenResponse
fetchToken
(RESTClient client, Map<String, String> headers, String credential, String scope) static OAuthTokenResponse
fetchToken
(RESTClient client, Map<String, String> headers, String credential, String scope, String oauth2ServerUri) static OAuthTokenResponse
fetchToken
(RESTClient client, Map<String, String> headers, String credential, String scope, String oauth2ServerUri, Map<String, String> optionalParams) static boolean
isValidScopeToken
(String scopeToken) parseScope
(String scope) static OAuthTokenResponse
tokenResponseFromJson
(com.fasterxml.jackson.databind.JsonNode json) static OAuthTokenResponse
tokenResponseFromJson
(String json) static String
tokenResponseToJson
(OAuthTokenResponse response) static void
tokenResponseToJson
(OAuthTokenResponse response, com.fasterxml.jackson.core.JsonGenerator gen) static String
-
Method Details
-
authHeaders
-
basicAuthHeaders
-
isValidScopeToken
-
parseScope
-
toScope
-
buildOptionalParam
-
exchangeToken
-
exchangeToken
public static OAuthTokenResponse exchangeToken(RESTClient client, Map<String, String> headers, String subjectToken, String subjectTokenType, String actorToken, String actorTokenType, String scope) -
exchangeToken
-
fetchToken
-
fetchToken
public static OAuthTokenResponse fetchToken(RESTClient client, Map<String, String> headers, String credential, String scope) -
fetchToken
public static OAuthTokenResponse fetchToken(RESTClient client, Map<String, String> headers, String credential, String scope, String oauth2ServerUri) -
tokenResponseToJson
-
tokenResponseToJson
public static void tokenResponseToJson(OAuthTokenResponse response, com.fasterxml.jackson.core.JsonGenerator gen) throws IOException - Throws:
IOException
-
tokenResponseFromJson
-
tokenResponseFromJson
public static OAuthTokenResponse tokenResponseFromJson(com.fasterxml.jackson.databind.JsonNode json)
-