open-standards/wai/http-conformance/falsify/declaration-unnamed.patch
Transaction Science ac602599d0 http receipts round 3: falsify the fixes
Patches (falsify/run.sh), each failing the corpus cases it names: bytes-unchecked,
decision-unchecked, recovery-record-unchecked, operating-point-unchecked,
session-accepted, declaration-unnamed, first-publisher, matchers-need-object and
set-sha-faults; claim-through-any-receipt, fetch-unmemoised,
fetch-budget-unchecked and file-cap-unchecked regenerated against the new
receipts.rs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-08 04:15:46 -04:00

16 lines
846 B
Diff

# must fail: receipts_lawful_basis_declaration_renamed
# a declaration fetched by its link read without §8.1's name check (receipts::declaration_of)
diff --git a/wai/wai-rs/src/http_binding/receipts.rs b/wai/wai-rs/src/http_binding/receipts.rs
index 83cd7ccb..a9187306 100644
--- a/wai/wai-rs/src/http_binding/receipts.rs
+++ b/wai/wai-rs/src/http_binding/receipts.rs
@@ -688,7 +688,8 @@ fn declaration_of(link: &[u8; 32], fetch: &mut ReceiptFetcher<'_>) -> Result<Cla
Err(ReceiptRefusal::NotServed) => return Err(ReceiptRefusal::ContextNotHeld),
Err(r) => return Err(r),
};
- read_claim_file(link, &bytes)
+ let _ = link;
+ ClaimReceipt::from_json(std::str::from_utf8(&bytes).unwrap_or("")).map_err(ReceiptRefusal::Claim)
}
/// §8.2's check of one claim the index of the object `cid` lists by its link hash