Interface KafkaConnectionContext
- All Superinterfaces:
BaseExecutionContext,NativeExecutionContext
Specialized context for Kafka connection.
- Author:
- Jeoffrey HAEYAERT (jeoffrey.haeyaert at graviteesource.com), GraviteeSource Team
-
Field Summary
Fields inherited from interface io.gravitee.gateway.reactive.api.context.base.BaseExecutionContext
TEMPLATE_ATTRIBUTE_CONTEXT -
Method Summary
Modifier and TypeMethodDescriptionCallback[]Access the array ofCallbackexchanged during connection.org.apache.kafka.common.security.auth.KafkaPrincipalAccess the principal of the current connection.Access the SASL mechanism name used during connection.Access the registry of topic identities.Methods inherited from interface io.gravitee.gateway.reactive.api.context.base.BaseExecutionContext
getAttribute, getAttributeAsList, getAttributeNames, getAttributes, getComponent, getInternalAttribute, getInternalAttributes, getTemplateEngine, getTracer, localAddress, putAttribute, putInternalAttribute, remoteAddress, removeAttribute, removeInternalAttribute, setAttribute, setInternalAttribute, timestamp, tlsSession, warnWith
-
Method Details
-
callbacks
Callback[] callbacks()Access the array ofCallbackexchanged during connection. This can be used by a kafka security policy to extract a security token and to authenticate the connection.- Returns:
- an array of
Callback
-
saslMechanism
String saslMechanism()Access the SASL mechanism name used during connection. It can be 'PLAIN', 'SCRAM-SHA-256', 'SCRAM-SHA-512' or 'OAUTHBEARER'.- Returns:
- the name of the SASL mechanism
-
principal
org.apache.kafka.common.security.auth.KafkaPrincipal principal()Access the principal of the current connection.- Returns:
- the principal of the current connection.
-
topicIdentityRegistry
TopicIdentityRegistry topicIdentityRegistry()Access the registry of topic identities. This registry store any Kafka topics (by their name & Uuid) from the broker (source=BROKER). But also those which could be created by our policies ( e.g. TopicMappingPolicy ) and used by clients (source=CLIENT). The registry can be used to find the name of a topic from an id or vice versa.- Returns:
TopicIdentityRegistry
-