test output

This commit is contained in:
Wolfgang Hottgenroth 2021-06-17 18:50:05 +02:00
parent 9929b38db7
commit 5b1209679b
Signed by: wn
GPG Key ID: E49AF3B9EF6DD469
3 changed files with 15 additions and 7 deletions

View File

@ -165,8 +165,8 @@ def decodeToken(token):
raise werkzeug.exceptions.Unauthorized()
def testToken(user, token_info):
return '''
You are user_id {user} and the provided token has been signed by this issuers. Fine.'.
Decoded token claims: {token_info}.
'''.format(user=user, token_info=token_info)
return {
"message": f"You are user_id {user} and the provided token has been signed by this issuers. Fine.",
"details": token_info
}

View File

@ -32,9 +32,9 @@ paths:
'200':
description: secret response
content:
'text/plain':
'application/json':
schema:
type: string
$ref: '#/components/schemas/TestOutput'
security:
- jwt: ['secret']
/pubkey:
@ -75,3 +75,11 @@ components:
properties:
encAleTuple:
type: string
TestOutput:
description: Test Output
type: object
properties:
message:
type: string
details:
type: object

View File

@ -8,7 +8,7 @@ JWT_PRIV_KEY = os.environ["JWT_PRIV_KEY"]
class JweTestMethods(unittest.TestCase):
def test_encryptDecrypt(self):
inObj = {"application":"test", "login":"wn", "password":"joshua"}
inObj = {"application":"hv2", "login":"wn", "password":"joshua"}
plainText = json.dumps(inObj)
cryptText = jwe.encrypt(plainText, JWT_PUB_KEY, "A256GCM", "RSA-OAEP")