diff --git a/backendAPI/Dockerfile b/backendAPI/Dockerfile index 1d1a3b01..717e4ea7 100644 --- a/backendAPI/Dockerfile +++ b/backendAPI/Dockerfile @@ -21,7 +21,7 @@ RUN pip install --upgrade pip && \ # --no-create-home \ # backend-user # USER backend-user -CMD ["uvicorn", "main:app", "--reload", "--host", "0.0.0.0", "--port", "80"] +CMD ["uvicorn", "main:app", "--reload", "--log-level", "'warning'" ,"--host", "0.0.0.0", "--port", "80"] FROM base AS prod LABEL org.opencontainers.image.source https://github.com/arnoldknott/fullstacksandbox23 diff --git a/backendAPI/src/main.py b/backendAPI/src/main.py index 521d8072..8509775a 100644 --- a/backendAPI/src/main.py +++ b/backendAPI/src/main.py @@ -62,19 +62,20 @@ async def lifespan(app: FastAPI): # scopes={ # f"api://{config.API_SCOPE}/api.read": "Read API", # f"api://{config.API_SCOPE}/api.write": "Write API", +# f"api://{config.API_SCOPE}/socketio": "Socket.io", # }, # scheme_name="OAuth2 Authorization Code", # description="OAuth2 Authorization Code Bearer implementation for Swagger UI - identity provider is Microsoft Azure AD", # ) # swagger_ui_parameters = { -# "oauth2RedirectUrl": "http://localhost:8000/oauth/callback", # replace with your actual callback URL +# "oauth2RedirectUrl": "http://localhost:8000/docs/oauth2-redirect", # replace with your actual callback URL # } # or: # swagger_ui_parameters = { # "network": { -# "oauth2RedirectUrl": "http://localhost:8000/oauth/callback", # replace with your actual callback URL +# "oauth2RedirectUrl": "http://localhost:8000/docs/oauth2-redirect", # replace with your actual callback URL # } # } diff --git a/backendAPI/src/routers/api/v1/core.py b/backendAPI/src/routers/api/v1/core.py index 12ff575c..d58f0163 100644 --- a/backendAPI/src/routers/api/v1/core.py +++ b/backendAPI/src/routers/api/v1/core.py @@ -46,7 +46,7 @@ # "code": code, # "client_id": config.AZURE_CLIENT_ID, # "client_secret": config.BACK_CLIENT_SECRET, -# "redirect_uri": "http://localhost:8000/callback", # replace with your actual callback URL +# "redirect_uri": "http://localhost:8000/docs/oauth2-redirect", # replace with your actual callback URL # } # response = httpx.post( # "https://login.microsoftonline.com/{config.AZURE_TENANT_ID}/oauth2/token", @@ -106,7 +106,7 @@ async def get_keyvault(): # } # # Not working yet, callback needs to handle the token -# @router.get("/callback") +# @router.get("/docs/oauth2-redirect") # def callback(code: str = Depends(oauth2_scheme)): # token = exchange_code_for_token(code) # if not token: diff --git a/backendAPI/src/routers/socketio/v1/base.py b/backendAPI/src/routers/socketio/v1/base.py index 194322dd..b0b93abf 100644 --- a/backendAPI/src/routers/socketio/v1/base.py +++ b/backendAPI/src/routers/socketio/v1/base.py @@ -192,8 +192,8 @@ async def on_connect( ) except Exception as err: logger.error(f"Client with session id {sid} failed to authenticate.") - print("=== base - on_connect - Exception ===") - print(err, flush=True) + # print("=== base - on_connect - Exception ===") + # print(err, flush=True) raise ConnectionRefusedError("Authorization failed") else: current_user = None