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)
- gRPC-Web 플러그인과 함께 HTTP 요청을 gRPC 서비스 방식으로 변환할 때 활용할 수 있는 플러그인이에요 — gRPC-Gateway plugin
- gRPC-Web 플러그인을 실제로 구성해서 HTTP 요청을 gRPC 서비스로 프록시하는 과정을 따라 해 볼 수 있는 실습 가이드예요 — Use the gRPC-Web plugin to proxy HTTP requests to a gRPC service