Repository navigation
fix(crossref): validate graphic DOI suffix characters - #14524
Conversation
|
Verified end to end — nice, tight fix. What I checked on head 547d059:
Execution: ran the suite in a clean python:3.11 container with the PR-pinned deps — Leaving merge sign-off to a maintainer: the checks-manifest addition introduces a new CI-lane check (workflow-sensitive surface), and issue #14523 is a bounty proposal whose reward disposition needs a maintainer call. Neither blocks the code itself. — Omi automated maintainer review by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with |
kodjima33
left a comment
There was a problem hiding this comment.
Confirmed old unnormalized DOI resolver-URL handling still on main (clean()/get_crossref_work unchanged). Fix correctly parses doi:/bare/doi.org+dx.doi.org resolver forms, decodes once, rejects unrelated hosts; thorough test suite, all required checks pass (remaining pending are unrelated mobile/desktop builds). 5/5.
|
Verified on Leaving this open as the keep vehicle (remaining hole: crossref DOI resolver URL normalize complementary vs #13979; CONFLICTING). Overlap is on Head is |
547d059 to
8bc6df3
Compare
|
@aryanorastar Rebased onto current The remaining delta keeps the hardened resolver parsing from #14606 and fixes its over-restrictive DOI suffix grammar. It includes a regression for a registered Crossref DOI containing angle brackets plus encoded reserved-character and exact-once-decoding coverage. Local verification:
All fresh hosted workflow runs currently show |
aryanorastar
left a comment
There was a problem hiding this comment.
Reviewed current head 8bc6df389eaa. origin/main _DOI_RE still rejects reserved DOI suffix characters ([-._;()/:A-Z0-9#]+). This SHA widens the suffix grammar and pins it. Hygiene SUCCESS. Not merging.
Accept registered Unicode graphic suffix characters while rejecting whitespace, controls, format code points, and non-ASCII prefix digits. Keep traversal-like suffix text safe by quoting the complete DOI as one outbound path segment. Failure-Class: FC-overstrict-identifier-grammar
8bc6df3 to
21bde74
Compare
|
@aryanorastar @kodjima33 Follow-up on current head I also removed the Verification on the new head:
Please re-review after hosted checks complete. |
aryanorastar
left a comment
There was a problem hiding this comment.
_DOI_RE on main still rejects graphic suffix characters, so the Wiley DOI fails normalize_doi. This head allowlists those characters and test_doi_normalization.py pins the Wiley DOI. Hygiene is green on 21bde747cddd.
What changed and why
Follow-up to #14523. The resolver normalization from #14606 correctly parses trusted
doi.orgURLs, but its DOI suffix grammar rejects registered identifiers containing reserved characters such as<and>, as well as encoded suffix characters such as&,?,=,@,+, and%.This rebased change keeps the hardened scheme, host, credential, port, and decode-once checks already on
main, while accepting visible Unicode DOI suffix characters and legacy dotted registrant codes. It rejects whitespace, controls, format code points, unassigned characters, and non-ASCII prefix digits. The normalized DOI is still quoted withsafe="", so reserved characters and traversal-like suffix text remain inside one Crossref API path segment.This is complementary to #13979: that PR handles malformed Crossref response payloads and HTTP client pooling, while this PR covers DOI input compatibility at the request boundary.
Product invariants affected
none
How it was verified
python plugins/omi-crossref-app/test_doi_normalization.py— 26 passed.python -m pytest plugins/omi-crossref-app -q --tb=short— 33 passed.python -m compileall -q plugins/omi-crossref-app— passed.git diff --check— no whitespace errors.10.1002/1097-4636(200108)56:2<297::aid-jbm1098>3.0.co;2-sreturned HTTP 200 and the expected work when the DOI was quoted as one path segment.The full manifest preflight cannot resolve in this sparse checkout because unrelated manifest paths under backend, mobile, web, and desktop are absent. The selected hermetic Crossref command and the complete plugin suite pass directly.
Tests
plugins/omi-crossref-app/test_doi_normalization.pynow covers encoded reserved suffix characters, exact-once decoding with a remaining literal percent escape, legacy dotted registrant codes, a real registered DOI containing angle brackets, visible Unicode suffixes, rejected control/format/unassigned code points, rejected non-ASCII prefix digits, repeated-dot suffixes, and the exact outbound quoted Crossref path.Backend Hermetic Merge Gate
Out of scope: this change only touches the Crossref plugin and its existing hermetic DOI suite; it does not change backend, lockfile, workflow, or gate paths.
Failure class (fixes)
Failure-Class: FC-overstrict-identifier-grammar
New guards
No new check is added. The existing
crossref-doi-normalization-testsmanifest entry runs the extended behavioral suite and would catch the over-restrictive DOI grammar.The research, implementation, and tests were prepared with Codex assistance on behalf of @dvdphobia.