tests: add committed test vectors and load them into the harness - #1452
Closed
quexten wants to merge 1 commit into
Closed
tests: add committed test vectors and load them into the harness#1452quexten wants to merge 1 commit into
quexten wants to merge 1 commit into
Conversation
Ten user accounts, one organization and two emergency-access grants, recorded as JSON under /test-vectors. Each pairs the ciphertext a server would serve with the plaintext it must decrypt to, so a test can assert against data that does not move when the code does. The set spans both crypto generations and every unlock method: V1 and V2 accounts, PBKDF2 and argon2id, master password, PIN, trusted device, key connector, and one mid-upgrade account. Organization and emergency-access vectors reference users by vector name rather than duplicating them. unlock/happy-path.test.ts opens every vector through every method it declares and decrypts its whole vault, with nothing ignored — nothing was written, so nothing may differ. It is the baseline the rest of the suite rests on, and it matters in TypeScript rather than only in Rust because the models cross the FFI boundary both ways. Landing them surfaced one real gap: an AttachmentView carries decryptedKey, the attachment key in the clear, which a vector deliberately does not record because a vector is committed to git. The validator now drops it, scoped to attachments — decryptedKey is also the variant tag of InitUserCryptoMethod, and dropping that would erase whole unlock methods. The change-kdf tests now seed from v1-pbkdf2-min-iterations and v1-argon2id-tde instead of hand-assembled fixtures, which also gives them a real vault to validate rather than one the harness created for itself. .aikido excludes the directory, whose committed private keys and passwords would otherwise be reported as leaked secrets; .prettierignore stops prettier reformatting bytes both suites read as fixed input.
This was referenced Sep 4, 2026
Contributor
🔍 SDK Breaking Change DetectionSDK Version:
Breaking change detection uses the build of the SDK from this branch, including any incompatibities pre-existing on or merged into this branch. Check the workflow logs to confirm. |
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.
Objective
Ten users, one organization and two emergency-access grants as JSON under
/test-vectors, each pairing the ciphertext a server would serve with the plaintext it must decrypt to — data that does not move when the code does.Covers both crypto generations and every unlock method: V1/V2, PBKDF2/argon2id, master password, PIN, trusted device, key connector, one mid-upgrade account. Org and emergency-access vectors reference users by name rather than duplicating them.
load.tsdeclares the shapes rather than inferring them, so a drifted vector fails to compile instead of loading asany.unlock/happy-path.test.tsopens every vector through every method it declares and decrypts its whole vault with nothing ignored — nothing was written, so nothing may differ. It matters in TS rather than only in Rust because the models cross the FFI boundary both ways.Finding
An
AttachmentViewcarriesdecryptedKey— the attachment key in the clear — which vectors deliberately don't record, being in git. The validator drops it, scoped to attachments:decryptedKeyis also theInitUserCryptoMethodvariant tag, so an unscoped drop erases whole unlock methods.Also
Change-kdf now seeds from
v1-pbkdf2-min-iterationsandv1-argon2id-tde, giving it a real vault to validate;tests/fixtures/accounts.tsgoes away..aikidoexcludes the directory (committed keys read as leaked secrets);.prettierignorestops reformatting bytes both suites read as fixed input.Testing
17 vector tests, 104 passing overall. Confirmed to fail on demand: tampering a recorded plaintext, and bumping
schemaVersion.Key rotation is out of scope — needs the rotation routes and
rotation-cases.tsfirst.Breaking changes
None. Test-only, plus a new top-level
test-vectors/.