JJ: Description from the destination commit:
~ http_information.ml JJ: Description from source commit: ~
This commit is contained in:
parent
df522f449a
commit
495ad62e7a
5 changed files with 23 additions and 24 deletions
|
|
@ -1 +0,0 @@
|
||||||
Iî÷q¸àwÇ´Y—›gbÙ'R+5µ™â°ƒˆyë>
|
|
||||||
|
|
@ -2,6 +2,24 @@ open Syntax
|
||||||
open Api
|
open Api
|
||||||
module String_map = Stdlib.Map.Make (Stdlib.String)
|
module String_map = Stdlib.Map.Make (Stdlib.String)
|
||||||
|
|
||||||
|
(* TODO mirage-crypto
|
||||||
|
is this ok?
|
||||||
|
maybe don't use the same RNG-initialization as the one used to generate keys *)
|
||||||
|
let seed req _server _env =
|
||||||
|
Logs.info (fun m -> m "GET /seed");
|
||||||
|
(* RNG is initialized by Vif.run *)
|
||||||
|
let s = Mirage_crypto_rng.generate 64 in
|
||||||
|
let open Vif.Response in
|
||||||
|
let open Syntax in
|
||||||
|
let* () = add ~field:"content-type" "application/octet-stream" in
|
||||||
|
let* () = with_string req s in
|
||||||
|
respond `OK
|
||||||
|
|
||||||
|
let config req _server _env =
|
||||||
|
Logs.info (fun m -> m "GET /config");
|
||||||
|
let s = Api.(encode_exn ExchangeVersionResponse.jsont config) in
|
||||||
|
Respond_util.respond_with_ok_json s req
|
||||||
|
|
||||||
(* TODO
|
(* TODO
|
||||||
for now we only have one item in each "denom group"
|
for now we only have one item in each "denom group"
|
||||||
change this once we have denom/signkey rotation *)
|
change this once we have denom/signkey rotation *)
|
||||||
|
|
@ -239,7 +257,7 @@ let mk_keys ~db_conn (module Sm : Secmod.S) ~last_issue_date =
|
||||||
|
|
||||||
let jsont = ExchangeKeysResponse.jsont
|
let jsont = ExchangeKeysResponse.jsont
|
||||||
|
|
||||||
let f req server _env =
|
let keys req server _env =
|
||||||
Logs.info (fun m -> m "GET /keys");
|
Logs.info (fun m -> m "GET /keys");
|
||||||
let db_conn = Vif.Server.device Devices.db_connection server in
|
let db_conn = Vif.Server.device Devices.db_connection server in
|
||||||
let sm = Vif.Server.device Devices.secmod server in
|
let sm = Vif.Server.device Devices.secmod server in
|
||||||
24
src/mte.ml
24
src/mte.ml
|
|
@ -13,24 +13,6 @@
|
||||||
You should have received a copy of the GNU Affero General Public License
|
You should have received a copy of the GNU Affero General Public License
|
||||||
along with this program. If not, see <https://www.gnu.org/licenses/>. *)
|
along with this program. If not, see <https://www.gnu.org/licenses/>. *)
|
||||||
|
|
||||||
(* TODO mirage-crypto
|
|
||||||
is this ok?
|
|
||||||
maybe don't use the same RNG-initialization as the one used to generate keys *)
|
|
||||||
let seed req _server _env =
|
|
||||||
Logs.info (fun m -> m "GET /seed");
|
|
||||||
(* RNG is initialized by Vif.run *)
|
|
||||||
let s = Mirage_crypto_rng.generate 64 in
|
|
||||||
let open Vif.Response in
|
|
||||||
let open Syntax in
|
|
||||||
let* () = add ~field:"content-type" "application/octet-stream" in
|
|
||||||
let* () = with_string req s in
|
|
||||||
respond `OK
|
|
||||||
|
|
||||||
let config req _server _env =
|
|
||||||
Logs.info (fun m -> m "GET /config");
|
|
||||||
let s = Api.(encode_exn ExchangeVersionResponse.jsont config) in
|
|
||||||
Respond_util.respond_with_ok_json s req
|
|
||||||
|
|
||||||
let hello req _server _env =
|
let hello req _server _env =
|
||||||
let open Vif.Response in
|
let open Vif.Response in
|
||||||
let open Syntax in
|
let open Syntax in
|
||||||
|
|
@ -53,9 +35,9 @@ let routes =
|
||||||
in
|
in
|
||||||
let status_info =
|
let status_info =
|
||||||
[
|
[
|
||||||
get_ (rel / "seed") --> seed;
|
get_ (rel / "seed") --> Http_information.seed;
|
||||||
get_ (rel / "config") --> config;
|
get_ (rel / "config") --> Http_information.config;
|
||||||
get_ (rel / "keys") --> Http_keys.f;
|
get_ (rel / "keys") --> Http_information.keys;
|
||||||
]
|
]
|
||||||
in
|
in
|
||||||
let management =
|
let management =
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ set -e
|
||||||
a="tmp_a.json"
|
a="tmp_a.json"
|
||||||
b="tmp_b.json"
|
b="tmp_b.json"
|
||||||
|
|
||||||
auditor_pub=$(<"./data/auditor_public_key")
|
auditor_pub=$(<"./test/auditor_public_key")
|
||||||
zero_euro="EUR:0.0"
|
zero_euro="EUR:0.0"
|
||||||
|
|
||||||
dune exec offline -- download --output $a
|
dune exec offline -- download --output $a
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue