CCSDS Space Data Link Security (355.0-B-2)
0
fork

Configure Feed

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

ocaml-sdls: enable MDX on eio/otar_eio.mli

Run mdx on eio/otar_eio.mli so the {[ ... ]} odoc block now
type-checks against the real Sdls.Otar / Sdls_eio.Otar_eio APIs.

The example referenced free `fs`, `kek`, `master_material`, `cmd`,
`send`, `log_error`, used unqualified `Otar_eio.of_path`, and
`let ... in` chains that do not parse at the toplevel. Wrapped in
`let run ~kek ~master_material ~cmd ~send = Eio_main.run @@ ...` so
the user supplies the credentials and command, the example shows
both the Ok reply and Error paths via Fmt.epr + Sdls.Otar.pp_error,
and the disk-touching of_path call doesn't execute at mdx test time.

+12 -9
+2 -2
eio/dune
··· 14 14 nox-hkdf)) 15 15 16 16 (mdx 17 - (files security_eio.mli) 18 - (libraries sdls sdls-eio eio eio.unix eio_main)) 17 + (files security_eio.mli otar_eio.mli) 18 + (libraries sdls sdls-eio fmt eio eio.unix eio_main))
+10 -7
eio/otar_eio.mli
··· 18 18 {2 Example} 19 19 20 20 {[ 21 - let root = Eio.Path.(fs / "state") in 22 - let otar = Otar_eio.of_path ~kek root in 23 - Sdls.Otar.add_master_key otar ~mkid:1 master_material; 24 - assert (Sdls.Otar.activate_master_key otar 1); 25 - match Sdls.Otar.receive otar cmd with 26 - | Ok reply -> send reply 27 - | Error e -> log_error e 21 + let run ~kek ~master_material ~cmd ~send = 22 + Eio_main.run @@ fun env -> 23 + let fs = Eio.Stdenv.fs env in 24 + let root = Eio.Path.(fs / "state") in 25 + let otar = Sdls_eio.Otar_eio.of_path ~kek root in 26 + Sdls.Otar.add_master_key otar ~mkid:1 master_material; 27 + assert (Sdls.Otar.activate_master_key otar 1); 28 + match Sdls.Otar.receive otar cmd with 29 + | Ok reply -> send reply 30 + | Error e -> Fmt.epr "otar receive failed: %a@." Sdls.Otar.pp_error e 28 31 ]} *) 29 32 30 33 val of_path : kek:bytes -> _ Eio.Path.t -> Sdls.Otar.t