Skip to content

feat: base access control - #2

Merged
dialnco merged 1 commit into
mainfrom
feat/access-control
Aug 5, 2026
Merged

dialnco merged 1 commit into
mainfrom
feat/access-control

Conversation

@dialnco

@dialnco dialnco commented Aug 5, 2026 •

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • New Features
    • Added opt-in project access control with roles, capabilities, per-user overrides, secure keys, revocation, expiration, and identity reporting.
    • Added user, key, join-code, recovery, and audit-log management across the CLI and Studio.
    • Added authentication and authorization for Studio views, APIs, MCP tools, and resources.
    • Added read-only enforcement for restricted identities and attribution of changes to the acting identity.
  • Documentation
    • Updated access-control guidance, workflows, migration status, and enforcement limitations.

@dialnco
dialnco merged commit c445850 into main Aug 5, 2026
1 of 2 checks passed
@coderabbitai

coderabbitai Bot commented Aug 5, 2026 •

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Free

Run ID: 56ad9cd3-6949-474d-95ce-98886aa76b4a

📥 Commits

Reviewing files that changed from the base of the PR and between 85d577b and 7d4764c.

📒 Files selected for processing (50)
  • README.md
  • progress.md
  • src/cli.ts
  • src/commands/_shared.ts
  • src/commands/access.ts
  • src/commands/project.ts
  • src/core/access/audit.ts
  • src/core/access/cache.ts
  • src/core/access/capabilities.ts
  • src/core/access/commands.ts
  • src/core/access/errors.ts
  • src/core/access/gate.ts
  • src/core/access/joincode.ts
  • src/core/access/keys.ts
  • src/core/access/principals.ts
  • src/core/access/readonly.ts
  • src/core/access/session.ts
  • src/core/access/settings.ts
  • src/core/access/status.ts
  • src/core/contexts.ts
  • src/core/db.ts
  • src/core/dump.ts
  • src/core/files.ts
  • src/core/migrate.ts
  • src/core/paths.ts
  • src/core/registry.ts
  • src/core/types.ts
  • src/mcp/access.ts
  • src/mcp/run.ts
  • src/mcp/server.ts
  • src/migrations/0004_access.ts
  • src/program.ts
  • src/studio/access.ts
  • src/studio/routes/access.ts
  • src/studio/routes/auth.ts
  • src/studio/run.ts
  • src/studio/server.ts
  • src/studio/stores.ts
  • studio/src/App.tsx
  • studio/src/api/access.ts
  • studio/src/state/StoreContext.tsx
  • studio/src/views/AccessSection.tsx
  • studio/src/views/LoginView.tsx
  • studio/src/views/SettingsView.tsx
  • test/access.test.ts
  • test/command-caps.test.ts
  • test/mcp-access.test.ts
  • test/migration.test.ts
  • test/online.test.ts
  • test/studio-auth.test.ts

📝 Walkthrough

Walkthrough

This change adds opt-in project access control with roles, capabilities, hashed keys, join codes, audit logs, recovery, principal attribution, and enforcement across the CLI, MCP, and Studio surfaces.

Changes

Project access control

Layer / File(s) Summary
Access schema and storage
src/migrations/0004_access.ts, src/core/types.ts, src/core/registry.ts, src/core/settings.ts, src/core/dump.ts
Adds principal, key, audit-log, attribution, credential, configuration, and seed-table support.
Authentication and authorization engine
src/core/access/*, src/core/db.ts, src/core/contexts.ts, src/core/files.ts
Adds key verification, capability resolution, session caching, authorization gates, read-only enforcement, audit logging, and principal attribution.
CLI access and project joining
src/program.ts, src/cli.ts, src/commands/_shared.ts, src/commands/access.ts, src/commands/project.ts
Builds the CLI through buildProgram(), maps commands to capabilities, adds access administration commands, and supports join-code project setup.
MCP and Studio server enforcement
src/mcp/*, src/studio/access.ts, src/studio/routes/*, src/studio/server.ts, src/studio/stores.ts
Adds MCP tool/resource authorization, Studio authentication routes, browser sessions, API guards, access-management endpoints, and restricted store handles.
Studio authentication and management UI
studio/src/api/access.ts, studio/src/state/StoreContext.tsx, studio/src/views/*, studio/src/App.tsx
Adds login, identity switching, capability-aware routing, identity display, and user, key, and audit-log management.
Documentation and validation
README.md, progress.md, test/*
Documents the shipped access system and its advisory limitations. Tests cover access behavior, migrations, seeding, CLI mappings, MCP enforcement, and Studio authentication.

Estimated code review effort: 5 (Critical) | ~120 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant Surface
  participant AccessGate
  participant Database
  participant AuditLog

  Client->>Surface: submit CLI, MCP, or Studio request
  Surface->>AccessGate: provide action and access key
  AccessGate->>Database: resolve session and principal capabilities
  AccessGate->>AuditLog: record allow or deny decision
  AccessGate->>Surface: return authorized session or access error
  Surface->>Database: execute session-scoped operation
Loading

Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login.

Comment @coderabbitai help to get the list of available commands.

@dialnco
dialnco deleted the feat/access-control branch August 5, 2026 04:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant