Repository navigation
id: bind the unkeyed-export trust decision in ingest_import - #13637
Merged
Merged
Conversation
ingest_import checked the VerifiedImport token's binding ID, Iroh ID, and entry counts against the export, but not its unkeyed_export trust decision — so a token minted for a keyed export could authorize ingesting an unkeyed (service-signed) export without the operator confirmation verify_import requires. Reject with VerificationMismatch before any event-store write when verified.unkeyed_export differs from the manifest's, and add regression tests: a keyed token cannot ingest the unkeyed shape of the same export (nor the reverse), while an explicitly confirmed unkeyed token still ingests its unkeyed export. Closes #13389
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 31 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
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
ingest_importnow binds theVerifiedImporttoken'sunkeyed_exporttrust decision to the export being ingested: whenverified.unkeyed_export != export.manifest.unkeyed_exportit returnsImportError::VerificationMismatchbefore any event-store write — the same refusal path the binding/ID/count checks already use.Previously a token minted for a keyed export could authorize ingesting an unkeyed (service-signed) export, skipping the operator confirmation
verify_importrequires for unkeyed exports.Tests
Two regression tests in
hosted_ingest::tests, built on a helper that produces the keyed and unkeyed shapes of one export from a single binding (identical binding ID, Iroh ID, objects, and blobs — only the manifest's trust flag and signer differ):a_keyed_token_cannot_ingest_an_unkeyed_export— the keyed token is refused against the unkeyed export and nothing lands; the mirror image (confirmed unkeyed token against the keyed export) is refused too.a_confirmed_unkeyed_token_ingests_its_unkeyed_export— the explicitly confirmed unkeyed pair keeps working (report complete, 3 objects + 1 blob applied).Verification (laptop worktree runs,
nix developin pkgs/id, sccache disabled per #13367):cargo test --lib hosted_ingest: 7 passed, 0 failed.cargo test -p id --lib: 578 passed, 0 failed, 1 ignored.rustfmt --checkon the touched file: clean.Closes #13389
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.