fix: update w3c function#112
Conversation
WalkthroughDependency bump for @trustvc/w3c in package.json and an asynchronous refactor of isObfuscated in src/utils/documents/index.ts to use isDerived for signed verifiable credentials. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Caller
participant DocsUtil as isObfuscated()
participant W3C as isDerived()
Caller->>DocsUtil: isObfuscated(document)
alt Wrapped OA v2/v3
DocsUtil-->>Caller: boolean (sync logic)
else Signed VC
DocsUtil->>W3C: await isDerived(document)
W3C-->>DocsUtil: Promise<boolean>
DocsUtil-->>Caller: boolean
end
note over DocsUtil,W3C: Asynchronous path introduced for derived VC detection
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
✨ Finishing Touches
🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/utils/documents/index.ts (1)
121-121: Drop redundant await.Returning the promise directly is sufficient here.
- return await isDerived(document); + return isDerived(document);
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
⛔ 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/utils/documents/index.ts(3 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
src/utils/documents/index.ts (1)
src/w3c/types.ts (1)
SignedVerifiableCredential(4-4)
🔇 Additional comments (3)
package.json (1)
124-124: Confirm lockfile update and prerelease compatibility
- No lockfile changes detected—ensure the updated lockfile is committed and CI installs from it.
- Sibling
@trustvc/w3c-*deps are at older alphas (context ^1.3.0-alpha.8, credential-status ^1.3.0-alpha.8, issuer ^1.3.0-alpha.6, vc ^1.3.0-alpha.9); either bump them to ^1.3.0-alpha.10 or manually verify cross-version compatibility.src/utils/documents/index.ts (2)
15-15: Importing isDerived/isSignedDocument is appropriate for centralizing VC-derived checks.
109-112: MarkisObfuscated’s new async signature as a breaking change
- It’s publicly re-exported in
src/utils/index.ts, so consumers now receive aPromise<boolean>instead ofboolean.- Update all internal and external call sites to
await isObfuscated(...)or handle the returned Promise.- Add migration notes or bump the major version to reflect this breaking change.
## [2.0.6](v2.0.5...v2.0.6) (2025-09-02) ### Bug Fixes * update w3c function ([#112](#112)) ([cc5d8fb](cc5d8fb))
|
🎉 This PR is included in version 2.0.6 🎉 The release is available on: Your semantic-release bot 📦🚀 |



Summary
update w3c function in trust vc library , function isDerived to check obfuscation
Summary by CodeRabbit
No UI changes. Users may notice more accurate handling of derived credentials during verification without additional steps.