This commit is contained in:
2021-01-26 13:43:09 +01:00
parent b88dec12d3
commit 0d898061c6
5 changed files with 186 additions and 55 deletions

View File

@ -4,24 +4,16 @@ info:
version: "0.1"
paths:
/auth/{login}:
/auth:
post:
tags: [ "JWT" ]
summary: Return JWT token
operationId: auth.generateToken
parameters:
- name: login
description: Login
in: path
required: true
schema:
type: string
- name: password
description: Password
in: body
required: true
schema:
type: string
requestBody:
content:
'application/json':
schema:
$ref: '#/components/schemas/User'
responses:
'200':
description: JWT token
@ -33,7 +25,7 @@ paths:
get:
tags: [ "JWT" ]
summary: Return secret string
operationId: auth.getSecret
operationId: test.getSecret
responses:
'200':
description: secret response
@ -50,4 +42,13 @@ components:
type: http
scheme: bearer
bearerFormat: JWT
x-bearerInfoFunc: auth.decodeToken
x-bearerInfoFunc: test.decodeToken
schemas:
User:
description: Login/Password tuple
type: object
properties:
login:
type: string
password:
type: string