fix(platform): reapply HIGH #6 + SA auth-gating + VULN-004 SHA enforcement after platform→workspace-server rename - #956
Closed
molecule-ai[bot] wants to merge 19 commits into
Closed
molecule-ai[bot] wants to merge 19 commits into
molecule-ai[bot] wants to merge 19 commits into
Conversation
Moved to private repo so the public monorepo only contains docs useful for contributors and users: Removed (now in Molecule-AI/internal): - edit-history/ — 15 daily dev session logs - retrospectives/ — session postmortems with ops details - marketing/ — competitor analysis, SEO strategy, landing briefs - product/ — PRD, SaaS strategy, growth research - runbooks/ — SaaS ops (secrets rotation, GDPR, admin auth) - security/ — internal security advisories - research/ — competitive framework analysis - ecosystem-watch.md — competitive landscape tracking - demo/, spikes/ — internal prototypes - known-issues.md, remote-workspaces-readiness.md Also removed duplicate docs/architecture.md (superseded by docs/architecture/overview.md). Remaining public docs: architecture, API reference, adapters, agent-runtime, plugins, guides, tutorials, development, frontend, integrations, glossary, quickstart. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
chore: move internal docs to private repo
Removed: - docs/.vitepress/ + package.json — docs site config belongs in Molecule-AI/docs - scripts/bridge/ — internal Claude Code bridge server - scripts/claude-code-bridge.py — internal agent bridge - scripts/dedup_settings_hooks.py, verify_settings_hooks.py — internal maintenance Gitignored: - .mcp.json → .mcp.json.example (local MCP config, users create their own) - test-results/ — ephemeral build artifacts Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
chore: final cleanup — remove internal tooling, gitignore local config
Remove entries for org-templates/, plugins/, docs/.vitepress/dist/ that no longer exist. Deduplicate .claude-bridge/ entry. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Aligns CI workflow filename with the platform/ → workspace-server/ rename. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
PRs targeting staging got no CI because the workflow only triggered on main. Now runs on both main and staging pushes + PRs. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The supply_chain.go implementation was merged in #937 but never called from the actual install handler. Plugins with a manifest.json sha256 field now get verified before staging completes. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…egrity fix(plugins): wire VerifyManifestIntegrity into install pipeline
…names Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
fix(docs): update cd commands for workspace-server/ and workspace/ renames
…rver rename Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
fix(docs): architecture + API paths for workspace-server rename
…ace rename Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
fix: workspace script path comments
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
fix: ChatTab comment path
…rm→workspace-server rename Ports all changes from fix/launch-high6-cp-auth-token-boot to the renamed workspace-server/ and workspace/ paths. Resolves the CONFLICTING state of PR #954 by applying each change cleanly to its new location. Changes applied: 1. workspace.go — GET /workspaces/:id auth-gating (SA finding): Authenticated callers get the full operational response; unauthenticated callers get only {id, name, agent_card:{name,description,version}} — stripping container URLs (SSRF risk), current_task, and topology fields. Adds publicAgentCard() helper to scrub agent_card.url. 2. workspace_provision.go — startSucceeded defer (security Q6): Revokes freshly-issued tokens if Start() fails, preventing orphaned tokens on 'failed' workspaces from authenticating API calls. 3. workspace_provision.go — HIGH #6 EC2 boot token race fix: Issues the auth token BEFORE cpProv.Start() and injects it as MOLECULE_AUTH_TOKEN in the boot env so EC2 agents don't race /registry/register. Token revocation guard added for CP path too. 4. plugins/github.go — full SHA-only enforcement (VULN-004): Strengthens the existing empty-ref check to also reject non-SHA refs (branch names, movable tags). Adds strings.ToLower normalization for uppercase clipboard SHAs. Uses git init+fetch+checkout for SHA refs instead of git clone --branch (which doesn't accept commit SHAs). 5. workspace/platform_auth.py — MOLECULE_AUTH_TOKEN bootstrap: get_token() now reads MOLECULE_AUTH_TOKEN env var as a fallback and auto-persists it to .auth_token (0600) on first access, surviving process restarts that don't inherit the original launch environment. Tests: updates github_test.go with PLUGIN_ALLOW_UNPINNED=true guards on all branch-ref tests; adds SHA enforcement regression suite. Updates workspace_test.go and handlers_test.go for the auth-gating path. Adds test_platform_auth.py cases for the MOLECULE_AUTH_TOKEN bootstrap. Closes #954 conflict; supersedes fix/launch-high6-cp-auth-token-boot. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
5 tasks
Contributor
|
Closing — this PR duplicates and conflicts with the open-source cleanup work already merged:
The changes in this PR (auth-gating, SHA enforcement, path renames) are either already on staging or need to be re-implemented on the current staging HEAD to avoid conflicts. |
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.
[backend-agent]
Summary
PR #954 (
fix/launch-high6-cp-auth-token-boot) has been in CONFLICTING state since theplatform/ → workspace-server/rename (#479a027). This PR reapplies all five change sets from #954 to the correct new paths, resolving the conflict cleanly.Changes ported from #954:
GET /workspaces/:id auth-gating (SA security finding): Unauthenticated callers now receive only
{id, name, agent_card:{name,description,version}}. Container URLs (agent_card.url, top-levelurl),current_task,active_tasks, and all topology fields are withheld. The endpoint returns 200 in both cases (not 401) so A2A peer discovery continues to work. AddspublicAgentCard()helper.HIGH Add admin endpoint to mint deterministic test tokens (follow-up to PR #5) #6 EC2 boot token race fix:
provisionWorkspaceCPnow issues the auth token BEFORE callingcpProv.Start()and injects it asMOLECULE_AUTH_TOKENin the boot environment. Previously, issuing AFTER Start caused the EC2 instance's first/registry/registercall to be treated as a re-registration (returning no token), leaving the agent stuck atprovisioningforever with 401 heartbeats.Orphaned token revocation (security Q6): Both
provisionWorkspaceOptsandprovisionWorkspaceCPnow use astartSucceededdefer pattern — ifStart()fails, the freshly-issued token is revoked so it cannot be used by a never-launched workspace.Full SHA-only enforcement (VULN-004, issue security: plugin supply chain hardening — require pinned refs and SHA256 manifest integrity (SAFE-T1102) #768):
github.gonow rejects branch names and movable tags (in addition to empty refs). Only a full 40-character hex commit SHA passes. Uppercase SHAs are normalized to lowercase. SHA refs use the correctgit init + git fetch + git checkout FETCH_HEADprotocol instead ofgit clone --branch(which doesn't accept commit SHAs).MOLECULE_AUTH_TOKENbootstrap:workspace/platform_auth.py'sget_token()reads the env var as a fallback after the.auth_tokenfile, auto-persists it to disk (0600) on first use.Test plan
cd workspace-server && go test -race ./...— all packagescd workspace && python -m pytest tests/test_platform_auth.py -v— MOLECULE_AUTH_TOKEN testsRelated
🤖 Generated with Claude Code