Skip to content

MU1 follow-ups from #348: VM control plane on Vault, dev identity provider, inference-credential binding #362

Closed

Description

@pdettori

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.example now carries the MU1 settings (SH_SESSION_TOKEN_PUBLIC_KEYS, SH_CONTROL_PLANE_URL, SH_EXCHANGE_TOKEN, SH_REQUIRE_AUTH). But setup-vm.sh installs no control plane, so on a VM they have nothing to point at.
  • Needed:
    • a control-plane.env.example and an sh-control-plane systemd unit, hardened like the others;
    • SH_CREDENTIAL_STORE=vault as the VM default (packages/control-plane/src/vault-store.ts);
    • setup-vm.sh generating the MU1 secrets once, with packages/control-plane/src/genkeys.ts, and writing the matching halves into both env files. A re-run must never rotate them, as with MOCA_RELAY_EXEC_TOKEN.
  • Vault integration to document or wire:
    • a KV v2 mount;
    • the list-free policy (create, read, update on <mount>/data/<path>/*);
    • Vault Agent doing the login (AppRole or cloud IAM) and renewal into VAULT_TOKEN_FILE;
    • NODE_EXTRA_CA_CERTS for a private CA.
  • Tests: extend setup-vm.test.sh, and extend compose.test.sh's var-for-var mirror check to a control-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 IdentityProvider seam (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.sh can drive the real mocactl login → doctor → run flow. 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 as Authorization: Bearer to 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 expects x-api-key, so a user who pastes one into mocactl onboarding 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/credentials with a message naming it.

4. Manual acceptance run of #348 with a real GitHub OAuth app

Related: #348, #350, #347.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions