Skip to content

Commit

Permalink
MSYS2 bootstrapper (#332)
Browse files Browse the repository at this point in the history
* Added API endpoints to pass files from the MSYS2 repos to the client MSYS2 terminals
* Updated documentation to reflect addition of MSYS2 support
* Updated documentation with 'virtualenv' and 'murfey' installation instructions
  • Loading branch information
tieneupin authored Sep 27, 2024
1 parent 70f5b4a commit 9c57c99
Show file tree
Hide file tree
Showing 6 changed files with 618 additions and 199 deletions.
10 changes: 5 additions & 5 deletions src/murfey/server/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@


class ExtendedRecord(NamedTuple):
record: Base
record_params: List[Base]
record: Base # type: ignore
record_params: List[Base] # type: ignore


class JobIDs(NamedTuple):
Expand Down Expand Up @@ -2852,8 +2852,8 @@ def _register(record, header: dict, **kwargs):
raise NotImplementedError(f"Not method to register {record} or type {type(record)}")


@_register.register # type: ignore
def _(record: Base, header: dict, **kwargs):
@_register.register
def _(record: Base, header: dict, **kwargs): # type: ignore
if not _transport_object:
logger.error(
f"No transport object found when processing record {record}. Message header: {header}"
Expand Down Expand Up @@ -2891,7 +2891,7 @@ def _(record: Base, header: dict, **kwargs):
return None


@_register.register # type: ignore
@_register.register
def _(extended_record: ExtendedRecord, header: dict, **kwargs):
if not _transport_object:
raise ValueError(
Expand Down
10 changes: 8 additions & 2 deletions src/murfey/server/api/auth.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from __future__ import annotations

import importlib.metadata
import secrets
import sys
from logging import getLogger
from typing import Annotated, Dict

Expand All @@ -17,6 +17,11 @@
from murfey.util.db import MurfeyUser as User
from murfey.util.db import Session as MurfeySession

if sys.version_info < (3, 10):
from importlib_metadata import entry_points
else:
from importlib.metadata import entry_points

# Set up logger
logger = getLogger("murfey.server.api.auth")

Expand Down Expand Up @@ -64,7 +69,8 @@ def validate_user(username: str, password: str) -> bool:


def validate_visit(visit_name: str, token: str) -> bool:
if validators := importlib.metadata.entry_points().select(
# Entry points have to be handled differently pre-3.9
if validators := entry_points().select(
group="murfey.auth.session_validation",
name=machine_config.auth.session_validation,
):
Expand Down
Loading

0 comments on commit 9c57c99

Please sign in to comment.