키 인증 - 암호화 플러그인 구성 참조
키 인증 - 암호화 플러그인 구성 참조 (Key Authentication - Encrypted Plugin Configuration Reference)
이 문서는 Kong의 키 인증 - 암호화 플러그인의 구성 참조 자료예요. anonymous, hide_credentials, key_names 같은 각 설정 파라미터의 타입과 기본값, 동작 방식을 항목별로 확인할 수 있어요. 키를 헤더·쿼리·본문 중 어디에서 읽을지 정하거나 인증 실패 시의 동작을 조정하고 싶을 때 이 구성표를 참고하면 좋아요
출처: 문서
본문
{
"properties": {
"config": {
"properties": {
"anonymous": {
"description": "An optional string (consumer UUID or username) value to use as an “anonymous” consumer if authentication fails. If empty (default null), the request will fail with an authentication failure `4xx`. Note that this value must refer to the consumer `id` or `username` attribute, and **not** its `custom_id`.",
"type": "string"
},
"hide_credentials": {
"default": true,
"description": "An optional boolean value telling the plugin to show or hide the credential from the upstream service. If `true`, the plugin strips the credential from the request (i.e., the header, query string, or request body containing the key) before proxying it.",
"type": "boolean"
},
"key_in_body": {
"default": false,
"description": "If enabled, the plugin reads the request body (if said request has one and its MIME type is supported) and tries to find the key in it. Supported MIME types: `application/www-form-urlencoded`, `application/json`, and `multipart/form-data`.",
"type": "boolean"
},
"key_in_header": {
"default": true,
"description": "If enabled (default), the plugin reads the request header and tries to find the key in it.",
"type": "boolean"
},
"key_in_query": {
"default": true,
"description": "If enabled (default), the plugin reads the query parameter in the request and tries to find the key in it.",
"type": "boolean"
},
"key_names": {
"default": [
"apikey"
],
"description": "Describes an array of parameter names where the plugin will look for a key. The client must send the authentication key in one of those key names, and the plugin will try to read the credential from a header, request body, or query string parameter with the same name. Key names may only contain [a-z], [A-Z], [0-9], [_] underscore, and [-] hyphen.",
"items": {
"description": "A string representing an HTTP header name.",
"type": "string"
},
"type": "array"
},
"realm": {
"description": "When authentication fails the plugin sends `WWW-Authenticate` header with `realm` attribute value.",
"type": "string"
},
"run_on_preflight": {
"default": true,
"description": "A boolean value that indicates whether the plugin should run (and try to authenticate) on `OPTIONS` preflight requests. If set to `false`, then `OPTIONS` requests are always allowed.",
"type": "boolean"
}
},
"type": "object"
},
"expressions": {
"additionalProperties": true,
"type": "object"
},
"protocols": {
"default": [
"grpc",
"grpcs",
"http",
"https",
"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": [
"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"
}
}
}
관련 리소스
더 알아보기 (Learn more)
- 키 인증 플러그인의 기본 개념과 전체 사용법을 담은 공식 문서 — Key Authentication plugin
- Kong Gateway에서 암호화된 키 인증으로 서비스를 보호하는 실습 가이드 — Enable key authentication on a Gateway Service with Kong Gateway
- 자격 증명을 암호화해 저장하는 키링 기능의 이해 — Keyring