2021-01-25 21:52:52 +01:00
|
|
|
openapi: 3.0.0
|
|
|
|
info:
|
|
|
|
title: AuthService
|
|
|
|
version: "0.1"
|
|
|
|
|
|
|
|
paths:
|
2021-06-15 23:13:18 +02:00
|
|
|
/token:
|
2021-01-25 21:52:52 +01:00
|
|
|
post:
|
|
|
|
tags: [ "JWT" ]
|
2021-06-15 23:13:18 +02:00
|
|
|
summary: Accept encrypted or clear set of credentials, return JWT token
|
2021-01-25 21:52:52 +01:00
|
|
|
operationId: auth.generateToken
|
2021-01-26 13:43:09 +01:00
|
|
|
requestBody:
|
|
|
|
content:
|
|
|
|
'application/json':
|
|
|
|
schema:
|
2021-06-15 23:13:18 +02:00
|
|
|
anyOf:
|
|
|
|
- $ref: '#/components/schemas/User'
|
|
|
|
- $ref: '#/components/schemas/EncUser'
|
2021-05-07 12:15:30 +02:00
|
|
|
responses:
|
|
|
|
'200':
|
|
|
|
description: JWT token
|
|
|
|
content:
|
|
|
|
'text/plain':
|
|
|
|
schema:
|
|
|
|
type: string
|
2021-06-15 23:13:18 +02:00
|
|
|
/test:
|
2021-01-25 21:52:52 +01:00
|
|
|
get:
|
2021-05-11 16:52:41 +02:00
|
|
|
tags: [ "Test" ]
|
2021-01-25 21:52:52 +01:00
|
|
|
summary: Return secret string
|
2021-06-15 23:13:18 +02:00
|
|
|
operationId: auth.testToken
|
2021-01-25 21:52:52 +01:00
|
|
|
responses:
|
|
|
|
'200':
|
|
|
|
description: secret response
|
|
|
|
content:
|
|
|
|
'text/plain':
|
|
|
|
schema:
|
|
|
|
type: string
|
|
|
|
security:
|
|
|
|
- jwt: ['secret']
|
2021-05-06 16:37:32 +02:00
|
|
|
/pubkey:
|
|
|
|
get:
|
|
|
|
tags: [ "JWT" ]
|
|
|
|
summary: Get the public key of this issuer
|
|
|
|
operationId: auth.getPubKey
|
|
|
|
responses:
|
|
|
|
'200':
|
|
|
|
description: public key
|
|
|
|
content:
|
|
|
|
'text/plain':
|
|
|
|
schema:
|
|
|
|
type: string
|
|
|
|
|
2021-01-25 21:52:52 +01:00
|
|
|
|
|
|
|
components:
|
|
|
|
securitySchemes:
|
|
|
|
jwt:
|
|
|
|
type: http
|
|
|
|
scheme: bearer
|
|
|
|
bearerFormat: JWT
|
2021-05-11 16:48:02 +02:00
|
|
|
x-bearerInfoFunc: auth.decodeToken
|
2021-01-26 13:43:09 +01:00
|
|
|
schemas:
|
|
|
|
User:
|
2021-01-26 21:27:17 +01:00
|
|
|
description: Application/Login/Password tuple
|
2021-01-26 13:43:09 +01:00
|
|
|
type: object
|
|
|
|
properties:
|
2021-01-26 21:27:17 +01:00
|
|
|
application:
|
|
|
|
type: string
|
2021-01-26 13:43:09 +01:00
|
|
|
login:
|
|
|
|
type: string
|
|
|
|
password:
|
|
|
|
type: string
|
2021-06-15 23:13:18 +02:00
|
|
|
EncUser:
|
|
|
|
description: Encrypted Application/Login/Password tuple
|
|
|
|
type: object
|
|
|
|
properties:
|
|
|
|
encAleTuple:
|
|
|
|
type: string
|