Class MultiTenantRequestContext

java.lang.Object
org.apache.kafka.common.requests.RequestContext
io.confluent.kafka.multitenant.MultiTenantRequestContext
All Implemented Interfaces:
org.apache.kafka.server.authorizer.AuthorizableRequestContext

public class MultiTenantRequestContext extends org.apache.kafka.common.requests.RequestContext
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.apache.kafka.common.requests.RequestContext

    org.apache.kafka.common.requests.RequestContext.ResponseSend
  • Field Summary

    Fields inherited from class org.apache.kafka.common.requests.RequestContext

    authenticationContext, clientAddress, clientInformation, clientPort, connectionId, fromPrivilegedListener, header, k2RequestContext, listenerName, principal, principalSerde, produceConsumeAuditLogTracker, securityProtocol, shouldLogForConnection, sniHostName
  • Constructor Summary

    Constructors
    Constructor
    Description
    MultiTenantRequestContext(org.apache.kafka.common.requests.RequestHeader header, String connectionId, long requestId, InetAddress clientAddress, Optional<Integer> clientPort, io.confluent.kafka.multitenant.MultiTenantPrincipal principal, org.apache.kafka.common.network.ListenerName listenerName, org.apache.kafka.common.security.auth.SecurityProtocol securityProtocol, org.apache.kafka.common.network.ClientInformation clientInformation, org.apache.kafka.common.security.authenticator.PathAwareSniHostName sniHostName, org.apache.kafka.common.utils.Time time, org.apache.kafka.common.metrics.Metrics metrics, TenantMetrics tenantMetrics, HotPartitionManager hotPartitionManager, MultiTenantInterceptorConfig config, Optional<org.apache.kafka.server.link.ClusterLinkSourceMetrics> clusterLinkSourceMetrics, boolean isPrivilegedListener, Optional<org.apache.kafka.common.security.auth.KafkaPrincipalSerde> principalSerde, org.apache.kafka.common.security.auth.AuthenticationContext authenticationContext, org.apache.kafka.common.network.ProduceConsumeAuditLogTracker produceConsumeAuditLogTracker, boolean isProxyModeLocal, org.apache.kafka.common.network.BrokerFqdnBuilder.FQDNPropertiesFromPPV2 fqdnPropertiesFromPpv2, String networkType, boolean shouldLogForConnection)
     
    MultiTenantRequestContext(org.apache.kafka.common.requests.RequestHeader header, String connectionId, long requestId, InetAddress clientAddress, Optional<Integer> clientPort, io.confluent.kafka.multitenant.MultiTenantPrincipal principal, org.apache.kafka.common.network.ListenerName listenerName, org.apache.kafka.common.security.auth.SecurityProtocol securityProtocol, org.apache.kafka.common.network.ClientInformation clientInformation, org.apache.kafka.common.security.authenticator.PathAwareSniHostName sniHostName, org.apache.kafka.common.utils.Time time, org.apache.kafka.common.metrics.Metrics metrics, TenantMetrics tenantMetrics, HotPartitionManager hotPartitionManager, MultiTenantInterceptorConfig config, Optional<org.apache.kafka.server.link.ClusterLinkSourceMetrics> clusterLinkSourceMetrics, boolean isPrivilegedListener, Optional<org.apache.kafka.common.security.auth.KafkaPrincipalSerde> principalSerde, org.apache.kafka.common.security.auth.AuthenticationContext authenticationContext, org.apache.kafka.common.network.ProduceConsumeAuditLogTracker produceConsumeAuditLogTracker, boolean isProxyModeLocal, org.apache.kafka.common.network.BrokerFqdnBuilder.FQDNPropertiesFromPPV2 fqdnPropertiesFromPpv2, String networkType, boolean shouldLogForConnection, org.apache.kafka.common.metrics.internals.ConfluentMetricsContextProvider confluentMetricsContextProvider, Optional<kafka.server.ClientRequestRateQuotaManager> requestRateQuotaManager)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.apache.kafka.common.requests.RequestContext.ResponseSend
    buildResponseSend(org.apache.kafka.common.requests.AbstractResponse body)
     
    org.apache.kafka.common.requests.AbstractResponse
    intercept(org.apache.kafka.common.requests.AbstractRequest request, int throttleTimeMs)
     
    boolean
     
    boolean
     
    static boolean
    isSupportedFFFClient(org.apache.kafka.common.requests.FetchRequest request, boolean fetchFromFollowerRequireLeaderEpochEnabled)
    The IS_SUPPORTED_FFF_CLIENT tag is set to false if client tries to use FetchFromFollower from KIP-392, but hasn't added CurrentLeaderEpoch to the FetchRequest that is introduced in KIP-320.
     
    org.apache.kafka.common.requests.AbstractResponse
    parsedResponse(org.apache.kafka.common.requests.AbstractResponse response, short version)
     
    org.apache.kafka.common.requests.RequestAndSize
    parseRequest(org.apache.kafka.common.protocol.Readable readable)
     
    boolean
     
     
    static org.apache.kafka.common.acl.AclBindingFilter
    transformAclFilter(String tenantPrefix, String prefixedWildcard, org.apache.kafka.common.acl.AclBindingFilter aclFilter)
     
    boolean
     

    Methods inherited from class org.apache.kafka.common.requests.RequestContext

    allBrokerZones, apiKey, apiVersion, brokerToGatewayZoneMapping, buildResponseEnvelopePayload, clientAddress, clientId, connectionId, controllerRequestPrincipal, correlationId, fqdnPropertiesFromPpv2, getClientAddress, getPrincipal, getPrincipalSerde, isProxyModeLocal, kafkaRequestId, listenerName, maybeEnableClusterLinkTenant, parseRequest, principal, quotaPrincipal, requestType, requestVersion, securityProtocol, sessionId, setAllBrokerZones, setBrokerToGatewayZoneMapping, sniHostName, toString

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.apache.kafka.server.authorizer.AuthorizableRequestContext

    clientAddressAsString
  • Constructor Details

    • MultiTenantRequestContext

      public MultiTenantRequestContext(org.apache.kafka.common.requests.RequestHeader header, String connectionId, long requestId, InetAddress clientAddress, Optional<Integer> clientPort, io.confluent.kafka.multitenant.MultiTenantPrincipal principal, org.apache.kafka.common.network.ListenerName listenerName, org.apache.kafka.common.security.auth.SecurityProtocol securityProtocol, org.apache.kafka.common.network.ClientInformation clientInformation, org.apache.kafka.common.security.authenticator.PathAwareSniHostName sniHostName, org.apache.kafka.common.utils.Time time, org.apache.kafka.common.metrics.Metrics metrics, TenantMetrics tenantMetrics, HotPartitionManager hotPartitionManager, MultiTenantInterceptorConfig config, Optional<org.apache.kafka.server.link.ClusterLinkSourceMetrics> clusterLinkSourceMetrics, boolean isPrivilegedListener, Optional<org.apache.kafka.common.security.auth.KafkaPrincipalSerde> principalSerde, org.apache.kafka.common.security.auth.AuthenticationContext authenticationContext, org.apache.kafka.common.network.ProduceConsumeAuditLogTracker produceConsumeAuditLogTracker, boolean isProxyModeLocal, org.apache.kafka.common.network.BrokerFqdnBuilder.FQDNPropertiesFromPPV2 fqdnPropertiesFromPpv2, String networkType, boolean shouldLogForConnection)
    • MultiTenantRequestContext

      public MultiTenantRequestContext(org.apache.kafka.common.requests.RequestHeader header, String connectionId, long requestId, InetAddress clientAddress, Optional<Integer> clientPort, io.confluent.kafka.multitenant.MultiTenantPrincipal principal, org.apache.kafka.common.network.ListenerName listenerName, org.apache.kafka.common.security.auth.SecurityProtocol securityProtocol, org.apache.kafka.common.network.ClientInformation clientInformation, org.apache.kafka.common.security.authenticator.PathAwareSniHostName sniHostName, org.apache.kafka.common.utils.Time time, org.apache.kafka.common.metrics.Metrics metrics, TenantMetrics tenantMetrics, HotPartitionManager hotPartitionManager, MultiTenantInterceptorConfig config, Optional<org.apache.kafka.server.link.ClusterLinkSourceMetrics> clusterLinkSourceMetrics, boolean isPrivilegedListener, Optional<org.apache.kafka.common.security.auth.KafkaPrincipalSerde> principalSerde, org.apache.kafka.common.security.auth.AuthenticationContext authenticationContext, org.apache.kafka.common.network.ProduceConsumeAuditLogTracker produceConsumeAuditLogTracker, boolean isProxyModeLocal, org.apache.kafka.common.network.BrokerFqdnBuilder.FQDNPropertiesFromPPV2 fqdnPropertiesFromPpv2, String networkType, boolean shouldLogForConnection, org.apache.kafka.common.metrics.internals.ConfluentMetricsContextProvider confluentMetricsContextProvider, Optional<kafka.server.ClientRequestRateQuotaManager> requestRateQuotaManager)
  • Method Details

    • tenantPrefix

      public Optional<String> tenantPrefix()
      Specified by:
      tenantPrefix in interface org.apache.kafka.server.authorizer.AuthorizableRequestContext
      Overrides:
      tenantPrefix in class org.apache.kafka.common.requests.RequestContext
    • isPpv2EndpointSchemeEnabled

      public boolean isPpv2EndpointSchemeEnabled()
      Overrides:
      isPpv2EndpointSchemeEnabled in class org.apache.kafka.common.requests.RequestContext
    • isPpv2EndpointSchemeMapBrokerToGatewayZoneEnabled

      public boolean isPpv2EndpointSchemeMapBrokerToGatewayZoneEnabled()
      Overrides:
      isPpv2EndpointSchemeMapBrokerToGatewayZoneEnabled in class org.apache.kafka.common.requests.RequestContext
    • parseRequest

      public org.apache.kafka.common.requests.RequestAndSize parseRequest(org.apache.kafka.common.protocol.Readable readable)
      Overrides:
      parseRequest in class org.apache.kafka.common.requests.RequestContext
    • shouldIntercept

      public boolean shouldIntercept()
      Overrides:
      shouldIntercept in class org.apache.kafka.common.requests.RequestContext
    • intercept

      public org.apache.kafka.common.requests.AbstractResponse intercept(org.apache.kafka.common.requests.AbstractRequest request, int throttleTimeMs)
      Overrides:
      intercept in class org.apache.kafka.common.requests.RequestContext
    • buildResponseSend

      public org.apache.kafka.common.requests.RequestContext.ResponseSend buildResponseSend(org.apache.kafka.common.requests.AbstractResponse body)
      Overrides:
      buildResponseSend in class org.apache.kafka.common.requests.RequestContext
    • transformed

      public boolean transformed()
      Overrides:
      transformed in class org.apache.kafka.common.requests.RequestContext
    • parsedResponse

      public org.apache.kafka.common.requests.AbstractResponse parsedResponse(org.apache.kafka.common.requests.AbstractResponse response, short version)
      Overrides:
      parsedResponse in class org.apache.kafka.common.requests.RequestContext
    • transformAclFilter

      public static org.apache.kafka.common.acl.AclBindingFilter transformAclFilter(String tenantPrefix, String prefixedWildcard, org.apache.kafka.common.acl.AclBindingFilter aclFilter)
    • isSupportedFFFClient

      public static boolean isSupportedFFFClient(org.apache.kafka.common.requests.FetchRequest request, boolean fetchFromFollowerRequireLeaderEpochEnabled)
      The IS_SUPPORTED_FFF_CLIENT tag is set to false if client tries to use FetchFromFollower from KIP-392, but hasn't added CurrentLeaderEpoch to the FetchRequest that is introduced in KIP-320. This function assumes that if client implements KIP-320, then it sets valid currentLeaderEpoch to all partitions in a FetchRequest. This function follows the logic of FetchParams::isSupportedFFFClient. If FetchParams::isSupportedFFFClient changes, modify this function accordingly.
      See Also:
    • metricsRequestContext