fix: redacted document check#71
Conversation
WalkthroughThe changes update dependency versions for two packages in Changes
Sequence Diagram(s)sequenceDiagram
participant Caller
participant W3CSignatureIntegrity
Caller->>W3CSignatureIntegrity: test(document)
alt proof.type is 'BbsBlsSignature2020' or 'BbsBlsSignatureProof2020'
W3CSignatureIntegrity-->>Caller: return true
else
W3CSignatureIntegrity-->>Caller: return false
end
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
npm error Exit handler never called! ✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
🔭 Outside diff range comments (1)
src/verify/fragments/document-integrity/w3cSignatureIntegrity.ts (1)
10-13:⚠️ Potential issueSkip-reason string is now inaccurate
skip()still claims that any proof type other than'BbsBlsSignature2020'is skipped, buttest()now supports'BbsBlsSignatureProof2020'as well. This can confuse integrators and log parsers.- message: `Document either has no proof or proof.type is not 'BbsBlsSignature2020'.`, + message: `Document either has no proof or proof.type is neither 'BbsBlsSignature2020' nor 'BbsBlsSignatureProof2020'.`,
🧹 Nitpick comments (1)
src/verify/fragments/document-integrity/w3cSignatureIntegrity.ts (1)
18-22: Micro-refactor: use a constant set for permitted proof typesExpressing the allowed proof types once makes the intent clearer and avoids duplication between
test()and the skip-reason string.- return ( - doc.proof?.type === 'BbsBlsSignature2020' || doc.proof?.type === 'BbsBlsSignatureProof2020' - ); + const ALLOWED_PROOF_TYPES = new Set([ + 'BbsBlsSignature2020', + 'BbsBlsSignatureProof2020', + ]); + return ALLOWED_PROOF_TYPES.has(doc.proof?.type as string);
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (2)
package.json(1 hunks)src/verify/fragments/document-integrity/w3cSignatureIntegrity.ts(1 hunks)
🔇 Additional comments (1)
package.json (1)
120-124: Confirm downstream impact of bumped@trustvcpackagesBoth
@trustvc/w3c-contextand@trustvc/w3c-vcwere bumped by a minor version. Although the caret (^) range should protect against breaking changes, please double-check:
- Generated types: any renamed/removed interfaces may surface as compilation errors only in consumer projects.
- Runtime behaviour: newer contexts sometimes introduce mandatory contexts or additional checks that could cause previously-valid credentials to fail validation.
If this library is consumed by external systems, publish a pre-release and run an integration test before merging.
## [1.5.3](v1.5.2...v1.5.3) (2025-06-13) ### Bug Fixes * redacted document check ([#71](#71)) ([413e295](413e295))
|
🎉 This PR is included in version 1.5.3 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Summary
Added check to allow redacted document to render
Jira Ticket
Summary by CodeRabbit
Bug Fixes
Chores