An easy-to-host PDS on the ATProtocol, iPhone and MacOS. Maintain control of your keys and data, always.
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: GET /v1/dids/:did — DID document retrieval #37

Summary#

  • Adds GET /v1/dids/:did public endpoint (no auth required)
  • Returns locally-cached DID document (200) when the DID is known to this relay
  • Proxies to plc.directory for unknown DIDs, forwarding the response
  • Returns 404 (NOT_FOUND) when the DID is not found in either place
  • Returns 502 (PLC_DIRECTORY_ERROR) on plc.directory infrastructure errors

Changes#

  • crates/relay/src/db/dids.rs — new get_did_document query against did_documents table
  • crates/relay/src/routes/get_did.rs — handler + 5 tests covering all 4 ACs
  • crates/relay/src/routes/test_utils.rsseed_did_document helper for tests
  • crates/relay/src/app.rs — route registered at /v1/dids/:did
  • bruno/get_did.bru — Bruno request file (seq 24)
  • crates/relay/CLAUDE.md — route table updated

Closes MM-91

Test plan#

  • cargo test -p relay get_did — all 5 tests pass
  • cargo clippy -p relay -- -D warnings — clean
  • Bruno: GET /v1/dids/:did with a known DID returns 200 with the DID document
  • Bruno: GET /v1/dids/:did with an unknown DID proxies to plc.directory
  • Bruno: GET /v1/dids/did:plc:doesnotexist returns 404
Labels

None yet.

assignee

None yet.

Participants 1
AT URI
at://did:web:malpercio.dev/sh.tangled.repo.pull/3mhwbud4oz322
Diff #0

No differences found between the selected revisions.

History

1 round 0 comments
sign up or login to add to the discussion
malpercio.dev submitted #0
patch application failed: error: No valid patches in input (allow with "--allow-empty")
expand 0 comments