Add single-user local authentication

This commit is contained in:
tim
2026-09-27 23:38:28 +02:00
parent 75cc0464a2
commit 1a10fe53f3
11 changed files with 425 additions and 20 deletions
+8
View File
@@ -73,6 +73,8 @@ def test_values_from_the_environment(monkeypatch, reload_config):
monkeypatch.setenv("TRUST_PROXY", "yes")
monkeypatch.setenv("CWA_DB_PATH", " /cwa/app.db ")
monkeypatch.setenv("CALIBRE_DB_PATH", "/library/metadata.db")
monkeypatch.setenv("BINDERY_USERNAME", " reader ")
monkeypatch.setenv("BINDERY_PASSWORD_HASH", " hash ")
reload_config()
assert config.URL_BASE == "/bindery"
assert config.AUTH_METHOD == "cwa"
@@ -83,6 +85,8 @@ def test_values_from_the_environment(monkeypatch, reload_config):
assert config.TRUST_PROXY is True
assert str(config.CWA_DB_PATH) == "/cwa/app.db"
assert str(config.CALIBRE_DB_PATH) == "/library/metadata.db"
assert config.LOCAL_USERNAME == "reader"
assert config.LOCAL_PASSWORD_HASH == "hash"
def test_defaults(monkeypatch, reload_config):
@@ -97,6 +101,8 @@ def test_defaults(monkeypatch, reload_config):
"TRUST_PROXY",
"CWA_DB_PATH",
"CALIBRE_DB_PATH",
"BINDERY_USERNAME",
"BINDERY_PASSWORD_HASH",
):
monkeypatch.delenv(name, raising=False)
reload_config()
@@ -110,3 +116,5 @@ def test_defaults(monkeypatch, reload_config):
assert config.TRUST_PROXY is False
assert config.CWA_DB_PATH is None
assert config.CALIBRE_DB_PATH is None
assert config.LOCAL_USERNAME == ""
assert config.LOCAL_PASSWORD_HASH == ""