From 309b4c6ba827de15200ae336bafdc7700ca739a6 Mon Sep 17 00:00:00 2001 From: Wolfgang Hottgenroth Date: Fri, 7 May 2021 12:24:59 +0200 Subject: [PATCH] authe --- auth.py | 15 ++++----------- openapi.yaml | 2 +- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/auth.py b/auth.py index 3c57aaa..357399c 100755 --- a/auth.py +++ b/auth.py @@ -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): diff --git a/openapi.yaml b/openapi.yaml index 047565e..9f07e58 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -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':