Log AI-access denials server-side - #171
Merged
Merged
Conversation
requireAiAccess returned 403s with no server-side trace, which let a total entitlement outage (feature gating baked on with zero grants) run silently in production: every transcription request 403'd for weeks with nothing in the logs. Each deny now writes one grep-stable console.error ([ai-access] prefix) distinguishing entitlement-absent from profile-read-failure, with the user id. Response shapes, status codes, and the grant path are unchanged.
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.
requireAiAccessreturned 403s with zero server-side trace. On app.getminutia.com this hid a total outage: feature gating was baked on at build time while no profile hadhas_full_access, so every transcription request 403'dFEATURE_UNAVAILABLEfor every user, silently, since the instance launched.Each deny now writes one grep-stable
console.errorwith the[ai-access]prefix, distinguishingentitlement-absentfromprofile-read-failure(andprofile-missing), with the user id. No secrets or emails logged. Response shapes, status codes, and the grant path are byte-identical.Tests:
verify-feature-access.test.mjsextended to coverrequireAiAccessvia the repo's esbuild DI pattern; 9/9 pass. Two independent reviews clean.