This commit is contained in:
Wolfgang Hottgenroth 2021-05-07 12:24:59 +02:00
parent a921fb6a0f
commit 309b4c6ba8
Signed by: wn
GPG Key ID: E49AF3B9EF6DD469
2 changed files with 5 additions and 12 deletions

15
auth.py
View File

@ -30,20 +30,13 @@ class PasswordMismatchException(Exception):
UserEntry = namedtuple('UserEntry', ['id', 'login', 'expiry', 'claims'])
JWT_PRIV_KEY = ""
try:
JWT_PRIV_KEY = os.environ["JWT_PRIV_KEY"]
except KeyError:
with open('/opt/app/config/authservice.key', 'r') as f:
JWT_PRIV_KEY = f.read()
with open('/opt/app/config/authservice.key', 'r') as f:
JWT_PRIV_KEY = f.read()
JWT_PUB_KEY = ""
try:
JWT_PUB_KEY = os.environ["JWT_PUB_KEY"]
except KeyError:
with open('/opt/app/config/authservice.pub', 'r') as f:
JWT_PUB_KEY = f.read()
with open('/opt/app/config/authservice.pub', 'r') as f:
JWT_PUB_KEY = f.read()
def getUserEntryFromDB(application: str, login: str):

View File

@ -25,7 +25,7 @@ paths:
post:
tags: [ "JWT" ]
summary: Accept encrypted set of credentials, return JWT token
operationId: auth.generateToken
operationId: auth.generateTokenFromEnc
requestBody:
content:
'text/plain':