test output
This commit is contained in:
parent
9929b38db7
commit
5b1209679b
8
auth.py
8
auth.py
@ -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
|
||||
}
|
||||
|
||||
|
12
openapi.yaml
12
openapi.yaml
@ -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
|
||||
|
@ -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")
|
||||
|
Loading…
x
Reference in New Issue
Block a user