Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ public static AuthManager loadAuthManager(String name, Map<String, String> prope
case AuthProperties.AUTH_TYPE_SIGV4:
impl = AuthProperties.AUTH_MANAGER_IMPL_SIGV4;
break;
case AuthProperties.AUTH_TYPE_GOOGLE:
impl = AuthProperties.AUTH_MANAGER_IMPL_GOOGLE;
break;
case AuthProperties.AUTH_TYPE_OAUTH2:
impl = AuthProperties.AUTH_MANAGER_IMPL_OAUTH2;
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ private AuthProperties() {}
public static final String AUTH_TYPE_BASIC = "basic";
public static final String AUTH_TYPE_OAUTH2 = "oauth2";
public static final String AUTH_TYPE_SIGV4 = "sigv4";
public static final String AUTH_TYPE_GOOGLE = "google";

public static final String AUTH_MANAGER_IMPL_NONE =
"org.apache.iceberg.rest.auth.NoopAuthManager";
Expand All @@ -37,6 +38,8 @@ private AuthProperties() {}
"org.apache.iceberg.rest.auth.OAuth2Manager";
public static final String AUTH_MANAGER_IMPL_SIGV4 =
"org.apache.iceberg.aws.RESTSigV4AuthManager";
public static final String AUTH_MANAGER_IMPL_GOOGLE =
"org.apache.iceberg.gcp.auth.GoogleAuthManager";

public static final String BASIC_USERNAME = "rest.auth.basic.username";
public static final String BASIC_PASSWORD = "rest.auth.basic.password";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@
import org.apache.iceberg.relocated.com.google.common.collect.ImmutableList;
import org.apache.iceberg.relocated.com.google.common.collect.ImmutableMap;
import org.apache.iceberg.rest.RESTClient;
import org.apache.iceberg.rest.auth.AuthManager;
import org.apache.iceberg.rest.auth.AuthManagers;
import org.apache.iceberg.rest.auth.AuthProperties;
import org.apache.iceberg.rest.auth.AuthSession;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
Expand Down Expand Up @@ -190,4 +193,12 @@ public void initSessionDelegatesToCatalogSession() {
assertThat(resultSession).isSameAs(mockSession);
verify(spyManager).catalogSession(restClient, props);
}

@Test
public void testLoadAuthManager() {
AuthManager manager =
AuthManagers.loadAuthManager(
"test", Map.of(AuthProperties.AUTH_TYPE, AuthProperties.AUTH_TYPE_GOOGLE));
assertThat(manager).isInstanceOf(GoogleAuthManager.class);
}
}