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

상호 TLS 인증 플러그인 OpenAPI 사양

원문 보기 위키 갱신

상호 TLS 인증 플러그인 OpenAPI 사양 (Mutual TLS Authentication Plugin OpenAPI Specification)

이 문서는 Kong의 상호 TLS(Mutual TLS) 인증 플러그인 자격 증명을 다루는 API의 OpenAPI 사양이에요. 소비자(Consumer)별 mTLS 자격 증명을 조회하고 관리할 때 필요한 경로 파라미터와 페이지네이션 옵션, 401 인증 오류 응답 같은 공통 컴포넌트들이 YAML 형식으로 정의되어 있어요. Kong Admin API로 mTLS 인증 설정을 자동화하거나 API 문서를 생성할 때 이 사양을 기준으로 삼으면 좋아요

출처: 문서

본문

---
components:
  parameters:
    ConsumerIdForNestedEntities:
      description: Consumer ID for nested entities
      example: f28acbfa-c866-4587-b688-0208ac24df21
      in: path
      name: ConsumerIdForNestedEntities
      required: true
      schema:
        type: string
    MTLSAuthId:
      description: ID of the MTLS-auth credential to lookup
      example: ''
      in: path
      name: MTLSAuthId
      required: true
      schema:
        type: string
    PaginationOffset:
      allowEmptyValue: true
      description: Offset from which to return the next set of resources. Use the
        value of the 'offset' field from the response of a list operation as input
        here to paginate through all the resources
      in: query
      name: offset
      schema:
        type: string
    PaginationSize:
      description: Number of resources to be returned.
      in: query
      name: size
      schema:
        default: 100
        maximum: 1000
        minimum: 1
        type: integer
    PaginationTagsFilter:
      allowEmptyValue: true
      description: A list of tags to filter the list of resources on. Multiple tags
        can be concatenated using ',' to mean AND or using '/' to mean OR.
      example: tag1,tag2
      in: query
      name: tags
      schema:
        type: string
  responses:
    HTTP401Error:
      content:
        application/json:
          examples:
            DuplicateApiKey:
              summary: Duplicate API key found
              value:
                message: Duplicate API key found
                status: 401
            InvalidAuthCred:
              summary: Invalid authentication credentials
              value:
                message: Unauthorized
                status: 401
            NoAPIKey:
              summary: No API key found
              value:
                message: No API key found in request
                status: 401
          schema:
            "$ref": "#/components/schemas/GatewayUnauthorizedError"
      description: Unauthorized
  schemas:
    GatewayUnauthorizedError:
      properties:
        message:
          type: string
        status:
          type: integer
      required:
      - message
      - status
      type: object
    MTLSAuth:
      additionalProperties: false
      example:
        ca_certificate:
          id: b2f34145-0343-41a4-9602-4c69dec2f260
        consumer:
          id: 84a73fb8-50fc-44a7-a4d5-aa17728ee83f
        id: b2f34145-0343-41a4-9602-4c69dec2f269
        subject_name: CA_Subject_Name
      properties:
        ca_certificate:
          properties:
            id:
              type: string
          type: object
          x-foreign: true
        consumer:
          nullable: true
          properties:
            id:
              type: string
          type: object
          x-foreign: true
        created_at:
          description: Unix epoch when the resource was created.
          nullable: true
          type: integer
        id:
          nullable: true
          type: string
        subject_name:
          type: string
        tags:
          items:
            type: string
          type: array
      required:
      - subject_name
      type: object
    MTLSAuthWithoutParents:
      additionalProperties: false
      example:
        ca_certificate:
          id: b2f34145-0343-41a4-9602-4c69dec2f260
        id: b2f34145-0343-41a4-9602-4c69dec2f269
        subject_name: CA_Subject_Name
      properties:
        ca_certificate:
          properties:
            id:
              type: string
          type: object
          x-foreign: true
        consumer:
          nullable: true
          properties:
            id:
              type: string
          type: object
          x-foreign: true
        created_at:
          description: Unix epoch when the resource was created.
          nullable: true
          type: integer
        id:
          nullable: true
          type: string
        subject_name:
          type: string
        tags:
          items:
            type: string
          type: array
      required:
      - subject_name
      type: object
    PaginationNextResponse:
      description: URI to the next page (may be null)
      type: string
    PaginationOffsetResponse:
      description: Offset is used to paginate through the API. Provide this value
        to the next list operation to fetch the next page
      type: string
externalDocs:
  description: MTLS Auth Plugin API Specification
  url: https://developer.konghq.com
info:
  contact:
    email: support@konghq.com
    name: Kong Inc
    url: https://konghq.com
  description: |-
    MTLS Auth API spec.
    You can lean more about Kong Gateway at [developer.konghq.com](https://developer.konghq.com).
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
  title: MTLS Auth Plugin API
  version: 0.0.1
openapi: 3.0.0
paths:
  "/mtls-auths":
    get:
      description: List all MTLS-auth credentials
      operationId: list-mtls-auth
      parameters:
      - "$ref": "#/components/parameters/PaginationSize"
      - "$ref": "#/components/parameters/PaginationOffset"
      - "$ref": "#/components/parameters/PaginationTagsFilter"
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  data:
                    items:
                      "$ref": "#/components/schemas/MTLSAuth"
                    type: array
                  next:
                    "$ref": "#/components/schemas/PaginationNextResponse"
                  offset:
                    "$ref": "#/components/schemas/PaginationOffsetResponse"
                type: object
          description: A successful response listing MTLS-auth credentials
        '401':
          "$ref": "#/components/responses/HTTP401Error"
      summary: List all MTLS-auth credentials
      tags:
      - MTLS-auth credentials
    post:
      description: Create a new MTLS-auth credential
      operationId: create-mtls-auth
      requestBody:
        content:
          application/json:
            schema:
              "$ref": "#/components/schemas/MTLSAuth"
        description: Description of the new MTLS-auth credential for creation
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/MTLSAuth"
          description: Successfully created MTLS-auth credential
        '401':
          "$ref": "#/components/responses/HTTP401Error"
      summary: Create a new MTLS-auth credential
      tags:
      - MTLS-auth credentials
  "/mtls-auths/{MTLSAuthId}":
    delete:
      description: Delete a MTLS-auth credential
      operationId: delete-mtls-auth
      parameters:
      - "$ref": "#/components/parameters/MTLSAuthId"
      responses:
        '204':
          description: Successfully deleted MTLS-auth credential or the resource didn't
            exist
        '401':
          "$ref": "#/components/responses/HTTP401Error"
      summary: Delete a MTLS-auth credential
      tags:
      - MTLS-auth credentials
    get:
      description: Get a MTLS-auth credential using ID.
      operationId: get-mtls-auth
      responses:
        '200':
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/MTLSAuth"
          description: Successfully fetched MTLS-auth credential
        '401':
          "$ref": "#/components/responses/HTTP401Error"
        '404':
          description: Resource does not exist
      summary: Fetch a MTLS-auth credential
      tags:
      - MTLS-auth credentials
    parameters:
    - "$ref": "#/components/parameters/MTLSAuthId"
    patch:
      description: Update a MTLS-auth credential
      operationId: update-mtls-auth
      requestBody:
        content:
          application/json:
            schema:
              "$ref": "#/components/schemas/MTLSAuth"
        description: Fields of the MTLS-auth credential that need to be updated
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/MTLSAuth"
          description: Successfully updated MTLS-auth credential
        '401':
          "$ref": "#/components/responses/HTTP401Error"
        '404':
          description: Resource does not exist
      summary: Update a MTLS-auth credential
      tags:
      - MTLS-auth credentials
    put:
      description: Create or Update MTLS-auth credential using ID.
      operationId: upsert-mtls-auth
      requestBody:
        content:
          application/json:
            schema:
              "$ref": "#/components/schemas/MTLSAuth"
        description: Description of the MTLS-auth credential
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/MTLSAuth"
          description: Successfully upserted MTLS-auth credential
        '401':
          "$ref": "#/components/responses/HTTP401Error"
      summary: Upsert a MTLS-auth credential
      tags:
      - MTLS-auth credentials
  "/{workspace}/consumers/{ConsumerIdForNestedEntities}/mtls-auth":
    get:
      description: List all MTLS-auth credentials associated with a Consumer in a
        workspace
      operationId: list-mtls-auth-with-consumer-in-workspace
      parameters:
      - "$ref": "#/components/parameters/ConsumerIdForNestedEntities"
      - "$ref": "#/components/parameters/PaginationSize"
      - "$ref": "#/components/parameters/PaginationOffset"
      - "$ref": "#/components/parameters/PaginationTagsFilter"
      - description: Name or ID of workspace
        example: team-a
        in: path
        name: workspace
        required: true
        schema:
          type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  data:
                    items:
                      "$ref": "#/components/schemas/MTLSAuth"
                    type: array
                  next:
                    "$ref": "#/components/schemas/PaginationNextResponse"
                  offset:
                    "$ref": "#/components/schemas/PaginationOffsetResponse"
                type: object
          description: A successful response listing MTLS-auth credentials
      summary: List all MTLS-auth credentials associated with a Consumer in a workspace
      tags:
      - MTLS-auth credentials
    post:
      description: Create a new MTLS-auth credential associated with a Consumer in
        a workspace
      operationId: create-mtls-auth-with-consumer-in-workspace
      parameters:
      - "$ref": "#/components/parameters/ConsumerIdForNestedEntities"
      - description: Name or ID of workspace
        example: team-a
        in: path
        name: workspace
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              "$ref": "#/components/schemas/MTLSAuthWithoutParents"
        description: Description of new MTLS-auth credential for creation
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/MTLSAuth"
          description: Successfully created MTLS-auth credential
      summary: Create a new MTLS-auth credential associated with a Consumer in a workspace
      tags:
      - MTLS-auth credentials
  "/{workspace}/consumers/{ConsumerIdForNestedEntities}/mtls-auth/{MTLSAuthId}":
    delete:
      description: Delete a a MTLS-auth credential associated with a Consumer using
        ID in a workspace.
      operationId: delete-mtls-auth-with-consumer-in-workspace
      parameters:
      - "$ref": "#/components/parameters/ConsumerIdForNestedEntities"
      - "$ref": "#/components/parameters/MTLSAuthId"
      - description: Name or ID of workspace
        example: team-a
        in: path
        name: workspace
        required: true
        schema:
          type: string
      responses:
        '204':
          description: Successfully deleted MTLS-auth credential or the resource didn't
            exist
      summary: Delete a a MTLS-auth credential associated with a Consumer in a workspace
      tags:
      - MTLS-auth credentials
    get:
      description: Get a MTLS-auth credential associated with a Consumer using ID
        in a workspace.
      operationId: get-mtls-auth-with-consumer-in-workspace
      parameters:
      - "$ref": "#/components/parameters/ConsumerIdForNestedEntities"
      - "$ref": "#/components/parameters/MTLSAuthId"
      - description: Name or ID of workspace
        example: team-a
        in: path
        name: workspace
        required: true
        schema:
          type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/MTLSAuth"
          description: Successfully fetched MTLS-auth credential
        '404':
          description: Resource does not exist
      summary: Fetch a MTLS-auth credential associated with a Consumer in a workspace
      tags:
      - MTLS-auth credentials
    patch:
      description: Update a a MTLS-auth credential associated with a Consumer using
        ID in a workspace.
      operationId: update-mtls-auth-with-consumer-in-workspace
      parameters:
      - "$ref": "#/components/parameters/ConsumerIdForNestedEntities"
      - "$ref": "#/components/parameters/MTLSAuthId"
      - description: Name or ID of workspace
        example: team-a
        in: path
        name: workspace
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              "$ref": "#/components/schemas/MTLSAuth"
        description: Fields of the MTLS-auth credential that need to be updated
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/MTLSAuth"
          description: Successfully updated MTLS-auth credential
        '404':
          description: Resource does not exist
      summary: Update a a MTLS-auth credential associated with a Consumer in a workspace
      tags:
      - MTLS-auth credentials
    put:
      description: Create or Update a MTLS-auth credential associated with a Consumer
        using ID in a workspace.
      operationId: upsert-mtls-auth-with-consumer-in-workspace
      parameters:
      - "$ref": "#/components/parameters/ConsumerIdForNestedEntities"
      - "$ref": "#/components/parameters/MTLSAuthId"
      - description: Name or ID of workspace
        example: team-a
        in: path
        name: workspace
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              "$ref": "#/components/schemas/MTLSAuthWithoutParents"
        description: Description of the MTLS-auth credential
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/MTLSAuth"
          description: Successfully upserted MTLS-auth credential
      summary: Upsert a MTLS-auth credential associated with a Consumer in a workspace
      tags:
      - MTLS-auth credentials
  "/{workspace}/mtls-auths":
    get:
      description: List all MTLS-auth credentials in a workspace
      operationId: list-mtls-auth-in-workspace
      parameters:
      - "$ref": "#/components/parameters/PaginationSize"
      - "$ref": "#/components/parameters/PaginationOffset"
      - "$ref": "#/components/parameters/PaginationTagsFilter"
      - description: Name or ID of workspace
        example: team-a
        in: path
        name: workspace
        required: true
        schema:
          type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  data:
                    items:
                      "$ref": "#/components/schemas/MTLSAuth"
                    type: array
                  next:
                    "$ref": "#/components/schemas/PaginationNextResponse"
                  offset:
                    "$ref": "#/components/schemas/PaginationOffsetResponse"
                type: object
          description: A successful response listing MTLS-auth credentials
        '401':
          "$ref": "#/components/responses/HTTP401Error"
      summary: List all MTLS-auth credentials in a workspace
      tags:
      - MTLS-auth credentials
    post:
      description: Create a new MTLS-auth credential in a workspace
      operationId: create-mtls-auth-in-workspace
      parameters:
      - description: Name or ID of workspace
        example: team-a
        in: path
        name: workspace
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              "$ref": "#/components/schemas/MTLSAuth"
        description: Description of the new MTLS-auth credential for creation
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/MTLSAuth"
          description: Successfully created MTLS-auth credential
        '401':
          "$ref": "#/components/responses/HTTP401Error"
      summary: Create a new MTLS-auth credential in a workspace
      tags:
      - MTLS-auth credentials
  "/{workspace}/mtls-auths/{MTLSAuthId}":
    delete:
      description: Delete a MTLS-auth credential in a workspace
      operationId: delete-mtls-auth-in-workspace
      parameters:
      - "$ref": "#/components/parameters/MTLSAuthId"
      - description: Name or ID of workspace
        example: team-a
        in: path
        name: workspace
        required: true
        schema:
          type: string
      responses:
        '204':
          description: Successfully deleted MTLS-auth credential or the resource didn't
            exist
        '401':
          "$ref": "#/components/responses/HTTP401Error"
      summary: Delete a MTLS-auth credential in a workspace
      tags:
      - MTLS-auth credentials
    get:
      description: Get a MTLS-auth credential using ID in a workspace.
      operationId: get-mtls-auth-in-workspace
      parameters:
      - description: Name or ID of workspace
        example: team-a
        in: path
        name: workspace
        required: true
        schema:
          type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/MTLSAuth"
          description: Successfully fetched MTLS-auth credential
        '401':
          "$ref": "#/components/responses/HTTP401Error"
        '404':
          description: Resource does not exist
      summary: Fetch a MTLS-auth credential in a workspace
      tags:
      - MTLS-auth credentials
    parameters:
    - "$ref": "#/components/parameters/MTLSAuthId"
    patch:
      description: Update a MTLS-auth credential in a workspace
      operationId: update-mtls-auth-in-workspace
      parameters:
      - description: Name or ID of workspace
        example: team-a
        in: path
        name: workspace
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              "$ref": "#/components/schemas/MTLSAuth"
        description: Fields of the MTLS-auth credential that need to be updated
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/MTLSAuth"
          description: Successfully updated MTLS-auth credential
        '401':
          "$ref": "#/components/responses/HTTP401Error"
        '404':
          description: Resource does not exist
      summary: Update a MTLS-auth credential in a workspace
      tags:
      - MTLS-auth credentials
    put:
      description: Create or Update MTLS-auth credential using ID in a workspace.
      operationId: upsert-mtls-auth-in-workspace
      parameters:
      - description: Name or ID of workspace
        example: team-a
        in: path
        name: workspace
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              "$ref": "#/components/schemas/MTLSAuth"
        description: Description of the MTLS-auth credential
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/MTLSAuth"
          description: Successfully upserted MTLS-auth credential
        '401':
          "$ref": "#/components/responses/HTTP401Error"
      summary: Upsert a MTLS-auth credential in a workspace
      tags:
      - MTLS-auth credentials
  "/consumers/{ConsumerIdForNestedEntities}/mtls-auth":
    get:
      description: List all MTLS-auth credentials associated with a Consumer
      operationId: list-mtls-auth-with-consumer
      parameters:
      - "$ref": "#/components/parameters/ConsumerIdForNestedEntities"
      - "$ref": "#/components/parameters/PaginationSize"
      - "$ref": "#/components/parameters/PaginationOffset"
      - "$ref": "#/components/parameters/PaginationTagsFilter"
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  data:
                    items:
                      "$ref": "#/components/schemas/MTLSAuth"
                    type: array
                  next:
                    "$ref": "#/components/schemas/PaginationNextResponse"
                  offset:
                    "$ref": "#/components/schemas/PaginationOffsetResponse"
                type: object
          description: A successful response listing MTLS-auth credentials
      summary: List all MTLS-auth credentials associated with a Consumer
      tags:
      - MTLS-auth credentials
    post:
      description: Create a new MTLS-auth credential associated with a Consumer
      operationId: create-mtls-auth-with-consumer
      parameters:
      - "$ref": "#/components/parameters/ConsumerIdForNestedEntities"
      requestBody:
        content:
          application/json:
            schema:
              "$ref": "#/components/schemas/MTLSAuthWithoutParents"
        description: Description of new MTLS-auth credential for creation
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/MTLSAuth"
          description: Successfully created MTLS-auth credential
      summary: Create a new MTLS-auth credential associated with a Consumer
      tags:
      - MTLS-auth credentials
  "/consumers/{ConsumerIdForNestedEntities}/mtls-auth/{MTLSAuthId}":
    delete:
      description: Delete a a MTLS-auth credential associated with a Consumer using
        ID.
      operationId: delete-mtls-auth-with-consumer
      parameters:
      - "$ref": "#/components/parameters/ConsumerIdForNestedEntities"
      - "$ref": "#/components/parameters/MTLSAuthId"
      responses:
        '204':
          description: Successfully deleted MTLS-auth credential or the resource didn't
            exist
      summary: Delete a a MTLS-auth credential associated with a Consumer
      tags:
      - MTLS-auth credentials
    get:
      description: Get a MTLS-auth credential associated with a Consumer using ID.
      operationId: get-mtls-auth-with-consumer
      parameters:
      - "$ref": "#/components/parameters/ConsumerIdForNestedEntities"
      - "$ref": "#/components/parameters/MTLSAuthId"
      responses:
        '200':
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/MTLSAuth"
          description: Successfully fetched MTLS-auth credential
        '404':
          description: Resource does not exist
      summary: Fetch a MTLS-auth credential associated with a Consumer
      tags:
      - MTLS-auth credentials
    patch:
      description: Update a a MTLS-auth credential associated with a Consumer using
        ID.
      operationId: update-mtls-auth-with-consumer
      parameters:
      - "$ref": "#/components/parameters/ConsumerIdForNestedEntities"
      - "$ref": "#/components/parameters/MTLSAuthId"
      requestBody:
        content:
          application/json:
            schema:
              "$ref": "#/components/schemas/MTLSAuth"
        description: Fields of the MTLS-auth credential that need to be updated
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/MTLSAuth"
          description: Successfully updated MTLS-auth credential
        '404':
          description: Resource does not exist
      summary: Update a a MTLS-auth credential associated with a Consumer
      tags:
      - MTLS-auth credentials
    put:
      description: Create or Update a MTLS-auth credential associated with a Consumer
        using ID.
      operationId: upsert-mtls-auth-with-consumer
      parameters:
      - "$ref": "#/components/parameters/ConsumerIdForNestedEntities"
      - "$ref": "#/components/parameters/MTLSAuthId"
      requestBody:
        content:
          application/json:
            schema:
              "$ref": "#/components/schemas/MTLSAuthWithoutParents"
        description: Description of the MTLS-auth credential
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/MTLSAuth"
          description: Successfully upserted MTLS-auth credential
      summary: Upsert a MTLS-auth credential associated with a Consumer
      tags:
      - MTLS-auth credentials
servers:
- description: Default Admin API URL
  url: "{protocol}://{hostname}:{port}{path}"
  variables:
    hostname:
      default: localhost
      description: Hostname for Kong's Admin API
    path:
      default: "/"
      description: Base path for Kong's Admin API
    port:
      default: '8001'
      description: Port for Kong's Admin API
    protocol:
      default: http
      description: Protocol for requests to Kong's Admin API
      enum:
      - http
      - https
tags:
- name: MTLS-auth credentials

더 알아보기 (Learn more)

  • Kong 개발자 포털에서 플러그인과 API에 대한 전체 문서를 확인해 보세요 — developer.konghq.com