support handover of cleartext and encrypted credentials, refactor naming of methods

This commit is contained in:
2021-06-15 23:13:18 +02:00
parent 1f55ef0a80
commit 91178b1fa7
4 changed files with 48 additions and 44 deletions

View File

@ -4,16 +4,18 @@ info:
version: "0.1"
paths:
/auth:
/token:
post:
tags: [ "JWT" ]
summary: Accept login and password, return JWT token
summary: Accept encrypted or clear set of credentials, return JWT token
operationId: auth.generateToken
requestBody:
content:
'application/json':
schema:
$ref: '#/components/schemas/User'
anyOf:
- $ref: '#/components/schemas/User'
- $ref: '#/components/schemas/EncUser'
responses:
'200':
description: JWT token
@ -21,28 +23,11 @@ paths:
'text/plain':
schema:
type: string
/authe:
post:
tags: [ "JWT" ]
summary: Accept encrypted set of credentials, return JWT token
operationId: auth.generateTokenFromEnc
requestBody:
content:
'text/plain':
schema:
type: string
responses:
'200':
description: JWT token
content:
'text/plain':
schema:
type: string
/secret:
/test:
get:
tags: [ "Test" ]
summary: Return secret string
operationId: auth.getSecret
operationId: auth.testToken
responses:
'200':
description: secret response
@ -84,3 +69,9 @@ components:
type: string
password:
type: string
EncUser:
description: Encrypted Application/Login/Password tuple
type: object
properties:
encAleTuple:
type: string