fix(backend): realign BYOK security tests with enrolled-key contract - #12302
fix(backend): realign BYOK security tests with enrolled-key contract#12302aryanorastar wants to merge 1 commit into
Conversation
Update stale mocks to target the current per-provider BYOK helpers and assert the fail-closed enrollment behavior implemented by the middleware. Reproduces BasedHardware#12289's BYOK test failures on main and restores the focused security suite from 8 failures / 96 passes to 104 passes. Failure-Class: none
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Thanks @aryanorastar - verified end to end; this cleanly repairs the BYOK security suite. What I ran (isolated worktrees, nothing shared with your branch):
Notes on
Heads-up on the red No production behavior changes here; BYOK validation semantics remain exactly what Automated maintainer-assist review on behalf of the Omi maintainers. by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with |
What changed and why
Fixes #12289.
The BYOK security suite still mocked the removed aggregate
subscription.get_byok_keysbinding and asserted permissive partial-enrollment behavior after production moved to per-provider keys plus strict enrolled-provider validation. This test-only repair targets the dependencies production now uses and aligns the assertions with the current fail-closed contract; no backend behavior changes.Product invariants affected
none
How it was verified
Reproduced on current
main(932e2f5f06):Verified this branch with the identical command:
The repository preflight also passes all 25 selected checks when run with this PR body:
The broader pre-push hook reaches Pyright and reports two pre-existing unused imports in
backend/utils/stt/streaming.py:37(SafeSonioxSocketandprocess_audio_soniox). That file is byte-for-byte outside this branch's diff, so the branch was pushed with only that inherited hook failure bypassed.Tests
backend/tests/unit/test_byok_security.pynow covers the current contract directly:Failure class (fixes)
Failure-Class: none