fmt: break-separators=before; + wip Future_sign_key
This commit is contained in:
parent
68b5e6608a
commit
c991f29b28
7 changed files with 51 additions and 32 deletions
|
|
@ -6,7 +6,7 @@ break-collection-expressions=wrap
|
||||||
break-sequences=false
|
break-sequences=false
|
||||||
break-infix-before-func=false
|
break-infix-before-func=false
|
||||||
dock-collection-brackets=true
|
dock-collection-brackets=true
|
||||||
break-separators=before
|
break-separators=after
|
||||||
field-space=tight
|
field-space=tight
|
||||||
if-then-else=compact
|
if-then-else=compact
|
||||||
break-sequences=false
|
break-sequences=false
|
||||||
|
|
|
||||||
|
|
@ -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,
|
(* 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. *)
|
e.g. EUR:1.50. The FRACTION portion may extend up to 8 places. *)
|
||||||
type value = {
|
type value = {
|
||||||
currency: [ `Eur ]
|
currency: [ `Eur ];
|
||||||
; value: int
|
value: int;
|
||||||
; fraction: int
|
fraction: int;
|
||||||
}
|
}
|
||||||
|
|
||||||
let currency_round_unit = { currency= `Eur; value= 0; fraction= 1 }
|
let currency_round_unit = { currency= `Eur; value= 0; fraction= 1 }
|
||||||
|
|
|
||||||
|
|
@ -21,8 +21,8 @@ end = struct
|
||||||
|
|
||||||
(* type for the value of header field *)
|
(* type for the value of header field *)
|
||||||
type header_etag_item = {
|
type header_etag_item = {
|
||||||
weak: bool
|
weak: bool;
|
||||||
; value: string
|
value: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
type header_value =
|
type header_value =
|
||||||
|
|
|
||||||
|
|
@ -110,8 +110,8 @@ let routes =
|
||||||
let open Vif.Route in
|
let open Vif.Route in
|
||||||
(*let open Vif.Type in*)
|
(*let open Vif.Type in*)
|
||||||
[
|
[
|
||||||
get (rel /?? nil) --> hello; get (rel / "terms" /?? nil) --> Static.terms
|
get (rel /?? nil) --> hello; get (rel / "terms" /?? nil) --> Static.terms;
|
||||||
; get (rel / "privacy" /?? nil) --> Static.privacy
|
get (rel / "privacy" /?? nil) --> Static.privacy;
|
||||||
]
|
]
|
||||||
|
|
||||||
let () =
|
let () =
|
||||||
|
|
@ -125,8 +125,8 @@ let () =
|
||||||
let devices =
|
let devices =
|
||||||
Vif.Devices.
|
Vif.Devices.
|
||||||
[
|
[
|
||||||
Management.eddsa_online_key_device
|
Management.eddsa_online_key_device;
|
||||||
; Management.rsa_denomination_key_device
|
Management.rsa_denomination_key_device;
|
||||||
]
|
]
|
||||||
in
|
in
|
||||||
let middlewares = Vif.Middlewares.[] 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
|
(* TODO GANA error codes
|
||||||
https://git.gnunet.org/gana.git/tree/gnu-taler-error-codes/registry.rec *)
|
https://git.gnunet.org/gana.git/tree/gnu-taler-error-codes/registry.rec *)
|
||||||
type t = {
|
type t = {
|
||||||
code: int
|
code: int;
|
||||||
; hint: string option
|
hint: string option;
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -44,10 +44,10 @@ module Amount = struct
|
||||||
Prefixed with '+' or '-' in certain contexts.
|
Prefixed with '+' or '-' in certain contexts.
|
||||||
When no sign is present, the amount is assumed to be positive. *)
|
When no sign is present, the amount is assumed to be positive. *)
|
||||||
type t = {
|
type t = {
|
||||||
sign: [ `Plus | `Minus ] option
|
sign: [ `Plus | `Minus ] option;
|
||||||
; currency: [ `Eur ]
|
currency: [ `Eur ];
|
||||||
; value: Int64.t
|
value: Int64.t;
|
||||||
; fraction: Int64.t
|
fraction: Int64.t;
|
||||||
}
|
}
|
||||||
|
|
||||||
let make ~sign ~currency ~value ~fraction =
|
let make ~sign ~currency ~value ~fraction =
|
||||||
|
|
@ -88,8 +88,8 @@ module Amount = struct
|
||||||
let parse_sign =
|
let parse_sign =
|
||||||
choice
|
choice
|
||||||
[
|
[
|
||||||
char '+' *> return (Some `Plus); char '-' *> return (Some `Minus)
|
char '+' *> return (Some `Plus); char '-' *> return (Some `Minus);
|
||||||
; return None
|
return None;
|
||||||
]
|
]
|
||||||
in
|
in
|
||||||
let parse_currency = string "EUR" *> return `Eur in
|
let parse_currency = string "EUR" *> return `Eur in
|
||||||
|
|
@ -132,7 +132,7 @@ module Eddsa = struct
|
||||||
|
|
||||||
(* EdDSA signatures are transmitted as 64-bytes base32
|
(* EdDSA signatures are transmitted as 64-bytes base32
|
||||||
binary-encoded objects with just the R and S values (base32_ binary-only). *)
|
binary-encoded objects with just the R and S values (base32_ binary-only). *)
|
||||||
(*type signature = string*)
|
type signature = string
|
||||||
end
|
end
|
||||||
|
|
||||||
module Rsa = struct
|
module Rsa = struct
|
||||||
|
|
@ -152,16 +152,16 @@ end
|
||||||
|
|
||||||
module Rsa_denomination_key = struct
|
module Rsa_denomination_key = struct
|
||||||
type t = {
|
type t = {
|
||||||
age_mask: int
|
age_mask: int;
|
||||||
; rsa_pub: string (* Rsa.pub *)
|
rsa_pub: string; (* Rsa.pub *)
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
module CS_denomination_key = struct
|
module CS_denomination_key = struct
|
||||||
(* Clause Schnorr *)
|
(* Clause Schnorr *)
|
||||||
type t = {
|
type t = {
|
||||||
age_mask: int
|
age_mask: int;
|
||||||
; cs_pub: string
|
cs_pub: string;
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -170,3 +170,22 @@ module Denomination_key = struct
|
||||||
| Rsa of Rsa_denomination_key.t
|
| Rsa of Rsa_denomination_key.t
|
||||||
| CS of CS_denomination_key.t
|
| CS of CS_denomination_key.t
|
||||||
end
|
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
|
module Mimetype = struct
|
||||||
let mimetype_extension_assoc =
|
let mimetype_extension_assoc =
|
||||||
[
|
[
|
||||||
(("text", "plain"), ".txt"); (("text", "markdown"), ".md")
|
(("text", "plain"), ".txt"); (("text", "markdown"), ".md");
|
||||||
; (("text", "html"), ".html"); (("text", "html"), ".htm")
|
(("text", "html"), ".html"); (("text", "html"), ".htm");
|
||||||
; (("application", "pdf"), ".pdf"); (("image", "jpeg"), ".jpg")
|
(("application", "pdf"), ".pdf"); (("image", "jpeg"), ".jpg");
|
||||||
; (("image", "jpeg"), ".jpeg"); (("image", "png"), ".png")
|
(("image", "jpeg"), ".jpeg"); (("image", "png"), ".png");
|
||||||
; (("image", "gif"), ".gif")
|
(("image", "gif"), ".gif");
|
||||||
]
|
]
|
||||||
|
|
||||||
let mimetype_l, _ = List.split mimetype_extension_assoc
|
let mimetype_l, _ = List.split mimetype_extension_assoc
|
||||||
|
|
|
||||||
|
|
@ -28,10 +28,10 @@ let () =
|
||||||
let open Types.Amount in
|
let open Types.Amount in
|
||||||
let v =
|
let v =
|
||||||
{
|
{
|
||||||
sign= Some `Plus
|
sign= Some `Plus;
|
||||||
; currency= `Eur
|
currency= `Eur;
|
||||||
; value= Int64.of_int 25
|
value= Int64.of_int 25;
|
||||||
; fraction= Int64.of_int 678
|
fraction= Int64.of_int 678;
|
||||||
}
|
}
|
||||||
in
|
in
|
||||||
let s = to_string v in
|
let s = to_string v in
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue