gnunet-svn
[Top][All Lists]
Advanced

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

[taler-donau] branch master updated: [header] adjust comments and some d


From: gnunet
Subject: [taler-donau] branch master updated: [header] adjust comments and some deletions
Date: Sun, 22 Oct 2023 21:39:39 +0200

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

lukas-matyja pushed a commit to branch master
in repository donau.

The following commit(s) were added to refs/heads/master by this push:
     new d02801a  [header] adjust comments and some deletions
d02801a is described below

commit d02801a9e19b9376bd05ac4625f5da4932f34557
Author: Matyja Lukas Adam <lukas.matyja@students.bfh.ch>
AuthorDate: Sun Oct 22 21:39:51 2023 +0200

    [header] adjust comments and some deletions
---
 src/include/taler_donau_crypto_lib.h |    1 +
 src/include/taler_donau_service.h    | 1341 ++--------------------------------
 src/include/taler_donau_util.h       |    1 +
 3 files changed, 56 insertions(+), 1287 deletions(-)

diff --git a/src/include/taler_donau_crypto_lib.h 
b/src/include/taler_donau_crypto_lib.h
index 0a5e8a3..b0ae27f 100644
--- a/src/include/taler_donau_crypto_lib.h
+++ b/src/include/taler_donau_crypto_lib.h
@@ -19,6 +19,7 @@
  * @author Sree Harsha Totakura <sreeharsha@totakura.in>
  * @author Christian Grothoff <christian@grothoff.org>
  * @author Özgür Kesim <oec-taler@kesim.org>
+ * @author Lukas Matyja
  */
 #if ! defined (__TALER_DONAU_UTIL_LIB_H_INSIDE__)
 #error "Only <taler_donau_util.h> can be included directly."
diff --git a/src/include/taler_donau_service.h 
b/src/include/taler_donau_service.h
index 89a7432..d4f3364 100644
--- a/src/include/taler_donau_service.h
+++ b/src/include/taler_donau_service.h
@@ -26,6 +26,7 @@
 
 #include <jansson.h>
 #include "taler_util.h"
+#include "taler_donau_util.h"
 #include "taler_error_codes.h"
 #include "taler_kyclogic_lib.h"
 #include <gnunet/gnunet_curl_lib.h>
@@ -588,15 +589,13 @@ typedef void
  * included in the response are all valid). If the donau's reply is not
  * well-formed, we return an HTTP status code of zero to @a cb.
  *
- * We also verify that the @a bdr.coin_sig are valid for this
- * request, and that the @a bdr.ub_sig are a valid signatures for @a
- * coin_pub.  Also, the @a donau must be ready to operate (i.e.  have
- * finished processing the /keys reply).  If either check fails, we do
- * NOT initiate the transaction with the donau and instead return NULL.
+ * We also verify that the signature of the charity is valid for this
+ * request. Also, the donau must be ready to operate (i.e.  have
+ * finished processing the /keys reply). If either check fails, we do
+ * NOT initiate the receipts with the donau and instead return NULL.
  *
  * @param ctx curl context
  * @param url donau base URL
- * @param keys donau keys
  * @param charity_priv details about the contract the  is for
  * @param num_bdids length of the @a bdid array
  * @param bdid array with details about the blinded donation envelopes
@@ -610,7 +609,6 @@ struct TALER_DONAU_BatchIssueReceiptHandle *
 TALER_DONAU_charity_issue_receipt (
   struct GNUNET_CURL_Context *ctx,
   const char *url,
-  struct TALER_DONAU_Keys *keys,
   const struct TALER_DONAU_CharityPrivateKey *charity_priv,
   unsigned int num_bdids,
   const struct TALER_DONAU_BlindedUniqueDonationIdentifier bdid[static 
num_bdids],
@@ -663,7 +661,7 @@ struct TALER_DONAU_DonationReceipt
 };
 
 /**
- * @brief A Batch Submit Handle
+ * @brief A Batch Submit recipts Handle
  */
 struct TALER_DONAU_DonorReceiptsToStatementHandle;
 
@@ -722,6 +720,30 @@ typedef void
   void *cls,
   const struct TALER_DONAU_DonorReceiptsToStatementResult *dr);
 
+
+/**
+ * Submit a batch of receipts to the donau and get the
+ * donau's response. This API is typically used by a donor. Note that
+ * while we return the response verbatim to the caller for further processing,
+ * we do already verify that the response is well-formed (i.e. that signatures
+ * included in the response are all valid). If the donau's reply is not
+ * well-formed, we return an HTTP status code of zero to @a cb.
+ *
+ * We also verify that the signature of the charity is valid for this
+ * request. Also, the @a donau must be ready to operate (i.e.  have
+ * finished processing the /keys reply). If either check fails, we do
+ * NOT initiate the receipts with the donau and instead return NULL.
+ *
+ * @param ctx curl context
+ * @param url donau base URL
+ * @param num_drs length of the @a drs array
+ * @param drs array with details about the donation receipts
+ * @param cb the callback to call when a reply for this request is available
+ * @param cls closure for the above callback
+ * @param[out] ec if NULL is returned, set to the error code explaining why 
the operation failed
+ * @return a handle for this request; NULL if the inputs are invalid (i.e.
+ *         signatures fail to verify). In this case, the callback is not 
called.
+ */
 struct TALER_DONAU_DonorReceiptsToStatementHandle *
 TALER_DONAU_donor_receipts_to_statement (
   struct GNUNET_CURL_Context *ctx,
@@ -732,10 +754,10 @@ TALER_DONAU_donor_receipts_to_statement (
   void *cls);
 
 /**
- * Cancel a batch  permission request.  This function cannot be used
+ * Cancel a batch  permission request. This function cannot be used
  * on a request handle if a response is already served for it.
  *
- * @param[in]  the deposit permission request handle
+ * @param[in] the Batch Submit recipts handle
  */
 void
 TALER_DONAU_donor_receipts_to_statement_cancel (
@@ -743,7 +765,6 @@ TALER_DONAU_donor_receipts_to_statement_cancel (
 
 
 
-
 /* ********************* POST /csr batch-issue *********************** */
 
 
@@ -1104,7 +1125,7 @@ TALER_DONAU_charity_get (
 
 
 /**
- * Cancel a charity GET request.  This function cannot be used
+ * Cancel a charity GET request. This function cannot be used
  * on a request handle if a response is already served for it.
  *
  * @param rgh the charity request handle
@@ -1201,6 +1222,16 @@ TALER_DONAU_charity_post (
   TALER_DONAU_PostCharityResponseCallback cb,
   void *cb_cls);
 
+/**
+ * Cancel a charity Post request. This function cannot be used
+ * on a request handle if a response is already served for it.
+ *
+ * @param rgh the charity post handle
+ */
+void
+TALER_DONAU_charity_post_cancel (
+  struct TALER_DONAU_charityPostHandle *rgh);
+
 /* ********************* PATCH /charities/$CHARITY_ID *********************** 
*/
 
 /**
@@ -1265,6 +1296,16 @@ TALER_DONAU_charity_patch (
   TALER_DONAU_PatchCharityResponseCallback cb,
   void *cb_cls);
 
+/**
+ * Cancel a charity Patch request. This function cannot be used
+ * on a request handle if a response is already served for it.
+ *
+ * @param rgh the charity patch handle
+ */
+void
+TALER_DONAU_charity_patch_cancel (
+  struct TALER_DONAU_charityPatchHandle *rgh);
+
 
 /* ********************* DELETE /charities/$CHARITY_ID *********************** 
*/
 
@@ -1328,7 +1369,7 @@ TALER_DONAU_charity_delete (
   void *cb_cls);
 
 /**
- * Cancel a charity POST request. This function cannot be used
+ * Cancel a charity Delete request. This function cannot be used
  * on a request handle if a response is already served for it.
  *
  * @param rgh the charity request handle
@@ -1336,1277 +1377,3 @@ TALER_DONAU_charity_delete (
 void
 TALER_DONAU_charity_post_delete (
   struct TALER_DONAU_CharityDeleteHandle *rgh);
-
-
-
-
-
-
-/**
- * Cancel #TALER_DONAU_management_enable_wire() operation.
- *
- * @param sgfh handle of the operation to cancel
- */
-void
-TALER_DONAU_management_set_global_fees_cancel (
-  struct TALER_DONAU_ManagementSetGlobalFeeHandle *sgfh);
-
-
-/**
- * Response when addingdonation unit signature by auditor.
- */
-struct TALER_DONAU_AuditorAddDonationUnitResponse
-{
-  /**
-   * HTTP response data.
-   */
-  struct TALER_DONAU_HttpResponse hr;
-};
-
-
-/**
- * Function called with information about the POST
- * /auditor/$AUDITOR_PUB/$H_DENOM_PUB operation result.
- *
- * @param cls closure
- * @param adr HTTP response data
- */
-typedef void
-(*TALER_DONAU_AuditorAddDonationUnitCallback) (
-  void *cls,
-  const struct TALER_DONAU_AuditorAddDonationUnitResponse *adr);
-
-
-/**
- * @brief Handle for a POST /auditor/$AUDITOR_PUB/$H_DENOM_PUB request.
- */
-struct TALER_DONAU_AuditorAddDonationUnitHandle;
-
-
-/**
- * Provide auditor signatures for adonation unit to the donau.
- *
- * @param ctx the context
- * @param url HTTP base URL for the donau
- * @param h_donation_unit_pub hash of the public key of thedonation unit
- * @param auditor_pub public key of the auditor
- * @param auditor_sig signature of the auditor, of
- *         purpose #TALER_SIGNATURE_AUDITOR_DONAU_KEYS
- * @param cb function to call with the donau's result
- * @param cb_cls closure for @a cb
- * @return the request handle; NULL upon error
- */
-struct TALER_DONAU_AuditorAddDonationUnitHandle *
-TALER_DONAU_add_auditor_DonationUnit (
-  struct GNUNET_CURL_Context *ctx,
-  const char *url,
-  const struct TALER_DonationUnitHashP *h_donation_unit_pub,
-  const struct TALER_AuditorPublicKeyP *auditor_pub,
-  const struct TALER_AuditorSignatureP *auditor_sig,
-  TALER_DONAU_AuditorAddDonationUnitCallback cb,
-  void *cb_cls);
-
-
-/**
- * Cancel #TALER_DONAU_add_auditor_DonationUnit() operation.
- *
- * @param ah handle of the operation to cancel
- */
-void
-TALER_DONAU_add_auditor_donation_unit_cancel (
-  struct TALER_DONAU_AuditorAddDonationUnitHandle *ah);
-
-
-/* ********************* W2W API ****************** */
-
-
-/**
- * Response generated for a contract get request.
- */
-struct TALER_DONAU_ContractGetResponse
-{
-  /**
-   * Full HTTP response.
-   */
-  struct TALER_DONAU_HttpResponse hr;
-
-  /**
-   * Details depending on the HTTP status code.
-   */
-  union
-  {
-    /**
-     * Information returned on #MHD_HTTP_OK.
-     */
-    struct
-    {
-
-      /**
-       * Public key of the purse.
-       */
-      struct TALER_PurseContractPublicKeyP purse_pub;
-
-      /**
-       * Encrypted contract.
-       */
-      const void *econtract;
-
-      /**
-       * Number of bytes in @e econtract.
-       */
-      size_t econtract_size;
-
-    } ok;
-
-  } details;
-
-};
-
-/**
- * Function called with information about the a purse.
- *
- * @param cls closure
- * @param cgr HTTP response data
- */
-typedef void
-(*TALER_DONAU_ContractGetCallback) (
-  void *cls,
-  const struct TALER_DONAU_ContractGetResponse *cgr);
-
-
-/**
- * @brief Handle for a GET /contracts/$CPUB request.
- */
-struct TALER_DONAU_ContractsGetHandle;
-
-
-/**
- * Request information about a contract from the donau.
- *
- * @param ctx CURL context
- * @param url donau base URL
- * @param contract_priv private key of the contract
- * @param cb function to call with the donau's result
- * @param cb_cls closure for @a cb
- * @return the request handle; NULL upon error
- */
-struct TALER_DONAU_ContractsGetHandle *
-TALER_DONAU_contract_get (
-  struct GNUNET_CURL_Context *ctx,
-  const char *url,
-  const struct TALER_ContractDiffiePrivateP *contract_priv,
-  TALER_DONAU_ContractGetCallback cb,
-  void *cb_cls);
-
-
-/**
- * Cancel #TALER_DONAU_contract_get() operation.
- *
- * @param cgh handle of the operation to cancel
- */
-void
-TALER_DONAU_contract_get_cancel (
-  struct TALER_DONAU_ContractsGetHandle *cgh);
-
-
-/**
- * Response generated for a purse get request.
- */
-struct TALER_DONAU_PurseGetResponse
-{
-  /**
-   * Full HTTP response.
-   */
-  struct TALER_DONAU_HttpResponse hr;
-
-  /**
-   * Details depending on the HTTP status.
-   */
-  union
-  {
-    /**
-     * Response on #MHD_HTTP_OK.
-     */
-    struct
-    {
-
-      /**
-       * Time when the purse was merged (or zero if it
-       * was not merged).
-       */
-      struct GNUNET_TIME_Timestamp merge_timestamp;
-
-      /**
-       * Time when the full amount was ed into
-       * the purse (or zero if a sufficient amount
-       * was not yet ed).
-       */
-      struct GNUNET_TIME_Timestamp _timestamp;
-
-      /**
-       * charity balance (how much was ed in
-       * total into the charity, minus  fees).
-       */
-      struct TALER_Amount balance;
-
-      /**
-       * Time when the purse will expire.
-       */
-      struct GNUNET_TIME_Timestamp purse_expiration;
-
-    } ok;
-
-  } details;
-
-};
-
-
-/**
- * Function called with information about the a purse.
- *
- * @param cls closure
- * @param pgr HTTP response data
- */
-typedef void
-(*TALER_DONAU_PurseGetCallback) (
-  void *cls,
-  const struct TALER_DONAU_PurseGetResponse *pgr);
-
-
-/**
- * @brief Handle for a GET /purses/$PPUB request.
- */
-struct TALER_DONAU_PurseGetHandle;
-
-
-/**
- * Request information about a purse from the donau.
- *
- * @param ctx curl context
- * @param url donau base URL
- * @param keys donau keys
- * @param purse_pub public key of the purse
- * @param timeout how long to wait for a change to happen
- * @param wait_for_merge true to wait for a merge event, otherwise wait for a  
event
- * @param cb function to call with the donau's result
- * @param cb_cls closure for @a cb
- * @return the request handle; NULL upon error
- */
-struct TALER_DONAU_PurseGetHandle *
-TALER_DONAU_purse_get (
-  struct GNUNET_CURL_Context *ctx,
-  const char *url,
-  struct TALER_DONAU_Keys *keys,
-  const struct TALER_PurseContractPublicKeyP *purse_pub,
-  struct GNUNET_TIME_Relative timeout,
-  bool wait_for_merge,
-  TALER_DONAU_PurseGetCallback cb,
-  void *cb_cls);
-
-
-/**
- * Cancel #TALER_DONAU_purse_get() operation.
- *
- * @param pgh handle of the operation to cancel
- */
-void
-TALER_DONAU_purse_get_cancel (
-  struct TALER_DONAU_PurseGetHandle *pgh);
-
-
-/**
- * Response generated for a purse creation request.
- */
-struct TALER_DONAU_PurseCreateSubmitResponse
-{
-  /**
-   * Full HTTP response.
-   */
-  struct TALER_DONAU_HttpResponse hr;
-
-  /**
-   * Details depending on the HTTP status.
-   */
-  union
-  {
-
-    /**
-     * Detailed returned on #MHD_HTTP_OK.
-     */
-    struct
-    {
-      /**
-       * Signing key used by the donau to sign the
-       * purse create with  confirmation.
-       */
-      struct TALER_DONAU_EddsaPublicKeyP donau_pub;
-
-      /**
-       * Signature from the donau on the
-       * purse create with  confirmation.
-       */
-      struct TALER_DonauSignatureP donau_sig;
-
-
-    } ok;
-
-  } details;
-
-};
-
-/**
- * Function called with information about the creation
- * of a new purse.
- *
- * @param cls closure
- * @param pcr HTTP response data
- */
-typedef void
-(*TALER_DONAU_PurseCreateSubmitCallback) (
-  void *cls,
-  const struct TALER_DONAU_PurseCreateSubmitResponse *pcr);
-
-
-/**
- * @brief Handle for a POST /purses/$PID/create request.
- */
-struct TALER_DONAU_PurseCreateSubmitHandle;
-
-
-/**
- * Information about a coin to be ed into a purse or charity.
- */
-struct TALER_DONAU_PurseSubmit
-{
-  /**
-   * Age commitment data, might be NULL.
-   */
-  const struct TALER_AgeCommitmentProof *age_commitment_proof;
-
-  /**
-   * Private key of the coin.
-   */
-  struct TALER_CoinSpendPrivateKeyP coin_priv;
-
-  /**
-   * Signature proving the validity of the coin.
-   */
-  struct TALER_DonationUnitSignature donation_unit_sig;
-
-  /**
-   * Hash of thedonation unit's public key.
-   */
-  struct TALER_DonationUnitHashP h_donation_unit_pub;
-
-  /**
-   * Amount of the coin to transfer into the purse.
-   */
-  struct TALER_Amount amount;
-
-};
-
-
-/**
- * Inform the donau that a purse should be created
- * and coins ed into it.
- *
- * @param ctx curl context
- * @param url donau base URL
- * @param keys donau keys
- * @param purse_priv private key of the purse
- * @param merge_priv the merge credential
- * @param contract_priv key needed to obtain and decrypt the contract
- * @param contract_terms contract the purse is about
- * @param num_s length of the @a deposits array
- * @param s array of deposits to make into the purse
- * @param upload_contract true to upload the contract; must
- *        be FALSE for repeated calls to this API for the
- *        same purse (i.e. when adding more s).
- * @param cb function to call with the donau's result
- * @param cb_cls closure for @a cb
- * @return the request handle; NULL upon error
- */
-struct TALER_DONAU_PurseCreateSubmitHandle *
-TALER_DONAU_purse_create_with_ (
-  struct GNUNET_CURL_Context *ctx,
-  const char *url,
-  struct TALER_DONAU_Keys *keys,
-  const struct TALER_PurseContractPrivateKeyP *purse_priv,
-  const struct TALER_PurseMergePrivateKeyP *merge_priv,
-  const struct TALER_ContractDiffiePrivateP *contract_priv,
-  const json_t *contract_terms,
-  unsigned int num_s,
-  const struct TALER_DONAU_PurseSubmit s[static num_deposits],
-  bool upload_contract,
-  TALER_DONAU_PurseCreateSubmitCallback cb,
-  void *cb_cls);
-
-
-/**
- * Cancel #TALER_DONAU_purse_create_with_() operation.
- *
- * @param pch handle of the operation to cancel
- */
-void
-TALER_DONAU_purse_create_with__cancel (
-  struct TALER_DONAU_PurseCreateSubmitHandle *pch);
-
-
-/**
- * Response generated for a purse deletion request.
- */
-struct TALER_DONAU_PurseDeleteResponse
-{
-  /**
-   * Full HTTP response.
-   */
-  struct TALER_DONAU_HttpResponse hr;
-};
-
-
-/**
- * Function called with information about the deletion
- * of a purse.
- *
- * @param cls closure
- * @param pdr HTTP response data
- */
-typedef void
-(*TALER_DONAU_PurseDeleteCallback) (
-  void *cls,
-  const struct TALER_DONAU_PurseDeleteResponse *pdr);
-
-
-/**
- * @brief Handle for a DELETE /purses/$PID request.
- */
-struct TALER_DONAU_PurseDeleteHandle;
-
-
-/**
- * Asks the donau to delete a purse. Will only succeed if
- * the purse was not yet merged and did not yet time out.
- *
- * @param ctx CURL context
- * @param url donau base URL
- * @param purse_priv private key of the purse
- * @param cb function to call with the donau's result
- * @param cb_cls closure for @a cb
- * @return the request handle; NULL upon error
- */
-struct TALER_DONAU_PurseDeleteHandle *
-TALER_DONAU_purse_delete (
-  struct GNUNET_CURL_Context *ctx,
-  const char *url,
-  const struct TALER_PurseContractPrivateKeyP *purse_priv,
-  TALER_DONAU_PurseDeleteCallback cb,
-  void *cb_cls);
-
-
-/**
- * Cancel #TALER_DONAU_purse_delete() operation.
- *
- * @param pdh handle of the operation to cancel
- */
-void
-TALER_DONAU_purse_delete_cancel (
-  struct TALER_DONAU_PurseDeleteHandle *pdh);
-
-
-/**
- * Response generated for an account merge request.
- */
-struct TALER_DONAU_AccountMergeResponse
-{
-  /**
-   * Full HTTP response.
-   */
-  struct TALER_DONAU_HttpResponse hr;
-
-  /**
-   * charity signature affirming the merge.
-   */
-  const struct TALER_charitySignatureP *charity_sig;
-
-  /**
-   * Details depending on the HTTP status.
-   */
-  union
-  {
-    /**
-     * Detailed returned on #MHD_HTTP_OK.
-     */
-    struct
-    {
-      /**
-       * Signature by the donau affirming the merge.
-       */
-      struct TALER_DonauSignatureP donau_sig;
-
-      /**
-       * Online signing key used by the donau.
-       */
-      struct TALER_DONAU_EddsaPublicKeyP donau_pub;
-
-      /**
-       * Timestamp of the donau for @e donau_sig.
-       */
-      struct GNUNET_TIME_Timestamp etime;
-
-    } ok;
-
-    /**
-     * Details if the status is #MHD_HTTP_UNAVAILABLE_FOR_LEGAL_REASONS.
-     */
-    struct
-    {
-      /**
-       * Requirement row target that the charity should use
-       * to check for its KYC status.
-       */
-      uint64_t requirement_row;
-    } unavailable_for_legal_reasons;
-
-  } details;
-
-};
-
-/**
- * Function called with information about an account merge
- * operation.
- *
- * @param cls closure
- * @param amr HTTP response data
- */
-typedef void
-(*TALER_DONAU_AccountMergeCallback) (
-  void *cls,
-  const struct TALER_DONAU_AccountMergeResponse *amr);
-
-
-/**
- * @brief Handle for a POST /purses/$PID/merge request.
- */
-struct TALER_DONAU_AccountMergeHandle;
-
-
-/**
- * Inform the donau that a purse should be merged
- * with a charity.
- *
- * @param ctx curl context
- * @param url donau base URL
- * @param keys donau keys
- * @param charity_donau_url base URL of the donau with the charity
- * @param charity_priv private key of the charity to merge into
- * @param purse_pub public key of the purse to merge
- * @param merge_priv private key granting us the right to merge
- * @param h_contract_terms hash of the purses' contract
- * @param min_age minimum age of s into the purse
- * @param purse_value_after_fees amount that should be in the purse
- * @param purse_expiration when will the purse expire
- * @param merge_timestamp when is the merge happening (current time)
- * @param cb function to call with the donau's result
- * @param cb_cls closure for @a cb
- * @return the request handle; NULL upon error
- */
-struct TALER_DONAU_AccountMergeHandle *
-TALER_DONAU_account_merge (
-  struct GNUNET_CURL_Context *ctx,
-  const char *url,
-  struct TALER_DONAU_Keys *keys,
-  const char *charity_donau_url,
-  const struct TALER_charityPrivateKeyP *charity_priv,
-  const struct TALER_PurseContractPublicKeyP *purse_pub,
-  const struct TALER_PurseMergePrivateKeyP *merge_priv,
-  const struct TALER_PrivateContractHashP *h_contract_terms,
-  uint8_t min_age,
-  const struct TALER_Amount *purse_value_after_fees,
-  struct GNUNET_TIME_Timestamp purse_expiration,
-  struct GNUNET_TIME_Timestamp merge_timestamp,
-  TALER_DONAU_AccountMergeCallback cb,
-  void *cb_cls);
-
-
-/**
- * Cancel #TALER_DONAU_account_merge() operation.
- *
- * @param amh handle of the operation to cancel
- */
-void
-TALER_DONAU_account_merge_cancel (
-  struct TALER_DONAU_AccountMergeHandle *amh);
-
-
-/**
- * Response generated for a purse creation request.
- */
-struct TALER_DONAU_PurseCreateMergeResponse
-{
-  /**
-   * Full HTTP response.
-   */
-  struct TALER_DONAU_HttpResponse hr;
-
-  /**
-   * charity signature generated for the request
-   * (client-side).
-   */
-  const struct TALER_charitySignatureP *charity_sig;
-
-  /**
-   * Details depending on the HTTP status.
-   */
-  union
-  {
-    /**
-     * Details returned on #MHD_HTTP_OK.
-     */
-    struct
-    {
-
-    } ok;
-
-    /**
-   * Details if the status is #MHD_HTTP_UNAVAILABLE_FOR_LEGAL_REASONS.
-   */
-    struct
-    {
-      /**
-       * Requirement row that the charity should use
-       * to check for its KYC status.
-       */
-      uint64_t requirement_row;
-    } unavailable_for_legal_reasons;
-
-  } details;
-
-};
-
-/**
- * Function called with information about the creation
- * of a new purse.
- *
- * @param cls closure
- * @param pcr HTTP response data
- */
-typedef void
-(*TALER_DONAU_PurseCreateMergeCallback) (
-  void *cls,
-  const struct TALER_DONAU_PurseCreateMergeResponse *pcr);
-
-
-/**
- * @brief Handle for a POST /charitys/$RID/purse request.
- */
-struct TALER_DONAU_PurseCreateMergeHandle;
-
-
-/**
- * Inform the donau that a purse should be created
- * and merged with a charity.
- *
- * @param ctx curl context
- * @param url donau base URL
- * @param keys donau keys
- * @param charity_priv private key of the charity
- * @param purse_priv private key of the purse
- * @param merge_priv private key of the merge capability
- * @param contract_priv private key to get the contract
- * @param contract_terms contract the purse is about
- * @param upload_contract true to upload the contract
- * @param pay_for_purse true to pay for purse creation
- * @param merge_timestamp when should the merge happen (use current time)
- * @param cb function to call with the donau's result
- * @param cb_cls closure for @a cb
- * @return the request handle; NULL upon error
- */
-struct TALER_DONAU_PurseCreateMergeHandle *
-TALER_DONAU_purse_create_with_merge (
-  struct GNUNET_CURL_Context *ctx,
-  const char *url,
-  struct TALER_DONAU_Keys *keys,
-  const struct TALER_charityPrivateKeyP *charity_priv,
-  const struct TALER_PurseContractPrivateKeyP *purse_priv,
-  const struct TALER_PurseMergePrivateKeyP *merge_priv,
-  const struct TALER_ContractDiffiePrivateP *contract_priv,
-  const json_t *contract_terms,
-  bool upload_contract,
-  bool pay_for_purse,
-  struct GNUNET_TIME_Timestamp merge_timestamp,
-  TALER_DONAU_PurseCreateMergeCallback cb,
-  void *cb_cls);
-
-
-/**
- * Cancel #TALER_DONAU_purse_create_with_merge() operation.
- *
- * @param pcm handle of the operation to cancel
- */
-void
-TALER_DONAU_purse_create_with_merge_cancel (
-  struct TALER_DONAU_PurseCreateMergeHandle *pcm);
-
-
-/**
- * Response generated for purse  request.
- */
-struct TALER_DONAU_PurseSubmitResponse
-{
-  /**
-   * Full HTTP response.
-   */
-  struct TALER_DONAU_HttpResponse hr;
-
-  /**
-   * Details depending on the HTTP status.
-   */
-  union
-  {
-    /**
-     * Detailed returned on #MHD_HTTP_OK.
-     */
-    struct
-    {
-
-      /**
-       * When does the purse expire.
-       */
-      struct GNUNET_TIME_Timestamp purse_expiration;
-
-      /**
-       * How much was actually ed into the purse.
-       */
-      struct TALER_Amount total_ed;
-
-      /**
-       * How much should be in the purse in total in the end.
-       */
-      struct TALER_Amount purse_value_after_fees;
-
-      /**
-       * Hash of the contract (needed to verify signature).
-       */
-      struct TALER_PrivateContractHashP h_contract_terms;
-
-    } ok;
-  } details;
-
-};
-
-/**
- * Function called with information about a purse-
- * operation.
- *
- * @param cls closure
- * @param pdr HTTP response data
- */
-typedef void
-(*TALER_DONAU_PurseSubmitCallback) (
-  void *cls,
-  const struct TALER_DONAU_PurseSubmitResponse *pdr);
-
-
-/**
- * @brief Handle for a POST /purses/$PID/ request.
- */
-struct TALER_DONAU_PurseSubmitHandle;
-
-
-/**
- * Inform the donau that a  should be made into
- * a purse.
- *
- * @param ctx curl context
- * @param url donau base URL
- * @param keys donau keys
- * @param purse_donau_url base URL of the donau hosting the purse
- * @param purse_pub public key of the purse to merge
- * @param min_age minimum age we need to prove for the purse
- * @param num_s length of the @a deposits array
- * @param s array of deposits to make into the purse
- * @param cb function to call with the donau's result
- * @param cb_cls closure for @a cb
- * @return the request handle; NULL upon error
- */
-struct TALER_DONAU_PurseSubmitHandle *
-TALER_DONAU_purse_ (
-  struct GNUNET_CURL_Context *ctx,
-  const char *url,
-  struct TALER_DONAU_Keys *keys,
-  const char *purse_donau_url,
-  const struct TALER_PurseContractPublicKeyP *purse_pub,
-  uint8_t min_age,
-  unsigned int num_s,
-  const struct TALER_DONAU_PurseSubmit s[static num_deposits],
-  TALER_DONAU_PurseSubmitCallback cb,
-  void *cb_cls);
-
-
-/**
- * Cancel #TALER_DONAU_purse_() operation.
- *
- * @param amh handle of the operation to cancel
- */
-void
-TALER_DONAU_purse__cancel (
-  struct TALER_DONAU_PurseSubmitHandle *amh);
-
-
-/* *********************  /charitys/$RID/open *********************** */
-
-
-/**
- * @brief A /charitys/$RID/open Handle
- */
-struct TALER_DONAU_charitysOpenHandle;
-
-
-/**
- * @brief charity open result details.
- */
-struct TALER_DONAU_charityOpenResult
-{
-
-  /**
-   * High-level HTTP response details.
-   */
-  struct TALER_DONAU_HttpResponse hr;
-
-  /**
-   * Details depending on @e hr.http_status.
-   */
-  union
-  {
-
-    /**
-     * Information returned on success, if
-     * @e hr.http_status is #MHD_HTTP_OK
-     */
-    struct
-    {
-      /**
-       * New expiration time
-       */
-      struct GNUNET_TIME_Timestamp expiration_time;
-
-      /**
-       * Actual cost of the open operation.
-       */
-      struct TALER_Amount open_cost;
-
-    } ok;
-
-
-    /**
-     * Information returned if the payment provided is insufficient, if
-     * @e hr.http_status is #MHD_HTTP_PAYMENT_REQUIRED
-     */
-    struct
-    {
-      /**
-       * Current expiration time of the charity.
-       */
-      struct GNUNET_TIME_Timestamp expiration_time;
-
-      /**
-       * Actual cost of the open operation that should have been paid.
-       */
-      struct TALER_Amount open_cost;
-
-    } payment_required;
-
-
-    /**
-     * Information returned if KYC is required to proceed, set if
-     * @e hr.http_status is #MHD_HTTP_UNAVAILABLE_FOR_LEGAL_REASONS.
-     */
-    struct
-    {
-      /**
-       * Requirement row that the charity should use
-       * to check for its KYC status.
-       */
-      uint64_t requirement_row;
-
-      /**
-       * Hash of the payto-URI of the account to KYC;
-       */
-      struct TALER_PaytoHashP h_payto;
-
-    } unavailable_for_legal_reasons;
-
-  } details;
-
-};
-
-
-/**
- * Callbacks of this type are used to serve the result of submitting a
- * charity open request to a donau.
- *
- * @param cls closure
- * @param ror HTTP response data
- */
-typedef void
-(*TALER_DONAU_charitysOpenCallback) (
-  void *cls,
-  const struct TALER_DONAU_charityOpenResult *ror);
-
-
-/**
- * Submit a request to open a charity.
- *
- * @param ctx curl context
- * @param url donau base URL
- * @param keys donau keys
- * @param charity_priv private key of the charity to open
- * @param charity_contribution amount to pay from the charity's balance for 
the operation
- * @param coin_payments_length length of the @a coin_payments array
- * @param coin_payments array of coin payments to use for opening the charity
- * @param expiration_time desired new expiration time for the charity
- * @param min_purses minimum number of purses to allow being concurrently 
opened per charity
- * @param cb the callback to call when a reply for this request is available
- * @param cb_cls closure for the above callback
- * @return a handle for this request; NULL if the inputs are invalid (i.e.
- *         signatures fail to verify).  In this case, the callback is not 
called.
- */
-struct TALER_DONAU_charitysOpenHandle *
-TALER_DONAU_charitys_open (
-  struct GNUNET_CURL_Context *ctx,
-  const char *url,
-  struct TALER_DONAU_Keys *keys,
-  const struct TALER_charityPrivateKeyP *charity_priv,
-  const struct TALER_Amount *charity_contribution,
-  unsigned int coin_payments_length,
-  const struct TALER_DONAU_PurseSubmit coin_payments[
-    static coin_payments_length],
-  struct GNUNET_TIME_Timestamp expiration_time,
-  uint32_t min_purses,
-  TALER_DONAU_charitysOpenCallback cb,
-  void *cb_cls);
-
-
-/**
- * Cancel a charity status request.  This function cannot be used
- * on a request handle if a response is already served for it.
- *
- * @param[in] roh the charity open request handle
- */
-void
-TALER_DONAU_charitys_open_cancel (
-  struct TALER_DONAU_charitysOpenHandle *roh);
-
-
-/* *********************  /charitys/$RID/attest *********************** */
-
-
-/**
- * @brief A Get /charitys/$RID/attest Handle
- */
-struct TALER_DONAU_charitysGetAttestHandle;
-
-
-/**
- * @brief charity GET attest result details.
- */
-struct TALER_DONAU_charityGetAttestResult
-{
-
-  /**
-   * High-level HTTP response details.
-   */
-  struct TALER_DONAU_HttpResponse hr;
-
-  /**
-   * Details depending on @e hr.http_status.
-   */
-  union
-  {
-
-    /**
-     * Information returned on success, if
-     * @e hr.http_status is #MHD_HTTP_OK
-     */
-    struct
-    {
-
-      /**
-       * Length of the @e attributes array.
-       */
-      unsigned int attributes_length;
-
-      /**
-       * Array of attributes available about the user.
-       */
-      const char **attributes;
-
-    } ok;
-
-  } details;
-
-};
-
-
-/**
- * Callbacks of this type are used to serve the result of submitting a
- * charity attest request to a donau.
- *
- * @param cls closure
- * @param ror HTTP response data
- */
-typedef void
-(*TALER_DONAU_charitysGetAttestCallback) (
-  void *cls,
-  const struct TALER_DONAU_charityGetAttestResult *ror);
-
-
-/**
- * Submit a request to get the list of attestable attributes for a charity.
- *
- * @param ctx CURL context
- * @param url donau base URL
- * @param charity_pub public key of the charity to get available attributes for
- * @param cb the callback to call when a reply for this request is available
- * @param cb_cls closure for the above callback
- * @return a handle for this request; NULL if the inputs are invalid (i.e.
- *         signatures fail to verify).  In this case, the callback is not 
called.
- */
-struct TALER_DONAU_charitysGetAttestHandle *
-TALER_DONAU_charitys_get_attestable (
-  struct GNUNET_CURL_Context *ctx,
-  const char *url,
-  const struct TALER_charityPublicKeyP *charity_pub,
-  TALER_DONAU_charitysGetAttestCallback cb,
-  void *cb_cls);
-
-
-/**
- * Cancel a request to get attestable attributes.  This function cannot be used
- * on a request handle if a response is already served for it.
- *
- * @param rgah the charity get attestable request handle
- */
-void
-TALER_DONAU_charitys_get_attestable_cancel (
-  struct TALER_DONAU_charitysGetAttestHandle *rgah);
-
-
-/**
- * @brief A POST /charitys/$RID/attest Handle
- */
-struct TALER_DONAU_charitysPostAttestHandle;
-
-
-/**
- * @brief charity attest result details.
- */
-struct TALER_DONAU_charityPostAttestResult
-{
-
-  /**
-   * High-level HTTP response details.
-   */
-  struct TALER_DONAU_HttpResponse hr;
-
-  /**
-   * Details depending on @e hr.http_status.
-   */
-  union
-  {
-
-    /**
-     * Information returned on success, if
-     * @e hr.http_status is #MHD_HTTP_OK
-     */
-    struct
-    {
-      /**
-       * Time when the donau made the signature.
-       */
-      struct GNUNET_TIME_Timestamp donau_time;
-
-      /**
-       * Expiration time of the attested attributes.
-       */
-      struct GNUNET_TIME_Timestamp expiration_time;
-
-      /**
-       * Signature by the donau affirming the attributes.
-       */
-      struct TALER_DonauSignatureP donau_sig;
-
-      /**
-       * Online signing key used by the donau.
-       */
-      struct TALER_DONAU_EddsaPublicKeyP donau_pub;
-
-      /**
-       * Attributes being confirmed by the donau.
-       */
-      const json_t *attributes;
-
-    } ok;
-
-  } details;
-
-};
-
-
-/**
- * Callbacks of this type are used to serve the result of submitting a
- * charity attest request to a donau.
- *
- * @param cls closure
- * @param ror HTTP response data
- */
-typedef void
-(*TALER_DONAU_charitysPostAttestCallback) (
-  void *cls,
-  const struct TALER_DONAU_charityPostAttestResult *ror);
-
-
-/**
- * Submit a request to attest attributes about the owner of a charity.
- *
- * @param ctx CURL context
- * @param url donau base URL
- * @param charity_priv private key of the charity to attest
- * @param attributes_length length of the @a attributes array
- * @param attributes array of names of attributes to get attestations for
- * @param cb the callback to call when a reply for this request is available
- * @param cb_cls closure for the above callback
- * @return a handle for this request; NULL if the inputs are invalid (i.e.
- *         signatures fail to verify).  In this case, the callback is not 
called.
- */
-struct TALER_DONAU_charitysAttestHandle *
-TALER_DONAU_charitys_attest (
-  struct GNUNET_CURL_Context *ctx,
-  const char *url,
-  const struct TALER_charityPrivateKeyP *charity_priv,
-  unsigned int attributes_length,
-  const char *attributes[const static attributes_length],
-  TALER_DONAU_charitysPostAttestCallback cb,
-  void *cb_cls);
-
-
-/**
- * Cancel a charity attestation request.  This function cannot be used
- * on a request handle if a response is already served for it.
- *
- * @param rah the charity attest request handle
- */
-void
-TALER_DONAU_charitys_attest_cancel (
-  struct TALER_DONAU_charitysAttestHandle *rah);
-
-
-/* *********************  /charitys/$RID/close *********************** */
-
-
-/**
- * @brief A /charitys/$RID/close Handle
- */
-struct TALER_DONAU_charitysCloseHandle;
-
-
-/**
- * @brief charity close result details.
- */
-struct TALER_DONAU_charityCloseResult
-{
-
-  /**
-   * High-level HTTP response details.
-   */
-  struct TALER_DONAU_HttpResponse hr;
-
-  /**
-   * Details depending on @e hr.http_status.
-   */
-  union
-  {
-
-    /**
-     * Information returned on success, if
-     * @e hr.http_status is #MHD_HTTP_OK
-     */
-    struct
-    {
-
-      /**
-       * Amount wired to the target account.
-       */
-      struct TALER_Amount wire_amount;
-    } ok;
-
-    /**
-     * Information returned if KYC is required to proceed, set if
-     * @e hr.http_status is #MHD_HTTP_UNAVAILABLE_FOR_LEGAL_REASONS.
-     */
-    struct
-    {
-      /**
-       * Requirement row that the charity should use
-       * to check for its KYC status.
-       */
-      uint64_t requirement_row;
-
-      /**
-       * Hash of the payto-URI of the account to KYC;
-       */
-      struct TALER_PaytoHashP h_payto;
-
-    } unavailable_for_legal_reasons;
-
-  } details;
-
-};
-
-
-/**
- * Callbacks of this type are used to serve the result of submitting a
- * charity close request to a donau.
- *
- * @param cls closure
- * @param ror HTTP response data
- */
-typedef void
-(*TALER_DONAU_charitysCloseCallback) (
-  void *cls,
-  const struct TALER_DONAU_charityCloseResult *ror);
-
-
-/**
- * Submit a request to close a charity.
- *
- * @param ctx curl context
- * @param url donau base URL
- * @param charity_priv private key of the charity to close
- * @param target_payto_uri where to send the payment, NULL to send to charity 
origin
- * @param cb the callback to call when a reply for this request is available
- * @param cb_cls closure for the above callback
- * @return a handle for this request; NULL if the inputs are invalid (i.e.
- *         signatures fail to verify).  In this case, the callback is not 
called.
- */
-struct TALER_DONAU_charitysCloseHandle *
-TALER_DONAU_charitys_close (
-  struct GNUNET_CURL_Context *ctx,
-  const char *url,
-  const struct TALER_charityPrivateKeyP *charity_priv,
-  const char *target_payto_uri,
-  TALER_DONAU_charitysCloseCallback cb,
-  void *cb_cls);
-
-
-/**
- * Cancel a charity status request.  This function cannot be used
- * on a request handle if a response is already served for it.
- *
- * @param rch the charity request handle
- */
-void
-TALER_DONAU_charitys_close_cancel (
-  struct TALER_DONAU_charitysCloseHandle *rch);
-
-#endif  /* _TALER_DONAU_SERVICE_H */
diff --git a/src/include/taler_donau_util.h b/src/include/taler_donau_util.h
index 5f00662..97610b0 100644
--- a/src/include/taler_donau_util.h
+++ b/src/include/taler_donau_util.h
@@ -26,6 +26,7 @@
 
 #include <gnunet/gnunet_util_lib.h>
 #include <microhttpd.h>
+#include "taler_util.h"
 #include "taler_amount_lib.h"
 #include "taler_crypto_lib.h"
 

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

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