fix(mcp): inject X-Molecule-Org-Id so SaaS tenant calls dont 400 (v2) #51
Reference in New Issue
Block a user
Delete Branch "fix/mcp-inject-org-header-v2"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Rebases and replaces #42.
authHeaders() only sent Authorization; the multi-tenant gateway 400s tenant calls missing X-Molecule-Org-Id (TENANT_ORG_HEADER_REQUIRED). Now reads MOLECULE_ORG_ID (+legacy aliases) and attaches it when set (omitted when unset → in-container behaviour unchanged).
5-axis review on current head
8f985373: APPROVED. Correctness: authHeaders now preserves Authorization while adding X-Molecule-Org-Id from canonical/legacy env sources for SaaS routing, and destructive recreate rejects explicit unknown actor. Robustness: unset env remains omitted; tests cover key/token/org precedence and unknown actor fail-closed path. Security: header source is trusted process env, no new external input/secrets exposure, no auth weakening. Performance/readability: no meaningful overhead; scoped, clear change with focused tests. CI / test is green.APPROVE on current head
8f985373. Verified focused mcp-server change: authHeaders preserves existing Bearer behavior and only adds X-Molecule-Org-Id from explicit org env vars; recreate_workspace now fails closed for literal actor='unknown'; regression tests cover both. No workflow/gate/auth-policy/merge-queue/required-check weakening; CI / test is green.