Add single-user local authentication
This commit is contained in:
@@ -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 == ""
|
||||
|
||||
Reference in New Issue
Block a user