diff options
author | Marc Coquand <marcc@fastmail.fr> | 2023-12-02 13:08:13 -0600 |
---|---|---|
committer | Marc Coquand <marcc@fastmail.fr> | 2023-12-02 13:08:13 -0600 |
commit | 11d14f6dd8581715e5241f1fc780a14bf4cc40a2 (patch) | |
tree | 32d20403bd99b766a2c52c90a02726653713c16d /lib/user.ml | |
parent | 3fd0ae419ff2dadb0a566a28c042333affbb03b4 (diff) | |
download | wormhole-11d14f6dd8581715e5241f1fc780a14bf4cc40a2.tar.gz wormhole-11d14f6dd8581715e5241f1fc780a14bf4cc40a2.tar.bz2 wormhole-11d14f6dd8581715e5241f1fc780a14bf4cc40a2.zip |
Add initial auth
Diffstat (limited to '')
-rw-r--r-- | lib/user.ml | 6 |
1 files changed, 5 insertions, 1 deletions
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 |