.
This commit is contained in:
parent
a0340bd100
commit
b04f0dc949
3 changed files with 25 additions and 25 deletions
|
|
@ -161,18 +161,13 @@ let read_master_key_file filename =
|
|||
let* master_key = read_file filename in
|
||||
Crypto.EddsaPrivateKey.of_octets master_key
|
||||
|
||||
let base_url = Uri.of_string "http://localhost:3434/"
|
||||
let full_url path = Uri.with_path base_url path |> Uri.to_string
|
||||
|
||||
let download ~output =
|
||||
let download ~output ~url =
|
||||
let open Bos in
|
||||
let uri = full_url "/management/keys/" in
|
||||
OS.Cmd.run Cmd.(v "curl" % "-s" % "-o" % output % "-X" % "GET" % uri)
|
||||
OS.Cmd.run Cmd.(v "curl" % "-s" % "-o" % output % "-X" % "GET" % url)
|
||||
|> unwrap_err_msg
|
||||
|
||||
let upload ~input ~url =
|
||||
let open Bos in
|
||||
let uri = full_url url in
|
||||
OS.Cmd.run
|
||||
Cmd.(
|
||||
v "curl"
|
||||
|
|
@ -183,7 +178,7 @@ let upload ~input ~url =
|
|||
% "Content-Type: application/json"
|
||||
% "--data"
|
||||
% ("@" ^ input)
|
||||
% uri)
|
||||
% url)
|
||||
|> unwrap_err_msg
|
||||
|
||||
let setup ~output =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue