fix(auth): when auth.enforce is false, still run auth checks as dry-run#359
Open
matt-codecov wants to merge 1 commit intomainfrom
Open
fix(auth): when auth.enforce is false, still run auth checks as dry-run#359matt-codecov wants to merge 1 commit intomainfrom
matt-codecov wants to merge 1 commit intomainfrom
Conversation
jan-auer
reviewed
Mar 6, 2026
065ba40 to
64aa65f
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
| Some(auth) => auth.assert_authorized(perm, context), | ||
| None => Ok(()), | ||
| } | ||
| .inspect_err(|err| err.log(Some(perm), Some(context.usecase.as_str()))); |
There was a problem hiding this comment.
Double debug logging on authorization check failures
Low Severity
When AuthContext::assert_authorized in context.rs fails, it emits a tracing::debug! with message "Authorization failed". Then inspect_err in assert_authorized calls err.log(), which emits a second tracing::debug! with message "Authorization failure" and increments a counter. The counter is new and valuable, but the debug log is redundant — every per-operation auth failure now produces two debug entries with overlapping information.
Additional Locations (1)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


currently when
auth.enforceis false we skip auth entirely. in order to safely roll auth out, we want to change that. with this PR, auth logic will always run andauth.enforcesimply controls whether failure should result in the request being rejectedthere is still some danger associated with rolling out auth (startup failure if we mess up secret mounting, for example) but now we'll be able to ensure sentry/launchpad/relay auth integration is working end-to-end before actually flipping the switch