gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-anastasis] branch master updated: added truth api


From: gnunet
Subject: [taler-anastasis] branch master updated: added truth api
Date: Fri, 17 Jan 2020 10:26:52 +0100

This is an automated email from the git hooks/post-receive script.

ds-meister pushed a commit to branch master
in repository anastasis.

The following commit(s) were added to refs/heads/master by this push:
     new 7b433f5  added truth api
7b433f5 is described below

commit 7b433f571dac02b0b104164e9a35b7a8ba8126af
Author: Dominik Meister <address@hidden>
AuthorDate: Fri Jan 17 10:26:43 2020 +0100

    added truth api
---
 src/include/anastasis_crypto_lib.h |  2 +-
 src/include/anastasis_service.h    | 79 +++++++++++++++++++++++++++++++++++++-
 2 files changed, 78 insertions(+), 3 deletions(-)

diff --git a/src/include/anastasis_crypto_lib.h 
b/src/include/anastasis_crypto_lib.h
index 4124670..aa22b66 100644
--- a/src/include/anastasis_crypto_lib.h
+++ b/src/include/anastasis_crypto_lib.h
@@ -68,7 +68,7 @@ struct ANASTASIS_CRYPTO_EscrowMasterKey
  */
 struct ANASTASIS_CRYPTO_UserIdentifier
 {
-  uint32_t hash[32];
+  uint32_t hash[8];
 };
 /**
  * the uuids are used as Identifiers for the Truths
diff --git a/src/include/anastasis_service.h b/src/include/anastasis_service.h
index 1920e81..8460544 100644
--- a/src/include/anastasis_service.h
+++ b/src/include/anastasis_service.h
@@ -396,13 +396,57 @@ ANASTASIS_policy_store_cancel (struct
 /****** TRUTH API ******/
 
 /**
- * Handle for a POST /policy operation.
+ * Handle for a GET /truth operation.
+ */
+struct ANASTASIS_TruthLookupOperation;
+
+/**
+ * Callback to process a GET /truth request
+ *
+ * @param cls closure
+ * @param http_status HTTP status code for this request
+ * @param ec anastasis-specific error code
+ * @param obj the response body
+ */
+typedef void
+(*ANASTASIS_TruthLookupCallback) (void *cls,
+                                  unsigned int http_status,
+                                  const struct ANASTASIS_DownloadDetails *dd);
+
+/**
+ * Does a GET /truth.
+ *
+ * @param ctx execution context
+ * @param backend_url base URL of the merchant backend
+ * @param truth_uuid identification of the Truth
+ * @param cb callback which will work the response gotten from the backend
+ * @param cb_cls closure to pass to the callback
+ * @return handle for this operation, NULL upon errors
+ */
+struct ANASTASIS_TruthLookupOperation *
+ANASTASIS_truth_lookup (struct GNUNET_CURL_Context *ctx,
+                        const char *backend_url,
+                        const struct ANASTASIS_UuidP *truth_uuid,
+                        ANASTASIS_TruthLookupCallback cb,
+                        void *cb_cls);
+
+/**
+ * Cancel a GET /truth request.
+ *
+ * @param tlo cancel the truth lookup operation
+ */
+void
+ANASTASIS_policy_lookup_cancel (struct
+                                ANASTASIS_TruthLookupOperation *tlo);
+
+/**
+ * Handle for a POST /truth operation.
  */
 struct ANASTASIS_TruthStoreOperation;
 
 
 /**
- * Callback to process a POST /policy request
+ * Callback to process a POST /truth request
  *
  * @param cls closure
  * @param http_status HTTP status code for this request
@@ -414,6 +458,37 @@ typedef void
                                  enum ANASTASIS_ErrorCode ec,
                                  unsigned int http_status,
                                  const struct ANASTASIS_UploadDetails *up);
+/**
+ * Store Truth, does a POST /policy/$UUID
+ *
+ * @param ctx the CURL context used to connect to the backend
+ * @param backend_url backend's base URL, including final "/"
+ * @param truth_uuid Identfication of the Truth Upload
+ * @param prev_truth_data_hash hash of the previous truth upload, NULL for the 
first upload ever
+ * @param truth_data contains the data which is stored on the Server in JSON 
Format
+ * @param cb callback processing the response from /truth
+ * @param cb_cls closure for cb
+ * @return handle for the operation
+ */
+struct ANASTASIS_TruthStoreOperation *
+ANASTASIS_truth_store (struct GNUNET_CURL_Context *ctx,
+                       const char *backend_url,
+                       const struct
+                       ANASTASIS_UuidP *truth_uuid,
+                       const struct
+                       GNUNET_HashCode *prev_truth_data_hash,
+                       json_t *truth_data,
+                       ANASTASIS_TruthStoreCallback cb,
+                       void *cb_cls);
+
+/**
+ * Cancel a POST /truth request.
+ *
+ * @param tso the truth store operation
+ */
+void
+ANASTASIS_truth_store_cancel (struct
+                              ANASTASIS_TruthStoreOperation *tso);
 
 
 #endif  /* _ANASTASIS_SERVICE_H */

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]