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

OPA 플러그인 설정 레퍼런스

원문 보기 위키 갱신

OPA 플러그인 설정 레퍼런스 (OPA Plugin Configuration Reference)

이 문서는 Kong Gateway의 OPA 플러그인에서 설정할 수 있는 파라미터를 한눈에 확인할 수 있는 설정 레퍼런스예요. OPA 서버 호스트, 포트, 프로토콜 같은 연결 기본 옵션과 SSL 검증(ssl_verify) 설정을 기본값과 함께 설명해 줘요. 특히 요청 본문이나 컨슈머, 라우트, 서비스, URI 캡처 정보를 OPA 입력에 포함할지 제어하는 include_* 계열 옵션이 각각 어떤 역할을 하는지 궁금할 때 여기서 정확한 동작을 확인해 보세요

출처: 문서

본문

{
  "properties": {
    "config": {
      "properties": {
        "include_body_in_opa_input": {
          "default": false,
          "description": "If set to true, the raw request body is included as input to OPA. Not supported for WebSocket protocols (ws/wss).",
          "type": "boolean"
        },
        "include_consumer_in_opa_input": {
          "default": false,
          "description": "If set to true, the Kong Gateway Consumer object in use for the current request (if any) is included as input to OPA.",
          "type": "boolean"
        },
        "include_parsed_json_body_in_opa_input": {
          "default": false,
          "description": "If set to true and the `Content-Type` header of the current request is `application/json`, the request body will be JSON decoded and the decoded struct is included as input to OPA. Not supported for WebSocket protocols (ws/wss).",
          "type": "boolean"
        },
        "include_route_in_opa_input": {
          "default": false,
          "description": "If set to true, the Kong Gateway Route object in use for the current request is included as input to OPA.",
          "type": "boolean"
        },
        "include_service_in_opa_input": {
          "default": false,
          "description": "If set to true, the Kong Gateway Service object in use for the current request is included as input to OPA.",
          "type": "boolean"
        },
        "include_uri_captures_in_opa_input": {
          "default": false,
          "description": "If set to true, the regex capture groups captured on the Kong Gateway Route's path field in the current request (if any) are included as input to OPA.",
          "type": "boolean"
        },
        "opa_host": {
          "default": "localhost",
          "description": "A string representing a host name, such as example.com.",
          "type": "string"
        },
        "opa_path": {
          "description": "A string representing a URL path, such as /path/to/resource. Must start with a forward slash (/) and must not contain empty segments (i.e., two consecutive forward slashes).",
          "type": "string"
        },
        "opa_port": {
          "default": 8181,
          "description": "An integer representing a port number between 0 and 65535, inclusive.",
          "maximum": 65535,
          "minimum": 0,
          "type": "integer"
        },
        "opa_protocol": {
          "default": "http",
          "description": "The protocol to use when talking to Open Policy Agent (OPA) server. Allowed protocols are `http` and `https`.",
          "enum": [
            "http",
            "https"
          ],
          "type": "string"
        },
        "ssl_verify": {
          "default": true,
          "description": "If set to true, the OPA certificate will be verified according to the CA certificates specified in lua_ssl_trusted_certificate.",
          "type": "boolean"
        }
      },
      "required": [
        "opa_path"
      ],
      "type": "object"
    },
    "expressions": {
      "additionalProperties": true,
      "type": "object"
    },
    "protocols": {
      "default": [
        "grpc",
        "grpcs",
        "http",
        "https"
      ],
      "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": [
          "grpc",
          "grpcs",
          "http",
          "https",
          "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"
    }
  },
  "required": [
    "config"
  ]
}

관련 자료

더 알아보기 (Learn more)