refactor(controlplane): remove regex support in authz middleware#3246
Conversation
Replace the regex fallback in the authz policy lookup with exact endpoint
matching. The only rule relying on it ("/controlplane.v1.OrgMetricsService/.*")
is replaced by explicit entries for the Totals, TopWorkflowsByRunsCount and
DailyRunsCount endpoints.
Assisted-by: Claude Code
Signed-off-by: Jose I. Paris <jiparis@chainloop.dev>
Chainloop-Trace-Sessions: af6e1c77-67e9-454c-8a56-5220930f328c
AI Session Analysis
|
| Status | Attribution | File | Lines |
|---|---|---|---|
| modified | ai | app/controlplane/pkg/authz/middleware/middleware_test.go |
+10 / -57 |
| modified | ai | app/controlplane/pkg/authz/authz.go |
+6 / -12 |
| modified | ai | app/controlplane/pkg/authz/middleware/middleware.go |
+2 / -15 |
Policies (4)
| Status | Policy | Material | Messages |
|---|---|---|---|
| ✅ Passed | ai-config-ai-agents-allowed |
ai-coding-session-af6e1c |
- |
| ✅ Passed | ai-config-no-dangerous-commands |
ai-coding-session-af6e1c |
- |
| ✅ Passed | ai-config-no-secrets |
ai-coding-session-af6e1c |
- |
| ✅ Passed | ai-config-mcp-servers-allowed |
ai-coding-session-af6e1c |
- |
Powered by Chainloop and Chainloop Trace
There was a problem hiding this comment.
1 issue found across 3 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
…inloop-dev#3245)" This reverts commit e7ebb3e. Assisted-by: Claude Code Signed-off-by: Jose I. Paris <jiparis@chainloop.dev> Chainloop-Trace-Sessions: af6e1c77-67e9-454c-8a56-5220930f328c
Removes the regex fallback from the authorization policy lookup in the control plane middleware, relying solely on exact endpoint matching against the server operations map.
The only rule that depended on the regex fallback (
/controlplane.v1.OrgMetricsService/.*) is replaced with explicit entries for theTotals,TopWorkflowsByRunsCount, andDailyRunsCountendpoints.This makes authorization matching unambiguous and avoids the risk of a loose pattern accidentally authorizing unintended operations.
AI Disclosure
This contribution was assisted by Claude Code.