Skip to content
Open
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 @@ -73,7 +73,8 @@ public boolean isLoginPossible() throws IOException {
return true;
}
} else {
throwProxyUserNotSupported();
LOG.debug("Login from ProxyUser");
return true;
}

LOG.debug("Login is NOT possible");
Expand All @@ -95,14 +96,11 @@ public void doLogin() throws IOException {
UserGroupInformation.loginUserFromSubject(null);
LOG.info("Loaded user's ticket cache successfully");
} else {
throwProxyUserNotSupported();
// Proxy user: credentials are already provided by the proxy mechanism.
LOG.debug("Skipping Kerberos login for proxy user");
}
}

private void throwProxyUserNotSupported() {
throw new UnsupportedOperationException("Proxy user is not supported");
}

public static boolean isProxyUser(UserGroupInformation ugi) {
return ugi.getAuthenticationMethod() == UserGroupInformation.AuthenticationMethod.PROXY;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@
import static org.apache.paimon.security.SecurityConfiguration.KERBEROS_LOGIN_PRINCIPAL;
import static org.apache.paimon.security.SecurityConfiguration.KERBEROS_LOGIN_USETICKETCACHE;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.mockStatic;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.when;

/**
Expand Down Expand Up @@ -108,7 +108,7 @@
}

@Test
public void isLoginPossibleMustThrowExceptionWithProxyUser() {
public void isLoginPossibleMustReturnTrueWithProxyUser() {
Options options = new Options();
KerberosLoginProvider kerberosLoginProvider = new KerberosLoginProvider(options);

Expand All @@ -119,8 +119,7 @@
ugi.when(UserGroupInformation::isSecurityEnabled).thenReturn(true);
ugi.when(UserGroupInformation::getCurrentUser).thenReturn(userGroupInformation);

assertThatThrownBy(kerberosLoginProvider::isLoginPossible)
.isInstanceOf(UnsupportedOperationException.class);
assertThat(kerberosLoginProvider.isLoginPossible()).isTrue();
}
}

Expand Down Expand Up @@ -158,7 +157,7 @@
}

@Test
public void doLoginMustThrowExceptionWithProxyUser() {
public void doLoginMustDoNothingWithProxyUser() {
Options options = new Options();
KerberosLoginProvider kerberosLoginProvider = new KerberosLoginProvider(options);

Expand All @@ -168,8 +167,12 @@
.thenReturn(UserGroupInformation.AuthenticationMethod.PROXY);
ugi.when(UserGroupInformation::getCurrentUser).thenReturn(userGroupInformation);

assertThatThrownBy(kerberosLoginProvider::doLogin)
.isInstanceOf(UnsupportedOperationException.class);
// proxy user should not trigger any Kerberos login
kerberosLoginProvider.doLogin();
ugi.verify(() -> UserGroupInformation.loginUserFromSubject(null), never());

Check failure on line 172 in paimon-common/src/test/java/org/apache/paimon/security/KerberosLoginProviderITCase.java

View workflow job for this annotation

GitHub Actions / build

incompatible types: incompatible parameter types in lambda expression

Check failure on line 172 in paimon-common/src/test/java/org/apache/paimon/security/KerberosLoginProviderITCase.java

View workflow job for this annotation

GitHub Actions / build

incompatible types: incompatible parameter types in lambda expression

Check failure on line 172 in paimon-common/src/test/java/org/apache/paimon/security/KerberosLoginProviderITCase.java

View workflow job for this annotation

GitHub Actions / build_test

incompatible types: incompatible parameter types in lambda expression

Check failure on line 172 in paimon-common/src/test/java/org/apache/paimon/security/KerberosLoginProviderITCase.java

View workflow job for this annotation

GitHub Actions / build_test

incompatible types: incompatible parameter types in lambda expression

Check failure on line 172 in paimon-common/src/test/java/org/apache/paimon/security/KerberosLoginProviderITCase.java

View workflow job for this annotation

GitHub Actions / build

incompatible types: incompatible parameter types in lambda expression

Check failure on line 172 in paimon-common/src/test/java/org/apache/paimon/security/KerberosLoginProviderITCase.java

View workflow job for this annotation

GitHub Actions / build

incompatible types: incompatible parameter types in lambda expression

Check failure on line 172 in paimon-common/src/test/java/org/apache/paimon/security/KerberosLoginProviderITCase.java

View workflow job for this annotation

GitHub Actions / build_test

incompatible types: incompatible parameter types in lambda expression

Check failure on line 172 in paimon-common/src/test/java/org/apache/paimon/security/KerberosLoginProviderITCase.java

View workflow job for this annotation

GitHub Actions / build_test

incompatible types: incompatible parameter types in lambda expression

Check failure on line 172 in paimon-common/src/test/java/org/apache/paimon/security/KerberosLoginProviderITCase.java

View workflow job for this annotation

GitHub Actions / build_test

incompatible types: incompatible parameter types in lambda expression

Check failure on line 172 in paimon-common/src/test/java/org/apache/paimon/security/KerberosLoginProviderITCase.java

View workflow job for this annotation

GitHub Actions / build_test

incompatible types: incompatible parameter types in lambda expression

Check failure on line 172 in paimon-common/src/test/java/org/apache/paimon/security/KerberosLoginProviderITCase.java

View workflow job for this annotation

GitHub Actions / build_test (1.20)

incompatible types: incompatible parameter types in lambda expression

Check failure on line 172 in paimon-common/src/test/java/org/apache/paimon/security/KerberosLoginProviderITCase.java

View workflow job for this annotation

GitHub Actions / build_test (1.20)

incompatible types: incompatible parameter types in lambda expression

Check failure on line 172 in paimon-common/src/test/java/org/apache/paimon/security/KerberosLoginProviderITCase.java

View workflow job for this annotation

GitHub Actions / build_test

incompatible types: incompatible parameter types in lambda expression

Check failure on line 172 in paimon-common/src/test/java/org/apache/paimon/security/KerberosLoginProviderITCase.java

View workflow job for this annotation

GitHub Actions / build_test

incompatible types: incompatible parameter types in lambda expression

Check failure on line 172 in paimon-common/src/test/java/org/apache/paimon/security/KerberosLoginProviderITCase.java

View workflow job for this annotation

GitHub Actions / build

incompatible types: incompatible parameter types in lambda expression

Check failure on line 172 in paimon-common/src/test/java/org/apache/paimon/security/KerberosLoginProviderITCase.java

View workflow job for this annotation

GitHub Actions / build

incompatible types: incompatible parameter types in lambda expression

Check failure on line 172 in paimon-common/src/test/java/org/apache/paimon/security/KerberosLoginProviderITCase.java

View workflow job for this annotation

GitHub Actions / eslib_test

incompatible types: incompatible parameter types in lambda expression

Check failure on line 172 in paimon-common/src/test/java/org/apache/paimon/security/KerberosLoginProviderITCase.java

View workflow job for this annotation

GitHub Actions / eslib_test

incompatible types: incompatible parameter types in lambda expression

Check failure on line 172 in paimon-common/src/test/java/org/apache/paimon/security/KerberosLoginProviderITCase.java

View workflow job for this annotation

GitHub Actions / build_test (2.2)

incompatible types: incompatible parameter types in lambda expression

Check failure on line 172 in paimon-common/src/test/java/org/apache/paimon/security/KerberosLoginProviderITCase.java

View workflow job for this annotation

GitHub Actions / build_test (2.2)

incompatible types: incompatible parameter types in lambda expression

Check failure on line 172 in paimon-common/src/test/java/org/apache/paimon/security/KerberosLoginProviderITCase.java

View workflow job for this annotation

GitHub Actions / build_test (2.13)

incompatible types: incompatible parameter types in lambda expression

Check failure on line 172 in paimon-common/src/test/java/org/apache/paimon/security/KerberosLoginProviderITCase.java

View workflow job for this annotation

GitHub Actions / build_test (2.13)

incompatible types: incompatible parameter types in lambda expression

Check failure on line 172 in paimon-common/src/test/java/org/apache/paimon/security/KerberosLoginProviderITCase.java

View workflow job for this annotation

GitHub Actions / build

incompatible types: incompatible parameter types in lambda expression

Check failure on line 172 in paimon-common/src/test/java/org/apache/paimon/security/KerberosLoginProviderITCase.java

View workflow job for this annotation

GitHub Actions / build

incompatible types: incompatible parameter types in lambda expression

Check failure on line 172 in paimon-common/src/test/java/org/apache/paimon/security/KerberosLoginProviderITCase.java

View workflow job for this annotation

GitHub Actions / build_test (2.12)

incompatible types: incompatible parameter types in lambda expression

Check failure on line 172 in paimon-common/src/test/java/org/apache/paimon/security/KerberosLoginProviderITCase.java

View workflow job for this annotation

GitHub Actions / build_test (2.12)

incompatible types: incompatible parameter types in lambda expression
ugi.verify(
() -> UserGroupInformation.loginUserFromKeytab(anyString(), anyString()),

Check failure on line 174 in paimon-common/src/test/java/org/apache/paimon/security/KerberosLoginProviderITCase.java

View workflow job for this annotation

GitHub Actions / build

incompatible types: incompatible parameter types in lambda expression

Check failure on line 174 in paimon-common/src/test/java/org/apache/paimon/security/KerberosLoginProviderITCase.java

View workflow job for this annotation

GitHub Actions / build

incompatible types: incompatible parameter types in lambda expression

Check failure on line 174 in paimon-common/src/test/java/org/apache/paimon/security/KerberosLoginProviderITCase.java

View workflow job for this annotation

GitHub Actions / build_test

incompatible types: incompatible parameter types in lambda expression

Check failure on line 174 in paimon-common/src/test/java/org/apache/paimon/security/KerberosLoginProviderITCase.java

View workflow job for this annotation

GitHub Actions / build_test

incompatible types: incompatible parameter types in lambda expression

Check failure on line 174 in paimon-common/src/test/java/org/apache/paimon/security/KerberosLoginProviderITCase.java

View workflow job for this annotation

GitHub Actions / build

incompatible types: incompatible parameter types in lambda expression

Check failure on line 174 in paimon-common/src/test/java/org/apache/paimon/security/KerberosLoginProviderITCase.java

View workflow job for this annotation

GitHub Actions / build

incompatible types: incompatible parameter types in lambda expression

Check failure on line 174 in paimon-common/src/test/java/org/apache/paimon/security/KerberosLoginProviderITCase.java

View workflow job for this annotation

GitHub Actions / build_test

incompatible types: incompatible parameter types in lambda expression

Check failure on line 174 in paimon-common/src/test/java/org/apache/paimon/security/KerberosLoginProviderITCase.java

View workflow job for this annotation

GitHub Actions / build_test

incompatible types: incompatible parameter types in lambda expression

Check failure on line 174 in paimon-common/src/test/java/org/apache/paimon/security/KerberosLoginProviderITCase.java

View workflow job for this annotation

GitHub Actions / build_test

incompatible types: incompatible parameter types in lambda expression

Check failure on line 174 in paimon-common/src/test/java/org/apache/paimon/security/KerberosLoginProviderITCase.java

View workflow job for this annotation

GitHub Actions / build_test

incompatible types: incompatible parameter types in lambda expression

Check failure on line 174 in paimon-common/src/test/java/org/apache/paimon/security/KerberosLoginProviderITCase.java

View workflow job for this annotation

GitHub Actions / build_test (1.20)

incompatible types: incompatible parameter types in lambda expression

Check failure on line 174 in paimon-common/src/test/java/org/apache/paimon/security/KerberosLoginProviderITCase.java

View workflow job for this annotation

GitHub Actions / build_test (1.20)

incompatible types: incompatible parameter types in lambda expression

Check failure on line 174 in paimon-common/src/test/java/org/apache/paimon/security/KerberosLoginProviderITCase.java

View workflow job for this annotation

GitHub Actions / build_test

incompatible types: incompatible parameter types in lambda expression

Check failure on line 174 in paimon-common/src/test/java/org/apache/paimon/security/KerberosLoginProviderITCase.java

View workflow job for this annotation

GitHub Actions / build_test

incompatible types: incompatible parameter types in lambda expression

Check failure on line 174 in paimon-common/src/test/java/org/apache/paimon/security/KerberosLoginProviderITCase.java

View workflow job for this annotation

GitHub Actions / build

incompatible types: incompatible parameter types in lambda expression

Check failure on line 174 in paimon-common/src/test/java/org/apache/paimon/security/KerberosLoginProviderITCase.java

View workflow job for this annotation

GitHub Actions / build

incompatible types: incompatible parameter types in lambda expression

Check failure on line 174 in paimon-common/src/test/java/org/apache/paimon/security/KerberosLoginProviderITCase.java

View workflow job for this annotation

GitHub Actions / eslib_test

incompatible types: incompatible parameter types in lambda expression

Check failure on line 174 in paimon-common/src/test/java/org/apache/paimon/security/KerberosLoginProviderITCase.java

View workflow job for this annotation

GitHub Actions / eslib_test

incompatible types: incompatible parameter types in lambda expression

Check failure on line 174 in paimon-common/src/test/java/org/apache/paimon/security/KerberosLoginProviderITCase.java

View workflow job for this annotation

GitHub Actions / build_test (2.2)

incompatible types: incompatible parameter types in lambda expression

Check failure on line 174 in paimon-common/src/test/java/org/apache/paimon/security/KerberosLoginProviderITCase.java

View workflow job for this annotation

GitHub Actions / build_test (2.2)

incompatible types: incompatible parameter types in lambda expression

Check failure on line 174 in paimon-common/src/test/java/org/apache/paimon/security/KerberosLoginProviderITCase.java

View workflow job for this annotation

GitHub Actions / build_test (2.13)

incompatible types: incompatible parameter types in lambda expression

Check failure on line 174 in paimon-common/src/test/java/org/apache/paimon/security/KerberosLoginProviderITCase.java

View workflow job for this annotation

GitHub Actions / build_test (2.13)

incompatible types: incompatible parameter types in lambda expression

Check failure on line 174 in paimon-common/src/test/java/org/apache/paimon/security/KerberosLoginProviderITCase.java

View workflow job for this annotation

GitHub Actions / build

incompatible types: incompatible parameter types in lambda expression

Check failure on line 174 in paimon-common/src/test/java/org/apache/paimon/security/KerberosLoginProviderITCase.java

View workflow job for this annotation

GitHub Actions / build

incompatible types: incompatible parameter types in lambda expression

Check failure on line 174 in paimon-common/src/test/java/org/apache/paimon/security/KerberosLoginProviderITCase.java

View workflow job for this annotation

GitHub Actions / build_test (2.12)

incompatible types: incompatible parameter types in lambda expression

Check failure on line 174 in paimon-common/src/test/java/org/apache/paimon/security/KerberosLoginProviderITCase.java

View workflow job for this annotation

GitHub Actions / build_test (2.12)

incompatible types: incompatible parameter types in lambda expression
never());
}
}
}
Loading