open-standards/openpay/crates
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Transaction Science 4d7edf3b36 trx, screening: resolve XML entity references, which quick-xml 0.41 now reports as their own event
The quick-xml 0.41 bump did not just rename `BytesText::unescape`. 0.41 reports
every entity reference — `&`, `'`, `&` — as its own
`Event::GeneralRef` instead of folding it into the surrounding text. Both XML
readers here matched only `Event::Text`, so after the bump each reference was
dropped **silently**: the document still parsed, every existing test still
passed, and the values were wrong.

That is the dangerous shape of this change, and it is why it needed more than a
compile fix:

  - `op-screening` parses the OFAC/EU/UN sanctions lists. An entry published as
    "Smith & Co" was being stored as "Smith  Co" — a name that no longer matches
    the party it names, with nothing downstream able to tell. A screening miss
    reads exactly like a clean screen.
  - `jouleclaw-transform-trx` carries JSON property values through TRX XML. The
    quotes arrive escaped, so dropping the references turned `{"k":1}` into
    `{k:1}`, which fails to parse and falls back to being stored as a bare
    string. One round-trip test caught this; nothing else did.

Both readers now accumulate an element's character data across events and
resolve each reference: a numeric reference through `resolve_char_ref`, a named
one through `resolve_predefined_entity`. TRX carries no DTD, so an unknown name
there is refused rather than dropped. The sanctions readers keep an unknown
reference in its literal `&name;` form, so the anomaly stays visible in the
record instead of silently altering a name.

`trim_text(true)` had to go with it, on all four readers. Trimming is applied
per text event, so once a run is split by a reference the trim eats the spaces
on either side of it — "Smith & Co" became "Smith&Co", which the new tests
caught. The assembled value is trimmed once where it is consumed instead; the
screening readers already did exactly that at every consumer, making the
reader-level trim redundant there even before this change.

Tests: the fixtures had no entity in them anywhere, which is precisely why a
silent data-corruption bug could pass CI. Added, failing first: a sanctioned
name carrying `&` and one carrying `&` (different code paths — a named
predefine and a numeric reference), entity references in TRX text asserted
against hand-written XML rather than our own writer's escaping, and a refusal
for an unresolvable name.

Co-Authored-By: Claude Opus 5 <[email protected]>
2026-10-22 12:45:52 -04:00
..
op-3ds2 sec: drop the unused rsa dependency from op-3ds2, removing the one advisory with no fix 2026-10-22 09:50:04 -04:00
op-batch Ingest batch 3: 9 more crates across openpay / smart-byte / eoc 2026-05-24 01:09:35 -04:00
op-bin ingest wave E: 3 crates · op-bin + smart-byte-tendermint + eoc-safety 2026-05-24 16:52:07 -04:00
op-bnpl chore(deps): update dependencies for Rust 1.98, pinning the crypto generations 2026-08-26 12:19:50 -04:00
op-cli Parallel ingest: 9 issues' worth of work across openpay / smart-byte / eoc 2026-05-23 13:24:05 -04:00
op-connect op-connect: an unrun PEP screen is not a clearance 2026-10-17 04:13:10 -04:00
op-core Parallel ingest: 9 issues' worth of work across openpay / smart-byte / eoc 2026-05-23 13:24:05 -04:00
op-crypto-extra ingest wave F: 3 crates · op-crypto-extra + smart-byte-acdc + eoc-memory 2026-05-24 17:28:24 -04:00
op-dispute
op-dispute-evidence ingest wave A2: 3 crates · op-dispute-evidence + smart-byte-edv + eoc-agent 2026-05-24 11:42:26 -04:00
op-driver-sdk Parallel ingest: 9 issues' worth of work across openpay / smart-byte / eoc 2026-05-23 13:24:05 -04:00
op-emv
op-ewallets-asia chore(deps): update dependencies for Rust 1.98, pinning the crypto generations 2026-08-26 12:19:50 -04:00
op-ffi-jni
op-ffi-swift
op-fraud Repo-wide toolchain refresh + jouleclaw policy/sandbox updates 2026-06-07 17:04:45 -04:00
op-fraud-graph Repo-wide toolchain refresh + jouleclaw policy/sandbox updates 2026-06-07 17:04:45 -04:00
op-fx
op-graph
op-iso8583 Ingest batch 2: 9 new crates across openpay / smart-byte / eoc 2026-05-23 18:12:24 -04:00
op-iso20022
op-ledger
op-mobile-wallets chore(deps): update dependencies for Rust 1.98, pinning the crypto generations 2026-08-26 12:19:50 -04:00
op-openbanking ingest wave A4: 3 crates · smart-byte-atproto + op-openbanking + eoc-distributed 2026-05-24 12:22:09 -04:00
op-orchestrator Repo-wide toolchain refresh + jouleclaw policy/sandbox updates 2026-06-07 17:04:45 -04:00
op-payouts ingest wave B: 3 crates · op-payouts + smart-byte-nostr + eoc-streaming 2026-05-24 13:39:09 -04:00
op-rails-a2a
op-rails-card Parallel ingest: 9 issues' worth of work across openpay / smart-byte / eoc 2026-05-23 13:24:05 -04:00
op-rails-crypto
op-rails-x402 op-rails-x402: x402 agentic-payment rail (HTTP 402 acceptance) 2026-06-25 15:43:20 -04:00
op-reconciliation
op-refund
op-revrec ingest batch 5 (salvage): 2 crates from 9-agent dispatch (session-limit hit mid-batch) 2026-05-24 09:28:38 -04:00
op-routing Ingest batch 2: 9 new crates across openpay / smart-byte / eoc 2026-05-23 18:12:24 -04:00
op-screening trx, screening: resolve XML entity references, which quick-xml 0.41 now reports as their own event 2026-10-22 12:45:52 -04:00
op-server
op-settlement
op-statements ingest wave C: 3 crates · op-statements + smart-byte-activitypub + eoc-observability 2026-05-24 13:51:09 -04:00
op-subscriptions
op-tax chore(deps): update dependencies for Rust 1.98, pinning the crypto generations 2026-08-26 12:19:50 -04:00
op-vault op-vault: test that a token is independent of the PAN, not free of "4242" 2026-09-30 23:07:55 -04:00
op-wasm
op-webhook fix(op-webhook): import KeyInit — hmac 0.13 moved new_from_slice off the Mac trait, breaking compute_signature 2026-08-26 09:28:40 -04:00