feat: document builder bbs2023 support#116
Conversation
WalkthroughDependency versions for @trustvc/w3c-related packages updated. DocumentBuilder test coverage expanded to include BBS2023 sign, derive, and verify flows while removing legacy BBS2020 tests. Core DocumentBuilder.sign() method refactored to exclude BbsBlsSignature2020 and simplify derived-verification logic. Changes
Sequence Diagram(s)sequenceDiagram
participant Caller
participant DocumentBuilder
participant SignatureHandler
participant VerifyHandler
rect rgb(220, 240, 255)
Note over Caller,VerifyHandler: Sign Flow (BBS2023 or ECDSA allowed)
Caller->>DocumentBuilder: sign(privateKey, cryptoSuite)
alt cryptoSuite === 'BbsBlsSignature2020'
DocumentBuilder-->>Caller: ❌ Error: BbsBlsSignature2020 not supported
else cryptoSuite is BBS2023 or ECDSA
DocumentBuilder->>SignatureHandler: Sign with selected suite
Note over DocumentBuilder: Add DATA_INTEGRITY_V2_URL context
SignatureHandler-->>DocumentBuilder: ✅ Signed document
DocumentBuilder-->>Caller: Return signed document
end
end
rect rgb(240, 220, 255)
Note over Caller,VerifyHandler: Verify Flow (derived-required check)
Caller->>DocumentBuilder: verify(document, publicKey)
alt !isDerived
DocumentBuilder-->>Caller: ❌ Error: Derivation required for verification
else isDerived
DocumentBuilder->>VerifyHandler: Verify derived document
VerifyHandler-->>DocumentBuilder: ✅ Verification successful
DocumentBuilder-->>Caller: Return verification result
end
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes The changes involve refactored crypto suite handling logic, updated method signatures with type constraints, runtime guards, modified verification flow, and expanded test coverage. Changes are cohesive and pattern-driven but require careful verification of cryptographic logic correctness, type safety, and test validity across multiple files. Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (3)
🧰 Additional context used🪛 Gitleaks (8.28.0)src/__tests__/core/documentBuilder.test.ts[high] 35-35: Detected a Generic API Key, potentially exposing access to various services and sensitive operations. (generic-api-key) [high] 176-176: Detected a Generic API Key, potentially exposing access to various services and sensitive operations. (generic-api-key) [high] 226-226: Detected a Generic API Key, potentially exposing access to various services and sensitive operations. (generic-api-key) [high] 282-282: Detected a Generic API Key, potentially exposing access to various services and sensitive operations. (generic-api-key) 🔇 Additional comments (12)
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 |
|
## [2.3.0](v2.2.0...v2.3.0) (2025-10-21) ### Features * document builder bbs2023 support ([#116](#116)) ([ce6e285](ce6e285))
|
🎉 This PR is included in version 2.3.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |


Summary
Document builder signing support for bbs2023
Summary by CodeRabbit
Chores
Bug Fixes
Tests