Repository navigation
feat(authority): require signed store owner credential for local MCP - #393
Conversation
🚀 Deploying Preview to Cloudflare 🚀Preview URL: https://surface-console-owner-387.spec.contextful.work (commit 2349865)This URL reflects your latest Preview deploymentPreview Deployments by commit
|
There was a problem hiding this comment.
AI code review — 🛑 Request changes
Risk tier: full · 1 critical · 0 warnings · 0 suggestions
Reviewers: security 1 · performance 0 · code-quality 1 · documentation
1. 🛑 Critical — Pull adopts a remote identity into a non-empty local store
📍 crates/contextful-sync/src/sync.rs:987-1004
The identity-conflict check rejects only a differing local 'store-id'; when the local file is missing, the pull proceeds regardless of whether the store root already contains data. The subsequent pull can import the bucket's UUID into an existing legacy/populated root, making owner credentials for the remote store valid against unrelated local rows. A missing identity should be accepted only for a demonstrably empty store (or the operation should fail and require explicit initialization).
token mint --owner signs a profile 2 owner claim bound to the selected store's persistent UUID. mcp --owner verifies that claim before protocol output and refuses ordinary, restricted, delegated, recreated-store and different-store credentials. Scoped pull carries the store identity and refuses a conflicting local UUID before replacement. Closes #387.
1a28b95 to
2349865
Compare
token mint --ownersigns a profile 2 owner claim bound to the selected store's persistent UUID.mcp --ownerverifies that claim before protocol output and rejects ordinary, restricted, delegated, recreated-store and different-store credentials. Owner reads retain row, zone and mask policy enforcement.Store initialization persists the UUID, and owner mint supplies it for an existing store. Scoped pull carries both the store identity and the reachable signed control head; a conflicting local identity refuses before replacement. The branch pins
surface.package.owner-flagand the owner profile test.Validation at
1a28b957: all 9 MCP integration tests pass and corpus lint reports 0 findings. The full workspace suite, including documentation tests, and test-first gate pass at57c275af. The merge from main changes only CI files. The isolated audit lookup over 8640 reads at57c275aftakes 207 milliseconds against its 1-second bound.Closes #387.