Conversation
- rename public XMLDSig pipeline error to DsigError - make TransformError::C14n hold typed C14nError via thiserror source - update xmldsig exports and integration tests to use DsigError Closes #36
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughSummary by CodeRabbit
WalkthroughReplaces the public error type for the XMLDSig verification pipeline with Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Pull request overview
This PR introduces DsigError as the top-level XMLDSig verification pipeline error type, replacing the previous SignatureVerificationPipelineError naming and improving typed error chaining (notably for C14N/transform layers).
Changes:
- Renamed the public XMLDSig pipeline error surface to
DsigErrorand updated key/resolver hooks + verify APIs accordingly. - Updated
TransformError::C14nto carry a typedC14nErrorsource (instead ofString) and simplified transform error propagation. - Updated integration tests and xmldsig module exports to use
DsigError.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/signature_pipeline_integration.rs | Updates assertions/imports to expect DsigError variants. |
| src/xmldsig/verify.rs | Introduces pub enum DsigError and updates public verify/key/resolver error types. |
| src/xmldsig/types.rs | Switches TransformError::C14n to typed C14nError with #[from] for source chaining. |
| src/xmldsig/transforms.rs | Uses ? to propagate C14nError into TransformError via From. |
| src/xmldsig/mod.rs | Re-exports DsigError and removes the old pipeline error export. |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/xmldsig/verify.rs (1)
445-447:⚠️ Potential issue | 🟠 MajorAdd
#[source]annotations toReferenceProcessingErrortuple fields to preserve theTransformError/C14nErrorsource chain.Line 447 wraps
ReferenceProcessingError, but the inner variantsUriDereferenceandTransformholdTransformErroras plain tuple fields. Inthiserror, plain tuple fields do not participate inError::source()— callers cannot walk the error chain to inspect the underlying typedTransformErrororC14nError.Fix
pub enum ReferenceProcessingError { /// URI dereference failed. #[error("URI dereference failed: {0}")] - UriDereference(super::types::TransformError), + UriDereference(#[source] super::types::TransformError), /// Transform execution failed. #[error("transform failed: {0}")] - Transform(super::types::TransformError), + Transform(#[source] super::types::TransformError), }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/xmldsig/verify.rs` around lines 445 - 447, The ReferenceProcessingError enum's tuple fields aren't exposed as error sources; add #[source] to the tuple fields in the enum variants that wrap underlying errors so Error::source() returns the inner TransformError/C14nError. Specifically, update the ReferenceProcessingError variants (e.g., UriDereference(#[source] TransformError) and Transform(#[source] C14nError) — or whichever variants wrap TransformError/C14nError) to annotate those tuple fields with #[source] so the error chain is preserved; no other API changes required.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@src/xmldsig/verify.rs`:
- Around line 445-447: The ReferenceProcessingError enum's tuple fields aren't
exposed as error sources; add #[source] to the tuple fields in the enum variants
that wrap underlying errors so Error::source() returns the inner
TransformError/C14nError. Specifically, update the ReferenceProcessingError
variants (e.g., UriDereference(#[source] TransformError) and Transform(#[source]
C14nError) — or whichever variants wrap TransformError/C14nError) to annotate
those tuple fields with #[source] so the error chain is preserved; no other API
changes required.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 5bc3b52b-ea57-4c31-b2ad-bf157f72c55b
📒 Files selected for processing (5)
src/xmldsig/mod.rssrc/xmldsig/transforms.rssrc/xmldsig/types.rssrc/xmldsig/verify.rstests/signature_pipeline_integration.rs
|
@coderabbitai Fixed. Added #[source] on ReferenceProcessingError::UriDereference and ::Transform so Error::source() preserves the typed TransformError/C14nError chain. |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chainLet me verify the fix in the codebase. 🏁 Script executed: Length of output: 6524 🏁 Script executed: Length of output: 73 🏁 Script executed: Length of output: 1746
Using The full error chain now traverses cleanly: 🧠 Learnings used |
Summary
Testing
Closes #36