Phase C of vendor-agnostic model-access (ADR 0050/0054). Two TypeScript runtime modules: - anthropic-manager: the refresh token is sealed at rest to the manager node's own key (atrest.ts, envelope encryption over X25519) and opened ONLY on the manager node. adopt seals the first envelope; refresh opens it, calls the Anthropic OAuth token endpoint, re-seals a rotated refresh token, and hands the control plane only the access token plus the opaque envelope. Also polls licence-grain usage (ADR 0054). - anthropic-consumer: writes the delivered access token to ~/.claude/.credentials.json, access-token-only, atomically (the refresh token is never delivered); reports session-grain usage from the CLI transcripts; a fail-closed identity guard (expected-uuid plumbing is a flagged TODO). Both run as scheduled containers (ADR 0053). Pure logic covered by node --test fixtures (at-rest round-trip, credential strip, transcript sum, refresh merge). Claude-Session: https://claude.ai/code/session_01LrgweAeERJYBg88c5cKDzF
69 lines
1.9 KiB
JSON
69 lines
1.9 KiB
JSON
{
|
|
"module": "anthropic-manager",
|
|
"version": "1",
|
|
"capabilities": [
|
|
"container-runtime"
|
|
],
|
|
"own-secrets": {
|
|
"broker": "/var/lib/mesh/anthropic-manager/broker"
|
|
},
|
|
"emits": [
|
|
"module.anthropic-manager.usage.read"
|
|
],
|
|
"resources": [
|
|
{
|
|
"id": "mesh-state",
|
|
"type": "directory",
|
|
"path": "/var/lib/mesh/anthropic-manager",
|
|
"mode": "0700"
|
|
},
|
|
{
|
|
"id": "keys",
|
|
"type": "directory",
|
|
"path": "/var/lib/mesh/anthropic-manager/keys",
|
|
"mode": "0700"
|
|
},
|
|
{
|
|
"id": "out",
|
|
"type": "directory",
|
|
"path": "/var/lib/mesh/anthropic-manager/out",
|
|
"mode": "0700"
|
|
},
|
|
{
|
|
"id": "config",
|
|
"type": "file",
|
|
"path": "/var/lib/mesh/anthropic-manager/config.json",
|
|
"merge": "json",
|
|
"content": "{}",
|
|
"mode": "0600"
|
|
},
|
|
{
|
|
"id": "refresh",
|
|
"type": "container",
|
|
"name": "mesh-anthropic-manager-refresh",
|
|
"image": "mesh-runtime-anthropic-manager@sha256:0000000000000000000000000000000000000000000000000000000000000000",
|
|
"network": "host",
|
|
"schedule": "*/5 * * * *",
|
|
"args": [
|
|
"run",
|
|
"/app/modules/anthropic-manager/dist/refresh/index.js"
|
|
],
|
|
"volumes": [
|
|
"/var/lib/mesh/anthropic-manager/broker:/run/secrets/broker:ro",
|
|
"/var/lib/mesh/anthropic-manager:/run/state"
|
|
],
|
|
"env": {
|
|
"MESH_BROKER_FILE": "/run/secrets/broker",
|
|
"MESH_ANTHROPIC_LICENCE": "personal",
|
|
"MESH_ANTHROPIC_GRANT_FILE": "/run/state/grant.json",
|
|
"MESH_NODE_SEALING_PUBLIC_FILE": "/run/state/keys/sealing.pub",
|
|
"MESH_NODE_SEALING_PRIVATE_FILE": "/run/state/keys/sealing.priv",
|
|
"MESH_ANTHROPIC_ACCESS_OUT": "/run/state/out/access-token",
|
|
"MESH_ANTHROPIC_GRANT_OUT": "/run/state/out/grant.json",
|
|
"MESH_ANTHROPIC_USAGE_OUT": "/run/state/out/usage.json",
|
|
"MESH_TOOLS_MAIN": "/app/dist/main.js"
|
|
}
|
|
}
|
|
]
|
|
}
|