donau

Donation authority for GNU Taler (experimental)
Log | Files | Refs | Submodules | README | LICENSE

commit abf771e857b36b56c14cd8cd8047f283153b2347
parent 4865637d8b7cb6bf6321dda192716d0f701f288b
Author: Matyja Lukas Adam <lukas.matyja@students.bfh.ch>
Date:   Mon,  1 Jan 2024 23:51:43 +0100

[testing] change config file

Diffstat:
M.gitignore | 1+
Msrc/donau/donau-httpd.c | 230++++++++++++++++++++++++++++++++++++++++----------------------------------------
Msrc/testing/test_donau_api.conf | 8+++++++-
3 files changed, 123 insertions(+), 116 deletions(-)

diff --git a/.gitignore b/.gitignore @@ -14,3 +14,4 @@ src/donau-tools/taler-donau-dbinit src/donau/donau-httpd src/util/donau-config src/testing/test_donau_api_home/.local/ +src/donau-tools/donau-dbinit diff --git a/src/donau/donau-httpd.c b/src/donau/donau-httpd.c @@ -93,7 +93,7 @@ struct TALER_MasterPublicKeyP DH_master_public_key; /** * Key used to encrypt KYC attribute data in our database. */ -struct TALER_AttributeEncryptionKeyP DH_attribute_key; +//struct TALER_AttributeEncryptionKeyP DH_attribute_key; /** * Our DB plugin. (global) @@ -134,7 +134,7 @@ char *DH_kyc_aml_trigger; /** * Option set to #GNUNET_YES if rewards are enabled. */ -int DH_enable_rewards; +//int DH_enable_rewards; /** * What is the largest amount we allow a peer to @@ -837,17 +837,17 @@ donau_serve_process_config (void) "valid relative time expected"); return GNUNET_SYSERR; } - if (GNUNET_OK != - GNUNET_CONFIGURATION_get_value_string (DH_cfg, - "donau", - "KYC_AML_TRIGGER", - &DH_kyc_aml_trigger)) - { - GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, - "donau", - "KYC_AML_TRIGGER"); - return GNUNET_SYSERR; - } + // if (GNUNET_OK != + // GNUNET_CONFIGURATION_get_value_string (DH_cfg, + // "donau", + // "KYC_AML_TRIGGER", + // &DH_kyc_aml_trigger)) + // { + // GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, + // "donau", + // "KYC_AML_TRIGGER"); + // return GNUNET_SYSERR; + // } if (GNUNET_OK != TALER_config_get_currency (DH_cfg, &DH_currency)) @@ -886,55 +886,55 @@ donau_serve_process_config (void) "Need amount in section `donau' under `AML_THRESHOLD'\n"); return GNUNET_SYSERR; } - if (GNUNET_OK != - TALER_config_get_amount (DH_cfg, - "donau", - "STEFAN_ABS", - &DH_stefan_abs)) - { - GNUNET_assert (GNUNET_OK == - TALER_amount_set_zero (DH_currency, - &DH_stefan_abs)); - } - if (GNUNET_OK != - TALER_config_get_amount (DH_cfg, - "donau", - "STEFAN_LOG", - &DH_stefan_log)) - { - GNUNET_assert (GNUNET_OK == - TALER_amount_set_zero (DH_currency, - &DH_stefan_log)); - } - if (GNUNET_OK != - TALER_config_get_amount (DH_cfg, - "donau", - "STEFAN_LIN", - &DH_stefan_lin)) - { - GNUNET_assert (GNUNET_OK == - TALER_amount_set_zero (DH_currency, - &DH_stefan_lin)); - } - - if (0 != strcmp (DH_currency, - DH_aml_threshold.currency)) - { - GNUNET_log (GNUNET_ERROR_TYPE_ERROR, - "Amount in section `donau' under `AML_THRESHOLD' uses the wrong currency!\n"); - return GNUNET_SYSERR; - } - DH_enable_rewards - = GNUNET_CONFIGURATION_get_value_yesno ( - DH_cfg, - "donau", - "ENABLE_REWARDS"); - if (GNUNET_SYSERR == DH_enable_rewards) - { - GNUNET_log (GNUNET_ERROR_TYPE_ERROR, - "Need YES or NO in section `donau' under `ENABLE_REWARDS'\n"); - return GNUNET_SYSERR; - } + // if (GNUNET_OK != + // TALER_config_get_amount (DH_cfg, + // "donau", + // "STEFAN_ABS", + // &DH_stefan_abs)) + // { + // GNUNET_assert (GNUNET_OK == + // TALER_amount_set_zero (DH_currency, + // &DH_stefan_abs)); + // } + // if (GNUNET_OK != + // TALER_config_get_amount (DH_cfg, + // "donau", + // "STEFAN_LOG", + // &DH_stefan_log)) + // { + // GNUNET_assert (GNUNET_OK == + // TALER_amount_set_zero (DH_currency, + // &DH_stefan_log)); + // } + // if (GNUNET_OK != + // TALER_config_get_amount (DH_cfg, + // "donau", + // "STEFAN_LIN", + // &DH_stefan_lin)) + // { + // GNUNET_assert (GNUNET_OK == + // TALER_amount_set_zero (DH_currency, + // &DH_stefan_lin)); + // } + + // if (0 != strcmp (DH_currency, + // DH_aml_threshold.currency)) + // { + // GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + // "Amount in section `donau' under `AML_THRESHOLD' uses the wrong currency!\n"); + // return GNUNET_SYSERR; + // } + // DH_enable_rewards + // = GNUNET_CONFIGURATION_get_value_yesno ( + // DH_cfg, + // "donau", + // "ENABLE_REWARDS"); + // if (GNUNET_SYSERR == DH_enable_rewards) + // { + // GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + // "Need YES or NO in section `donau' under `ENABLE_REWARDS'\n"); + // return GNUNET_SYSERR; + // } if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_string (DH_cfg, "donau", @@ -955,59 +955,59 @@ donau_serve_process_config (void) return GNUNET_SYSERR; } - { - char *master_public_key_str; - - if (GNUNET_OK != - GNUNET_CONFIGURATION_get_value_string (DH_cfg, - "donau", - "MASTER_PUBLIC_KEY", - &master_public_key_str)) - { - GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, - "donau", - "MASTER_PUBLIC_KEY"); - return GNUNET_SYSERR; - } - if (GNUNET_OK != - GNUNET_CRYPTO_eddsa_public_key_from_string (master_public_key_str, - strlen ( - master_public_key_str), - &DH_master_public_key. - eddsa_pub)) - { - GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_ERROR, - "donau", - "MASTER_PUBLIC_KEY", - "invalid base32 encoding for a master public key"); - GNUNET_free (master_public_key_str); - return GNUNET_SYSERR; - } - GNUNET_log (GNUNET_ERROR_TYPE_INFO, - "Launching donau with public key `%s'...\n", - master_public_key_str); - GNUNET_free (master_public_key_str); - } - - { - char *attr_enc_key_str; - - if (GNUNET_OK != - GNUNET_CONFIGURATION_get_value_string (DH_cfg, - "donau", - "ATTRIBUTE_ENCRYPTION_KEY", - &attr_enc_key_str)) - { - GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, - "donau", - "ATTRIBUTE_ENCRYPTION_KEY"); - return GNUNET_SYSERR; - } - GNUNET_CRYPTO_hash (attr_enc_key_str, - strlen (attr_enc_key_str), - &DH_attribute_key.hash); - GNUNET_free (attr_enc_key_str); - } + // { + // char *master_public_key_str; + + // if (GNUNET_OK != + // GNUNET_CONFIGURATION_get_value_string (DH_cfg, + // "donau", + // "MASTER_PUBLIC_KEY", + // &master_public_key_str)) + // { + // GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, + // "donau", + // "MASTER_PUBLIC_KEY"); + // return GNUNET_SYSERR; + // } + // if (GNUNET_OK != + // GNUNET_CRYPTO_eddsa_public_key_from_string (master_public_key_str, + // strlen ( + // master_public_key_str), + // &DH_master_public_key. + // eddsa_pub)) + // { + // GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_ERROR, + // "donau", + // "MASTER_PUBLIC_KEY", + // "invalid base32 encoding for a master public key"); + // GNUNET_free (master_public_key_str); + // return GNUNET_SYSERR; + // } + // GNUNET_log (GNUNET_ERROR_TYPE_INFO, + // "Launching donau with public key `%s'...\n", + // master_public_key_str); + // GNUNET_free (master_public_key_str); + // } + + // { + // char *attr_enc_key_str; + + // if (GNUNET_OK != + // GNUNET_CONFIGURATION_get_value_string (DH_cfg, + // "donau", + // "ATTRIBUTE_ENCRYPTION_KEY", + // &attr_enc_key_str)) + // { + // GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, + // "donau", + // "ATTRIBUTE_ENCRYPTION_KEY"); + // return GNUNET_SYSERR; + // } + // GNUNET_CRYPTO_hash (attr_enc_key_str, + // strlen (attr_enc_key_str), + // &DH_attribute_key.hash); + // GNUNET_free (attr_enc_key_str); + // } for (unsigned int i = 0; i<MAX_DB_RETRIES; i++) { diff --git a/src/testing/test_donau_api.conf b/src/testing/test_donau_api.conf @@ -16,16 +16,21 @@ TERMS_ETAG = tos PRIVACY_ETAG = 0 AML_THRESHOLD = EUR:1000000 PORT = 8081 -MASTER_PUBLIC_KEY = 98NJW3CQHZQGQXTY3K85K531XKPAPAVV4Q5V8PYYRR00NJGZWNVG DB = postgres BASE_URL = "http://localhost:8081/" SERVE = tcp EXPIRE_SHARD_SIZE ="300 ms" EXPIRE_IDLE_SLEEP_INTERVAL ="1 s" +MAX_KEYS_CACHING = forever +KYC_AML_TRIGGER = false +ENABLE_REWARDS = NO [donaudb-postgres] CONFIG = "postgres:///talercheck" +[donaudb] +IDLE_RESERVE_EXPIRATION_TIME = 0 s + [taler-donau-secmod-cs] LOOKAHEAD_SIGN = "24 days" @@ -56,3 +61,4 @@ WIRE_GATEWAY_AUTH_METHOD = basic USERNAME = Donau PASSWORD = x WIRE_GATEWAY_URL = "http://localhost:8082/2/" +