change testoutput format
This commit is contained in:
parent
3d0e602ee6
commit
b30e587c34
11
auth.py
11
auth.py
@ -19,9 +19,10 @@ def decodeToken(token):
|
|||||||
logger.error("{}".format(e))
|
logger.error("{}".format(e))
|
||||||
raise werkzeug.exceptions.Unauthorized()
|
raise werkzeug.exceptions.Unauthorized()
|
||||||
|
|
||||||
def testToken(user, token_info):
|
|
||||||
return '''
|
def testToken(user, token_info):
|
||||||
You are user_id {user} and the provided token has been signed by this issuers. Fine.'.
|
return {
|
||||||
Decoded token claims: {token_info}.
|
"message": f"You are user_id {user} and the provided token has been signed by this issuers. Fine.",
|
||||||
'''.format(user=user, token_info=token_info)
|
"details": token_info
|
||||||
|
}
|
||||||
|
|
||||||
|
13
openapi.yaml
13
openapi.yaml
@ -21,9 +21,9 @@ paths:
|
|||||||
'200':
|
'200':
|
||||||
description: secret response
|
description: secret response
|
||||||
content:
|
content:
|
||||||
'text/plain':
|
'application/json':
|
||||||
schema:
|
schema:
|
||||||
type: string
|
$ref: '#/components/schemas/TestOutput'
|
||||||
security:
|
security:
|
||||||
- jwt: ['secret']
|
- jwt: ['secret']
|
||||||
|
|
||||||
@ -35,3 +35,12 @@ components:
|
|||||||
scheme: bearer
|
scheme: bearer
|
||||||
bearerFormat: JWT
|
bearerFormat: JWT
|
||||||
x-bearerInfoFunc: auth.decodeToken
|
x-bearerInfoFunc: auth.decodeToken
|
||||||
|
schemas:
|
||||||
|
TestOutput:
|
||||||
|
description: Test Output
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
message:
|
||||||
|
type: string
|
||||||
|
details:
|
||||||
|
type: object
|
||||||
|
Loading…
x
Reference in New Issue
Block a user