add http_information.ml
This commit is contained in:
parent
df522f449a
commit
3ad123b016
5 changed files with 23 additions and 24 deletions
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
|
||||
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 open Vif.Response in
|
||||
let open Syntax in
|
||||
|
|
@ -53,9 +35,9 @@ let routes =
|
|||
in
|
||||
let status_info =
|
||||
[
|
||||
get_ (rel / "seed") --> seed;
|
||||
get_ (rel / "config") --> config;
|
||||
get_ (rel / "keys") --> Http_keys.f;
|
||||
get_ (rel / "seed") --> Http_information.seed;
|
||||
get_ (rel / "config") --> Http_information.config;
|
||||
get_ (rel / "keys") --> Http_information.keys;
|
||||
]
|
||||
in
|
||||
let management =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue