Skip to content

fix(auth): when auth.enforce is false, still run auth checks as dry-run#359

Open
matt-codecov wants to merge 1 commit intomainfrom
matt/auth-dry-run
Open

fix(auth): when auth.enforce is false, still run auth checks as dry-run#359
matt-codecov wants to merge 1 commit intomainfrom
matt/auth-dry-run

Conversation

@matt-codecov
Copy link
Contributor

currently when auth.enforce is 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 and auth.enforce simply controls whether failure should result in the request being rejected

there 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

@matt-codecov matt-codecov requested a review from a team as a code owner March 6, 2026 00:45
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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())));
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants