Skip to content

fix: did:cid universal resolver responses#700

Merged
macterra merged 4 commits into
mainfrom
agent/issue-699-did-cid-resolution
Jul 9, 2026
Merged

fix: did:cid universal resolver responses#700
macterra merged 4 commits into
mainfrom
agent/issue-699-did-cid-resolution

Conversation

@macterra

@macterra macterra commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fixes #699.

This tightens the Universal Resolver-style /1.0/identifiers/{did} response for did:cid in both Gatekeeper implementations.

  • Rust Gatekeeper: adds DID media type negotiation, stable didResolutionMetadata.contentType, and fixture-stable metadata on successful conformant resolution responses
  • TypeScript Gatekeeper: mirrors the Rust behavior in identifiers-router, including exact Content-Type responses for DID JSON and DID JSON-LD
  • removes volatile didResolutionMetadata.retrieved from the conformant Universal Resolver-style success response while leaving the internal resolver metadata behavior intact
  • keeps conformant responses limited to the DID Resolution triple: didDocument, didResolutionMetadata, and didDocumentMetadata
  • updates Gatekeeper docs and records the Rust formatting lesson in AGENTS.md

Validation

  • cargo test --manifest-path rust/services/gatekeeper/Cargo.toml --test http_contract -- --nocapture
  • node --experimental-vm-modules node_modules/.bin/jest tests/gatekeeper/api.test.ts --runInBand --verbose

Note: the Rust test run still reports the existing unused import warning for queue_outbound_operation in rust/services/gatekeeper/src/lib.rs.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.contentType and strips volatile didResolutionMetadata.retrieved from successful resolution results.
  • Honors Accept: application/did+json vs Accept: application/did+ld+json, returning the selected DID media type as the HTTP Content-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.

Comment thread services/gatekeeper/server/src/identifiers-router.ts
Comment thread services/gatekeeper/server/src/identifiers-router.ts
Comment thread services/gatekeeper/server/src/identifiers-router.ts
Comment thread rust/services/gatekeeper/src/api.rs
Comment thread rust/services/gatekeeper/src/api.rs
@macterra macterra changed the title Fix did:cid universal resolver responses fix: did:cid universal resolver responses Jul 8, 2026
@macterra macterra marked this pull request as ready for review July 8, 2026 23:42
@macterra macterra merged commit 57c68d2 into main Jul 9, 2026
28 checks passed
@macterra macterra deleted the agent/issue-699-did-cid-resolution branch July 9, 2026 00:14
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.

Make /1.0/identifiers did:cid responses conformant for DID test suite fixtures

2 participants