fix(did): resolve path-based did:web documents per spec#48
Conversation
Use /.well-known/did.json only for host-only did:web identifiers and resolve path-based identifiers at /:path/did.json. Adds regression tests for both https and allowed-http host resolution with path components.
WalkthroughThis PR updates the did:web resolver to align with specification requirements. It refines the buildDidPath function to handle path-based DIDs with stricter validation and modified URL construction logic, adds regression tests for path-based resolution and host allowances, and includes a changelog entry documenting the patch-level changes. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes 🚥 Pre-merge checks | ✅ 3 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
⚔️ Resolve merge conflicts (beta)
No actionable comments were generated in the recent review. 🎉 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 |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
Summary
Examples
Spec Reference
DID Method Web spec, Read (Resolve) section:
That section defines root identifiers resolving via /.well-known/did.json, and identifiers with path components resolving via path segments plus /did.json.
Validation
Summary by CodeRabbit
Bug Fixes
/.well-known/did.json, while path-based identifiers resolve to/:path/did.json.Tests