vaultik had two age wrappers. Production already encrypts and decrypts
through blobgen; the crypto package and Vaultik.GetEncryptor/GetDecryptor
had no production caller, and verify --deep re-implemented decryption
with its own zstd reader — the duplication that drifted in #131.
Changes:
Delete internal/crypto and GetEncryptor/GetDecryptor. verify --deep
now parses the age key once, like restore, and reads both the database
(still streamed to a temp file) and every blob through blobgen.NewReader.
The blob-ID second hash step is one exported function, blobgen.DoubleSHA256, called by its three former copies. Writer.Sum256
(the double hash) becomes Writer.ContentID, so it no longer shares the
name Sum256 with Reader.Sum256 (the single plaintext hash). CompressData/CompressStream (test-only) are deleted.
Delete the unused, never-adopted secret/config newtypes in internal/types.
Delete the uncalled CleanupIncompleteSnapshots and correct ARCHITECTURE.md.
The only multi-recipient test moves to blobgen; the earlier
encrypted-bytes hash test is removed. Production behavior is unchanged.
Disclosures:
Deviation: the brief asked to avoid internal/snapshot/snapshot.go, but the
issue requires deleting CleanupIncompleteSnapshots there; that left deleteSnapshot (its only caller) dead, so it is removed too. One debug-log
line in that file also changed for the ContentID rename.
make check green.
Model: opus-4-8
Closes https://git.eeqj.de/sneak/vaultik/issues/151.
vaultik had two age wrappers. Production already encrypts and decrypts
through `blobgen`; the `crypto` package and `Vaultik.GetEncryptor`/`GetDecryptor`
had no production caller, and `verify --deep` re-implemented decryption
with its own zstd reader — the duplication that drifted in
https://git.eeqj.de/sneak/vaultik/issues/131.
Changes:
- Delete `internal/crypto` and `GetEncryptor`/`GetDecryptor`. `verify --deep`
now parses the age key once, like restore, and reads both the database
(still streamed to a temp file) and every blob through `blobgen.NewReader`.
- The blob-ID second hash step is one exported function,
`blobgen.DoubleSHA256`, called by its three former copies. `Writer.Sum256`
(the double hash) becomes `Writer.ContentID`, so it no longer shares the
name `Sum256` with `Reader.Sum256` (the single plaintext hash).
`CompressData`/`CompressStream` (test-only) are deleted.
- Delete the unused, never-adopted secret/config newtypes in `internal/types`.
- Delete the uncalled `CleanupIncompleteSnapshots` and correct `ARCHITECTURE.md`.
The only multi-recipient test moves to `blobgen`; the earlier
encrypted-bytes hash test is removed. Production behavior is unchanged.
Disclosures:
- Deviation: the brief asked to avoid `internal/snapshot/snapshot.go`, but the
issue requires deleting `CleanupIncompleteSnapshots` there; that left
`deleteSnapshot` (its only caller) dead, so it is removed too. One debug-log
line in that file also changed for the `ContentID` rename.
`make check` green.
Model: opus-4-8
Production encryption and decryption already run through blobgen; the
crypto package (Encryptor, Decryptor, UpdateRecipients, the fx Module)
and Vaultik.GetEncryptor/GetDecryptor had no production caller. Delete
crypto and route verify --deep through the same blobgen reader restore
uses: it parses the age key once and reads both the database (still
streamed to a temp file) and every blob through blobgen.NewReader.
The second, blob-ID hash step is now one exported function,
blobgen.DoubleSHA256, called by the three former copies. Writer.Sum256
(the double hash) becomes Writer.ContentID so it no longer shares the
name Sum256 with Reader.Sum256 (the single plaintext hash). CompressData
and CompressStream, unused outside tests, are deleted.
Delete the unused, never-adopted secret/config newtypes in internal/types
(the redacting AgeSecretKey and AWSSecretAccessKey plus AgeRecipient,
S3Endpoint, BucketName, S3Prefix, AWSRegion, AWSAccessKeyID). Delete the
uncalled CleanupIncompleteSnapshots (and deleteSnapshot, its only caller,
now dead) and correct ARCHITECTURE.md. The only multi-recipient test
moves to blobgen; the pre-#131 encrypted-bytes hash test is removed.
Model: opus-4-8
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Closes #151.
vaultik had two age wrappers. Production already encrypts and decrypts
through
blobgen; thecryptopackage andVaultik.GetEncryptor/GetDecryptorhad no production caller, and
verify --deepre-implemented decryptionwith its own zstd reader — the duplication that drifted in
#131.
Changes:
internal/cryptoandGetEncryptor/GetDecryptor.verify --deepnow parses the age key once, like restore, and reads both the database
(still streamed to a temp file) and every blob through
blobgen.NewReader.blobgen.DoubleSHA256, called by its three former copies.Writer.Sum256(the double hash) becomes
Writer.ContentID, so it no longer shares thename
Sum256withReader.Sum256(the single plaintext hash).CompressData/CompressStream(test-only) are deleted.internal/types.CleanupIncompleteSnapshotsand correctARCHITECTURE.md.The only multi-recipient test moves to
blobgen; the earlierencrypted-bytes hash test is removed. Production behavior is unchanged.
Disclosures:
internal/snapshot/snapshot.go, but theissue requires deleting
CleanupIncompleteSnapshotsthere; that leftdeleteSnapshot(its only caller) dead, so it is removed too. One debug-logline in that file also changed for the
ContentIDrename.make checkgreen.Model: opus-4-8
PASS
Model: opus-4-8