Repository navigation
Closed
Description
Summary
Follow-ups left open by the #348 fix (branch fix/348-compose-control-plane, stacked on #350). #348 gives the Docker Compose trial a control plane. It also adds a file and a vault credential store behind SH_CREDENTIAL_STORE. The items below are out of its scope.
Items
1. Run a control plane on the VM path (deploy/vm), backed by Vault
deploy/vm/env/supervisor.env.examplenow carries the MU1 settings (SH_SESSION_TOKEN_PUBLIC_KEYS,SH_CONTROL_PLANE_URL,SH_EXCHANGE_TOKEN,SH_REQUIRE_AUTH). Butsetup-vm.shinstalls no control plane, so on a VM they have nothing to point at.- Needed:
- a
control-plane.env.exampleand ansh-control-planesystemd unit, hardened like the others; SH_CREDENTIAL_STORE=vaultas the VM default (packages/control-plane/src/vault-store.ts);setup-vm.shgenerating the MU1 secrets once, withpackages/control-plane/src/genkeys.ts, and writing the matching halves into both env files. A re-run must never rotate them, as withMOCA_RELAY_EXEC_TOKEN.
- a
- Vault integration to document or wire:
- a KV v2 mount;
- the list-free policy (
create, read, updateon<mount>/data/<path>/*); - Vault Agent doing the login (AppRole or cloud IAM) and renewal into
VAULT_TOKEN_FILE; NODE_EXTRA_CA_CERTSfor a private CA.
- Tests: extend
setup-vm.test.sh, and extendcompose.test.sh's var-for-var mirror check to acontrol-plane.env.example.
2. Optional loopback-only development identity provider (#348 item 6, option b)
- Login needs a GitHub OAuth app with device flow enabled, plus internet access. That is friction for a five-minute trial, and it rules out offline use.
- Option: an opt-in, single-user identity provider behind the existing
IdentityProviderseam (packages/control-plane/src/identity.ts). - Requirements:
- never the default;
- refuses to start on a non-loopback bind;
- loudly logged;
- its own ADR before any code.
- Once it exists,
deploy/compose/smoke.shcan drive the realmocactl login→doctor→runflow. Today the smoke stands in for login by minting an api token inside the control-plane container.
3. How a per-user inference credential reaches the model
applyModelGateway(harness/src/run-turn.ts) sends a caller's credential asAuthorization: Bearerto the credential's endpoint.- Works: a gateway token (LiteLLM-style), as the Compose deployment: add a control plane so mocactl works (credential store without Kubernetes, MU1 auth wiring) #348 live smoke used.
- Likely broken: a raw Anthropic API key (
sk-ant-api…). The Anthropic API expectsx-api-key, so a user who pastes one intomocactlonboarding probably gets an opaque 401. Verify this. - If it is broken, options:
- honour the credential's
binding(header plus format), which the descriptor already carries; - or refuse the combination at
PUT /v1/credentialswith a message naming it.
- honour the credential's
4. Manual acceptance run of #348 with a real GitHub OAuth app
- Not yet run. On the compose stack with
SH_GITHUB_CLIENT_IDset, check thatmocactl --control-plane-url http://127.0.0.1:8090 login, thendoctor(all 7 checks), thenrun "hello"streams a reply. - Compose deployment: add a control plane so mocactl works (credential store without Kubernetes, MU1 auth wiring) #348's automated live smoke covers everything except the device-flow login itself.
Metadata
Metadata
Assignees
Labels
No labels
Activity
fix(control-plane): refuse inference credentials that would 401 upstream
fix(harness): send an x-api-key caller credential as x-api-key