summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-07-05 21:54:11 +0200
committerChristian Grothoff <christian@grothoff.org>2020-07-05 21:54:11 +0200
commit54e63f01df85ee0470493c6d0de29576ce3371c4 (patch)
tree174ef13378081c4845a9f0adc52bcac97674aff2 /src/include
parent6de49ea2c02e311e5f5366005bd3497a9bb25187 (diff)
downloadexchange-54e63f01df85ee0470493c6d0de29576ce3371c4.tar.gz
exchange-54e63f01df85ee0470493c6d0de29576ce3371c4.tar.bz2
exchange-54e63f01df85ee0470493c6d0de29576ce3371c4.zip
fix #6408: make sure all timestamps are always rounded when they arrive over JSON, or 400 the requester; similarly don't tolerate anything else as client
Diffstat (limited to 'src/include')
-rw-r--r--src/include/taler_json_lib.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/include/taler_json_lib.h b/src/include/taler_json_lib.h
index 094cbe2eb..fbc8785d0 100644
--- a/src/include/taler_json_lib.h
+++ b/src/include/taler_json_lib.h
@@ -81,6 +81,31 @@ TALER_JSON_spec_amount_nbo (const char *name,
/**
+ * Provide specification to parse given JSON object to an absolute time.
+ * The absolute time value is expected to be already rounded.
+ *
+ * @param name name of the time field in the JSON
+ * @param[out] r_time where the time has to be written
+ */
+struct GNUNET_JSON_Specification
+TALER_JSON_spec_absolute_time (const char *name,
+ struct GNUNET_TIME_Absolute *r_time);
+
+
+/**
+ * Provide specification to parse given JSON object to an absolute time
+ * in network byte order.
+ * The absolute time value is expected to be already rounded.
+ *
+ * @param name name of the time field in the JSON
+ * @param[out] r_time where the time has to be written
+ */
+struct GNUNET_JSON_Specification
+TALER_JSON_spec_absolute_time_nbo (const char *name,
+ struct GNUNET_TIME_AbsoluteNBO *r_time);
+
+
+/**
* Generate line in parser specification for denomination public key.
*
* @param field name of the field