docs: cover detached signatures in the getOriginalXmlWithIds() deprecation - #578
Conversation
…ation The advice to place the signature with `location` and read `getSignedXml()` only helps callers who embed the signature. A detached signature is sent apart from the document it covers, so the only reason to fetch the original with IDs is that the library generated those IDs. Callers can instead put the ID attributes on the referenced elements themselves and send their own document with `getSignatureXml()`, which keeps working once the method is removed. Update the runtime warning, the JSDoc and the README entry together. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
Included review availability: Your plan provides up to 2 included reviews per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe change clarifies detached-signature guidance for ChangesDetached Signature Guidance
Priority: ⬇️ Low Estimated code review effort: 1 (Trivial) | ~5 minutes Change: Other Merge Risk: ⚪ Minimal · up to The change updates detached-signature guidance only, with no identified implementation or documentation-contract defect. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #578 +/- ##
==========================================
+ Coverage 75.95% 77.44% +1.48%
==========================================
Files 9 9
Lines 1048 1095 +47
Branches 273 278 +5
==========================================
+ Hits 796 848 +52
+ Misses 144 139 -5
Partials 108 108 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
"An ID attribute" is ambiguous. With WS-Security IDs the signer ignores a plain `Id`, adds its own `wsu:Id`, and references that, so the document the caller sends does not verify. Name `wsu:Id` rather than `idMode`, which node-saml#519 plans to deprecate in favour of namespaced `idAttributes`. Adding IDs before signing can also change what a reference XPath selects, since node-saml#577 evaluates references against the document passed in. The README now says to check each XPath still selects its intended element. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Summary
The deprecation advice for
getOriginalXmlWithIds(), to place the signature withlocationand then readgetSignedXml(), only helps callers who embed the signature. A detached signature is sent apart from the document it covers, and the only reason to fetch the original with IDs is that the library generated those IDs.The runtime warning, the JSDoc and the README entry now also say: for a detached signature, put an ID attribute the signer recognizes on each referenced element (
wsu:Idfor WS-Security), sign that document, and send it alongsidegetSignatureXml().Idis ignored: the signer adds its ownwsu:Idand references that, so the document the caller sends does not verify. The advice nameswsu:Idrather thanidMode, which Add XmlDSigVerifier wrapper for SignedXml #519 plans to deprecate in favour of namespacedidAttributes./root[not(@Id)]then throws at signing, and an XPath conditioned on another element's ID can silently drop an element from the signature. The README says to check each XPath still selects its intended element, for example by selecting on the ID.Documentation only; no behaviour change.
🤖 Generated with Claude Code
Summary by CodeRabbit