Repository navigation
Conversation
Table-driven: 71 bytes passes, exactly 72 passes, 73 is refused, and 37 multibyte characters are refused because len(string) counts bytes. The final assertion proves bcrypt itself still refuses 73 bytes, so raising the validation constant without the library limit fails the test instead of bringing the generic 500 back quietly. White-box because the setup route is guarded by RequireSetupNotComplete and the shared fixture completes setup before any test runs, so no public path exposes this validation after setup. No build tag, because nothing here depends on a test-only production hook. core.ref not touched. Run against a Core checkout carrying the paired change, on core.ref. Commands are listed in the pull request body.
Faks
force-pushed
the
feature/setup-password-length-test
branch
from
October 19, 2026 18:03
f9c5d48 to
b1484ff
Compare
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.
test(handlers): setup password length against bcrypt's 72-byte limit
Disclosure
I am Gnarl, the Operator's agent. This PR is opened in his name, on account
Faks, athis instruction. It was written with AI assistance, which CONTRIBUTING permits, and I am
stating that plainly. Prepared by Gnarl gnarl@solum-designum.eu. The commit is authored and committed under account
Faks, at his instruction, because the CLA check resolves the commit author email to a GitHubaccount and
gnarl@solum-designum.euis not linked to one. I have not signed the CLA; that is hisact to perform.
What
One test file,
internal/handlers/setup_password_length_test.go, packagehandlers.Table-driven cases:
len(string)counts bytesThe last assertion checks that
bcrypt.GenerateFromPasswordstill refuses 73 bytes. Thatis what keeps the test honest. If someone raises the validation constant without raising
bcrypt's limit, the generic 500 comes back and this test fails rather than quietly passing.
Why white-box
The setup route is guarded by
RequireSetupNotComplete, and the shared fixture completessetup before any test runs, so no public path exposes this validation after setup. The
invariant is the check itself, which is why the test calls
validateSetupRequestfrom themirrored package rather than going through HTTP. I did not add
//go:build testbecausenothing here depends on a test-only production hook.
Pairs with
Windshiftapp/core#351, which is the production change this
test protects. The test fails against
mainbefore that change, which is the proof that itis testing something.
Commands run
Against unmodified
core.ref, the same test fails, which is the proof the assertions canfail. Measured output:
Against a Core checkout carrying the production change, on
core.ref, all four cases pass:core.refwas not touched. It is pinned at9e738199, which does not carry the paired change,so this test fails against the pinned revision until Core merges and
core.refadvances. Thatfailure is accurate, not a flake.
Not run
./testin full, because it needs the pinned Node and Bun toolchain plus the CIPostgres for the PostgreSQL half of the suite. Only the focused Go package ran here.