fix(account): close deletion cache gap
CI and Deploy / test (pull_request) Successful in 5m22s
CI and Deploy / deploy (pull_request) Has been skipped

Require authenticated sidecar cache purge before a deletion can complete and keep failures retryable. Mount tombstones outside restored application data while leaving deletion disabled by default.
This commit is contained in:
cesnimda
2026-08-15 19:40:07 +02:00
parent c0e190d5b5
commit 7185491a05
14 changed files with 134 additions and 20 deletions
+16
View File
@@ -510,6 +510,22 @@ def test_health_stays_open_so_probes_and_healthchecks_work(monkeypatch):
assert client.get("/health").status_code == 200
def test_cache_purge_requires_service_token_and_clears_content(monkeypatch):
module = load_app_module(monkeypatch, service_token="s3cret")
module.cache["synthetic-key"] = "synthetic-summary"
client = TestClient(module.app)
assert client.delete("/maintenance/cache").status_code == 401
response = client.delete(
"/maintenance/cache",
headers={"X-Ai-Service-Token": "s3cret"},
)
assert response.status_code == 200
assert response.json() == {"cleared": 1}
assert len(module.cache) == 0
def test_endpoints_stay_open_when_no_token_is_configured(monkeypatch):
module = load_app_module(monkeypatch)
client = TestClient(module.app)