fix: did:cid universal resolver responses#700
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR tightens Gatekeeper’s Universal Resolver-style GET /1.0/identifiers/{did} responses for did:cid so they are fixture-stable and properly advertise DID media types across both the TypeScript and Rust Gatekeeper surfaces.
Changes:
- Adds stable
didResolutionMetadata.contentTypeand strips volatiledidResolutionMetadata.retrievedfrom successful resolution results. - Honors
Accept: application/did+jsonvsAccept: application/did+ld+json, returning the selected DID media type as the HTTPContent-Type. - Extends both TS (Jest) and Rust (http_contract) tests plus documentation to lock in fixture-ready behavior.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/gatekeeper/api.test.ts | Adds Jest coverage for contentType and omission of retrieved, including Accept negotiation assertions. |
| services/gatekeeper/server/src/identifiers-router.ts | Implements TS-side Accept negotiation, stable metadata shaping, and explicit DID media Content-Type on success. |
| rust/services/gatekeeper/tests/http_contract.rs | Adds Rust HTTP contract coverage for fixture-stable resolution results and negotiated DID media types. |
| rust/services/gatekeeper/src/api.rs | Implements Rust-side Accept negotiation, stable metadata shaping, and DID media Content-Type on success. |
| docs/services/gatekeeper/README.md | Documents the fixture-ready response behavior and negotiated DID media types. |
| AGENTS.md | Records a repo workflow lesson about avoiding broad cargo fmt churn in focused Rust Gatekeeper fixes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Summary
Fixes #699.
This tightens the Universal Resolver-style
/1.0/identifiers/{did}response fordid:cidin both Gatekeeper implementations.didResolutionMetadata.contentType, and fixture-stable metadata on successful conformant resolution responsesidentifiers-router, including exactContent-Typeresponses for DID JSON and DID JSON-LDdidResolutionMetadata.retrievedfrom the conformant Universal Resolver-style success response while leaving the internal resolver metadata behavior intactdidDocument,didResolutionMetadata, anddidDocumentMetadataAGENTS.mdValidation
cargo test --manifest-path rust/services/gatekeeper/Cargo.toml --test http_contract -- --nocapturenode --experimental-vm-modules node_modules/.bin/jest tests/gatekeeper/api.test.ts --runInBand --verboseNote: the Rust test run still reports the existing unused import warning for
queue_outbound_operationinrust/services/gatekeeper/src/lib.rs.