Repository navigation
Add tests that lock in v1.0.0 passwords - #2
Merged
Merged
Conversation
SecretKey's promise is that the same root key and date code always regenerate the same passwords. Nothing checked that, and the derivation changed twice in June 2026 without a version marker. This adds SecretKey.Core.Tests (xUnit) with known-answer tests for: - the crypto building blocks (monthly key, HMAC-SHA256 incl. RFC 4231 case 2, mask mapping), - end-to-end CSV processing for typical accounts, URL prefixing, trimming, quoted fields, Unicode, custom masks, date codes, - sample_input.csv, - known v1 quirks (32-byte truncation, no field separator, mask wrap), so they can't be "fixed" in place and silently change passwords. Expected values come from the v1.0.0 engine and were cross-checked against an independent implementation. No app code is changed. CI now runs these tests on pull requests, and the workflow token is limited to read-only access. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QSQZn3X5gDJdRjbqMfKRpd
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.
What this does
Adds automated tests that record the exact passwords SecretKey v1.0.0 produces for a set of sample accounts. No app code changes. Your existing passwords are not affected.
From now on, every pull request runs these tests. If a future change would alter any password, the tests fail and the pull request shows a red ❌ before anything is merged.
Why
SecretKey only works if the same root key and date code always regenerate the same passwords. Nothing was checking that, and the password math already changed twice in June 2026 without anyone noticing.
What's in it
SecretKey.Core.Tests/: a new test project (xUnit), also added toSecretKey.slnxso it shows up in Visual Studio's Test Explorer.CryptoTests.cs: the building blocks (monthly key, HMAC-SHA256 checked against the published RFC 4231 test vector, mask mapping).PasswordDerivationV1Tests.cs: full CSV-in/CSV-out runs, covering URL prefixing, trimming, quoted fields, accented characters, custom masks, different date codes, andsample_input.csv..github/workflows/build.yml: runs on pull requests too, adds atestjob, and limits the workflow's GitHub token to read-only.How it was checked
How to review
git pullon your PC.Generated by Claude Code