Repository navigation
mcpx: record and report the permissive auth decision (#1972 step 2) - #5012
Conversation
…ep 2) The funnel (#1968) already records every permissive decision in internal/api, but nothing surfaced the record. Step 2 of #1972 makes it an operator dry-run: - api.ReportDecisions aggregates the bounded record into counts by operation (with the permission tier a future policy would require) and by principal, over the recorded window; api.ClearDecisions resets it. A Decision still holds only principal, operation, tier and the answer - no field a credential could be written into. - GET /v1/authz/decisions returns the report and DELETE clears it, declared in the ops table as authz_decisions / authz_decisions_clear (generated CLI: mcpx authz decisions [clear]; docs/parity.md regenerated). Both are recorded by the funnel like any declared operation. - Behaviour is unchanged: the stage stays permissive, nothing is refused, no new config. Step 3 enforcement is not started. Tests: packet command (api/daemon/cli -run Auth|Doctor) passes; full daemon and cli packages pass; api package fails only TestPluginOpsAreGenerated, which fails identically on clean main (formatting-only drift in ops.gen.ts). Conformance TestAuthSplit/TestMatrix/TestUtilitiesServer/TestMessagesClient fail identically at the branch base.
…r drift) TestPluginOpsAreGenerated fails on clean origin/main because the committed ops.gen.ts predates a generator formatting change; regenerating also picks up authz_decisions and authz_decisions_clear from #1972 step 2.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 52 minutes. View limit details
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. CodeRabbit Verify
|
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
🤖 Agent note · parked (CI pending)
|
|
agent-note:v1 — merge disposition, task 8156 resumed by lane code-b
Merging under the standing merge criteria (verified change; CI stall is unrelated infra). Issue #1972 stays open — this is step 2 of its four-step ship order. |
#1972 step 2 — the permissive auth funnel records and reports its decisions
Step 2 of the four-step ship order in #1972 (Approach C): the decision log, landed
while everything is still permissive, so enabling any check later is a verification
rather than a leap. Step 1 (the matrix split) merged in #2673.
What this adds
api.Decision+api.Authorizerecording — every permission check appendswho asked (surface + descriptive ID), which operation, which tier it declared and
the answer, bounded to the most recent 1024. In this stage the answer is always
yes; the record is the point.
api.DecisionReport— the operator's dry-run read of that record: totals byoperation (with the tier a future policy would require) and by principal, plus the
stage label so a reader knows every
allowedhere is permissive.GET /v1/authz/decisions(report) andDELETE /v1/authz/decisions(clear), registered in the daemon and declared in the ops table.
(a request records exactly one decision; the clear wipes its own decision), and
authz_test.gopins the permissive stage as before.docs/parity.mdnames the new surface.Nothing refuses anything yet, and no credential can reach the record: a
Decisionhas no field a secret could be written into. A local daemon with no credentials
configured keeps today's complete local answer.
Also fixes a stale generated file on
mainTestPluginOpsAreGeneratedfails on cleanorigin/main— the committedplugin/opencode/mcpx/ops.gen.tspredates a generator formatting change.Regenerating (as the test instructs) both clears that drift and picks up the two
new authz operations.
Verification
go test ./internal/api/ ./internal/daemon/— pass (daemon suite 79s).go test ./internal/api -run TestPluginOpsAreGenerated— pass after regeneration;fails identically on unmodified
origin/mainbefore it.Refs #1972. Step 3 (per-check enforcement, each defaulting off) is not in this PR.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.