Sigstore signing and verification for OCaml
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

ocaml-sigstore: reflow sigstore.mli example after dune fmt

Pure formatting: collapse the now-binding onto one line and parenthesise
the inner Ok-branch match so the outer match is well-structured. dune
fmt nudges this on every run.

+4 -8
+4 -8
lib/sigstore.mli
··· 22 22 Eio_main.run @@ fun env -> 23 23 Eio.Switch.run @@ fun sw -> 24 24 let session = Requests.v ~sw env in 25 - let now = 26 - Eio.Time.now env#clock |> Ptime.of_float_s |> Option.get 27 - in 25 + let now = Eio.Time.now env#clock |> Ptime.of_float_s |> Option.get in 28 26 29 27 (* Sign an artifact *) 30 28 match 31 29 Sigstore.sign session ~now ~id_token 32 30 ~artifact:(Sigstore.Artifact.of_string "hello world") 33 31 with 34 - | Error e -> 35 - Format.eprintf "Signing failed: %a@." Sigstore.pp_error e 36 - | Ok bundle -> 32 + | Error e -> Format.eprintf "Signing failed: %a@." Sigstore.pp_error e 33 + | Ok bundle -> ( 37 34 (* Verify *) 38 35 match Sigstore.verify session ~now bundle with 39 36 | Ok identity -> Format.printf "Signed by %s@." identity.email 40 37 | Error e -> 41 - Format.eprintf "Verification failed: %a@." 42 - Sigstore.pp_error e 38 + Format.eprintf "Verification failed: %a@." Sigstore.pp_error e) 43 39 ]} *) 44 40 45 41 (** {1 Hash Algorithms}