Search in sources :

Example 6 with ChannelState

use of org.apache.kafka.common.network.ChannelState in project kafka by apache.

the class SaslAuthenticatorTest method createAndCheckSslAuthenticationFailure.

private void createAndCheckSslAuthenticationFailure(SecurityProtocol securityProtocol, String node) throws Exception {
    ChannelState finalState = createAndCheckClientConnectionFailure(securityProtocol, node);
    Exception exception = finalState.exception();
    assertEquals(SslAuthenticationException.class, exception.getClass());
}
Also used : ChannelState(org.apache.kafka.common.network.ChannelState) UnsupportedCallbackException(javax.security.auth.callback.UnsupportedCallbackException) KafkaException(org.apache.kafka.common.KafkaException) SaslException(javax.security.sasl.SaslException) OAuthBearerIllegalTokenException(org.apache.kafka.common.security.oauthbearer.internals.unsecured.OAuthBearerIllegalTokenException) NoSuchAlgorithmException(java.security.NoSuchAlgorithmException) OAuthBearerConfigException(org.apache.kafka.common.security.oauthbearer.internals.unsecured.OAuthBearerConfigException) SaslAuthenticationException(org.apache.kafka.common.errors.SaslAuthenticationException) IOException(java.io.IOException) LoginException(javax.security.auth.login.LoginException) SchemaException(org.apache.kafka.common.protocol.types.SchemaException) SslAuthenticationException(org.apache.kafka.common.errors.SslAuthenticationException) SSLPeerUnverifiedException(javax.net.ssl.SSLPeerUnverifiedException)

Example 7 with ChannelState

use of org.apache.kafka.common.network.ChannelState in project kafka by apache.

the class SaslAuthenticatorFailureDelayTest method createAndCheckClientConnectionFailure.

private ChannelState createAndCheckClientConnectionFailure(SecurityProtocol securityProtocol, String node) throws Exception {
    createClientConnection(securityProtocol, node);
    ChannelState finalState = NetworkTestUtils.waitForChannelClose(selector, node, ChannelState.State.AUTHENTICATION_FAILED);
    selector.close();
    selector = null;
    return finalState;
}
Also used : ChannelState(org.apache.kafka.common.network.ChannelState)

Example 8 with ChannelState

use of org.apache.kafka.common.network.ChannelState in project kafka by apache.

the class MockSelector method serverAuthenticationFailed.

public void serverAuthenticationFailed(String id) {
    ChannelState authFailed = new ChannelState(ChannelState.State.AUTHENTICATION_FAILED, new AuthenticationException("Authentication failed"), null);
    this.disconnected.put(id, authFailed);
    close(id);
}
Also used : ChannelState(org.apache.kafka.common.network.ChannelState) AuthenticationException(org.apache.kafka.common.errors.AuthenticationException)

Aggregations

ChannelState (org.apache.kafka.common.network.ChannelState)8 IOException (java.io.IOException)4 SaslAuthenticationException (org.apache.kafka.common.errors.SaslAuthenticationException)4 NoSuchAlgorithmException (java.security.NoSuchAlgorithmException)3 KafkaException (org.apache.kafka.common.KafkaException)3 SSLPeerUnverifiedException (javax.net.ssl.SSLPeerUnverifiedException)2 UnsupportedCallbackException (javax.security.auth.callback.UnsupportedCallbackException)2 LoginException (javax.security.auth.login.LoginException)2 SaslException (javax.security.sasl.SaslException)2 SslAuthenticationException (org.apache.kafka.common.errors.SslAuthenticationException)2 SchemaException (org.apache.kafka.common.protocol.types.SchemaException)2 OAuthBearerConfigException (org.apache.kafka.common.security.oauthbearer.internals.unsecured.OAuthBearerConfigException)2 OAuthBearerIllegalTokenException (org.apache.kafka.common.security.oauthbearer.internals.unsecured.OAuthBearerIllegalTokenException)2 AuthenticationException (org.apache.kafka.common.errors.AuthenticationException)1