gnunet-svn
[Top][All Lists]
Advanced

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

[taler-anastasis] branch master updated (e47001e -> 1ed1642)


From: gnunet
Subject: [taler-anastasis] branch master updated (e47001e -> 1ed1642)
Date: Tue, 27 Oct 2020 14:28:25 +0100

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

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

    from e47001e  fix FTBS, fix memory leak, remove '= NULL' after GNUNET_free 
()
     new 33166ca  backend plugin and fixes in test
     new 1ed1642  merge

The 2 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:
 doc/ypsomed/ypsomed.tex                           | 30 ++++++--------
 src/backend/anastasis-httpd.c                     |  1 +
 src/backend/anastasis_authorization_plugin_file.c | 49 +++++++++++++++--------
 src/include/anastasis_service.h                   |  3 +-
 src/lib/anastasis_api_challenge_run.c             | 15 +++++--
 src/lib/test_anastasis_api.c                      | 12 +++---
 src/lib/testing_api_cmd_challenge_run.c           |  3 +-
 7 files changed, 69 insertions(+), 44 deletions(-)

diff --git a/doc/ypsomed/ypsomed.tex b/doc/ypsomed/ypsomed.tex
index 8eeb1fa..da65631 100644
--- a/doc/ypsomed/ypsomed.tex
+++ b/doc/ypsomed/ypsomed.tex
@@ -397,10 +397,13 @@ To summarize, our current key software development 
objectives are:
 
 
 \section{Business model}
+Anastasis is a young company founded in July 2020 and based in Luxembourg. 
+The developers of the software work in Switzerland. 
+The company currently has two full-time developers working on the software.
+Other people in the business area work part-time for Anastasis. 
+
+The following section describes a short overview of the business model of 
Anastasis.
 
-We are currently in the process of building a start-up for
-Anastasis. This business model shows an overview how we plan to
-operate the Anastasis start-up.
 
 \subsection{Key partners}
 
@@ -428,6 +431,8 @@ commercial use. This involves the integration of different
 authentication methods and the integration of our application into the
 different consumer applications. Another key activity is the
 maintenance and deployment of our service.
+On the business side the main activity is to look for new potential customers
+and investors. 
 
 \subsection{Key resources}
 
@@ -437,15 +442,7 @@ invest in hardware. To operate our application, we will 
need servers
 to provide our service, as previously mentioned we would provide our
 service on a Cloud provider.  For the timely further development of
 our service and integration with various authentication providers,
-payment solutions and applications needing key recovery, we see an
-initial need for at least two fulltime employees. These developers
-would also be responsible for the maintenance and deployment of the
-application.
-
-Additionally, the start-up needs a person who is responsible for the
-business of Anastasis. This employee would be responsible to find new
-business partners and present our application to investors. This
-employee might initially work only part-time.
+payment solutions and applications needing key recovery.
 
 \subsection{Value propositions}
 
@@ -488,8 +485,7 @@ crypto-currencies and end-to-end encrypted communication 
services.
 
 The main cost for our start-up is the salary of our employees. We need
 to have two or more fulltime employees for the development and one
-part time employee for the business development. Additional costs for
-the start-up are the costs for registering a company. To provide
+part time employee for the business development. To provide
 Anastasis as a service, we expect to make use of existing public Cloud
 services, which also cost a little bit.
 
@@ -500,9 +496,9 @@ operate an Anastasis server and to help them integrate our 
protocol
 with their software.  Once we have many end-users utilizing Anastasis,
 they will have to pay directly for the service. The users have to pay
 a subscription fee and possibly additional fees for expensive recovery
-operations. For example a user might pay 0.10 CHF per month for the
-subscription and 0.01 CHF for each encrypted truth
-upload. Additionally, the user would have to pay for expensive
+operations. For example a user might pay 1 CHF per month for the
+subscription and 0.10 CHF for each upload.
+Additionally, the user would have to pay for expensive
 authentication methods like video identification.
 \newpage
 
diff --git a/src/backend/anastasis-httpd.c b/src/backend/anastasis-httpd.c
index a5ac3a3..c5d56d5 100644
--- a/src/backend/anastasis-httpd.c
+++ b/src/backend/anastasis-httpd.c
@@ -341,6 +341,7 @@ url_handler (void *cls,
                     "/truth/",
                     strlen ("/truth/")))
   {
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "arrived at truth get");
     // return handle_truth (...);
     if (0 == strcmp (method,
                      MHD_HTTP_METHOD_GET))
diff --git a/src/backend/anastasis_authorization_plugin_file.c 
b/src/backend/anastasis_authorization_plugin_file.c
index ecc0dbe..0a8d8c5 100644
--- a/src/backend/anastasis_authorization_plugin_file.c
+++ b/src/backend/anastasis_authorization_plugin_file.c
@@ -19,6 +19,7 @@
  * @author Dominik Meister
  */
 #include "platform.h"
+#include "anastasis-httpd.h"
 #include "anastasis_authorization_plugin.h"
 #include <taler/taler_mhd_lib.h>
 
@@ -40,7 +41,7 @@ struct ANASTASIS_AUTHORIZATION_State
   /**
    * holds the truth information
    */
-  const char *data;
+  char *filename;
   /**
    * closure
    */
@@ -70,20 +71,20 @@ file_validate (void *cls,
                const char *data,
                size_t data_length)
 {
-  char *data_string;
+  char *filename;
 
   if (data == NULL)
   {
     return GNUNET_NO;
   }
 
-  data_string = GNUNET_STRINGS_data_to_string_alloc (data,
-                                                     data_length);
+  filename = GNUNET_STRINGS_data_to_string_alloc (data,
+                                                  data_length);
   int i = 0;
   int flag = 0;
-  for (i = 0; i<strlen (data_string); i++)
+  for (i = 0; i<strlen (filename); i++)
   {
-    if ((data_string[i] == ' ') || (data_string[i] == '/'))
+    if ((filename[i] == ' ') || (filename[i] == '/'))
     {
       flag = 1;
       break;
@@ -93,7 +94,7 @@ file_validate (void *cls,
   {
     return GNUNET_NO;
   }
-  GNUNET_free (data_string);
+  GNUNET_free (filename);
   return GNUNET_OK;
 }
 
@@ -123,8 +124,8 @@ file_start (void *cls,
   as->cls = cls;
   as->truth_public_key = truth_public_key;
   as->code = code;
-  as->data = GNUNET_STRINGS_data_to_string_alloc (data,
-                                                  data_length);
+  as->filename = GNUNET_STRINGS_data_to_string_alloc (data,
+                                                      data_length);
   return as;
 }
 
@@ -142,13 +143,21 @@ file_process (struct ANASTASIS_AUTHORIZATION_State *as,
               struct MHD_Connection *connection)
 {
   MHD_RESULT mres;
-  struct MHD_Response *foobar;
-  FILE *f = fopen (as->data, "w");
+  struct MHD_Response *resp;
+  FILE *f = fopen (as->filename, "w");
 
   if (f == NULL)
   {
     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
                 "Could not open file");
+    resp = TALER_MHD_make_error (TALER_EC_INTERNAL_INVARIANT_FAILURE,
+                                 "Failed to open filebuffer");
+    mres = MHD_queue_response (connection,
+                               MHD_HTTP_INTERNAL_SERVER_ERROR,
+                               resp);
+    MHD_destroy_response (resp);
+    if (MHD_YES != mres)
+      return ANASTASIS_AUTHORIZATION_RES_FAILED_REPLY_FAILED;
     return ANASTASIS_AUTHORIZATION_RES_FAILED;
   }
 
@@ -156,17 +165,25 @@ file_process (struct ANASTASIS_AUTHORIZATION_State *as,
   if (0 >= fprintf (f, "%lu", as->code))
   {
     fclose (f);
+    resp = TALER_MHD_make_error (TALER_EC_INTERNAL_INVARIANT_FAILURE,
+                                 "Failed to write to file");
     mres = MHD_queue_response (connection,
-                               MHD_NO,
-                               foobar);
+                               MHD_HTTP_INTERNAL_SERVER_ERROR,
+                               resp);
+    MHD_destroy_response (resp);
     if (MHD_YES != mres)
       return ANASTASIS_AUTHORIZATION_RES_FAILED_REPLY_FAILED;
     return ANASTASIS_AUTHORIZATION_RES_FAILED;
   }
   fclose (f);
+  resp = MHD_create_response_from_buffer (strlen (as->filename),
+                                          as->filename,
+                                          MHD_RESPMEM_MUST_FREE);
+  TALER_MHD_add_global_headers (resp);
   mres = MHD_queue_response (connection,
-                             MHD_YES,
-                             foobar);
+                             MHD_HTTP_OK,
+                             resp);
+  MHD_destroy_response (resp);
   if (MHD_YES != mres)
     return ANASTASIS_AUTHORIZATION_RES_SUCCESS_REPLY_FAILED;
   return ANASTASIS_AUTHORIZATION_RES_SUCCESS;
@@ -181,7 +198,7 @@ file_process (struct ANASTASIS_AUTHORIZATION_State *as,
 static void
 file_cleanup (struct ANASTASIS_AUTHORIZATION_State *as)
 {
-  GNUNET_free (as->data);
+  GNUNET_free (as->filename);
   GNUNET_free (as);
 }
 
diff --git a/src/include/anastasis_service.h b/src/include/anastasis_service.h
index 3336278..2a3411c 100644
--- a/src/include/anastasis_service.h
+++ b/src/include/anastasis_service.h
@@ -465,7 +465,8 @@ struct ANASTASIS_ChallengeRunOperation;
 typedef void
 (*ANASTASIS_ChallengeRunCallback) (
   void *cls,
-  unsigned int http_status);
+  unsigned int http_status,
+  char *response_string);
 
 /**
  * Cancel a GET /truth request.
diff --git a/src/lib/anastasis_api_challenge_run.c 
b/src/lib/anastasis_api_challenge_run.c
index 4089c4e..4f12b16 100644
--- a/src/lib/anastasis_api_challenge_run.c
+++ b/src/lib/anastasis_api_challenge_run.c
@@ -73,6 +73,8 @@ struct ANASTASIS_ChallengeRunOperation
    * Key to decrypt the truth on the server
    */
   const struct ANASTASIS_CRYPTO_TruthKeyP *truth_key;
+
+  char *response_string;
 };
 
 
@@ -115,9 +117,15 @@ handle_challenge_run_finished (void *cls,
                 "Backend didn't even return from GET /truth\n");
     break;
 
-  case MHD_HTTP_NO_CONTENT:
+  case MHD_HTTP_OK:
     {
-      cro->cb = NULL;
+      cro->response_string = GNUNET_STRINGS_data_to_string_alloc (data,
+                                                                  data_size);
+      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                  "Response from backend: %s",cro->response_string);
+      cro->cb (cro->cb_cls,
+               response_code,
+               "run failed");
       ANASTASIS_challenge_run_cancel (cro);
       return;
     }
@@ -144,7 +152,8 @@ handle_challenge_run_finished (void *cls,
   if (NULL != cro->cb)
   {
     cro->cb (cro->cb_cls,
-             response_code);
+             response_code,
+             "run failed");
     cro->cb = NULL;
   }
   ANASTASIS_challenge_run_cancel (cro);
diff --git a/src/lib/test_anastasis_api.c b/src/lib/test_anastasis_api.c
index 6226646..330736a 100644
--- a/src/lib/test_anastasis_api.c
+++ b/src/lib/test_anastasis_api.c
@@ -275,16 +275,16 @@ run (void *cls,
                                          "file",
                                          "Truth mime",
                                          ANASTASIS_TESTING_make_hashed_answer (
-                                           "Hashed-Answer",
-                                           strlen ("Hashed-Answer")),
+                                           "Hashed-Answer-2",
+                                           strlen ("Hashed-Answer-2")),
                                          ANASTASIS_TESTING_make_truthkey (
-                                           "Truth-Key"))),
+                                           "Truth-Key-2"))),
 
     ANASTASIS_TESTING_cmd_challenge_run ("challenge-run-1",
                                          anastasis_url,
-                                         MHD_HTTP_NO_CONTENT,
+                                         MHD_HTTP_OK,
                                          ANASTASIS_TESTING_make_truthkey (
-                                           "Truth-Key"),
+                                           "Truth-Key-2"),
                                          "truth-store-2"),
 
     ANASTASIS_TESTING_cmd_keyshare_lookup ("keyshare-lookup-2",
@@ -292,7 +292,7 @@ run (void *cls,
                                            MHD_HTTP_OK,
                                            "42",
                                            ANASTASIS_TESTING_make_truthkey (
-                                             "Truth-Key"),
+                                             "Truth-Key-2"),
                                            "truth-store-2"),
     TALER_TESTING_cmd_end ()
   };
diff --git a/src/lib/testing_api_cmd_challenge_run.c 
b/src/lib/testing_api_cmd_challenge_run.c
index defa013..6c7ac55 100644
--- a/src/lib/testing_api_cmd_challenge_run.c
+++ b/src/lib/testing_api_cmd_challenge_run.c
@@ -76,7 +76,8 @@ struct ChallengeRunState
  */
 static void
 challenge_run_cb (void *cls,
-                  unsigned int http_status)
+                  unsigned int http_status,
+                  char *response_string)
 {
   struct ChallengeRunState *crs = cls;
 

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