Repository navigation
Conversation
|
Reviewed against #14523 - the normalization is correct and security-reducing. Thanks for the well-scoped change and the hermetic test suite (18/18 pass locally, no network or extra deps needed). File-by-file:
Bounty note: this PR implements the fix proposed in #14523 by a different account; awarding is a maintainer decision, not part of this review. Leaving for human maintainer review before merge (plugin-boundary sign-off plus the bounty decision); no blocking concerns from this pass. by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with |
## What changed and why Follow-up to #14523. The resolver normalization from #14606 correctly parses trusted `doi.org` URLs, 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 with `safe=""`, 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. - Live Crossref lookup of registered DOI `10.1002/1097-4636(200108)56:2<297::aid-jbm1098>3.0.co;2-s` returned 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.py` now 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-tests` manifest 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.
|
Follow-up after the merge: the linked bounty issue proposed US$25, but the PR states that the award is subject to maintainer review. Could a maintainer confirm whether a reward was approved for this PR, the final amount, and the official private payout channel or instructions? I will not post any wallet or financial details publicly. Thank you. |
Fixes #14523
Summary
doi:identifiers, anddoi.org/dx.doi.orgresolver URLs before Crossref lookup.Verification
python plugins/omi-crossref-app/test_doi_normalization.py— 18/18 passed.python .github/scripts/run_checks.py --lane local --check-id crossref-doi-normalization-tests— passed; manifest checks passed.python -m compileall -q plugins/omi-crossref-app— passed.git diff --check— clean.Failure-Class: none
Bounty
The issue proposes US$25. Award and payment remain subject to maintainer review and the repository's terms; no payment is represented as guaranteed.
Disclosure
AI-assisted work, reviewed locally; no credentials, private data, or live network access were used by the tests.