223 lines
5.4 KiB
YAML
223 lines
5.4 KiB
YAML
openapi: 3.0.3
|
|
info:
|
|
title: swisssign-challenge - dlmw
|
|
description: |-
|
|
This is the documentation for the SwissSign Challenge API.
|
|
termsOfService: ""
|
|
contact:
|
|
email: dylan@dlmw.ch
|
|
license:
|
|
name: GNU General Public License Version 3
|
|
url: https://www.gnu.org/licenses/gpl-3.0.txt
|
|
version: 0.0.1
|
|
externalDocs:
|
|
description: ""
|
|
url: ""
|
|
servers:
|
|
- url: ""
|
|
tags:
|
|
- name: token
|
|
description: ""
|
|
- name: signing-request
|
|
description: ""
|
|
- name: signing-request-document
|
|
description: ""
|
|
|
|
paths:
|
|
/signing-request/{id}:
|
|
get:
|
|
tags:
|
|
- signing-request
|
|
summary: Get a signing request
|
|
operationId: getSigningRequest
|
|
parameters:
|
|
- name: id
|
|
in: path
|
|
required: true
|
|
description: The ID of the signing request
|
|
schema:
|
|
type: string
|
|
responses:
|
|
200:
|
|
description: "Signing request was found"
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: "#/components/schemas/GetSigningRequestResponse"
|
|
401:
|
|
description: "Unauthorized"
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: "#/components/schemas/ErrorResponse"
|
|
404:
|
|
description: "Signing request was not found"
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: "#/components/schemas/ErrorResponse"
|
|
|
|
/signing-request-document/{id}:
|
|
patch:
|
|
tags:
|
|
- signing-request-document
|
|
summary: Change some data in a signing request document
|
|
operationId: patchSigningRequestDocument
|
|
parameters:
|
|
- name: id
|
|
in: path
|
|
required: true
|
|
description: The ID of the signing request document
|
|
schema:
|
|
type: string
|
|
requestBody:
|
|
content:
|
|
application/json:
|
|
schema:
|
|
items:
|
|
$ref: "#/components/schemas/PatchOperation"
|
|
responses:
|
|
204:
|
|
description: "Signing request document was patched"
|
|
401:
|
|
description: "Unauthorized"
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: "#/components/schemas/ErrorResponse"
|
|
404:
|
|
description: "Signing request document was not found"
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: "#/components/schemas/ErrorResponse"
|
|
|
|
/signing-request-document/{id}/data:
|
|
get:
|
|
tags:
|
|
- signing-request-document
|
|
summary: Get the file data of a signing request document
|
|
operationId: getSigningRequestDocumentData
|
|
parameters:
|
|
- name: id
|
|
in: path
|
|
required: true
|
|
description: The ID of the signing request document
|
|
schema:
|
|
type: string
|
|
responses:
|
|
200:
|
|
description: "Signing request document file data was found"
|
|
content:
|
|
application/pdf:
|
|
schema:
|
|
type: string
|
|
format: binary
|
|
404:
|
|
description: "Signing request document file data was not found"
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: "#/components/schemas/ErrorResponse"
|
|
|
|
/token:
|
|
post:
|
|
tags:
|
|
- token
|
|
summary: Create a bearer token
|
|
operationId: createToken
|
|
requestBody:
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: "#/components/schemas/CreateSessionRequest"
|
|
responses:
|
|
200:
|
|
description: "New token was generated"
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: "#/components/schemas/CreateSessionResponse"
|
|
400:
|
|
description: "Couldn't process request"
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: "#/components/schemas/ErrorResponse"
|
|
|
|
components:
|
|
schemas:
|
|
CreateSessionRequest:
|
|
type: object
|
|
required:
|
|
- username
|
|
- password
|
|
properties:
|
|
username:
|
|
type: string
|
|
password:
|
|
type: string
|
|
|
|
CreateSessionResponse:
|
|
type: object
|
|
required:
|
|
- token
|
|
properties:
|
|
token:
|
|
type: string
|
|
|
|
GetSigningRequestResponse:
|
|
type: object
|
|
required:
|
|
- id
|
|
- signed
|
|
properties:
|
|
id:
|
|
type: string
|
|
signingRequestDocuments:
|
|
type: array
|
|
items:
|
|
$ref: "#/components/schemas/GetSigningRequestResponseSigningRequestDocument"
|
|
signed:
|
|
type: boolean
|
|
|
|
GetSigningRequestResponseSigningRequestDocument:
|
|
type: object
|
|
required:
|
|
- id
|
|
- name
|
|
- confirmed
|
|
properties:
|
|
id:
|
|
type: string
|
|
name:
|
|
type: string
|
|
confirmed:
|
|
type: boolean
|
|
|
|
PatchOperation:
|
|
type: object
|
|
required:
|
|
- op
|
|
- path
|
|
- value
|
|
properties:
|
|
op:
|
|
type: string
|
|
path:
|
|
type: string
|
|
value:
|
|
type: string
|
|
|
|
ErrorResponse:
|
|
type: object
|
|
required:
|
|
- message
|
|
- code
|
|
properties:
|
|
message:
|
|
type: string
|
|
description: Human-readable error message
|
|
code:
|
|
type: integer
|
|
description: Machine-readable error code |