ServiceMap: update dependencies and backend/app (+5 areas)
Public changes compared with the previous published export: 16 files changed. Affected areas: - backend/app: 3 files - dependencies: 5 files - deployment and CI: 2 files - documentation: 2 files - frontend/src: 1 file - project files: 1 file - tests: 2 files Changed files: - Updated: ".env.example" - Updated: "Dockerfile.unraid" - Updated: "README.md" - Updated: "backend/app/incidents.py" - Updated: "backend/app/main.py" - Updated: "backend/app/store.py" - Updated: "backend/pyproject.toml" - Updated: "backend/tests/test_docker_provider.py" - Updated: "backend/tests/test_v163_health_performance.py" - Updated: "docker-compose.broker.yml" - Updated: "docs/ARCHITECTURE.md" - Updated: "frontend/package-lock.json" - Updated: "frontend/package.json" - Updated: "frontend/src/App.tsx" - Updated: "package-lock.json" - Updated: "package.json" Export provenance/manifests refreshed; excluded from the change summary. Publish curated ServiceMap source from 8c297f756ff84aaa917ae9c48535e835f8c09ec7
This commit is contained in:
1 parent
d4c351ce73
commit
41a8eee259
18 files changed
+167
-92
No files matched your search
@@ -53,6 +53,41 @@ def _mocked_broker_client(
|
||||
return client, options
|
||||
|
||||
|
||||
def test_reopened_inventory_client_reads_atomically_rotated_broker_token(tmp_path, monkeypatch) -> None:
|
||||
token_file = tmp_path / "servicemap-docker-broker.token"
|
||||
token_file.write_text("initial-token", encoding="utf-8")
|
||||
monkeypatch.setenv("SERVICEMAP_DOCKER_PROVIDER", "broker")
|
||||
monkeypatch.setenv("SERVICEMAP_DOCKER_BROKER_URL", "https://broker.internal")
|
||||
monkeypatch.setenv("SERVICEMAP_DOCKER_BROKER_TOKEN_FILE", str(token_file))
|
||||
|
||||
seen = []
|
||||
def inventory(request):
|
||||
seen.append(request.headers["authorization"])
|
||||
return httpx.Response(200, json={"items": []})
|
||||
|
||||
original_client = httpx.Client
|
||||
monkeypatch.setattr(
|
||||
docker_provider.httpx, "Client",
|
||||
lambda **kwargs: original_client(transport=httpx.MockTransport(inventory), **kwargs),
|
||||
)
|
||||
client = docker_provider.docker_client_for_inventory("")
|
||||
try:
|
||||
assert client.containers.list() == []
|
||||
finally:
|
||||
client.close()
|
||||
|
||||
replacement = tmp_path / "next-token"
|
||||
replacement.write_text("rotated-token", encoding="utf-8")
|
||||
replacement.replace(token_file)
|
||||
client = docker_provider.docker_client_for_inventory("")
|
||||
try:
|
||||
assert client.containers.list() == []
|
||||
finally:
|
||||
client.close()
|
||||
|
||||
assert seen == ["Bearer initial-token", "Bearer rotated-token"]
|
||||
|
||||
|
||||
def test_inventory_uses_authenticated_fixed_get_and_health_check_has_no_token(monkeypatch) -> None:
|
||||
requests = []
|
||||
|
||||
|
||||
Reference in new issue
Block a user