키 세트
키 세트 (Key Sets)
키 세트는 Kong Gateway에서 여러 키를 하나로 묶어주는 컬렉션 엔티티예요. 특정 애플리케이션이나 서비스에 쓸 키들을 논리적으로 그룹화하고, 플러그인이 접근할 수 있는 키 목록을 지정할 때 활용해요. 이 문서에서는 키 세트가 무엇인지부터 decK, Admin API, Konnect API로 생성하는 방법과 스키마 구조까지 차근차근 알려줄게요
출처: 문서
본문
Key Set이란 무엇인가요?
Key Set은 Kong Gateway Key의 모음이에요.
Key Set에는 Key를 하나만 할당할 수도 있고 여러 개를 할당할 수도 있어요. 특정 애플리케이션이나 서비스에서 사용할 여러 Key를 논리적으로 그룹으로 묶을 때 유용해요. Key Set을 사용하면 플러그인이 특정 Key 목록에 접근할 수 있도록 허용할 수 있어요.
Key Set은 다음 플러그인과 함께 사용할 수 있어요:
- ACME,
config.account_key.key_set파라미터와 함께 사용 - JWE Decrypt,
config.key_sets파라미터와 함께 사용 - JWT Signer,
config.access_token_keyset파라미터와 함께 사용
Key Set 설정하기
decK
_format_version: "3.0"
key-sets:
- name: example-key-set
{: data-file="kong.yaml" data-tool="deck" }
Admin API
Key Set을 생성하려면 Admin API의 /key-sets 엔드포인트를 호출하세요.
curl -i -X POST http://localhost:8001/key-sets/ \
--header "Accept: application/json" \
--header "Content-Type: application/json" \
--data '
{
"name": "example-key-set"
}
'
Konnect API
Key Set을 생성하려면 Konnect 컨트롤 플레인 config API의 /key-sets 엔드포인트를 호출하세요.
curl -X POST https://{region}.api.konghq.com/v2/control-planes/{controlPlaneId}/core-entities/key-sets \
--header "accept: application/json" \
--header "Content-Type: application/json" \
--header "Authorization: Bearer $KONNECT_TOKEN" \
--data '
{
"name": "example-key-set"
}
'
다음 플레이스홀더는 반드시 여러분의 값으로 바꾸세요:
-
region: 여러분의 Kong Konnect가 호스팅되고 운영되는 지리적 리전이에요. -
KONNECT_TOKEN: Konnect 계정과 연결된 여러분의 개인 액세스 토큰(PAT)이에요. -
controlPlaneId: 컨트롤 플레인의id예요.
리전별 URL과 개인 액세스 토큰에 대해 알아보려면 Konnect Control Planes Config API 참조를 확인하세요.
스키마
{
"additionalProperties": false,
"example": {
"id": "b58c7d9d-e54f-444c-b24d-cdfc4159f61e",
"name": "example-key-set",
"tags": [
"idp-keys"
]
},
"properties": {
"created_at": {
"description": "Unix epoch when the resource was created.",
"nullable": true,
"type": "integer"
},
"id": {
"description": "A string representing a UUID (universally unique identifier).",
"nullable": true,
"type": "string"
},
"name": {
"description": "The name to associate with the given key-set.",
"nullable": true,
"type": "string"
},
"tags": {
"description": "A set of strings representing tags.",
"items": {
"description": "A string representing a tag.",
"type": "string"
},
"nullable": true,
"type": "array"
},
"updated_at": {
"description": "Unix epoch when the resource was last updated.",
"nullable": true,
"type": "integer"
}
},
"type": "object"
}
관련 리소스
더 알아보기 (Learn more)
- 키 세트를 구성하는 개별 키 엔티티의 상세 문서 — Keys
- 키 세트를 활용하는 ACME 플러그인 문서 — ACME
- 키 세트를 사용하는 JWE 복호화 플러그인 문서 — JWE Decrypt
- 키 세트를 사용하는 JWT 서명 플러그인 문서 — JWT Signer
- 키 세트를 생성할 때 호출하는 Gateway Admin API 엔드포인트 참조 — Admin API's
/key-setsendpoint - Konnect 컨트롤 플레인 설정 API에서 키 세트를 생성하는 엔드포인트 참조 — control plane config API's
/key-setsendpoint