File tree Expand file tree Collapse file tree 2 files changed +3
-9
lines changed
Expand file tree Collapse file tree 2 files changed +3
-9
lines changed Original file line number Diff line number Diff line change 11from __future__ import annotations
22
3- import os
43import secrets
54import time
65from logging import getLogger
1918
2019from murfey .server import sanitise
2120from murfey .server .murfey_db import murfey_db , url
22- from murfey .util .config import get_machine_config , get_security_config
21+ from murfey .util .config import get_security_config
2322from murfey .util .db import MurfeyUser as User
2423from murfey .util .db import Session as MurfeySession
2524
@@ -64,12 +63,7 @@ async def __call__(self, request: Request):
6463
6564# Set up variables used for authentication
6665security_config = get_security_config ()
67- machine_config = get_machine_config ()
68- auth_url = (
69- machine_config [os .getenv ("BEAMLINE" , "" )].auth_url
70- if machine_config .get (os .getenv ("BEAMLINE" , "" ))
71- else ""
72- )
66+ auth_url = security_config .auth_url
7367ALGORITHM = security_config .auth_algorithm or "HS256"
7468SECRET_KEY = security_config .auth_key or secrets .token_hex (32 )
7569if security_config .auth_type == "password" :
Original file line number Diff line number Diff line change @@ -68,7 +68,6 @@ class MachineConfig(BaseModel, extra=Extra.allow): # type: ignore
6868 rsync_url : str = ""
6969
7070 security_configuration_path : Optional [Path ] = None
71- auth_url : str = ""
7271
7372 notifications_queue : str = "pato_notification"
7473
@@ -88,6 +87,7 @@ class Security(BaseModel):
8887 crypto_key : str
8988 auth_key : str = ""
9089 auth_algorithm : str = ""
90+ auth_url : str = ""
9191 sqlalchemy_pooling : bool = True
9292 allow_origins : List [str ] = ["*" ]
9393 session_validation : str = ""
You can’t perform that action at this time.
0 commit comments