objective categorical abstract machine language personal data server
65
fork

Configure Feed

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

/.well-known/atproto-did

futurGH cfb36a03 9ce723b1

+20
+1
bin/main.ml
··· 13 13 ; ( get 14 14 , "/.well-known/oauth-authorization-server" 15 15 , Api.Well_known.oauth_authorization_server ) 16 + ; (get, "/.well-known/atproto-did", Api.Well_known.atproto_did) 16 17 ; (options, "/xrpc/**", Xrpc.handler (fun _ -> Dream.empty `No_Content)) 17 18 ; (* oauth *) 18 19 (options, "/oauth/par", Xrpc.handler (fun _ -> Dream.empty `No_Content))
+19
pegasus/lib/api/well_known.ml
··· 65 65 ; ( "dpop_signing_alg_values_supported" 66 66 , `List [`String "ES256"; `String "ES256K"] ) 67 67 ; ("client_id_metadata_document_supported", `Bool true) ] ) 68 + 69 + let atproto_did = 70 + Xrpc.handler (fun {req; db; _} -> 71 + try 72 + let handle = Dream.header req "Host" |> Option.get in 73 + if not (String.ends_with ~suffix:("." ^ Env.hostname) handle) then 74 + failwith "not found" 75 + else 76 + match%lwt Data_store.get_actor_by_identifier handle db with 77 + | Some {did; _} -> 78 + Dream.respond 79 + ~headers:[("Content-Type", "text/plain; charset=utf-8")] 80 + ~status:`OK did 81 + | None -> 82 + failwith "not found" 83 + with _ -> 84 + Dream.respond 85 + ~headers:[("Content-Type", "text/plain; charset=utf-8")] 86 + ~status:`Not_Found "user not found" )