S05: NATS endpoint catalog, passthrough and error-bundle docs
This commit is contained in:
commit
0cf87863d4
15 changed files with 1315 additions and 0 deletions
38
scripts/import_pfc_subjects.py
Normal file
38
scripts/import_pfc_subjects.py
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
#!/usr/bin/env python3
|
||||
"""Merge peergos-for-compliance subjects.json into catalog/pfc-derived.json."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
from pathlib import Path
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
PFC = Path("/Users/marchon/research/peergos-for-compliance/schemas/subjects.json")
|
||||
OUT = ROOT / "catalog" / "pfc-derived.json"
|
||||
|
||||
|
||||
def main() -> None:
|
||||
src = json.loads(PFC.read_text())
|
||||
rows = []
|
||||
for s in src.get("subjects") or []:
|
||||
rows.append(
|
||||
{
|
||||
"name": s["name"],
|
||||
"pattern": s.get("pattern"),
|
||||
"for": "PFC/Verae subject (see peergos-for-compliance/docs/nats-addresses.md)",
|
||||
"from": ["pfc services", "connectors"],
|
||||
"to": [s.get("owner") or "unknown"],
|
||||
"in": {"fields": s.get("payload") or []},
|
||||
"out": "service-specific",
|
||||
"encryption": "NATS envelope pfc-lab-xor or NPE sidecar; Pattern A apps never publish",
|
||||
"reject": ["unknown subject", "missing required fields"],
|
||||
"dead": "none",
|
||||
"git": "https://git.georgelambert.org/marchon/peergos-for-compliance",
|
||||
}
|
||||
)
|
||||
OUT.write_text(json.dumps({"version": src.get("version"), "endpoints": rows}, indent=2) + "\n")
|
||||
print("wrote", OUT, "n=", len(rows))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Loading…
Add table
Add a link
Reference in a new issue