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
|
||||
let tls key_ro certificate_ro =
|
||||
let open Lwt_result.Infix in
|
||||
Lwt.Infix.(
|
||||
Key.list key_ro Mirage_kv.Key.empty
|
||||
>|= R.reword_error (R.msgf "%a" Key.pp_error))
|
||||
>>= fun keys ->
|
||||
let ( let* ) = Lwt_result.bind in
|
||||
let* keys =
|
||||
Lwt.Infix.(
|
||||
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
|
||||
Lwt.Infix.(
|
||||
Certificate.list certificate_ro Mirage_kv.Key.empty
|
||||
>|= R.reword_error (R.msgf "%a" Certificate.pp_error))
|
||||
>>= fun certificates ->
|
||||
let* certificates =
|
||||
Lwt.Infix.(
|
||||
Certificate.list certificate_ro Mirage_kv.Key.empty
|
||||
>|= R.reword_error (R.msgf "%a" Certificate.pp_error))
|
||||
in
|
||||
let certificates, _ =
|
||||
List.partition (fun (_, t) -> t = `Value) certificates
|
||||
in
|
||||
|
|
@ -54,7 +57,6 @@ struct
|
|||
match Mirage_kv.Key.basename name with
|
||||
| ".gitkeep" -> Lwt.return acc
|
||||
| _ ->
|
||||
let open Lwt_result.Infix in
|
||||
Lwt.Infix.(
|
||||
Certificate.get certificate_ro name
|
||||
>|= R.reword_error (R.msgf "%a" Certificate.pp_error))
|
||||
|
|
@ -68,7 +70,6 @@ struct
|
|||
match Mirage_kv.Key.basename name with
|
||||
| ".gitkeep" -> Lwt.return acc
|
||||
| _ ->
|
||||
let open Lwt_result.Infix in
|
||||
Lwt.Infix.(
|
||||
Key.get key_ro name >|= R.reword_error (R.msgf "%a" Key.pp_error))
|
||||
>>= (Lwt.return <.> X509.Private_key.decode_pem)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue