fix: make Vaultwarden cache refresh durable
This commit is contained in:
parent
8e07f50c03
commit
6e80578ca6
6 changed files with 88 additions and 17 deletions
27
tests/test_vault_sync.py
Normal file
27
tests/test_vault_sync.py
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
from pathlib import Path
|
||||
import re
|
||||
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
|
||||
|
||||
def test_vault_cache_is_a_persistent_named_volume():
|
||||
compose = (ROOT / "compose.yaml").read_text()
|
||||
assert "vault-cache:/data/vault-cache" in compose
|
||||
assert "volumes:\n vault-cache:" in compose
|
||||
|
||||
|
||||
def test_vault_sync_uses_protected_environment_instead_of_embedded_password():
|
||||
script = (ROOT / "vault-sync.sh").read_text()
|
||||
assert '.vault-sync.env' in script
|
||||
assert not re.search(r'export BW_PASSWORD=["\'](?!\$)', script)
|
||||
assert 'BW_CLIENTID' in script
|
||||
assert 'BW_CLIENTSECRET' in script
|
||||
assert 'bw login --apikey' in script
|
||||
assert 'bw unlock --passwordenv BW_PASSWORD' in script
|
||||
|
||||
|
||||
def test_vault_sync_runtime_files_are_not_tracked():
|
||||
gitignore = (ROOT / ".gitignore").read_text().splitlines()
|
||||
assert ".vault-sync.env" in gitignore
|
||||
assert "vault-sync.log" in gitignore
|
||||
Loading…
Add table
Add a link
Reference in a new issue