스키마 검증 프로듀스 정책 구성 참조
스키마 검증 프로듀스 정책 구성 참조 (Schema Validation Produce Policy Configuration Reference)
이 문서는 Kong Event Gateway에서 프로듀스(produce) 메시지를 스키마 레지스트리 기준으로 검증하는 스키마 검증 프로듀스 정책의 구성 참조 자료예요. 정책 이름, 설명, 활성화 여부 같은 기본 필드부터 실제 검증 동작을 정의하는 config, 정책 적용 조건을 불리언 표현식으로 지정하는 condition까지 각 속성의 의미와 형식을 확인할 수 있어요. condition에서는 인증 주체 정보나 토픽 이름 같은 컨텍스트 필드를 활용해 정책 적용 대상을 유연하게 제어할 수 있다는 점도 함께 살펴보세요.
출처: 문서
본문
구성
{
"description": "A policy that validates produce messages against a schema registry.",
"type": "object",
"properties": {
"type": {
"description": "The type name of the policy.",
"type": "string",
"enum": [
"schema_validation"
],
"maxLength": 255,
"minLength": 1,
"x-terraform-transform-const": true
},
"name": {
"description": "A unique user-defined name of the policy.",
"type": "string",
"maxLength": 255,
"x-unicode-pattern": "^[\\p{L}\\p{N}][\\p{L}\\p{N} _\\-\\.:/+']*[\\p{L}\\p{N}]$"
},
"description": {
"description": "A human-readable description of the policy.",
"type": "string",
"default": "",
"maxLength": 512
},
"enabled": {
"description": "Whether the policy is enabled.",
"type": "boolean",
"default": true
},
"labels": {
"$ref": "#/components/schemas/Labels"
},
"config": {
"description": "The configuration of the policy.",
"type": "object",
"$ref": "#/components/schemas/EventGatewayProduceSchemaValidationPolicyConfig"
},
"condition": {
"description": "A string containing the boolean expression that determines whether the policy is applied.",
"type": "string",
"example": "context.topic.name.endsWith(\"my_suffix\") && record.headers[\"x-flag\"] == \"a-value\"",
"default": "",
"maxLength": 1000,
"x-expression": {
"type": "boolean",
"fields": [
{
"name": "context.auth.principal.name",
"type": "string",
"description": "Name of authenticated principal. Username in case of PLAIN/SCRAM, `sub` claim in case of OAUTHBEARER."
},
{
"name": "context.auth.principal.id",
"type": "string",
"description": "Kong Identity principal ID. Only populated when Kong Identity principal fetching is configured and succeeds.\n\n**Requires a minimum runtime version of `1.2`**.",
"x-min-runtime-version": "1.2"
},
{
"name": "context.auth.principal.metadata",
"type": "object",
"description": "Kong Identity principal metadata. Only populated when Kong Identity principal fetching is configured and succeeds. Values can be strings, numbers, booleans, arrays or nested JSON objects.\n\n**Requires a minimum runtime version of `1.2`**.",
"x-min-runtime-version": "1.2"
},
{
"name": "context.auth.type",
"type": "string",
"description": "The matched authentication type from a virtual cluster: anonymous, sasl_plain, sasl_scram_sha256, sasl_scram_sha512, sasl_oauth_bearer.\n"
},
{
"name": "context.topic.name",
"type": "string",
"description": "The name of the topic."
},
{
"name": "record.headers",
"type": "object",
"description": "An associative array of header key value pairs."
}
]
}
}
},
"required": [
"type",
"config"
],
"title": "Schema Validation"
}
관련 리소스
더 알아보기 (Learn more)
- 정책이 적용되는 Event Gateway 가상 클러스터의 개념과 구성 방법을 살펴봐요 — Virtual clusters
- 스키마 검증 프로듀스 정책을 포함한 Event Gateway 정책 엔티티의 전반적인 구성과 관리 방법을 확인해요 — Policies