From 11d14f6dd8581715e5241f1fc780a14bf4cc40a2 Mon Sep 17 00:00:00 2001 From: Marc Coquand Date: Sat, 2 Dec 2023 13:08:13 -0600 Subject: Add initial auth --- lib/user.ml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib/user.ml') diff --git a/lib/user.ml b/lib/user.ml index 00cd33f..f0ac7cf 100644 --- a/lib/user.ml +++ b/lib/user.ml @@ -6,7 +6,7 @@ open Lwt type public_key = { id : string; owner : string; - public_key_prem : string; [@key "publicKeyPem"] + public_key_pem : string; [@key "publicKeyPem"] } [@@deriving yojson] [@@yojson.allow_extra_fields] @@ -26,4 +26,8 @@ let get_user actor_url = Ok body with exn -> Lwt.return (Error exn) +let get_public_pem user = + user.public_key.public_key_pem |> Cstruct.of_string + |> X509.Public_key.decode_pem + let name user = user.name -- cgit v1.2.3