Custom capability plugins + /invoke endpoint#3
Open
amiller wants to merge 13 commits into
Open
Conversation
- Custom plugin type: owner writes arbitrary JS code as the endowment with fetch, secrets, and persistent KV store globals - POST /invoke/:permit_id — bearer-token-authenticated endpoint for calling custom capabilities directly (no JWT needed) - Browser approval page (approve-html.ts) — embedded HTML UI served from the enclave for permit approval with secrets input - CORS: bearer-token requests allow any origin (the token is the trust boundary, not the origin) - Database: session expiry (expires_at), bearer_token column, kv_store table for persistent custom capability state - JWT expiry fix: was passing expiresIn=0, now defaults to 24h - Updated docker image digest in docker-compose.yml Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Approval URLs now include &tee= so orchestrator HTML page knows which enclave to call - Added amiller.github.io to staging CORS origins Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- browser/: Headless Playwright HTTP service (POST /browse) for cookie-authenticated YouTube/TikTok fetches from TEE - openvpn-socks5/: OpenVPN→SOCKS5 container for local dev - dstack/docker-compose.yml: Added socks5-relay (gost) + browser services - Removed stale deploy/docker-compose.yml, docker-compose-sidecar.yaml - Removed SQLite WAL files from tracking - Auth fixes: owner JWT 24h→1yr, approve-html link fix Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fixes #4 — bearer tokens were generated on approval but never returned in the sessions list, making web-approved permits unusable. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Secrets were committed to this public repo in 591c430. All exposed credentials have been rotated. This commit removes the file from tracking and prevents future .env files from being committed. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
d913cfd to
e38e1f7
Compare
Case study of why one permit stayed live for weeks while 41 siblings went stale. Covers the five decoupled ingredients (immutable capability code, year-long bearer, out-of-band cookie refresh, static GitHub Pages UI, untouched enclave), the DB evidence for the cookie-refresh correlation, a clone-this-pattern recipe, and the sidecar SSH debug checklist. Flags the unbuilt distribution path for the companion Chrome extension as an open question. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Covers the dstack LUKS2 disk-encryption model, HKDF key derivation tied to app_id + instance_id, what lives in each SQLite table, token lifecycle, and Stage 0 limitations. README now points readers there and corrects the env-template filename. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Exposes attestation/worker info from the CVM's dstack socket so clients can verify what code is running. Proxies POST /prpc/Worker.Info on /var/run/dstack.sock with a 5s timeout. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Custom capabilities now receive a refreshSecret(name, value) callback as the 4th endowment argument. Primary use: cookies returned from a TEE-internal browser fetch get written back as the secret so the next invocation sees the rotated set. Browser service now returns cookies on every /browse response to support this. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
When /signup is called with an email, tenant_id is sha256(email) sliced to 16 hex chars instead of random bytes. Same email → same tenant → signup is idempotent. Anonymous signup (no email) keeps the random tenant_N prefix. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Adds /push/vapid-key (public), /push/subscribe (owner) and /push/send (owner) endpoints. VAPID keys are derived from the dstack KMS via /var/run/tappd.sock so they're stable across restarts without being stored anywhere. Subscriptions are owner-scoped secrets prefixed PUSH_SUB_; /push/send fans out to all of them with a 10s per-tenant cooldown, cleans up 410 Gone entries, and uses web-push for the actual transport. docker-compose mounts tappd.sock and sets VAPID_SUBJECT. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
oauth3-proxy: sha256:2dfd4bb73c... (confirmed running on app_23da7533b60fe6e5f5e30c97f30af5bd7ccdf4df via phala ps). oauth3-browser: sha256:75c6c946f9... This closes the last gap between what's committed and what's actually running in the staging CVM. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
fetch,secrets, andstore(persistent KV) as globalsPOST /invoke/:permit_id: bearer-token-authenticated endpoint for calling custom capabilities directly — no JWT needed for callersGET /approve/:idwith secrets input, capability review, and bearer token displayexpires_at+bearer_tokencolumns,kv_storetable for persistent custom capability stateissueToken()was passingexpiresIn=0, tokens expired instantly — now defaults to 24hTest plan
Authorizationin request headers getsAccess-Control-Allow-Origineven when origin not inCORS_ORIGIN🤖 Generated with Claude Code