Conversation
📝 WalkthroughWalkthroughEnhanced authorization sidecar server with new request headers for token name and workflow ID. Implemented conditional role synchronization to skip syncing when these headers are present, indicating access tokens or workflow-originated requests. Added corresponding traceability to logging throughout the service. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 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 |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/service/authz_sidecar/server/authz_server.go (1)
178-185: Consider centralizing the repeated request log attrs.The new
token_name/workflow_idfields are now duplicated across several log sites. A small helper or shared[]anyattr slice would keep future auth-context changes consistent and reduce omission risk.Also applies to: 190-195, 207-229, 242-253
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/service/authz_sidecar/server/authz_server.go` around lines 178 - 185, Several logger.Debug sites repeat the same authorization request attributes (user, path, method, token_name, workflow_id, roles); centralize them by creating a small helper that returns the shared []any slice and use it wherever s.logger.Debug(...) is called (e.g., replace the repeated attr lists in the Debug calls around the authorization check with something like authRequestLogAttrs(...) and call s.logger.Debug("authorization check request", authRequestLogAttrs(user, path, method, tokenName, workflowID, roleNames)...)). Update all occurrences noted (the blocks around lines 178-185, 190-195, 207-229, 242-253) to use this helper so future auth-context fields stay consistent.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@src/service/authz_sidecar/server/authz_server.go`:
- Around line 178-185: Several logger.Debug sites repeat the same authorization
request attributes (user, path, method, token_name, workflow_id, roles);
centralize them by creating a small helper that returns the shared []any slice
and use it wherever s.logger.Debug(...) is called (e.g., replace the repeated
attr lists in the Debug calls around the authorization check with something like
authRequestLogAttrs(...) and call s.logger.Debug("authorization check request",
authRequestLogAttrs(user, path, method, tokenName, workflowID, roleNames)...)).
Update all occurrences noted (the blocks around lines 178-185, 190-195, 207-229,
242-253) to use this helper so future auth-context fields stay consistent.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 820c4d9a-f6f4-40fa-801d-b154f294342b
📒 Files selected for processing (1)
src/service/authz_sidecar/server/authz_server.go
Currently, we set jwt values to determine if it is from a token or from the user but the sidecar didn't compute those values so tokens had all the access the user had.
Issue #None
Checklist
Summary by CodeRabbit