Class KafkaChannelTest

java.lang.Object
org.apache.kafka.common.network.KafkaChannelTest

public class KafkaChannelTest extends Object
  • Field Details

    • CHANNEL_ID

      public static final String CHANNEL_ID
      See Also:
    • MAX_RECEIVE_SIZE

      public static final int MAX_RECEIVE_SIZE
      See Also:
    • METADATA_REGISTRY

      public static final org.apache.kafka.common.network.ChannelMetadataRegistry METADATA_REGISTRY
    • POOL

      public static final org.apache.kafka.common.memory.MemoryPool POOL
    • TRANSPORT

      public static final org.apache.kafka.common.network.TransportLayer TRANSPORT
    • AUTHENTICATOR

      public static final org.apache.kafka.common.network.Authenticator AUTHENTICATOR
    • SSL_TRANSPORT_LAYER

      public static final org.apache.kafka.common.network.SslTransportLayer SSL_TRANSPORT_LAYER
    • SASL_SERVER_AUTHENTICATOR

      public static final org.apache.kafka.common.security.authenticator.SaslServerAuthenticator SASL_SERVER_AUTHENTICATOR
    • PROXY_TLV_PROVIDER

      public static final org.apache.kafka.common.network.ProxyTlvProvider PROXY_TLV_PROVIDER
    • MOCK_TIME

      public static final org.apache.kafka.common.utils.Time MOCK_TIME
    • LOG_CONTEXT

      public static final org.apache.kafka.common.utils.internals.LogContext LOG_CONTEXT
    • KAFKA_CHANNEL

      public static final org.apache.kafka.common.network.KafkaChannel KAFKA_CHANNEL
    • BROKER_PREFIX

      public static final String BROKER_PREFIX
      See Also:
    • RAW_SNI_HOST_NAME

      public static final SNIHostName RAW_SNI_HOST_NAME
    • SNI_HOST_NAME

      public static final org.apache.kafka.common.security.authenticator.PathAwareSniHostName SNI_HOST_NAME
    • SNI_HOST_NAME_WITH_LKC

      public static final SNIHostName SNI_HOST_NAME_WITH_LKC
    • SNI_HOST_NAME_WITH_LKC_ID

      public static final String SNI_HOST_NAME_WITH_LKC_ID
    • LKC_PROXY_ID

      public static final String LKC_PROXY_ID
      See Also:
    • SNI_HOST_NAME_WITH_PKC_STRING

      public static final String SNI_HOST_NAME_WITH_PKC_STRING
      See Also:
    • SNI_HOST_NAME_WITH_PKC

      public static final SNIHostName SNI_HOST_NAME_WITH_PKC
    • INVALID_SNI_HOST_NAME_STRING

      public static final String INVALID_SNI_HOST_NAME_STRING
      See Also:
    • INVALID_SNI_HOST_NAME

      public static final SNIHostName INVALID_SNI_HOST_NAME
    • INVALID_SNI_HOST_NAME_UPPER_CASE

      public static final SNIHostName INVALID_SNI_HOST_NAME_UPPER_CASE
    • VALID_SNI_HOST_NAMES_EXCLUDE_SUFFIX

      public static final String VALID_SNI_HOST_NAMES_EXCLUDE_SUFFIX
      See Also:
    • AUTHENTICATION_ID

      public static final String AUTHENTICATION_ID
      See Also:
    • VALID_SNI_HOSTNAMES

      public static final List<String> VALID_SNI_HOSTNAMES
    • LOOPBACK_SOCKET_ADDRESS

      public static final InetAddress LOOPBACK_SOCKET_ADDRESS
  • Constructor Details

    • KafkaChannelTest

      public KafkaChannelTest()
  • Method Details

    • setUp

      @BeforeEach public void setUp()
    • tearDown

      @AfterEach public void tearDown()
    • testPrepareSetSniHostName

      @Test public void testPrepareSetSniHostName() throws IOException
      Throws:
      IOException
    • testPrepareSetLkcId

      @Test public void testPrepareSetLkcId() throws IOException
      Throws:
      IOException
    • testChannelLkcIdFromProxyProtocol

      @Test public void testChannelLkcIdFromProxyProtocol() throws IOException
      Throws:
      IOException
    • testChannelWithValidSniHostname

      @Test public void testChannelWithValidSniHostname() throws IOException
      Throws:
      IOException
    • testChannelWithInvalidSniHostname

      @Test public void testChannelWithInvalidSniHostname() throws IOException
      Throws:
      IOException
    • testChannelWithInvalidSniHostnameUpperCase

      @Test public void testChannelWithInvalidSniHostnameUpperCase() throws IOException
      Throws:
      IOException
    • testChannelWithEmptySniHostname

      @Test public void testChannelWithEmptySniHostname() throws IOException
      Throws:
      IOException
    • testChannelWithInvalidSniHostnameAndValidSniHostNamesExcludeSuffix

      @Test public void testChannelWithInvalidSniHostnameAndValidSniHostNamesExcludeSuffix() throws IOException
      Throws:
      IOException
    • testChannelWithUnparseableSniHostname

      @Test public void testChannelWithUnparseableSniHostname() throws IOException
      Throws:
      IOException
    • testFqdnPropertiesFromProxyProtocolV2

      @Test public void testFqdnPropertiesFromProxyProtocolV2() throws IOException
      Throws:
      IOException
    • testChannelLkcIdFromSniHeader

      @Test public void testChannelLkcIdFromSniHeader() throws IOException
      Throws:
      IOException
    • testInetAddressToTenantMap

      @Test public void testInetAddressToTenantMap() throws IOException
      Throws:
      IOException
    • testInetAddressToAPIKeyMap

      @Test public void testInetAddressToAPIKeyMap() throws IOException
      Throws:
      IOException
    • testSending

      @Test public void testSending() throws IOException
      Throws:
      IOException
    • testReceiving

      @Test public void testReceiving() throws IOException
      Throws:
      IOException
    • testChannelTotalServiceTimeMetrics

      @Test public void testChannelTotalServiceTimeMetrics() throws IOException
      Throws:
      IOException
    • testReportClientInformation

      @Test public void testReportClientInformation()
    • testSocketAddressWithoutProxyProtocol

      @Test public void testSocketAddressWithoutProxyProtocol() throws IOException
      Throws:
      IOException
    • testSocketAddressWithLat

      @Test public void testSocketAddressWithLat() throws IOException
      Throws:
      IOException
    • testSocketAddressWithProxyProtocol

      @Test public void testSocketAddressWithProxyProtocol() throws IOException
      Throws:
      IOException
    • testUnreadableSocket

      @ParameterizedTest @EnumSource(value=org.apache.kafka.common.network.ProxyProtocol.class, names={"V1","V2","COMBINED"}) public void testUnreadableSocket(org.apache.kafka.common.network.ProxyProtocol proxyProtocolEngineType) throws IOException
      Throws:
      IOException
    • testRequestSequenceId

      @Test public void testRequestSequenceId() throws IOException
      Throws:
      IOException
    • testOneRequestLogPerConnection

      @Test public void testOneRequestLogPerConnection() throws IOException
      Throws:
      IOException
    • testPrepareSniParsingWithSslAuthenticator

      @Test public void testPrepareSniParsingWithSslAuthenticator() throws IOException
      Throws:
      IOException
    • testPrepareSniPassedToSslAuthenticator

      @Test public void testPrepareSniPassedToSslAuthenticator() throws IOException
      Throws:
      IOException
    • testPrepareSniNotPassedWhenDisabled

      @Test public void testPrepareSniNotPassedWhenDisabled() throws IOException
      Throws:
      IOException
    • testPrepareSniParsingDisabledWithSslAuthenticator

      @Test public void testPrepareSniParsingDisabledWithSslAuthenticator() throws IOException
      Throws:
      IOException
    • testPrepareNoSniWithSslAuthenticatorNotEnforced

      @Test public void testPrepareNoSniWithSslAuthenticatorNotEnforced() throws IOException
      Throws:
      IOException
    • testLkcIdFromProxyNotSetForSslAuthenticator

      @Test public void testLkcIdFromProxyNotSetForSslAuthenticator() throws IOException
      Throws:
      IOException
    • testSaslPathInvalidSniRejectedThrows

      @Test public void testSaslPathInvalidSniRejectedThrows()
    • testSaslPathInvalidSniExemptTenantNotRejected

      @Test public void testSaslPathInvalidSniExemptTenantNotRejected() throws IOException
      Throws:
      IOException
    • testSaslPathMissingSniRejectedThrows

      @Test public void testSaslPathMissingSniRejectedThrows()
    • testSaslPathMissingSniExemptTenantNotRejected

      @Test public void testSaslPathMissingSniExemptTenantNotRejected() throws IOException
      Throws:
      IOException
    • testSaslPathAuthFailureTakesPrecedenceOverSniRejection

      @Test public void testSaslPathAuthFailureTakesPrecedenceOverSniRejection() throws IOException
      Throws:
      IOException
    • testIsMTlsAuthenticatedDefaultFalse

      @Test public void testIsMTlsAuthenticatedDefaultFalse()
    • testIsMTlsAuthenticatedWhenToggleMTlsEnabled

      @ParameterizedTest(name="{displayName}.mtls_enabled={0}") @ValueSource(booleans={true,false}) public void testIsMTlsAuthenticatedWhenToggleMTlsEnabled(boolean mTlsEnabled) throws IOException
      Throws:
      IOException
    • testGetClientCertExpirationMsDefaultValue

      @Test public void testGetClientCertExpirationMsDefaultValue()
    • testGetClientCertExpirationMsWithMTlsCert

      @Test public void testGetClientCertExpirationMsWithMTlsCert() throws Exception
      Throws:
      Exception
    • testGetClientCertExpirationMsWithSslPeerUnverified

      @Test public void testGetClientCertExpirationMsWithSslPeerUnverified() throws Exception
      Throws:
      Exception
    • testGetClientCertExpirationMsWithNonMTls

      @Test public void testGetClientCertExpirationMsWithNonMTls() throws IOException
      Throws:
      IOException
    • testPrepareWithAltLkcResolverNull

      @Test public void testPrepareWithAltLkcResolverNull() throws IOException
      Throws:
      IOException
    • testPrepareWithAltLkcResolverReturnsLkc

      @Test public void testPrepareWithAltLkcResolverReturnsLkc() throws IOException
      Throws:
      IOException
    • testPrepareWithAltLkcResolverReturnsNull

      @Test public void testPrepareWithAltLkcResolverReturnsNull() throws IOException
      Throws:
      IOException
    • testPrepareWithAltLkcResolverThrowsException

      @Test public void testPrepareWithAltLkcResolverThrowsException()
    • testPrepareWithAltLkcResolverReceivesCorrectHostname

      @Test public void testPrepareWithAltLkcResolverReceivesCorrectHostname() throws IOException
      Throws:
      IOException
    • testReverseChannelPreservesAltLkcResolver

      @Test public void testReverseChannelPreservesAltLkcResolver() throws Exception
      Throws:
      Exception