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

gRPC-Web 플러그인 구성 참조

원문 보기 위키 갱신

gRPC-Web 플러그인 구성 참조 (gRPC-Web Plugin Configuration Reference)

이 문서는 Kong의 gRPC-Web 플러그인에서 설정할 수 있는 모든 파라미터를 정리해 놓은 구성 참조 자료예요. allow_origin_header로 응답의 Access-Control-Allow-Origin 헤더를 제어하고, pass_stripped_path로 정리된 요청 경로를 업스트림 gRPC 서비스에 전달할지 정하고, proto로 페이로드 트랜스코딩에 필요한 gRPC 타입과 메서드를 지정하는 방법을 확인할 수 있어요. 아울러 consumer, route, service, protocols 항목으로 플러그인이 어떤 요청에 적용될지 적용 범위를 조정하는 방법까지 함께 안내하고 있어요

출처: 문서

본문

{
  "properties": {
    "config": {
      "properties": {
        "allow_origin_header": {
          "default": "*",
          "description": "The value of the `Access-Control-Allow-Origin` header in the response to the gRPC-Web client.",
          "type": "string"
        },
        "pass_stripped_path": {
          "description": "If set to `true` causes the plugin to pass the stripped request path to the upstream gRPC service.",
          "type": "boolean"
        },
        "proto": {
          "description": "If present, describes the gRPC types and methods. Required to support payload transcoding. When absent, the web client must use application/grpw-web+proto content.",
          "type": "string"
        }
      },
      "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": [
        "grpc",
        "grpcs",
        "http",
        "https"
      ],
      "description": "A set of strings representing protocols.",
      "items": {
        "description": "A string representing a protocol, such as HTTP or HTTPS.",
        "enum": [
          "grpc",
          "grpcs",
          "http",
          "https",
          "tcp",
          "tls",
          "tls_passthrough",
          "udp",
          "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)