use of alluxio.grpc.GrpcServer in project alluxio by Alluxio.
the class GrpcSecurityTest method testCustomAuthenticationFails.
@Test
public void testCustomAuthenticationFails() throws Exception {
mConfiguration.set(PropertyKey.SECURITY_AUTHENTICATION_TYPE, AuthType.CUSTOM.getAuthName());
mConfiguration.set(PropertyKey.SECURITY_AUTHENTICATION_CUSTOM_PROVIDER_CLASS, ExactlyMatchAuthenticationProvider.class.getName());
GrpcServer server = createServer(AuthType.CUSTOM);
try {
server.start();
GrpcChannelBuilder channelBuilder = GrpcChannelBuilder.newBuilder(getServerConnectAddress(server), mConfiguration);
mThrown.expect(UnauthenticatedException.class);
channelBuilder.setSubject(createSubject("fail", "fail")).build();
} finally {
server.shutdown();
}
}
use of alluxio.grpc.GrpcServer in project alluxio by Alluxio.
the class GrpcSecurityTest method testNoSaslAuthentication.
@Test
public void testNoSaslAuthentication() throws Exception {
GrpcServer server = createServer(AuthType.NOSASL);
try {
server.start();
GrpcChannelBuilder channelBuilder = GrpcChannelBuilder.newBuilder(getServerConnectAddress(server), mConfiguration);
channelBuilder.build();
} finally {
server.shutdown();
}
}
use of alluxio.grpc.GrpcServer in project alluxio by Alluxio.
the class GrpcSecurityTest method testAuthMismatch.
@Test
public void testAuthMismatch() throws Exception {
GrpcServer server = createServer(AuthType.NOSASL);
try {
server.start();
mConfiguration.set(PropertyKey.SECURITY_AUTHENTICATION_TYPE, AuthType.SIMPLE);
GrpcChannelBuilder channelBuilder = GrpcChannelBuilder.newBuilder(getServerConnectAddress(server), mConfiguration);
mThrown.expect(UnauthenticatedException.class);
channelBuilder.build();
} finally {
server.shutdown();
}
}
Aggregations