fix(core): params, error system, crypto - #5
Closed
rmlearney-digicatapult wants to merge 29 commits into
Closed
Conversation
Signed-off-by: Brian Richter <brian@aviary.tech>
Signed-off-by: Brian Richter <brian@aviary.tech>
Signed-off-by: Brian Richter <brian@aviary.tech>
Signed-off-by: Brian Richter <brian@aviary.tech>
Signed-off-by: Brian Richter <brian@aviary.tech>
Signed-off-by: Brian Richter <brian@aviary.tech>
Signed-off-by: Brian Richter <brian@aviary.tech>
Signed-off-by: Brian Richter <brian@aviary.tech>
Signed-off-by: Brian Richter <brian@aviary.tech>
…hape - delete removed verificationMethod resolution tests - convert resolution-failure assertions from throws to error results - add getResolver integration + resolver-result/verifier unit tests - apply biome formatting Signed-off-by: Brian Richter <brian@aviary.tech>
…n shape Signed-off-by: Brian Richter <brian@aviary.tech>
URLSearchParams applies application/x-www-form-urlencoded rules where '+' decodes to a space. A DID URL query is a URI component (RFC 3986) where '+' is literal, so a versionTime with a +HH:MM timezone offset was corrupted into an Invalid Date. Parse the query manually with decodeURIComponent instead. Signed-off-by: Brian Richter <brian@aviary.tech>
- resolver.ts: reject NaN versionNumber / Invalid Date versionTime as invalidDidUrl - resolver-result.ts: tighten mapErrorToCode so validation errors embedding '404'/'not found' (attacker-controlled log data) aren't misclassified as notFound; only genuine log-fetch absence maps to notFound - cli.ts: surface resolution errors in update/deactivate instead of TypeError on meta.updateKeys - examples: return the resolution error before file-serving fallback (avoid https:/// fetch) - tests: cover the new validation paths; reclassify invalid-update-key read as invalidDid Signed-off-by: Brian Richter <brian@aviary.tech>
- resolver-result.ts: preserve a valid earlier document when returned alongside a warning-level error (e.g. explicit version selector resolves while a later entry fails witness verification) instead of dropping it - resolver-result.ts: toErrorResult now synthesizes RFC9457 problemDetails (type/title/detail) so fetch/validation/invalidDidUrl errors keep structured error info - cli.ts: resolve a deactivated DID's identifier from the log instead of printing an empty id - tests: cover preserved-doc and problemDetails behavior Signed-off-by: Brian Richter <brian@aviary.tech>
Signed-off-by: Brian Richter <brian@aviary.tech>
- resolver-result.ts: add 'internalError' code; classify 5xx/network/transport failures as internalError instead of invalidDid (document-validation errors stay invalidDid). Synthesize problemDetails for it too. - examples/express-resolver.ts: map resolution error codes to HTTP status (notFound->404, invalid*->400, internalError->500) instead of a blanket 400. - tests: cover internalError classification; update network-failure expectation. Signed-off-by: Brian Richter <brian@aviary.tech>
…rning error Only bail on resolution error when didDocument is null; a valid earlier version can be returned alongside warning-level error metadata (consistent with toResolutionResult preserving the doc). Signed-off-by: Brian Richter <brian@aviary.tech>
A valid DID served from an unauthorized (401/403), gone (410), rate-limited (429), or failing (5xx) endpoint is a resolver-side internal error, not a document-validation failure. 404/empty-log stay notFound; document-validation errors stay invalidDid. Signed-off-by: Brian Richter <brian@aviary.tech>
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>
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>
brianorwhatever
force-pushed
the
design/did-resolver-query-params
branch
from
July 13, 2026 05:35
2a84b6e to
a2080de
Compare
rmlearney-digicatapult
deleted the branch
aviarytech:design/did-resolver-query-params
July 13, 2026 14:20
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Wanted to help out by addressing the comments I raised.
This PR into your branch does the following:
@stablelib/ed25519with@noble/curvesfor better supported library aligning with existing@noble/hashesunknownfor type safetyswitch-casereturns, no fall-throughsBit bigger change to the internal error system:
DidResolutionErrorfor all errors, no separateWebvhErrorCodeInvalidDidUrlerror class and exception-based control flow fromresolver-result.tsrepresentationNotSupportederror (not in spec)did-resolveroutput (JSON metadata)validateSingleVersionSelector) withnullor structured{ code, detail }instead of previous assertTest suite extended:
Note
Replace
invalidDidUrlerror code withinvalidDidand migrate Ed25519 crypto to@noble/curvesinvalidDidUrlandrepresentationNotSupportederror codes withinvalidDidacross the resolver, replacing theDidResolutionErrorenum with a'invalidDid' | 'notFound' | 'internalError'string union type in src/interfaces.tsvalidateSingleVersionSelectorin src/resolver-result.ts to return a structured error instead of throwing when conflicting version selectors are suppliederror='invalidDid'@stablelib/ed25519with@noble/curvesfor Ed25519 signature verification in src/verifier.tsInvalidDidUrlError,WebvhErrorCode, anddefaultVerifierare no longer exported from the package root; consumers relying on these or oninvalidDidUrlerror codes must update their codeMacroscope summarized 9193a84.