context.auth.type
|
string
|
The type of authentication used.
|
condition field in Cluster, Produce, and Consume policies
resource_names field in ACL policies
|
context.auth.type == "anonymous"
|
context.auth.principal.name
|
string
|
The name of the principal for this connection.
|
condition field in Cluster, Produce, and Consume policies
resource_names field in ACL policies
|
context.auth.principal.name == "user1"
|
context.auth.principal.id v1.2+
|
string
|
The UUID of the authenticated principal. Only populated when the principal was resolved through a Kong Identity directory lookup.
|
condition field in Cluster, Produce, and Consume policies
resource_names field in ACL policies
|
context.auth.principal.id == "a1b2c3d4-..."
|
context.auth.principal.metadata v1.2+
|
map<string, any>
|
Metadata attached to the authenticated principal in Kong Identity. Inner keys must be checked with has() before access.
|
condition field in Cluster, Produce, and Consume policies
resource_names field in ACL policies
|
has(context.auth.principal.metadata.team) && context.auth.principal.metadata.team == "operators"
|
context.auth.token.claims v1.1+
|
map<string, any>
|
Only populated for sasl_oauth_bearer authentication. Contains all claims from the JWT token. Claims can be strings, numbers, booleans, arrays, or nested JSON objects.
|
condition field in Cluster, Produce, and Consume policies
resource_names field in ACL policies
|
"test-claim" in context.auth.token.claims
|
context.topic.name
|
string
|
The name of the topic of the record.
|
condition field in Produce and Consume policies
|
context.topic.name == "my-ns.my-topic"
|
record.headers
|
map<string, string>
|
The headers of the record.
|
condition field in Produce and Consume policies
|
record.headers["skip-record"] == "true"
|
record.value.content
|
map<string, any>
|
The value of the record. Deep fields can be accessed using map indexing.
|
condition field in Produce and Consume policies used as children of Schema Validation
|
record.value.content["sub.other"] == 3
|
record.value.validated
|
bool
|
Whether record validation succeeded or not.
|
condition field in Produce and Consume policies used as children of Schema Validation
|
record.value.validated == true
|
record.value.schema.id v1.2+
|
int
|
Registry-assigned schema ID. Populated when the record value is validated by a Confluent schema registry.
|
condition field in Produce and Consume policies used as children of Schema Validation
|
record.value.schema.id == 42
|
record.value.schema.version v1.2+
|
int
|
Registry-assigned schema version, when returned by the registry.
|
condition field in Produce and Consume policies used as children of Schema Validation
|
record.value.schema.version == 3
|
record.value.schema.format v1.2+
|
string
|
"avro" or "json".
|
condition field in Produce and Consume policies used as children of Schema Validation
|
record.value.schema.format == "avro"
|
record.value.schema.avro.name v1.2+
|
string
|
Avro record name (Avro only).
|
condition field in Produce and Consume policies used as children of Schema Validation
|
record.value.schema.avro.name == "User"
|
record.value.schema.avro.namespace v1.2+
|
string
|
Avro record namespace (Avro only, when declared on the schema).
|
condition field in Produce and Consume policies used as children of Schema Validation
|
record.value.schema.avro.namespace == "com.example"
|
record.value.schema.json.title v1.2+
|
string
|
JSON Schema title (JSON only, when declared on the schema).
|
condition field in Produce and Consume policies used as children of Schema Validation
|
record.value.schema.json.title == "Order"
|
record.value.schema.json.id v1.2+
|
string
|
JSON Schema $id (JSON only, when declared on the schema).
|
condition field in Produce and Consume policies used as children of Schema Validation
|
record.value.schema.json.id == "https://example.com/schemas/order.json"
|
record.value.schema.metadata.tags
|
list<string>
|
Tags assigned to the schema in the schema registry.
|
condition field in Produce and Consume policies used as children of Schema Validation
|
"PII" in record.value.schema.metadata.tags
|
record.value.schema.metadata.properties
|
map<string, string>
|
Custom properties assigned to the schema in the schema registry.
|
condition field in Produce and Consume policies used as children of Schema Validation
|
record.value.schema.metadata.properties["owner"] == "team-orders"
|
record.value.schema.metadata.properties v1.3+
|
map<string, string>
|
Confluent schema-registry metadata.properties. Present as an empty map whenever record.value.schema is present, even when the registry omits the properties.
|
condition field in Produce and Consume policies used as children of Schema Validation
|
record.value.schema.metadata.properties['owner'] == 'payments-team'
|
record.value.schema.metadata.tags v1.3+
|
map<string, list<string>>
|
Confluent schema-registry metadata.tags, keyed by tag. Each value is the list of schema paths (for example io.confluent.field.<name>) that carry that tag. Present as an empty map whenever record.value.schema is present, even when the registry omits the tags.
|
condition field in Produce and Consume policies used as children of Schema Validation
|
'PII' in record.value.schema.metadata.tags && 'io.confluent.field.ssn' in record.value.schema.metadata.tags['PII']
|
record.key.schema.* v1.2+
|
Same shape as record.value.schema.*
|
Populated when the record key has schema_validation configured. Sub-fields are absent when not applicable; use has() to test presence.
|
condition field in Produce and Consume policies used as children of Schema Validation
|
record.key.schema.format == "json" && record.key.schema.json.title == "UserKey"
|
context.certificate.subject
|
map<string, string>
|
Subject distinguished name of the client certificate, as a map. Access individual attributes such as context.certificate.subject["CN"] (Common Name) or context.certificate.subject["O"] (Organization).
|
principal_mapping field in TLS Server listener policies (mTLS)
|
context.certificate.subject["CN"]
|
context.certificate.issuer
|
map<string, string>
|
Issuer distinguished name of the client certificate, same format as subject.
|
principal_mapping field in TLS Server listener policies (mTLS)
|
context.certificate.issuer["O"]
|
context.certificate.serialNumber
|
string
|
Serial number of the client certificate.
|
principal_mapping field in TLS Server listener policies (mTLS)
|
context.certificate.serialNumber
|
context.certificate.sans.dns
|
list<string>
|
DNS Subject Alternative Names on the client certificate.
|
principal_mapping field in TLS Server listener policies (mTLS)
|
context.certificate.sans.dns[0]
|
context.certificate.sans.uri
|
list<string>
|
URI Subject Alternative Names on the client certificate.
|
principal_mapping field in TLS Server listener policies (mTLS)
|
context.certificate.sans.uri.filter(u, u.startsWith("spiffe://"))[0]
|