fix(planning): require signed workspace authority on all routes - #168
Conversation
|
Warning Review limit reached
Next review available in: 15 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughPlanning 서비스의 목표·프로젝트·작업 생성 및 조회 라우트가 클라이언트 선택형 workspace 헤더 대신 서명된 ChangesPlanning workspace authority
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant PlanningController
participant requireTrustedWorkspaceContext
participant PlanningService
PlanningController->>requireTrustedWorkspaceContext: 서명된 workspace 헤더 전달
requireTrustedWorkspaceContext-->>PlanningController: 검증된 workspace ID 반환
PlanningController->>PlanningService: workspace ID와 라우트 데이터 전달
PlanningService-->>PlanningController: 목표, 프로젝트 또는 작업 반환
Possibly related issues
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai review |
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@apps/planning-service/src/planning-controller-authority.test.ts`:
- Around line 20-32: Extend the tests in the PlanningController workspace
authority contract to execute every Goal, Project, and Task route rather than
only counting source tokens. Verify valid signed workspace contexts pass
trustedWorkspaceId to the service, while missing, expired, future-dated,
tampered, malformed, and secret-unconfigured contexts are rejected before any
service call; retain the existing legacy-header coverage.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 0674605f-adc3-4e1b-a4ce-ae6418be49a4
📒 Files selected for processing (4)
CHANGELOG.mdapps/planning-service/src/main.tsapps/planning-service/src/planning-controller-authority.test.tsdocs/research/2026-08-10-planning-workspace-authority.md
Security outcome
Replace conflicted PR #160 with the same bounded fix rebuilt from current protected
main(563fa9851a0ae4232144c65d949d82e1fcb28154). Goal, project and task create/list routes derive workspace ownership from the short-lived signedlife-os.workspace.v1context already used by planning search and durable Today.Preservation proof
The current-main replacement has exactly the four intended semantic deltas:
CHANGELOG.md,apps/planning-service/src/main.ts,apps/planning-service/src/planning-controller-authority.test.ts, anddocs/research/2026-08-10-planning-workspace-authority.md. The production/test/research contents are preserved from #160; the changelog is reconciled with current protected-main calendar disconnect and fail-closed Today entries.Test-first contract
The retained RED source contract requires zero bare
x-workspace-iddecorators, no legacyrequireWorkspaceIdhelper, and all nine workspace-scoped Planning routes (search, Today GET/PUT, six Goal/Project/Task operations) to bind and verify the signed workspace/issued-at/signature context. Existinghttp-boundary.test.tsindependently covers fresh, stale, future, malformed, forged and unconfigured verifier evidence.Implementation
BadRequestExceptionand the legacy bare-workspace helper;Merge gate
Merge only after the unchanged exact head passes Planning tests/typecheck/build, configured owned-code coverage/docstrings, CI, AppGuardrail, SAST Semgrep, Security Scan, Commercial Readiness, all current review findings, and current-live-base compatibility without administrative bypass.
Supersedes #160. Closes #158 when integrated.
Summary by CodeRabbit
보안
문서
테스트