- delete_worker.py: DELETE-scoped worker loop (ApprovalStateStore, fail-closed) - delete_tolaria_client.py: DELETE-only Tolaria client (fixed /delete endpoint) - delete_entrypoint.py: DELETE runtime entrypoint (health/status + worker) - delete_Dockerfile: DELETE executor image (no SAVE code, no credentials) - delete_executor_core.py: minimal SoT patch — VALID_NONCE replay guard + VALID_DELETE_REQUEST binding (approval binds delete_request_id, fail-closed APPROVAL_MISMATCH). Closes P10/T29 security gap in productive SoT. AUTH.4D P14. No deployment, no token injection, no key provisioning.
49 lines
1.4 KiB
Python
49 lines
1.4 KiB
Python
#!/usr/bin/env python3
|
|
"""
|
|
AUTH.4D — c5-delete-executor Runtime Entrypoint (DELETE-only, fail-closed).
|
|
Startet den verdrahteten DELETE-Worker-Loop. Health/Status-Modus.
|
|
"""
|
|
import json
|
|
import os
|
|
import sys
|
|
|
|
from job_store import JobStore
|
|
|
|
SCOPE = "DELETE"
|
|
DB_PATH = os.environ.get("C5_DELETE_DB", "/data/c5a_delete.db")
|
|
VERSION = "0.1.0-auth4d-wired"
|
|
|
|
|
|
def health() -> dict:
|
|
credential_present = bool(os.environ.get("TOLARIA_DELETE_TOKEN"))
|
|
public_key_present = bool(os.environ.get("C5_DELETE_PUBLIC_KEY_PEM"))
|
|
db_ready = False
|
|
try:
|
|
store = JobStore(DB_PATH, SCOPE)
|
|
store.close()
|
|
db_ready = True
|
|
except Exception:
|
|
db_ready = False
|
|
return {
|
|
"service": "c5-delete-executor",
|
|
"version": VERSION,
|
|
"mode": "fail_closed" if not credential_present else "credential_present",
|
|
"credential_present": credential_present,
|
|
"public_key_present": public_key_present,
|
|
"job_db_ready": db_ready,
|
|
"state": "idle" if not credential_present else "blocked",
|
|
"last_error": None,
|
|
}
|
|
|
|
|
|
def main() -> int:
|
|
if "--health" in sys.argv or "--status" in sys.argv:
|
|
print(json.dumps(health(), indent=2))
|
|
return 0
|
|
# Worker-Loop starten (verdrahtet, fail-closed)
|
|
from delete_worker import main as worker_main
|
|
return worker_main()
|
|
|
|
|
|
if __name__ == "__main__":
|
|
sys.exit(main())
|