Enforce private-by-default rail exposure

Assistant: codex
Assistant-Model: gpt-5.6-sol
Assistant-Session: 01a02669-87ee-7a31-b111-edc95a16e0fa
This commit is contained in:
codex 2026-08-22 12:34:25 +02:00
parent c6b045051f
commit 004f1c4dc1
7 changed files with 368 additions and 7 deletions

34
tools/validate_exposure.py Executable file
View file

@ -0,0 +1,34 @@
#!/usr/bin/env python3
"""Validate a rendered manifest against ADR-0008 declarations."""
from __future__ import annotations
import argparse
import json
import sys
from pathlib import Path
from exposure import ExposureError, validate_rendered_exposure
def main() -> int:
parser = argparse.ArgumentParser()
parser.add_argument("rendered_manifest", type=Path)
parser.add_argument("--rapp-declaration", type=Path)
parser.add_argument("--reef-declaration", type=Path)
args = parser.parse_args()
try:
result = validate_rendered_exposure(
args.rendered_manifest.read_text(encoding="utf-8"),
rapp_declaration=args.rapp_declaration,
reef_declaration=args.reef_declaration,
)
except (OSError, ExposureError) as exc:
print(f"exposure validation failed: {exc}", file=sys.stderr)
return 1
print(json.dumps(result, sort_keys=True))
return 0
if __name__ == "__main__":
raise SystemExit(main())