Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions src/murfey/server/api/auth.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from __future__ import annotations

import os
import secrets
import time
from logging import getLogger
Expand All @@ -19,7 +18,7 @@

from murfey.server import sanitise
from murfey.server.murfey_db import murfey_db, url
from murfey.util.config import get_machine_config, get_security_config
from murfey.util.config import get_security_config
from murfey.util.db import MurfeyUser as User
from murfey.util.db import Session as MurfeySession

Expand Down Expand Up @@ -64,12 +63,7 @@ async def __call__(self, request: Request):

# Set up variables used for authentication
security_config = get_security_config()
machine_config = get_machine_config()
auth_url = (
machine_config[os.getenv("BEAMLINE", "")].auth_url
if machine_config.get(os.getenv("BEAMLINE", ""))
else ""
)
auth_url = security_config.auth_url
ALGORITHM = security_config.auth_algorithm or "HS256"
SECRET_KEY = security_config.auth_key or secrets.token_hex(32)
if security_config.auth_type == "password":
Expand Down
2 changes: 1 addition & 1 deletion src/murfey/util/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ class MachineConfig(BaseModel, extra=Extra.allow): # type: ignore
rsync_url: str = ""

security_configuration_path: Optional[Path] = None
auth_url: str = ""

notifications_queue: str = "pato_notification"

Expand All @@ -88,6 +87,7 @@ class Security(BaseModel):
crypto_key: str
auth_key: str = ""
auth_algorithm: str = ""
auth_url: str = ""
sqlalchemy_pooling: bool = True
allow_origins: List[str] = ["*"]
session_validation: str = ""
Expand Down