5 Commits
0.1.1 ... 0.1.5

Author SHA1 Message Date
309b4c6ba8 authe 2021-05-07 12:24:59 +02:00
a921fb6a0f changes 2021-05-07 12:15:30 +02:00
f56db65012 pubkey stuff, remove debug 2021-05-06 16:55:39 +02:00
ef0793be4e pubkey stuff 2021-05-06 16:52:16 +02:00
3f2442e259 pubkey stuff 2021-05-06 16:50:17 +02:00
2 changed files with 23 additions and 3 deletions

View File

@ -32,11 +32,11 @@ UserEntry = namedtuple('UserEntry', ['id', 'login', 'expiry', 'claims'])
JWT_PRIV_KEY = ""
with open('/opt/app/config/authservice.key', 'r') as f:
JWT_PRIV_KEY = f.read().replace('\n','')
JWT_PRIV_KEY = f.read()
JWT_PUB_KEY = ""
with open('/opt/app/config/authservice.pub', 'r') as f:
JWT_PUB_KEY = f.read().replace('\n','')
JWT_PUB_KEY = f.read()
def getUserEntryFromDB(application: str, login: str):
@ -129,5 +129,8 @@ def generateToken(**args):
print("ERROR: generateToken: unspecific exception: {}".format(str(e)))
raise werkzeug.exceptions.Unauthorized()
def generateTokenFromEnc(content):
return content
def getPubKey():
return JWT_PUB_KEY

View File

@ -7,7 +7,7 @@ paths:
/auth:
post:
tags: [ "JWT" ]
summary: Return JWT token
summary: Accept login and password, return JWT token
operationId: auth.generateToken
requestBody:
content:
@ -21,6 +21,23 @@ paths:
'text/plain':
schema:
type: string
/authe:
post:
tags: [ "JWT" ]
summary: Accept encrypted set of credentials, return JWT token
operationId: auth.generateTokenFromEnc
requestBody:
content:
'text/plain':
schema:
type: string
responses:
'200':
description: JWT token
content:
'text/plain':
schema:
type: string
/secret:
get:
tags: [ "JWT" ]