molecule-core/workspace-server/internal/provisioner
Hongming Wang 296c52cb25 test(ws-server): cover CPProvisioner — auth, env fallback, error paths
Post-merge audit flagged cp_provisioner.go as the only new file from
the canary/C1 work without test coverage. Fills the gap:

- NewCPProvisioner_RequiresOrgID — self-hosted without MOLECULE_ORG_ID
  refuses to construct (avoids silent phone-home to prod CP).
- NewCPProvisioner_FallsBackToProvisionSharedSecret — the operator
  ergonomics of using one env-var name on both sides of the wire.
- AuthHeader noop + happy path — bearer only set when secret is set.
- Start_HappyPath — end-to-end POST to stubbed CP, bearer forwarded,
  instance_id parsed out of response.
- Start_Non201ReturnsStructuredError — when CP returns structured
  {"error":"…"}, that message surfaces to the caller.
- Start_NoStructuredErrorFallsBackToSize — regression gate for the
  anti-log-leak change from PR #980: raw upstream body must NOT
  appear in the error, only the byte count.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-19 03:41:16 -07:00
..
cp_provisioner_test.go test(ws-server): cover CPProvisioner — auth, env fallback, error paths 2026-04-19 03:41:16 -07:00
cp_provisioner.go Merge pull request #981 from Molecule-AI/fix/security-tenant-cpprovisioner-bearer 2026-04-19 01:55:20 -07:00
isrunning_test.go chore: open-source restructure — rename dirs, remove internal files, scrub secrets 2026-04-18 00:24:44 -07:00
provisioner_test.go chore: final open-source cleanup — binary, stale paths, private refs 2026-04-18 00:38:55 -07:00
provisioner.go chore: final open-source cleanup — binary, stale paths, private refs 2026-04-18 00:38:55 -07:00