diff --git a/src/python/jw/util/auth/Auth.py b/src/python/jw/util/auth/Auth.py index 46266bd..bd70a3d 100644 --- a/src/python/jw/util/auth/Auth.py +++ b/src/python/jw/util/auth/Auth.py @@ -3,13 +3,17 @@ from __future__ import annotations import abc from enum import Enum, Flag, auto -from typing import TYPE_CHECKING, Self, Sequence +from typing import TYPE_CHECKING from ..log import ERR from ..misc import load_object if TYPE_CHECKING: + + from typing import Any, Self, Sequence + from ..Config import Config + from ..stree.StringTree import StringTree class Access(Enum): # export Read = auto() @@ -80,7 +84,11 @@ class User(AuthEntity): # export class Auth(abc.ABC): # export @classmethod - def load(cls, conf: Config, tp: str = '') -> Self: + def load(cls, conf: Config | dict[str, Any] | StringTree, tp: str = '') -> Self: + if isinstance(conf, dict): + conf = StringTree.from_dict(conf) + if isinstance(conf, StringTree): + conf = Config(tree = conf) if tp == '': val = conf.get('type') if val is None: