mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-01-29 00:51:53 +08:00
unix socket auth
This commit is contained in:
@@ -83,3 +83,6 @@ StorageContext.read_port_names
|
||||
StorageContext.read_atx_cp_delays
|
||||
StorageContext.read_atx_cpl_delays
|
||||
StorageContext.read_atx_cr_delays
|
||||
|
||||
RequestUnixCredentials.pid
|
||||
RequestUnixCredentials.gid
|
||||
|
||||
@@ -40,9 +40,9 @@ from kvmd.crypto import KvmdHtpasswdFile
|
||||
|
||||
|
||||
# =====
|
||||
_E_AUTH = HttpExposed("GET", "/foo_auth", True, (lambda: None))
|
||||
_E_UNAUTH = HttpExposed("GET", "/bar_unauth", True, (lambda: None))
|
||||
_E_FREE = HttpExposed("GET", "/baz_free", False, (lambda: None))
|
||||
_E_AUTH = HttpExposed("GET", "/foo_auth", auth_required=True, allow_usc=True, handler=(lambda: None))
|
||||
_E_UNAUTH = HttpExposed("GET", "/bar_unauth", auth_required=True, allow_usc=True, handler=(lambda: None))
|
||||
_E_FREE = HttpExposed("GET", "/baz_free", auth_required=False, allow_usc=True, handler=(lambda: None))
|
||||
|
||||
|
||||
def _make_service_kwargs(path: str) -> dict:
|
||||
@@ -62,6 +62,8 @@ async def _get_configured_manager(
|
||||
manager = AuthManager(
|
||||
enabled=True,
|
||||
expire=0,
|
||||
usc_users=[],
|
||||
usc_groups=[],
|
||||
unauth_paths=unauth_paths,
|
||||
|
||||
int_type="htpasswd",
|
||||
@@ -262,6 +264,8 @@ async def test_ok__disabled() -> None:
|
||||
manager = AuthManager(
|
||||
enabled=False,
|
||||
expire=0,
|
||||
usc_users=[],
|
||||
usc_groups=[],
|
||||
unauth_paths=[],
|
||||
|
||||
int_type="foobar",
|
||||
|
||||
Reference in New Issue
Block a user