Skip to content

feat(parser): implement stricter DID Core v1.0 URI parser#163

Open
rmlearney-digicatapult wants to merge 8 commits into
decentralized-identity:masterfrom
rmlearney-digicatapult:feat/parse-strict
Open

feat(parser): implement stricter DID Core v1.0 URI parser#163
rmlearney-digicatapult wants to merge 8 commits into
decentralized-identity:masterfrom
rmlearney-digicatapult:feat/parse-strict

Conversation

@rmlearney-digicatapult

@rmlearney-digicatapult rmlearney-digicatapult commented Jul 16, 2026

Copy link
Copy Markdown

Existing parser() is more lenient than DID Core v1.0 (and v1.1) describes in §3.1 & §3.2 for DID syntax

Updated parser() to comply with stricter DID Core v1.0 requirements:

  • no support for matrix parameters (params removed from ParsedDID)
  • RFC 3986 character sets for path/query/fragment
  • case-insensitive hex for percent-encoding

Global and per-call caching still enabled, but not through matrix parameters (not in spec)

More flexible per-call caching now allows per-call cache control both positively and negatively even if global is disabled, when previous matrix parameter usage only allowed noCache if global was enabled. Documented in README.md

Added new tests for parser()

Bumped version to 6.0.0

Signed-off-by: rmlearney-digicatapult <robert.learney@digicatapult.org.uk>
Signed-off-by: rmlearney-digicatapult <robert.learney@digicatapult.org.uk>

@mirceanis mirceanis left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, thank you for your submission!

I'd take a slightly different approach.
Instead of introducing strict methods, rather tighten the existing ones.
This may be a breaking change, thus needing a major version bump, but the point is for the functionality that exists here to be compatible with DID Core.

Please update the existing methods to be stricter, instead of introducing new ones.

If too many things break, we can add lenient methods after

@rmlearney-digicatapult

Copy link
Copy Markdown
Author

Hi @mirceanis happy to do that, wanted to take the lower-risk route and not force a major semver

Signed-off-by: rmlearney-digicatapult <robert.learney@digicatapult.org.uk>
Signed-off-by: rmlearney-digicatapult <robert.learney@digicatapult.org.uk>
Signed-off-by: rmlearney-digicatapult <robert.learney@digicatapult.org.uk>
Signed-off-by: rmlearney-digicatapult <robert.learney@digicatapult.org.uk>
Signed-off-by: rmlearney-digicatapult <robert.learney@digicatapult.org.uk>
Signed-off-by: rmlearney-digicatapult <robert.learney@digicatapult.org.uk>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants