adjust for postgres

This commit is contained in:
2021-05-11 16:48:02 +02:00
parent 7346da8419
commit e0bc8371ac
6 changed files with 70 additions and 64 deletions

24
test.py
View File

@ -1,20 +1,8 @@
from jose import JWTError, jwt
import os
import werkzeug
import connexion
import logging
logging.basicConfig(level=logging.INFO)
JWT_SECRET = os.environ['JWT_SECRET']
def decodeToken(token):
try:
return jwt.decode(token, JWT_SECRET)
except JWTError as e:
print("ERROR: decodeToken: {}".format(e))
raise werkzeug.exceptions.Unauthorized()
def getSecret(user, token_info):
return '''
You are user_id {user} and the secret is 'wbevuec'.
Decoded token claims: {token_info}.
'''.format(user=user, token_info=token_info)
app = connexion.App('authservice')
app.add_api('./openapi.yaml')
app.run(port=8080)