fmt: break-separators=before; + wip Future_sign_key
This commit is contained in:
parent
68b5e6608a
commit
7ab0d55c51
8 changed files with 724 additions and 32 deletions
|
|
@ -27,9 +27,9 @@ let currency_to_string = function `Eur -> "EUR"
|
|||
(* Values that represent an amount are in the usual amount syntax: CURRENCY:VALUE.FRACTION,
|
||||
e.g. EUR:1.50. The FRACTION portion may extend up to 8 places. *)
|
||||
type value = {
|
||||
currency: [ `Eur ]
|
||||
; value: int
|
||||
; fraction: int
|
||||
currency: [ `Eur ];
|
||||
value: int;
|
||||
fraction: int;
|
||||
}
|
||||
|
||||
let currency_round_unit = { currency= `Eur; value= 0; fraction= 1 }
|
||||
|
|
|
|||
|
|
@ -21,8 +21,8 @@ end = struct
|
|||
|
||||
(* type for the value of header field *)
|
||||
type header_etag_item = {
|
||||
weak: bool
|
||||
; value: string
|
||||
weak: bool;
|
||||
value: string;
|
||||
}
|
||||
|
||||
type header_value =
|
||||
|
|
|
|||
|
|
@ -110,8 +110,8 @@ let routes =
|
|||
let open Vif.Route in
|
||||
(*let open Vif.Type in*)
|
||||
[
|
||||
get (rel /?? nil) --> hello; get (rel / "terms" /?? nil) --> Static.terms
|
||||
; get (rel / "privacy" /?? nil) --> Static.privacy
|
||||
get (rel /?? nil) --> hello; get (rel / "terms" /?? nil) --> Static.terms;
|
||||
get (rel / "privacy" /?? nil) --> Static.privacy;
|
||||
]
|
||||
|
||||
let () =
|
||||
|
|
@ -125,8 +125,8 @@ let () =
|
|||
let devices =
|
||||
Vif.Devices.
|
||||
[
|
||||
Management.eddsa_online_key_device
|
||||
; Management.rsa_denomination_key_device
|
||||
Management.eddsa_online_key_device;
|
||||
Management.rsa_denomination_key_device;
|
||||
]
|
||||
in
|
||||
let middlewares = Vif.Middlewares.[] in
|
||||
|
|
|
|||
45
src/types.ml
45
src/types.ml
|
|
@ -3,8 +3,8 @@ module Error_detail = struct
|
|||
(* TODO GANA error codes
|
||||
https://git.gnunet.org/gana.git/tree/gnu-taler-error-codes/registry.rec *)
|
||||
type t = {
|
||||
code: int
|
||||
; hint: string option
|
||||
code: int;
|
||||
hint: string option;
|
||||
}
|
||||
end
|
||||
|
||||
|
|
@ -44,10 +44,10 @@ module Amount = struct
|
|||
Prefixed with '+' or '-' in certain contexts.
|
||||
When no sign is present, the amount is assumed to be positive. *)
|
||||
type t = {
|
||||
sign: [ `Plus | `Minus ] option
|
||||
; currency: [ `Eur ]
|
||||
; value: Int64.t
|
||||
; fraction: Int64.t
|
||||
sign: [ `Plus | `Minus ] option;
|
||||
currency: [ `Eur ];
|
||||
value: Int64.t;
|
||||
fraction: Int64.t;
|
||||
}
|
||||
|
||||
let make ~sign ~currency ~value ~fraction =
|
||||
|
|
@ -88,8 +88,8 @@ module Amount = struct
|
|||
let parse_sign =
|
||||
choice
|
||||
[
|
||||
char '+' *> return (Some `Plus); char '-' *> return (Some `Minus)
|
||||
; return None
|
||||
char '+' *> return (Some `Plus); char '-' *> return (Some `Minus);
|
||||
return None;
|
||||
]
|
||||
in
|
||||
let parse_currency = string "EUR" *> return `Eur in
|
||||
|
|
@ -132,7 +132,7 @@ module Eddsa = struct
|
|||
|
||||
(* EdDSA signatures are transmitted as 64-bytes base32
|
||||
binary-encoded objects with just the R and S values (base32_ binary-only). *)
|
||||
(*type signature = string*)
|
||||
type signature = string
|
||||
end
|
||||
|
||||
module Rsa = struct
|
||||
|
|
@ -152,16 +152,16 @@ end
|
|||
|
||||
module Rsa_denomination_key = struct
|
||||
type t = {
|
||||
age_mask: int
|
||||
; rsa_pub: string (* Rsa.pub *)
|
||||
age_mask: int;
|
||||
rsa_pub: string; (* Rsa.pub *)
|
||||
}
|
||||
end
|
||||
|
||||
module CS_denomination_key = struct
|
||||
(* Clause Schnorr *)
|
||||
type t = {
|
||||
age_mask: int
|
||||
; cs_pub: string
|
||||
age_mask: int;
|
||||
cs_pub: string;
|
||||
}
|
||||
end
|
||||
|
||||
|
|
@ -170,3 +170,22 @@ module Denomination_key = struct
|
|||
| Rsa of Rsa_denomination_key.t
|
||||
| CS of CS_denomination_key.t
|
||||
end
|
||||
|
||||
module Future_sign_key = struct
|
||||
type t = {
|
||||
(* The actual exchange's EdDSA signing public key *)
|
||||
key: Eddsa.pub;
|
||||
(* Initial validity date for the signing key. *)
|
||||
stamp_start: Timestamp.t;
|
||||
(* Date when the exchange will stop using the signing key, allowed to overlap
|
||||
slightly with the next signing key's validity to allow for clock skew. *)
|
||||
stamp_expire: Timestamp.t;
|
||||
(* Date when all signatures made by the signing key expire and should
|
||||
henceforth no longer be considered valid in legal disputes. *)
|
||||
stamp_end: Timestamp.t;
|
||||
(* Signature over TALER_SigningKeyAnnouncementPS
|
||||
for this signing key by the signkey security
|
||||
module using purpose TALER_SIGNATURE_SM_SIGNING_KEY. *)
|
||||
signkey_secmod_sig: Eddsa.signature;
|
||||
}
|
||||
end
|
||||
|
|
|
|||
10
src/util.ml
10
src/util.ml
|
|
@ -10,11 +10,11 @@ end
|
|||
module Mimetype = struct
|
||||
let mimetype_extension_assoc =
|
||||
[
|
||||
(("text", "plain"), ".txt"); (("text", "markdown"), ".md")
|
||||
; (("text", "html"), ".html"); (("text", "html"), ".htm")
|
||||
; (("application", "pdf"), ".pdf"); (("image", "jpeg"), ".jpg")
|
||||
; (("image", "jpeg"), ".jpeg"); (("image", "png"), ".png")
|
||||
; (("image", "gif"), ".gif")
|
||||
(("text", "plain"), ".txt"); (("text", "markdown"), ".md");
|
||||
(("text", "html"), ".html"); (("text", "html"), ".htm");
|
||||
(("application", "pdf"), ".pdf"); (("image", "jpeg"), ".jpg");
|
||||
(("image", "jpeg"), ".jpeg"); (("image", "png"), ".png");
|
||||
(("image", "gif"), ".gif");
|
||||
]
|
||||
|
||||
let mimetype_l, _ = List.split mimetype_extension_assoc
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue