본문으로 바로가기 본문 바로가기
WIKI 기술 지식 베이스

레코드 건너뛰기 정책 구성 참조

원문 보기 위키 갱신

레코드 건너뛰기 정책 구성 참조 (Skip Records Policy Configuration Reference)

이 문서는 이벤트 게이트웨이에서 조건에 맞는 레코드의 처리를 건너뛰는 스킵 레코드(skip_record) 정책의 구성 옵션을 JSON 스키마 형태로 정리한 참조 자료예요. 정책 이름, 설명, 활성화 여부 같은 기본 속성과 함께, 정책 적용 여부를 판단하는 불리언 조건식을 작성하는 방법을 확인할 수 있어요. 조건식에서는 인증 주체나 토픽 같은 컨텍스트 필드를 참조할 수 있어서, 원하는 조건에 해당하는 레코드만 골라서 건너뛰도록 구성할 수 있어요

출처: 문서

본문

구성

{
  "description": "A policy that skips processing of a record.",
  "type": "object",
  "properties": {
    "type": {
      "description": "The type name of the policy.",
      "type": "string",
      "enum": [
        "skip_record"
      ],
      "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"
    },
    "condition": {
      "description": "A string containing the boolean expression that determines whether the policy is applied.\n\nWhen the policy is applied as a child policy of schema_validation, the expression can also reference\n`record.value` fields.\n",
      "type": "string",
      "example": "record.value.content.foo.bar == \"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."
          },
          {
            "name": "record.value.validated",
            "type": "boolean",
            "description": "Indicates whether the record value was successfully validated."
          },
          {
            "name": "record.value.content",
            "type": "object",
            "description": "The content of the record value."
          },
          {
            "name": "record.value.schema",
            "type": "object",
            "x-min-runtime-version": "1.2",
            "description": "Registry-supplied schema metadata for the record value. Populated when the value\nwas validated by a Confluent schema registry. Fields: `id` (uint), `version` (uint,\nwhen returned by the registry), `format` (\"avro\"|\"json\"), and either\n`avro.{name, namespace}` or `json.{title, id}`. Sub-fields are absent when not\napplicable; use `has()` to test presence. Registry `metadata` (tags and properties)\nis available from runtime 1.3 via `record.value.schema.metadata`.\n\n**Requires a minimum runtime version of `1.2`**."
          },
          {
            "name": "record.value.schema.metadata",
            "type": "object",
            "x-min-runtime-version": "1.3",
            "description": "Confluent schema-registry metadata for the record value. Present (as empty maps)\nwhenever `record.value.schema` is present. Fields:\n* `properties` (`map` of `string` to `string`) - Confluent `metadata.properties`;\n  empty map when the registry omits it.\n* `tags` (`map` of `string` to list of `string`) - keyed by tag, value is the list\n  of Confluent schema paths (e.g. `io.confluent.field.<name>`) carrying that tag;\n  empty map when the registry omits it.\n\n**Requires a minimum runtime version of `1.3`**."
          },
          {
            "name": "record.key.schema",
            "type": "object",
            "x-min-runtime-version": "1.2",
            "description": "Same shape as `record.value.schema`, populated when the record key has\nschema_validation configured.\n\n**Requires a minimum runtime version of `1.2`**."
          },
          {
            "name": "record.key.schema.metadata",
            "type": "object",
            "x-min-runtime-version": "1.3",
            "description": "Same shape as `record.value.schema.metadata`, populated when the record key has\nschema_validation configured.\n\n**Requires a minimum runtime version of `1.3`**."
          }
        ]
      }
    }
  },
  "required": [
    "type"
  ]
}

관련 리소스

더 알아보기 (Learn more)

  • 스킵 정책이 적용되는 가상 클러스터 엔티티의 구성을 함께 살펴보면 전체 동작 흐름을 이해하는 데 도움이 돼요 — Virtual clusters
  • 정책 엔티티의 공통 구조와 다른 정책 유형을 참고하면 스킵 레코드 정책의 역할을 더 쉽게 파악할 수 있어요 — Policies