Repository navigation
fix(auth): fail closed when cached pepper is explicitly blanked - #258
Conversation
Signed-off-by: Christopher <131207452+PetrefiedThunder@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
An explicitly empty or whitespace Two regression cases prime the actual Settings cache, blank the environment variable, and require Independent Muse review: PASS for the exact two-file diff SHA256 Head: |
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: f97a1771-2ef5-4817-acb7-1b06369dcbad) |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
No actionable comments were generated in the recent review.
|
|
REVIEW: PASS claude 7814d3e VerdictPASS — fail-closed pepper sourcing when Scope vs description
Correctness
Security
Tests
Residual / non-blocking
|
|
REVIEW: PASS claude 45dd80b Delta vs PASS at 7814d3ePASS — catch-up merges only; PR-side pepper fix unchanged; no conflict with #242. PR-side identity
#242 interplay
Tests (fresh Extreme SSD worktree at this SHA)
Prior full-review findings at 7814d3e still hold. Merge still gated on CI green. |
An explicitly empty or whitespace
API_KEY_HASH_PEPPERcould fall back to an earlier nonempty value in cached Settings after #254. Production authentication configuration now fails closed when that environment variable is present but blank; an absent variable still uses Settings.Two regression cases prime the actual Settings cache, blank the environment variable, and require
APIKeyHashingUnavailable. Both failed before the fix. The complete scrypt test file passes: 36 passed. Configured pre-commit (including mypy, Ruff and secret checks), staged gitleaks, and committed-branch TruffleHog passed.Independent Muse review: PASS for the exact two-file diff SHA256
29628d2bf4c4bada1735076041f5134c0823ff288185d5dd3bf51c32146b3988. Codex independently inspected the diff and reran all 36 tests. Muse performed a read-only inline-diff review and did not execute tests. No schema, public API, key format, or deployment change.Head:
7814d3e1f2ef3adec43fb710029bc2c6b97ba504. CI must be green before merge.Note
High Risk
Changes how the API-key hash pepper is resolved when operators blank the env var, directly affecting production authentication and startup guards.
Overview
Production API-key hashing no longer treats an explicitly set but empty
API_KEY_HASH_PEPPERas “missing” and fall back to.envor cached Settings._configured_pepper()now keys offAPI_KEY_HASH_PEPPER in os.environ: if the variable is present, only its value (after strip) counts; blank or whitespace yields no pepper and fail-closed startup/auth in production-like environments. If the variable is unset, behavior is unchanged—Settings still supply the pepper.A parametrized regression test primes the real
get_settings()cache with a valid env pepper, then sets the env to""or whitespace and assertsvalidate_api_key_hashing_config()raisesAPIKeyHashingUnavailable.Reviewed by Cursor Bugbot for commit 45dd80b. Bugbot is set up for automated code reviews on this repo. Configure here.