Skip to content

Commit

Permalink
adds ssl 11
Browse files Browse the repository at this point in the history
  • Loading branch information
joerivrij committed Oct 19, 2023
1 parent 8a49e15 commit 0e68762
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
11 changes: 7 additions & 4 deletions api/v1/endpoints/register.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
responses={400: {"model": response.BadRequest}},
tags=["register"],
)
def create_propagated_user(user: models.User, request: Request):
async def create_propagated_user(user: models.User, request: Request):
"""
Create the requested client_ids with different APIs.
Expand Down Expand Up @@ -90,11 +90,14 @@ def create_propagated_user(user: models.User, request: Request):
logging.info(f"propagated to all apis result: {str(propagated)}")

token = tokens.create_token(user_ids[0], secret)
resp = {"authorization": f"Bearer {token}", "propagated": propagated}
token_response = {"authorization": f"Bearer {token}", "propagated": propagated}
logging.info(f"found response {token_response}")
if settings.ENV.lower() == "kubernetes":
https_url = request.url.replace(scheme="https")
headers = {"Location": str(https_url)}
return JSONResponse(status_code=200, content=resp, headers=headers)
logging.info(https_url)
logging.info(headers)
return JSONResponse(status_code=200, content=token_response, headers=headers)

else:
return JSONResponse(status_code=200, content=resp)
return JSONResponse(status_code=200, content=token_response)
1 change: 1 addition & 0 deletions api/v1/endpoints/tokens.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from models import response
from models import token as models
from util import tokens
from fastapi.responses import JSONResponse

from config.settings import settings

Expand Down

0 comments on commit 0e68762

Please sign in to comment.