gnunet-svn
[Top][All Lists]
Advanced

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

[taler-anastasis] branch master updated (c9b8f98 -> c19d64f)


From: gnunet
Subject: [taler-anastasis] branch master updated (c9b8f98 -> c19d64f)
Date: Mon, 07 Sep 2020 15:45:42 +0200

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

dennis-neufeld pushed a change to branch master
in repository anastasis.

    from c9b8f98  Merge branch 'master' of ssh://git.taler.net/anastasis into 
master
     new 32a41d7  started with wrapper for de-/serialization
     new 865210b  fix
     new c19d64f  added challenge state

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/include/anastasis_json.h | 194 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 194 insertions(+)
 create mode 100644 src/include/anastasis_json.h

diff --git a/src/include/anastasis_json.h b/src/include/anastasis_json.h
new file mode 100644
index 0000000..9d4227f
--- /dev/null
+++ b/src/include/anastasis_json.h
@@ -0,0 +1,194 @@
+/*
+  This file is part of Anastasis
+  Copyright (C) 2020 Taler Systems SA
+
+  Anastasis is free software; you can redistribute it and/or modify it under 
the
+  terms of the GNU Lesser General Public License as published by the Free 
Software
+  Foundation; either version 3, or (at your option) any later version.
+
+  Anastasis is distributed in the hope that it will be useful, but WITHOUT ANY
+  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+  A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+
+  You should have received a copy of the GNU General Public License along with
+  Anastasis; see the file COPYING.GPL.  If not, see 
<http://www.gnu.org/licenses/>
+*/
+/**
+ * @file lib/anastasis_json.h
+ * @brief anastasis de-/serialization api
+ * @author Christian Grothoff
+ * @author Dominik Meister
+ * @author Dennis Neufeld
+ */
+#ifndef ANASTASIS_JSON_H
+#define ANASTASIS_JSON_H
+
+#include <jansson.h>
+#include <gnunet/gnunet_util_lib.h>
+
+/**
+ * Defines a user with all possible attributes.
+ */
+struct UserData
+{
+  /**
+   * First name of user
+   */
+  char *first_name;
+
+  /**
+   * Last name of user
+   */
+  char *last_name;
+
+  /**
+   * Birthdate of user
+   */
+  struct GNUNET_TIME_Absolute date;
+
+  /**
+   * Social security number for swiss citizens (AHV number)
+   */
+  char *AHV_number;
+
+  // FIXME: more attributes following here
+};
+
+/**
+ * Defines a state of a policy object.
+ */
+struct PolicyState
+{
+  // FIXME add attributes here
+};
+
+/**
+ * Defines a state of a truth object.
+ */
+struct TruthState
+{
+  // FIXME add attributes here
+};
+
+/**
+ * Defines a state of a challenge object.
+ */
+struct ChallengeState
+{
+  // FIXME add attributes here
+};
+
+
+/**
+ * Parses the country config file for the country code and
+ * returns a json object containing the country-specific
+ * attributes needed to create the user identifier.
+ *
+ * @param conf_filename name of config file
+ * @param country_code country code (Alpha-2 code)
+ * @return reference to json object containing data of specified country
+ */
+json_t *
+ANASTASIS_JSON_get_country_conf (
+  const char *conf_filename,
+  const char *country_code);
+
+
+/**
+ * Returns default providers.
+ *
+ * @param prov_filename filename which contains the default providers
+ * @return reference to json object containing the default providers
+ */
+json_t *
+ANASTASIS_JSON_get_default_providers (const char *prov_filename);
+
+
+/**
+ * Loads user attributes from a json object.
+ *
+ * @param state_memory json object containing all stored states
+ * @return reference to user data
+ */
+struct UserData *
+ANASTASIS_JSON_user_deserialize (const json_t *state_memory);
+
+
+/**
+ * Stores user attributes into a json object.
+ *
+ * @param user user data
+ * @return json object representing user data
+ */
+json_t *
+ANASTASIS_JSON_user_serialize (const struct UserData *user);
+
+
+/**
+ * Restores states of policies from a json object.
+ * Used during backup process.
+ *
+ * @param state_memory json object containing all stored states (backup 
process)
+ * @return array of policy states
+ */
+struct PolicyState **
+ANASTASIS_JSON_policies_deserialize (const json_t *state_memory);
+
+
+/**
+ * Stores states of policies into a json object.
+ * Used during backup process.
+ *
+ * @param policy_states array of policy states
+ * @return json object containing policy states
+ */
+json_t *
+ANASTASIS_JSON_policies_serialize (const struct PolicyState **policy_states);
+
+
+/**
+ * Restores states of truths from a json object.
+ * Used during backup process.
+ *
+ * @param state_memory json object containing all stored states (backup 
process)
+ * @return array of truth states
+ */
+struct TruthState **
+ANASTASIS_JSON_truths_deserialize (const json_t *state_memory);
+
+
+/**
+ * Stores states of truths into a json object.
+ * Used during backup process.
+ *
+ * @param truth_states array of truth states
+ * @return json object containing all truth states
+ */
+json_t *
+ANASTASIS_JSON_truths_serialize (const struct TruthState **truth_states);
+
+
+/**
+ * Restores states of challenges from a json object.
+ * Used during recovery process.
+ *
+ * @param state_memory json object containing all stored states (recovery 
process)
+ * @return array of truth states
+ */
+struct ChallengeState **
+ANASTASIS_JSON_challenges_deserialize (const json_t *state_memory);
+
+
+/**
+ * Stores states of challenges into a json object.
+ * Used during recovery process.
+ *
+ * @param challenge_states array of challenge states
+ * @return json object containing all truth states
+ */
+json_t *
+ANASTASIS_JSON_challenges_serialize (const struct
+                                     ChallengeState **challenge_states);
+
+
+#endif  /* _ANASTASIS_JSON_H */
\ No newline at end of file

-- 
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]