docs: add ADR-0037 for scheduler attribution design#2165
Conversation
Documents the decision to use attributed identity (Actor struct with Authenticated=false) with a separate actorContextKey to prevent trust escalation, satisfying SOC 2 CC6.1 and ISO 27001 A.5.16 requirements. Covers Phase A implementation, context key separation rationale, and Phase C JWT authentication forward-compatibility.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughA new Architecture Decision Record is added that documents the design for injecting scheduler attribution context into background job executions, specifying Actor properties, audit logging behavior, and implementation requirements for schedulers and workers. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Claude Code ReviewCommit: SummaryWell-structured ADR that accurately documents the scheduler attribution design implemented in PRs #2151 and #2163. All code references verified against the current codebase — the Cross-referenced against ADR-0009 (application-level audit logging) and ADR-0029 (settlement scheduler architecture) — no conflicts. This ADR is a natural extension of both: ADR-0009 established app-level audit, ADR-0029 established the cron scheduler pattern, and this ADR closes the attribution gap between them. Risk Assessment
Findings
Questions for the Author
Bot Review NotesNo unresolved bot threads found on this PR. |
Summary
actorContextKey(notUserIDContextKey) to prevent trust escalationChanges Made
docs/adr/0037-scheduler-attribution-design.md- New ADRTechnical Details
The ADR documents:
GetUserIDFromContextis used as an auth gate in identity service endpoints; placing scheduler identity inUserIDContextKeywould bypass those checksactorContextKey(unexported struct type) is structurally distinct fromcontextKey(UserIDContextKey) - no runtime collision is possiblecron.go:executeJobandcatchup.go:catchUpSchedulechanged_byformatsystem:scheduler:{name}distinguishes scheduler from human and anonymous operationsAuthenticated=true; no downstream changes neededTesting
Documentation-only change. No functional changes.
Risk Assessment
Low. Documentation only.