Files
ziti/specs/source/client/current-api-session-certificates.yml
T
Andrew Martinez b562fb5c07 splits API specs into composible modules
- splits Open API 2.0 (swagger) into client/management APIs
- uses go-swaggers flatten capabilities
- uses newer version of go-swagger (v0.27.0)
- introduces /edge/client/v1, /edge/management/v1
- non-prefixed URLs default to /edge/client/v1
- splits some shared management/client API handlers
- renames some REST models to "client" instead of "limited"
- passes all apitests, fails dataflow upd test (main fails this as well)
- updates generate rest script for powershell
- todo: test generate rest script for bash
- todo: use xweb (different branch)
2021-05-04 11:30:32 -04:00

166 lines
5.4 KiB
YAML

---
paths:
current-api-session-certificates:
get:
summary: List the ephemeral certificates available for the current API Session
description: Retrieves a list of certificate resources for the current API session; supports filtering, sorting, and pagination
security:
- ztSession: [ ]
tags:
- Current API Session
operationId: listCurrentApiSessionCertificates
parameters:
- $ref: '../shared/parameters.yml#/limit'
- $ref: '../shared/parameters.yml#/offset'
- $ref: '../shared/parameters.yml#/filter'
responses:
'200':
$ref: '#/responses/listCurrentApiSessionCertificates'
post:
summary: Creates an ephemeral certificate for the current API Session
description: Creates an ephemeral certificate for the current API Session. This endpoint
expects a PEM encoded CSRs to be provided for fulfillment as a property of a JSON payload.
It is up to the client to manage the private key backing the CSR request.
security:
- ztSession: [ ]
tags:
- Current API Session
operationId: createCurrentApiSessionCertificate
parameters:
- name: sessionCertificate
in: body
required: true
description: The payload describing the CSR used to create a session certificate
schema:
$ref: '#/definitions/currentApiSessionCertificateCreate'
responses:
'201':
$ref: '#/responses/createCurrentApiSessionCertificateResponse'
'400':
$ref: '../shared/standard-responses.yml#/responses/badRequestResponse'
'401':
$ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse'
current-api-session-certificates-id:
parameters:
- $ref: '../shared/parameters.yml#/id'
get:
summary: Retrieves an ephemeral certificate
description: Retrieves a single ephemeral certificate by id
security:
- ztSession: [ ]
tags:
- Current API Session
operationId: detailCurrentApiSessionCertificate
responses:
'200':
$ref: '#/responses/detailCurrentApiSessionCertificate'
'404':
$ref: '../shared/standard-responses.yml#/responses/notFoundResponse'
'401':
$ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse'
delete:
summary: Delete an ephemeral certificate
description: |
Delete an ephemeral certificateby id
security:
- ztSession: [ ]
tags:
- Current API Session
operationId: deleteCurrentApiSessionCertificate
responses:
'200':
$ref: '../shared/standard-responses.yml#/responses/deleteResponse'
'400':
$ref: '../shared/standard-responses.yml#/responses/badRequestResponse'
'401':
$ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse'
responses:
listCurrentApiSessionCertificates:
description: A list of the current API Session's certificate
schema:
$ref: '#/definitions/listCurrentAPISessionCertificatesEnvelope'
createCurrentApiSessionCertificateResponse:
description: A response of a create API Session certificate
schema:
$ref: '#/definitions/createCurrentApiSessionCertificateEnvelope'
detailCurrentApiSessionCertificate:
description: A response containing a single API Session certificate
schema:
$ref: '#/definitions/detailCurrentApiSessionCertificateEnvelope'
definitions:
listCurrentAPISessionCertificatesEnvelope:
required:
- meta
- data
properties:
meta:
$ref: '../shared/standard-responses.yml#/definitions/meta'
data:
$ref: '#/definitions/currentApiSessionCertificateList'
createCurrentApiSessionCertificateEnvelope:
required:
- meta
- data
properties:
meta:
$ref: '../shared/standard-responses.yml#/definitions/meta'
data:
$ref: '#/definitions/currentApiSessionCertificateCreateResponse'
detailCurrentApiSessionCertificateEnvelope:
required:
- meta
- data
properties:
meta:
$ref: '../shared/standard-responses.yml#/definitions/meta'
data:
$ref: '#/definitions/currentApiSessionCertificateDetail'
currentApiSessionCertificateList:
type: array
items:
$ref: '#/definitions/currentApiSessionCertificateDetail'
currentApiSessionCertificateDetail:
type: object
allOf:
- $ref: '../shared/base-entity.yml#/definitions/baseEntity'
- type: object
required:
- subject
- fingerprint
- validFrom
- validTo
- certificate
properties:
subject:
type: string
fingerprint:
type: string
validFrom:
type: string
format: date-time
validTo:
type: string
format: date-time
certificate:
type: string
currentApiSessionCertificateCreate:
type: object
required:
- csr
properties:
csr:
type: string
currentApiSessionCertificateCreateResponse:
allOf:
- $ref: '../shared/standard-responses.yml#/definitions/createLocation'
- type: object
required:
- certificate
properties:
certificate:
type: string
cas:
type: string