summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/backend/anastasis-httpd.c15
-rw-r--r--src/backend/anastasis-httpd_truth.c3
-rw-r--r--src/backend/anastasis.conf35
-rw-r--r--src/cli/test_reducer.conf4
-rw-r--r--src/stasis/test_anastasis_db.c25
-rw-r--r--src/testing/test_anastasis_api.conf12
6 files changed, 46 insertions, 48 deletions
diff --git a/src/backend/anastasis-httpd.c b/src/backend/anastasis-httpd.c
index 8350ee7..fd5ffc3 100644
--- a/src/backend/anastasis-httpd.c
+++ b/src/backend/anastasis-httpd.c
@@ -708,12 +708,12 @@ run (void *cls,
}
if (GNUNET_OK !=
GNUNET_CONFIGURATION_get_value_string (config,
- "anastasis",
+ "anastasis-merchant-backend",
"PAYMENT_BACKEND_URL",
&AH_backend_url))
{
GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
- "anastasis",
+ "anastasis-merchant-backend",
"PAYMENT_BACKEND_URL");
GNUNET_SCHEDULER_shutdown ();
return;
@@ -726,7 +726,7 @@ run (void *cls,
strlen ("http://"))) )
{
GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_ERROR,
- "anastasis",
+ "anastasis-merchant-backend",
"PAYMENT_BACKEND_URL",
"Must be HTTP(S) URL");
GNUNET_SCHEDULER_shutdown ();
@@ -739,7 +739,7 @@ run (void *cls,
AH_backend_url)) )
{
GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_ERROR,
- "anastasis",
+ "anastasis-merchant-backend",
"PAYMENT_BACKEND_URL",
"Must have domain name");
GNUNET_SCHEDULER_shutdown ();
@@ -823,6 +823,13 @@ run (void *cls,
certfile,
keyfile,
keypass);
+ if (NULL == apikey)
+ {
+ (void) GNUNET_CONFIGURATION_get_value_string (config,
+ "anastasis-merchant-backend",
+ "API_KEY",
+ &apikey);
+ }
if (NULL != apikey)
{
char *auth_header;
diff --git a/src/backend/anastasis-httpd_truth.c b/src/backend/anastasis-httpd_truth.c
index ee0f2bf..0b9f4a3 100644
--- a/src/backend/anastasis-httpd_truth.c
+++ b/src/backend/anastasis-httpd_truth.c
@@ -1192,7 +1192,8 @@ AH_handler_truth_get (
GNUNET_free (method);
}
- if (! gc->authorization->payment_plugin_managed)
+ if ( (is_question) ||
+ (! gc->authorization->payment_plugin_managed) )
{
struct TALER_Amount zero_amount;
diff --git a/src/backend/anastasis.conf b/src/backend/anastasis.conf
index 23015ae..c10973c 100644
--- a/src/backend/anastasis.conf
+++ b/src/backend/anastasis.conf
@@ -30,7 +30,7 @@ DB = postgres
# ANNUAL_FEE = TESTKUDOS:0.1
# Number of policy uploads included in one annual fee payment
-ANNUAL_POLICY_UPLĂ„OAD_LIMIT = 64
+ANNUAL_POLICY_UPLOAD_LIMIT = 64
# Insurance
# INSURANCE = TESTKUDOS:1.0
@@ -43,35 +43,16 @@ UPLOAD_LIMIT_MB = 16
# Cost of authentication by question
#QUESTION_COST = EUR:0
-# Cost of authentication by file (only for testing purposes)
-#FILE_COST = EUR:1
-
-# Cost of authentication by E-Mail
-#EMAIL_COST = EUR:0
-
-# Cost of authentication by SMS
-#SMS_COST = EUR:0
-
-# Cost of authentication by postal
-#POSTAL_COST = EUR:0
-
-# Cost of authentication by video
-#VIDEO_COST = EUR:0
-
-#SMS authentication command which is executed
-#SMSAUTH_COMMAND = some_sms_script.sh
-
-#E-Mail authentication command which is executed
-#EMAILAUTH_COMMAND = some_email_script.sh
-
# Fulfillment URL of the ANASTASIS service itself.
FULFILLMENT_URL = taler://fulfillment-success
-# Base URL of our payment backend
-# PAYMENT_BACKEND_URL = http://localhost:9976/
-
# Server salt 16 Byte
# SERVER_SALT = gUfO1KGOKYIFlFQg
-# Supported methods
-SUPPORTED_METHODS = question
+
+[anastasis-merchant-backend]
+# Base URL of our payment backend
+# PAYMENT_BACKEND_URL = http://localhost:9976/
+
+# API Key to send to the backend for authorization
+# API_KEY =
diff --git a/src/cli/test_reducer.conf b/src/cli/test_reducer.conf
index f2a5efd..ef923bb 100644
--- a/src/cli/test_reducer.conf
+++ b/src/cli/test_reducer.conf
@@ -11,13 +11,15 @@ CURRENCY_ROUND_UNIT = TESTKUDOS:0.01
[anastasis]
DB = postgres
-PAYMENT_BACKEND_URL = http://localhost:9966/
ANNUAL_FEE = TESTKUDOS:4.99
TRUTH_UPLOAD_FEE = TESTKUDOS:0.01
UPLOAD_LIMIT_MB = 1
ANNUAL_POLICY_UPLOAD_LIMIT = 128
INSURANCE = TESTKUDOS:1.0
+[anastasis-merchant-backend]
+PAYMENT_BACKEND_URL = http://localhost:9966/
+
[authorization-question]
COST = TESTKUDOS:0.0
diff --git a/src/stasis/test_anastasis_db.c b/src/stasis/test_anastasis_db.c
index 54d665e..8f11827 100644
--- a/src/stasis/test_anastasis_db.c
+++ b/src/stasis/test_anastasis_db.c
@@ -268,18 +268,23 @@ run (void *cls)
}
ANASTASIS_hash_answer (123,
&c_hash);
- FAILIF (ANASTASIS_DB_CODE_STATUS_CHALLENGE_CODE_MISMATCH !=
- plugin->verify_challenge_code (plugin->cls,
- &truth_uuid,
- &c_hash));
+ {
+ bool sat;
- ANASTASIS_hash_answer (challenge_code,
- &c_hash);
- FAILIF (ANASTASIS_DB_CODE_STATUS_VALID_CODE_STORED !=
- plugin->verify_challenge_code (plugin->cls,
- &truth_uuid,
- &c_hash));
+ FAILIF (ANASTASIS_DB_CODE_STATUS_CHALLENGE_CODE_MISMATCH !=
+ plugin->verify_challenge_code (plugin->cls,
+ &truth_uuid,
+ &c_hash,
+ &sat));
+ ANASTASIS_hash_answer (challenge_code,
+ &c_hash);
+ FAILIF (ANASTASIS_DB_CODE_STATUS_VALID_CODE_STORED !=
+ plugin->verify_challenge_code (plugin->cls,
+ &truth_uuid,
+ &c_hash,
+ &sat));
+ }
if (-1 == result)
result = 0;
diff --git a/src/testing/test_anastasis_api.conf b/src/testing/test_anastasis_api.conf
index 65c05b3..8befd99 100644
--- a/src/testing/test_anastasis_api.conf
+++ b/src/testing/test_anastasis_api.conf
@@ -56,11 +56,6 @@ INSURANCE = EUR:0
SERVER_SALT = salty
-# Base URL of anastasis.
-# BASE_URL = http://localhost:8086/
-
-# Where does our payment backend run? Must match PORT under [merchant]
-PAYMENT_BACKEND_URL = http://localhost:8080/
# Annual fee we charge.
#ANNUAL_FEE = EUR:4.99
@@ -68,6 +63,13 @@ ANNUAL_FEE = EUR:4.99
TRUTH_UPLOAD_FEE = EUR:0.0
+# Base URL of anastasis.
+# BASE_URL = http://localhost:8086/
+
+[anastasis-merchant-backend]
+# Where does our payment backend run? Must match PORT under [merchant]
+PAYMENT_BACKEND_URL = http://localhost:8080/
+
# Authentication costs
[authorization-question]
# Cost of authentication by question