Feat/password policy2 - #10
Merged
Merged
Conversation
Swapping the real crypto/rand.Reader package variable to simulate an entropy-source failure isn't portable: on at least one real platform (reported: Termux/Android), a failed read through that actual global triggers the Go runtime's own unrecoverable fatal-error path instead of returning a normal error — crashing the entire test binary rather than failing one test. CryptoRandTokenGenerator now holds its own randReader field (defaults to crypto/rand.Reader, set in the constructor), and the regression test injects a fake failing reader directly into a same-package instance instead of mutating any global state. Same coverage, no process-crashing side effect.
TestGoWebAuthnProvider_LoginRoundTrip asserted the returned credential's SignCount must be nonzero after a real login. virtualwebauthn's simulated credential starts at counter 0 and never auto-increments on its own — and a counter of 0 is itself a legitimate, spec-allowed value (many real platform authenticators never track one at all), so the assertion was simply testing a false assumption, not a real property of the code under test. Now manually sets the simulated credential's counter to a known nonzero value before the login call and asserts FinishLogin correctly surfaces that exact value — actually exercising the pass-through path this test cares about (persisting whatever the authenticator reports, which is what makes cloned-authenticator detection possible later) instead of an assumption that doesn't hold.
Missed when SignUp/ChangePassword's signature changed on the stacked feat/password-policy branch — this file was written earlier on feat/breached-password-check and never revisited, so it built fine on that branch alone but failed to compile once merged after the password-policy signature change landed on top. Same class of miss as an earlier one on login_second_factor_test.go — a full grep across every call site for a changed signature, not just the files touched in that commit, is the actual fix to the process here.
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.
No description provided.