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

futurGH 0a011665 97619eb0

+60 -2
+6
bin/main.ml
··· 7 7 ; (get, "/robots.txt", Api.Robots.handler) 8 8 ; (get, "/xrpc/_health", Api.Health.handler) 9 9 ; (get, "/.well-known/did.json", Api.Well_known.did_json) 10 + ; ( get 11 + , "/.well-known/oauth-protected-resource" 12 + , Api.Well_known.oauth_protected_resource ) 13 + ; ( get 14 + , "/.well-known/oauth-authorization-server" 15 + , Api.Well_known.oauth_authorization_server ) 10 16 ; (* unauthed *) 11 17 ( get 12 18 , "/xrpc/com.atproto.server.describeServer"
+54 -2
pegasus/lib/api/well_known.ml
··· 1 + open struct 2 + let make_url pth = 3 + Uri.(make ~scheme:"https" ~host:Env.hostname ~path:pth () |> to_string) 4 + 5 + let pds_url = `String (make_url "") 6 + end 7 + 1 8 let did_json = 2 9 Xrpc.handler (fun _ -> 3 10 Dream.json @@ Yojson.Safe.to_string ··· 8 15 , `Assoc 9 16 [ ("id", `String "#atproto_pds") 10 17 ; ("type", `String "AtprotoPersonalDataServer") 11 - ; ("serviceEndpoint", `String ("https://" ^ Env.hostname)) ] ) 12 - ] ) 18 + ; ("serviceEndpoint", pds_url) ] ) ] ) 19 + 20 + let oauth_protected_resource = 21 + Xrpc.handler (fun _ -> 22 + Dream.json @@ Yojson.Safe.to_string 23 + @@ `Assoc 24 + [ ("authorization_servers", `List [pds_url]) 25 + ; ("bearer_methods_supported", `List [`String "header"]) 26 + ; ("resource", pds_url) 27 + ; ("resource_documentation", `String "https://atproto.com") 28 + ; ("scopes_supported", `List []) ] ) 29 + 30 + let oauth_authorization_server = 31 + Xrpc.handler (fun _ -> 32 + Dream.json @@ Yojson.Safe.to_string 33 + @@ `Assoc 34 + [ ("issuer", pds_url) 35 + ; ("authorization_endpoint", `String (make_url "/oauth/authorize")) 36 + ; ("token_endpoint", `String (make_url "/oauth/token")) 37 + ; ( "pushed_authorization_request_endpoint" 38 + , `String (make_url "/oauth/par") ) 39 + ; ("require_pushed_authorization_requests", `Bool true) 40 + ; ( "scopes_supported" 41 + , `List 42 + [ `String "atproto" 43 + ; `String "transition:generic" 44 + ; `String "transition:chat.bsky" ] ) 45 + ; ("subject_types_supported", `List [`String "public"]) 46 + ; ("response_types_supported", `List [`String "code"]) 47 + ; ( "response_modes_supported" 48 + , `List [`String "query"; `String "fragment"] ) 49 + ; ( "grant_types_supported" 50 + , `List [`String "authorization_code"; `String "refresh_token"] ) 51 + ; ( "code_challenge_methods_supported" 52 + , `List [`String "S256"; `String "plain"] ) 53 + ; ("ui_locales_supported", `List [`String "en-US"]) 54 + ; ("display_values_supported", `List [`String "page"]) 55 + ; ("authorization_response_iss_parameter_supported", `Bool true) 56 + ; ( "request_object_signing_alg_values_supported" 57 + , `List [`String "none"] ) 58 + ; ("request_object_encryption_alg_values_supported", `List []) 59 + ; ("request_object_encryption_enc_values_supported", `List []) 60 + ; ("token_endpoint_auth_methods_supported", `List [`String "none"]) 61 + ; ( "token_endpoint_auth_signing_alg_values_supported" 62 + , `List [`String "ES256"] ) 63 + ; ("dpop_signing_alg_values_supported", `List [`String "ES256"]) 64 + ; ("client_id_metadata_document_supported", `Bool true) ] )