From bd7d8c62b0735a09f3cc326a326bda5193411db5 Mon Sep 17 00:00:00 2001 From: Evan Jarrett Date: Tue, 14 Oct 2025 23:55:31 -0500 Subject: [PATCH] add atproto-did endpoint --- pkg/hold/pds/xrpc.go | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/pkg/hold/pds/xrpc.go b/pkg/hold/pds/xrpc.go index da75808..ba2b089 100644 --- a/pkg/hold/pds/xrpc.go +++ b/pkg/hold/pds/xrpc.go @@ -68,8 +68,9 @@ func (h *XRPCHandler) RegisterHandlers(mux *http.ServeMux) { mux.HandleFunc("/xrpc/com.atproto.repo.uploadBlob", corsMiddleware(h.HandleUploadBlob)) mux.HandleFunc("/xrpc/com.atproto.sync.getBlob", corsMiddleware(h.HandleGetBlob)) - // DID document + // DID document and handle resolution mux.HandleFunc("/.well-known/did.json", corsMiddleware(h.HandleDIDDocument)) + mux.HandleFunc("/.well-known/atproto-did", corsMiddleware(h.HandleAtprotoDID)) } // HandleHealth returns health check information @@ -364,3 +365,14 @@ func (h *XRPCHandler) HandleDIDDocument(w http.ResponseWriter, r *http.Request) w.Header().Set("Content-Type", "application/did+json") json.NewEncoder(w).Encode(doc) } + +// HandleAtprotoDID returns the DID for handle resolution +func (h *XRPCHandler) HandleAtprotoDID(w http.ResponseWriter, r *http.Request) { + if r.Method != http.MethodGet { + http.Error(w, "method not allowed", http.StatusMethodNotAllowed) + return + } + + w.Header().Set("Content-Type", "text/plain") + fmt.Fprint(w, h.pds.DID()) +}