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

WebSocket Validator 플러그인 구성 참조

원문 보기 위키 갱신

WebSocket Validator 플러그인 구성 참조 (WebSocket Validator Plugin Configuration Reference)

이 문서는 Kong의 WebSocket Validator 플러그인 구성 참조 문서예요. 클라이언트와 업스트림 사이에서 오가는 WebSocket 텍스트 및 바이너리 프레임을 JSON Schema(draft4)로 검증하기 위한 설정 필드를 정리해 줘요. config.client와 config.upstream 아래의 binary, text 항목에 각각 검증 스키마와 검증 라이브러리 타입을 지정하는 방법을 확인할 수 있어요

출처: 문서

본문

{
  "properties": {
    "config": {
      "properties": {
        "client": {
          "properties": {
            "binary": {
              "properties": {
                "schema": {
                  "description": "Schema used to validate upstream-originated binary frames. The semantics of this field depend on the validation type set by `config.upstream.binary.type`.",
                  "type": "string"
                },
                "type": {
                  "description": "The corresponding validation library for `config.upstream.binary.schema`. Currently, only `draft4` is supported.",
                  "enum": [
                    "draft4"
                  ],
                  "type": "string"
                }
              },
              "required": [
                "schema",
                "type"
              ],
              "type": "object"
            },
            "text": {
              "properties": {
                "schema": {
                  "description": "Schema used to validate upstream-originated binary frames. The semantics of this field depend on the validation type set by `config.upstream.binary.type`.",
                  "type": "string"
                },
                "type": {
                  "description": "The corresponding validation library for `config.upstream.binary.schema`. Currently, only `draft4` is supported.",
                  "enum": [
                    "draft4"
                  ],
                  "type": "string"
                }
              },
              "required": [
                "schema",
                "type"
              ],
              "type": "object"
            }
          },
          "type": "object"
        },
        "upstream": {
          "properties": {
            "binary": {
              "properties": {
                "schema": {
                  "description": "Schema used to validate upstream-originated binary frames. The semantics of this field depend on the validation type set by `config.upstream.binary.type`.",
                  "type": "string"
                },
                "type": {
                  "description": "The corresponding validation library for `config.upstream.binary.schema`. Currently, only `draft4` is supported.",
                  "enum": [
                    "draft4"
                  ],
                  "type": "string"
                }
              },
              "required": [
                "schema",
                "type"
              ],
              "type": "object"
            },
            "text": {
              "properties": {
                "schema": {
                  "description": "Schema used to validate upstream-originated binary frames. The semantics of this field depend on the validation type set by `config.upstream.binary.type`.",
                  "type": "string"
                },
                "type": {
                  "description": "The corresponding validation library for `config.upstream.binary.schema`. Currently, only `draft4` is supported.",
                  "enum": [
                    "draft4"
                  ],
                  "type": "string"
                }
              },
              "required": [
                "schema",
                "type"
              ],
              "type": "object"
            }
          },
          "type": "object"
        }
      },
      "type": "object"
    },
    "consumer": {
      "additionalProperties": false,
      "description": "If set, the plugin will activate only for requests where the specified has been authenticated. (Note that some plugins can not be restricted to consumers this way.). Leave unset for the plugin to activate regardless of the authenticated Consumer.",
      "properties": {
        "id": {
          "type": "string"
        }
      },
      "type": "object"
    },
    "expressions": {
      "additionalProperties": true,
      "type": "object"
    },
    "protocols": {
      "default": [
        "ws",
        "wss"
      ],
      "description": "A list of the request protocols that will trigger this plugin. The default value, as well as the possible values allowed on this field, may change depending on the plugin type. For example, plugins that only work in stream mode will only support tcp and tls.",
      "items": {
        "enum": [
          "ws",
          "wss"
        ],
        "type": "string"
      },
      "type": "array"
    },
    "route": {
      "additionalProperties": false,
      "description": "If set, the plugin will only activate when receiving requests via the specified route. Leave unset for the plugin to activate regardless of the route being used.",
      "properties": {
        "id": {
          "type": "string"
        }
      },
      "type": "object"
    },
    "service": {
      "additionalProperties": false,
      "description": "If set, the plugin will only activate when receiving requests via one of the routes belonging to the specified Service. Leave unset for the plugin to activate regardless of the Service being matched.",
      "properties": {
        "id": {
          "type": "string"
        }
      },
      "type": "object"
    }
  }
}

관련 리소스

더 알아보기 (Learn more)