test: close the sweep across the remaining modules - #248
Merged
Conversation
Fourth and last pass of #229, over auth/email, auth/username, internal/keymanager and the injected-material path. Sixteen guards were mutated; fifteen were already covered, which is the first time the sweep has come back mostly clean and worth saying plainly. The one survivor was email's 254-character total length. Its test built a 249-character local part, so the 64-character local-part rule refused it first and the total was never measured — the same shape as the size-cap tests in #227 and the PHC bounds in #234. An address that exercises it has to be assembled from parts that are each individually legal, with a companion assertion that the same shape just under the limit is accepted, or the rejection would prove nothing. Also closes the loader gaps in internal/keymanager. The cleanup that removes a freshly written private key when the public write fails is unreachable through New — checkKeyDirConsistency refuses a partial directory before generation is attempted — so it is driven directly, and it asserts the private key does not survive rather than that an error came back. Planting a directory where a file should go makes the write fail on any platform without permission games. An unreadable descriptor is now distinguished from an absent one: absent means the pre-marker layout and is adopted, unreadable means the loader cannot tell what wrote the directory and fails closed. KeyID had been reading as 0% while being exercised from the JWT module next door. It has its own assertion now, so the number stops lying. Every package is over 90% for the first time: keymanager 88.9% -> 92.0%, email 90.9% -> 91.9%, total 92.9%. Signed-off-by: Jaro-c <75870284+Jaro-c@users.noreply.github.com>
This was referenced Jul 28, 2026
Merged
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.
Fourth and last pass of #229, over
auth/email,auth/username,internal/keymanagerand the injected-material path inkeystore.Sixteen guards mutated, fifteen already covered. That is the first pass that came back mostly clean, and it is worth saying plainly rather than presenting the one finding as though the module were riddled.
auth/usernameand the key-material validation ininternal/keymanager— private and public key lengths, the pair matching, the refresh-secret length, the partial-directory refusal — all detected their own deletion.The one survivor
auth/email's 254-character total length.TestValidate_tooLongbuilt a 249-character local part, so the 64-character local-part rule refused it first and the total was never measured. Same shape as the size-cap tests in #227 and the PHC bounds in #234: the fixture violated more than one rule, and an earlier guard fired.An address that reaches it has to be assembled from parts that are each individually legal — a 60-character local part and 60-character DNS labels — with a companion test asserting the same shape just under the limit is accepted. Without that second assertion the first would be satisfied by any rejection at all, which is the whole failure mode being fixed.
Loader gaps in
internal/keymanagerNew—checkKeyDirConsistencyrefuses a partial directory before generation is attempted — so it is driven directly, and asserts the private key does not survive rather than that an error came back. Planting a directory where a file should go makes the write fail on any platform, with no permission games.KeyIDhad been reading as 0% while being exercised from the JWT module next door. It has its own assertion now, so the number stops lying.Measured
internal/keymanagerauth/emailEvery package is over 90% for the first time, which settles the substantive half of #218 — no package is hiding under the aggregate any more. The policy question there, whether the gate should be per-package, is unaffected and still open.
go vet,golangci-lint(0 issues) andgo test -race ./...pass. Each new test was confirmed by deleting the control it names and watching it fail.