This commit is contained in:
parent
9390ece117
commit
cd24e80d6e
1 changed files with 11 additions and 10 deletions
|
|
@ -38,15 +38,18 @@ module Make
|
||||||
struct
|
struct
|
||||||
let tls key_ro certificate_ro =
|
let tls key_ro certificate_ro =
|
||||||
let open Lwt_result.Infix in
|
let open Lwt_result.Infix in
|
||||||
Lwt.Infix.(
|
let ( let* ) = Lwt_result.bind in
|
||||||
Key.list key_ro Mirage_kv.Key.empty
|
let* keys =
|
||||||
>|= R.reword_error (R.msgf "%a" Key.pp_error))
|
Lwt.Infix.(
|
||||||
>>= fun keys ->
|
Key.list key_ro Mirage_kv.Key.empty
|
||||||
|
>|= R.reword_error (R.msgf "%a" Key.pp_error))
|
||||||
|
in
|
||||||
let keys, _ = List.partition (fun (_, t) -> t = `Value) keys in
|
let keys, _ = List.partition (fun (_, t) -> t = `Value) keys in
|
||||||
Lwt.Infix.(
|
let* certificates =
|
||||||
Certificate.list certificate_ro Mirage_kv.Key.empty
|
Lwt.Infix.(
|
||||||
>|= R.reword_error (R.msgf "%a" Certificate.pp_error))
|
Certificate.list certificate_ro Mirage_kv.Key.empty
|
||||||
>>= fun certificates ->
|
>|= R.reword_error (R.msgf "%a" Certificate.pp_error))
|
||||||
|
in
|
||||||
let certificates, _ =
|
let certificates, _ =
|
||||||
List.partition (fun (_, t) -> t = `Value) certificates
|
List.partition (fun (_, t) -> t = `Value) certificates
|
||||||
in
|
in
|
||||||
|
|
@ -54,7 +57,6 @@ struct
|
||||||
match Mirage_kv.Key.basename name with
|
match Mirage_kv.Key.basename name with
|
||||||
| ".gitkeep" -> Lwt.return acc
|
| ".gitkeep" -> Lwt.return acc
|
||||||
| _ ->
|
| _ ->
|
||||||
let open Lwt_result.Infix in
|
|
||||||
Lwt.Infix.(
|
Lwt.Infix.(
|
||||||
Certificate.get certificate_ro name
|
Certificate.get certificate_ro name
|
||||||
>|= R.reword_error (R.msgf "%a" Certificate.pp_error))
|
>|= R.reword_error (R.msgf "%a" Certificate.pp_error))
|
||||||
|
|
@ -68,7 +70,6 @@ struct
|
||||||
match Mirage_kv.Key.basename name with
|
match Mirage_kv.Key.basename name with
|
||||||
| ".gitkeep" -> Lwt.return acc
|
| ".gitkeep" -> Lwt.return acc
|
||||||
| _ ->
|
| _ ->
|
||||||
let open Lwt_result.Infix in
|
|
||||||
Lwt.Infix.(
|
Lwt.Infix.(
|
||||||
Key.get key_ro name >|= R.reword_error (R.msgf "%a" Key.pp_error))
|
Key.get key_ro name >|= R.reword_error (R.msgf "%a" Key.pp_error))
|
||||||
>>= (Lwt.return <.> X509.Private_key.decode_pem)
|
>>= (Lwt.return <.> X509.Private_key.decode_pem)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue