gnunet-svn
[Top][All Lists]
Advanced

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

[taler-anastasis] 03/05: fix action


From: gnunet
Subject: [taler-anastasis] 03/05: fix action
Date: Wed, 23 Sep 2020 19:04:25 +0200

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

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

commit ce4e845aa7ccfba6ad5f3c66c3196c291ade54da
Author: Dennis Neufeld <dennis.neufeld@students.bfh.ch>
AuthorDate: Mon Sep 21 09:22:05 2020 +0200

    fix action
---
 src/lib/anastasis_api_backup_redux.c | 76 +++++++++++++++++++++---------------
 1 file changed, 44 insertions(+), 32 deletions(-)

diff --git a/src/lib/anastasis_api_backup_redux.c 
b/src/lib/anastasis_api_backup_redux.c
index 8297127..fb56837 100644
--- a/src/lib/anastasis_api_backup_redux.c
+++ b/src/lib/anastasis_api_backup_redux.c
@@ -327,6 +327,36 @@ enter_user_attributes (const json_t *state,
 {
   json_t *new_state;
   json_t *attributes = json_object_get (arguments, "identity");
+  char *dn;
+  json_error_t error;
+
+  {
+    char *path;
+
+    path = GNUNET_OS_installation_get_path (GNUNET_OS_IPK_PREFIX);
+    if (NULL == path)
+    {
+      GNUNET_break (0);
+      return GNUNET_SYSERR;
+    }
+    GNUNET_asprintf (&dn,
+                     "%s/share/anastasis/provider-list.json",
+                     path);
+    GNUNET_free (path);
+  }
+  provider_list = json_load_file (dn, JSON_COMPACT, &error);
+  if (NULL == provider_list)
+  {
+    GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+                "Failed to parse `%s': %s at %d:%d (%d)\n",
+                dn,
+                error.text,
+                error.line,
+                error.column,
+                error.position);
+    GNUNET_free (dn);
+    return GNUNET_SYSERR;
+  }
 
   if (NULL == state)
   {
@@ -360,6 +390,10 @@ enter_user_attributes (const json_t *state,
                        "identity_attributes",
                        attributes);
 
+  json_object_set_new (new_state,
+                       "provider-list",
+                       provider_list);
+
   cb (cb_cls,
       ANASTASIS_EC_NONE,
       new_state);
@@ -400,7 +434,6 @@ edit_user_attributes (const json_t *state,
         NULL);
   }
 
-
   json_object_set_new (new_state,
                        "identity_attributes",
                        attributes);
@@ -479,36 +512,8 @@ add_authentication (const json_t *state,
                     void *cb_cls)
 {
   json_t *new_state;
-  char *dn;
-  json_error_t error;
+  json_t *methods = json_object_get (arguments, "authentication_methods");
 
-  {
-    char *path;
-
-    path = GNUNET_OS_installation_get_path (GNUNET_OS_IPK_PREFIX);
-    if (NULL == path)
-    {
-      GNUNET_break (0);
-      return GNUNET_SYSERR;
-    }
-    GNUNET_asprintf (&dn,
-                     "%s/share/anastasis/provider-list.json",
-                     path);
-    GNUNET_free (path);
-  }
-  provider_list = json_load_file (dn, JSON_COMPACT, &error);
-  if (NULL == provider_list)
-  {
-    GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                "Failed to parse `%s': %s at %d:%d (%d)\n",
-                dn,
-                error.text,
-                error.line,
-                error.column,
-                error.position);
-    GNUNET_free (dn);
-    return GNUNET_SYSERR;
-  }
   new_state = json_deep_copy (state);
   if (NULL == new_state)
   {
@@ -517,14 +522,21 @@ add_authentication (const json_t *state,
         ANASTASIS_EC_INVALID, // FIXME: Define correct error code
         NULL);
   }
+  if (NULL == methods)
+  {
+    GNUNET_break (0);
+    cb (cb_cls,
+        ANASTASIS_EC_INVALID, // FIXME: Define correct error code
+        NULL);
+  }
 
   json_object_set (new_state,
                    "backup-state",
                    json_string ("ReduxUserAttributesAddedState"));
 
   json_object_set_new (new_state,
-                       "provider-list",
-                       provider_list);
+                       "authentication_methods",
+                       methods);
 
   cb (cb_cls,
       ANASTASIS_EC_NONE,

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