헤더 인증서 인증 플러그인 OpenAPI 사양
헤더 인증서 인증 플러그인 OpenAPI 사양 (Header Cert Authentication Plugin OpenAPI Specification)
이 문서는 Kong Gateway에서 Header Cert Auth 자격 증명을 관리하는 Admin API를 OpenAPI 3.0 사양으로 정의한 명세예요. 컨슈머별로 자격 증명 목록을 조회하거나 새로 만들고, 특정 자격 증명을 가져오고 교체·수정하는 엔드포인트가 담겨 있어요. Kong Admin API(localhost:8001)를 통해 헤더 인증서 인증 플러그인의 자격 증명을 프로그래밍 방식으로 다루고 싶을 때 참고하면 좋아요
출처: 문서
본문
---
openapi: 3.0.2
info:
title: Header Cert Auth API
version: 1.0.0
description: API for managing Header Cert Auth credentials in Kong Gateway.
contact:
name: Kong Inc
url: https://konghq.com
email: docs@konghq.com
servers:
- url: http://localhost:8001
description: Kong Admin API
paths:
"/consumers/{consumerUsernameOrId}/header-cert-auth":
get:
summary: List Header Cert Auth credentials for a consumer
tags:
- Header Cert Auth
parameters:
- "$ref": "#/components/parameters/consumerUsernameOrId"
responses:
'200':
description: List of credentials
content:
application/json:
schema:
type: object
properties:
data:
type: array
items:
"$ref": "#/components/schemas/HeaderCertAuthCredential"
post:
summary: Create a Header Cert Auth credential for a Consumer
tags:
- Header Cert Auth
parameters:
- "$ref": "#/components/parameters/consumerUsernameOrId"
requestBody:
required: true
content:
application/json:
schema:
"$ref": "#/components/schemas/HeaderCertAuthCredential"
responses:
'201':
description: Credential created
content:
application/json:
schema:
"$ref": "#/components/schemas/HeaderCertAuthCredential"
"/consumers/{consumerUsernameOrId}/header-cert-auth/{headerCertAuthCredentials}":
get:
summary: Retrieve a Header Cert Auth credential
tags:
- Header Cert Auth
parameters:
- "$ref": "#/components/parameters/consumerUsernameOrId"
- "$ref": "#/components/parameters/headerCertAuthCredentials"
responses:
'200':
description: Credential found
content:
application/json:
schema:
"$ref": "#/components/schemas/HeaderCertAuthCredential"
'404':
description: Credential or consumer not found
put:
summary: Replace a Header Cert Auth credential
tags:
- Header Cert Auth
parameters:
- "$ref": "#/components/parameters/consumerUsernameOrId"
- "$ref": "#/components/parameters/headerCertAuthCredentials"
requestBody:
required: true
content:
application/json:
schema:
"$ref": "#/components/schemas/HeaderCertAuthCredential"
responses:
'200':
description: Credential replaced
patch:
summary: Update a Header Cert Auth credential
tags:
- Header Cert Auth
parameters:
- "$ref": "#/components/parameters/consumerUsernameOrId"
- "$ref": "#/components/parameters/headerCertAuthCredentials"
requestBody:
required: true
content:
application/json:
schema:
"$ref": "#/components/schemas/HeaderCertAuthCredential"
responses:
'200':
description: Credential updated
delete:
summary: Delete a Header Cert Auth credential
tags:
- Header Cert Auth
parameters:
- "$ref": "#/components/parameters/consumerUsernameOrId"
- "$ref": "#/components/parameters/headerCertAuthCredentials"
responses:
'204':
description: Credential deleted
"/header-cert-auths":
get:
summary: List all Header Cert Auth credentials
tags:
- Header Cert Auth
responses:
'200':
description: List of all credentials
content:
application/json:
schema:
type: object
properties:
data:
type: array
items:
"$ref": "#/components/schemas/HeaderCertAuthCredential"
"/header-cert-auths/{headerCertAuthCredentials}/consumer":
get:
summary: Get the consumer associated with a Header Cert Auth credential
tags:
- Header Cert Auth
parameters:
- "$ref": "#/components/parameters/consumerUsernameOrId"
- "$ref": "#/components/parameters/headerCertAuthCredentials"
responses:
'200':
description: Consumer associated with the credential
content:
application/json:
schema:
"$ref": "#/components/schemas/Consumer"
components:
parameters:
consumerUsernameOrId:
name: consumerUsernameOrId
in: path
required: true
schema:
type: string
example: example-consumer
description: The username or ID of the consumer.
headerCertAuthCredentials:
name: headerCertAuthCredentials
in: path
required: true
schema:
type: string
format: uuid
example: 84175eaa-c795-483e-8a4a-3d57132003e8
description: UUID of the Header Cert Auth credential.
schemas:
HeaderCertAuthCredential:
type: object
required:
- subject_name
properties:
id:
description: UUID of the Consumer mapping. Required if adding mapping using
declarative configuration, otherwise generated automatically by Kong's
Admin API.
type: string
example: 84175eaa-c795-483e-8a4a-3d57132003e8
subject_name:
description: The Subject Alternative Name (SAN) or Common Name (CN) that
should be mapped to `consumer` (in order of lookup).
type: string
example: CA_Subject_Name
consumer:
type: object
properties:
id:
type: string
example: a6f1f9db-737b-4a0b-8e87-21cda32fc857
ca_certificate:
description: "The provided CA UUID or full CA Certificate has to be verifiable
by the issuing certificate authority for the mapping to succeed. \nThis
is to help distinguish multiple certificates with the same subject name
that are issued under different CAs.\n"
type: object
properties:
id:
type: string
example: 50132e7d-a652-4a58-9f40-3722e9bd6afb
tags:
description: An optional set of strings associated with the credential for
grouping and filtering.
items:
type: string
type: array
created_at:
description: Unix epoch when the resource was created.
nullable: true
type: integer
Consumer:
type: object
description: The Consumer object represents a consumer - or a user - of a Service.
You can either rely on Kong as the primary datastore, or you can map the consumer
list with your database to keep consistency between Kong and your existing
primary datastore.
example:
id: 8a388226-80e8-4027-a486-25e4f7db5d21
username: example-consumer
properties:
created_at:
description: Unix epoch when the resource was created.
nullable: true
type: integer
custom_id:
description: Field for storing an existing unique ID for the Consumer -
useful for mapping Kong with users in your existing database. You must
send either this field or `username` with the request.
nullable: true
type: string
id:
nullable: true
type: string
tags:
description: An optional set of strings associated with the Consumer for
grouping and filtering.
items:
type: string
type: array
updated_at:
description: Unix epoch when the resource was last updated.
nullable: true
type: integer
username:
description: The unique username of the Consumer. You must send either this
field or `custom_id` with the request.
nullable: true
type: string
관련 리소스
더 알아보기 (Learn more)
- Kong Gateway의 인증 방식 전반을 먼저 이해하면 이 플러그인의 역할을 더 쉽게 파악할 수 있어요 — About authentication
- 헤더 인증서 인증에서 신뢰의 기준이 되는 CA 인증서 엔티티를 함께 살펴보면 좋아요 — CA Certificates