Summary#
- Adds
GET /v1/dids/:didpublic endpoint (no auth required) - Returns locally-cached DID document (200) when the DID is known to this relay
- Proxies to
plc.directoryfor 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— newget_did_documentquery againstdid_documentstablecrates/relay/src/routes/get_did.rs— handler + 5 tests covering all 4 ACscrates/relay/src/routes/test_utils.rs—seed_did_documenthelper for testscrates/relay/src/app.rs— route registered at/v1/dids/:didbruno/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/:didwith a known DID returns 200 with the DID document - Bruno:
GET /v1/dids/:didwith an unknown DID proxies to plc.directory - Bruno:
GET /v1/dids/did:plc:doesnotexistreturns 404