test output
This commit is contained in:
8
auth.py
8
auth.py
@ -165,8 +165,8 @@ def decodeToken(token):
|
|||||||
raise werkzeug.exceptions.Unauthorized()
|
raise werkzeug.exceptions.Unauthorized()
|
||||||
|
|
||||||
def testToken(user, token_info):
|
def testToken(user, token_info):
|
||||||
return '''
|
return {
|
||||||
You are user_id {user} and the provided token has been signed by this issuers. Fine.'.
|
"message": f"You are user_id {user} and the provided token has been signed by this issuers. Fine.",
|
||||||
Decoded token claims: {token_info}.
|
"details": token_info
|
||||||
'''.format(user=user, token_info=token_info)
|
}
|
||||||
|
|
||||||
|
12
openapi.yaml
12
openapi.yaml
@ -32,9 +32,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']
|
||||||
/pubkey:
|
/pubkey:
|
||||||
@ -75,3 +75,11 @@ components:
|
|||||||
properties:
|
properties:
|
||||||
encAleTuple:
|
encAleTuple:
|
||||||
type: string
|
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):
|
class JweTestMethods(unittest.TestCase):
|
||||||
def test_encryptDecrypt(self):
|
def test_encryptDecrypt(self):
|
||||||
inObj = {"application":"test", "login":"wn", "password":"joshua"}
|
inObj = {"application":"hv2", "login":"wn", "password":"joshua"}
|
||||||
plainText = json.dumps(inObj)
|
plainText = json.dumps(inObj)
|
||||||
|
|
||||||
cryptText = jwe.encrypt(plainText, JWT_PUB_KEY, "A256GCM", "RSA-OAEP")
|
cryptText = jwe.encrypt(plainText, JWT_PUB_KEY, "A256GCM", "RSA-OAEP")
|
||||||
|
Reference in New Issue
Block a user