aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2022-04-13 09:15:39 +0200
committerChristian Grothoff <christian@grothoff.org>2022-04-13 09:15:39 +0200
commitf96c892972444d7f73231c04a7f40375bd4ff811 (patch)
tree07e392e510d2a6b4e15be3783065da53beff4df6
parent6516ced3f6bdbedb43a40023f3336097662bfc03 (diff)
downloadanastasis-f96c892972444d7f73231c04a7f40375bd4ff811.tar.gz
anastasis-f96c892972444d7f73231c04a7f40375bd4ff811.zip
-rename fest for #7222
-rw-r--r--src/cli/resources/02-backup.json8
-rw-r--r--src/cli/resources/02-recovery.json8
-rw-r--r--src/cli/resources/03-backup.json4
-rw-r--r--src/cli/resources/04-backup.json4
-rw-r--r--src/cli/resources/05-backup.json4
-rw-r--r--src/cli/resources/06-backup.json4
-rw-r--r--src/reducer/anastasis_api_backup_redux.c60
-rw-r--r--src/reducer/anastasis_api_redux.c15
8 files changed, 61 insertions, 46 deletions
diff --git a/src/cli/resources/02-backup.json b/src/cli/resources/02-backup.json
index 67df7e0..05ccab1 100644
--- a/src/cli/resources/02-backup.json
+++ b/src/cli/resources/02-backup.json
@@ -40,10 +40,10 @@
40 } 40 }
41 ], 41 ],
42 "authentication_providers": { 42 "authentication_providers": {
43 "http://localhost:8086/": {}, 43 "http://localhost:8086/": { "status" : "not-contacted" },
44 "http://localhost:8087/": {}, 44 "http://localhost:8087/": { "status" : "not-contacted" },
45 "http://localhost:8088/": {}, 45 "http://localhost:8088/": { "status" : "not-contacted" },
46 "http://localhost:8089/": {} 46 "http://localhost:8089/": { "status" : "not-contacted" }
47 }, 47 },
48 "selected_country": "xx", 48 "selected_country": "xx",
49 "currencies": [ "TESTKUDOS" ], 49 "currencies": [ "TESTKUDOS" ],
diff --git a/src/cli/resources/02-recovery.json b/src/cli/resources/02-recovery.json
index e77ed0c..875fae0 100644
--- a/src/cli/resources/02-recovery.json
+++ b/src/cli/resources/02-recovery.json
@@ -40,10 +40,10 @@
40 } 40 }
41 ], 41 ],
42 "authentication_providers": { 42 "authentication_providers": {
43 "http://localhost:8086/": {}, 43 "http://localhost:8086/": { "status" : "not-contacted" },
44 "http://localhost:8087/": {}, 44 "http://localhost:8087/": { "status" : "not-contacted" },
45 "http://localhost:8088/": {}, 45 "http://localhost:8088/": { "status" : "not-contacted" },
46 "http://localhost:8089/": {} 46 "http://localhost:8089/": { "status" : "not-contacted" }
47 }, 47 },
48 "selected_country": "xx", 48 "selected_country": "xx",
49 "currencies": [ "TESTKUDOS" ], 49 "currencies": [ "TESTKUDOS" ],
diff --git a/src/cli/resources/03-backup.json b/src/cli/resources/03-backup.json
index ad9d23b..838b669 100644
--- a/src/cli/resources/03-backup.json
+++ b/src/cli/resources/03-backup.json
@@ -41,6 +41,7 @@
41 ], 41 ],
42 "authentication_providers": { 42 "authentication_providers": {
43 "http://localhost:8086/": { 43 "http://localhost:8086/": {
44 "status" : "ok",
44 "methods": [ 45 "methods": [
45 { 46 {
46 "type": "question", 47 "type": "question",
@@ -60,6 +61,7 @@
60 "http_status": 200 61 "http_status": 200
61 }, 62 },
62 "http://localhost:8087/": { 63 "http://localhost:8087/": {
64 "status" : "ok",
63 "methods": [ 65 "methods": [
64 { 66 {
65 "type": "question", 67 "type": "question",
@@ -79,6 +81,7 @@
79 "http_status": 200 81 "http_status": 200
80 }, 82 },
81 "http://localhost:8088/": { 83 "http://localhost:8088/": {
84 "status" : "ok",
82 "methods": [ 85 "methods": [
83 { 86 {
84 "type": "question", 87 "type": "question",
@@ -98,6 +101,7 @@
98 "http_status": 200 101 "http_status": 200
99 }, 102 },
100 "http://localhost:8089/": { 103 "http://localhost:8089/": {
104 "status" : "ok",
101 "methods": [ 105 "methods": [
102 { 106 {
103 "type": "question", 107 "type": "question",
diff --git a/src/cli/resources/04-backup.json b/src/cli/resources/04-backup.json
index 34cabfd..3676f3e 100644
--- a/src/cli/resources/04-backup.json
+++ b/src/cli/resources/04-backup.json
@@ -41,6 +41,7 @@
41 ], 41 ],
42 "authentication_providers": { 42 "authentication_providers": {
43 "http://localhost:8086/": { 43 "http://localhost:8086/": {
44 "status" : "ok",
44 "methods": [ 45 "methods": [
45 { 46 {
46 "type": "question", 47 "type": "question",
@@ -60,6 +61,7 @@
60 "http_status": 200 61 "http_status": 200
61 }, 62 },
62 "http://localhost:8087/": { 63 "http://localhost:8087/": {
64 "status" : "ok",
63 "methods": [ 65 "methods": [
64 { 66 {
65 "type": "question", 67 "type": "question",
@@ -79,6 +81,7 @@
79 "http_status": 200 81 "http_status": 200
80 }, 82 },
81 "http://localhost:8088/": { 83 "http://localhost:8088/": {
84 "status" : "ok",
82 "methods": [ 85 "methods": [
83 { 86 {
84 "type": "question", 87 "type": "question",
@@ -98,6 +101,7 @@
98 "http_status": 200 101 "http_status": 200
99 }, 102 },
100 "http://localhost:8089/": { 103 "http://localhost:8089/": {
104 "status" : "ok",
101 "methods": [ 105 "methods": [
102 { 106 {
103 "type": "question", 107 "type": "question",
diff --git a/src/cli/resources/05-backup.json b/src/cli/resources/05-backup.json
index bb988be..c8f52f0 100644
--- a/src/cli/resources/05-backup.json
+++ b/src/cli/resources/05-backup.json
@@ -41,6 +41,7 @@
41 ], 41 ],
42 "authentication_providers": { 42 "authentication_providers": {
43 "http://localhost:8086/": { 43 "http://localhost:8086/": {
44 "status" : "ok",
44 "methods": [ 45 "methods": [
45 { 46 {
46 "type": "question", 47 "type": "question",
@@ -60,6 +61,7 @@
60 "http_status": 200 61 "http_status": 200
61 }, 62 },
62 "http://localhost:8087/": { 63 "http://localhost:8087/": {
64 "status" : "ok",
63 "methods": [ 65 "methods": [
64 { 66 {
65 "type": "question", 67 "type": "question",
@@ -79,6 +81,7 @@
79 "http_status": 200 81 "http_status": 200
80 }, 82 },
81 "http://localhost:8088/": { 83 "http://localhost:8088/": {
84 "status" : "ok",
82 "methods": [ 85 "methods": [
83 { 86 {
84 "type": "question", 87 "type": "question",
@@ -98,6 +101,7 @@
98 "http_status": 200 101 "http_status": 200
99 }, 102 },
100 "http://localhost:8089/": { 103 "http://localhost:8089/": {
104 "status" : "ok",
101 "methods": [ 105 "methods": [
102 { 106 {
103 "type": "question", 107 "type": "question",
diff --git a/src/cli/resources/06-backup.json b/src/cli/resources/06-backup.json
index 23a8927..04d8b02 100644
--- a/src/cli/resources/06-backup.json
+++ b/src/cli/resources/06-backup.json
@@ -41,6 +41,7 @@
41 ], 41 ],
42 "authentication_providers": { 42 "authentication_providers": {
43 "http://localhost:8086/": { 43 "http://localhost:8086/": {
44 "status" : "ok",
44 "methods": [ 45 "methods": [
45 { 46 {
46 "type": "question", 47 "type": "question",
@@ -60,6 +61,7 @@
60 "http_status": 200 61 "http_status": 200
61 }, 62 },
62 "http://localhost:8087/": { 63 "http://localhost:8087/": {
64 "status" : "ok",
63 "methods": [ 65 "methods": [
64 { 66 {
65 "type": "question", 67 "type": "question",
@@ -79,6 +81,7 @@
79 "http_status": 200 81 "http_status": 200
80 }, 82 },
81 "http://localhost:8088/": { 83 "http://localhost:8088/": {
84 "status" : "ok",
82 "methods": [ 85 "methods": [
83 { 86 {
84 "type": "question", 87 "type": "question",
@@ -98,6 +101,7 @@
98 "http_status": 200 101 "http_status": 200
99 }, 102 },
100 "http://localhost:8089/": { 103 "http://localhost:8089/": {
104 "status" : "ok",
101 "methods": [ 105 "methods": [
102 { 106 {
103 "type": "question", 107 "type": "question",
diff --git a/src/reducer/anastasis_api_backup_redux.c b/src/reducer/anastasis_api_backup_redux.c
index a97e6dc..9a9b3ad 100644
--- a/src/reducer/anastasis_api_backup_redux.c
+++ b/src/reducer/anastasis_api_backup_redux.c
@@ -357,9 +357,11 @@ add_authentication (json_t *state,
357 json_t *method; 357 json_t *method;
358 size_t index; 358 size_t index;
359 uint32_t size_limit_in_mb = 0; 359 uint32_t size_limit_in_mb = 0;
360 bool disabled = false; 360 const char *status;
361 uint32_t http_status = 0; 361 uint32_t http_status = 0;
362 struct GNUNET_JSON_Specification ispec[] = { 362 struct GNUNET_JSON_Specification ispec[] = {
363 GNUNET_JSON_spec_string ("status",
364 &status),
363 GNUNET_JSON_spec_mark_optional ( 365 GNUNET_JSON_spec_mark_optional (
364 GNUNET_JSON_spec_uint32 ("storage_limit_in_megabytes", 366 GNUNET_JSON_spec_uint32 ("storage_limit_in_megabytes",
365 &size_limit_in_mb), 367 &size_limit_in_mb),
@@ -369,10 +371,6 @@ add_authentication (json_t *state,
369 &http_status), 371 &http_status),
370 NULL), 372 NULL),
371 GNUNET_JSON_spec_mark_optional ( 373 GNUNET_JSON_spec_mark_optional (
372 GNUNET_JSON_spec_bool ("disabled",
373 &disabled),
374 NULL),
375 GNUNET_JSON_spec_mark_optional (
376 GNUNET_JSON_spec_json ("methods", 374 GNUNET_JSON_spec_json ("methods",
377 &methods), 375 &methods),
378 NULL), 376 NULL),
@@ -387,7 +385,8 @@ add_authentication (json_t *state,
387 GNUNET_break (0); 385 GNUNET_break (0);
388 continue; 386 continue;
389 } 387 }
390 if (disabled) 388 if (0 != strcmp (status,
389 "ok"))
391 continue; 390 continue;
392 if (MHD_HTTP_OK != http_status) 391 if (MHD_HTTP_OK != http_status)
393 continue; /* skip providers that are down */ 392 continue; /* skip providers that are down */
@@ -1946,8 +1945,8 @@ add_policy (json_t *state,
1946 { 1945 {
1947 const char *provider_url; 1946 const char *provider_url;
1948 uint32_t method_idx; 1947 uint32_t method_idx;
1949 json_t *prov_methods;
1950 const char *method_type; 1948 const char *method_type;
1949 json_t *prov_methods;
1951 struct GNUNET_JSON_Specification spec[] = { 1950 struct GNUNET_JSON_Specification spec[] = {
1952 GNUNET_JSON_spec_string ("provider", 1951 GNUNET_JSON_spec_string ("provider",
1953 &provider_url), 1952 &provider_url),
@@ -1973,13 +1972,11 @@ add_policy (json_t *state,
1973 { 1972 {
1974 const json_t *prov_cfg; 1973 const json_t *prov_cfg;
1975 uint32_t limit; 1974 uint32_t limit;
1976 bool disabled = false; 1975 const char *status;
1977 uint32_t http_status = 0; 1976 uint32_t http_status = 0;
1978 struct GNUNET_JSON_Specification spec[] = { 1977 struct GNUNET_JSON_Specification spec[] = {
1979 GNUNET_JSON_spec_mark_optional ( 1978 GNUNET_JSON_spec_string ("status",
1980 GNUNET_JSON_spec_bool ("disabled", 1979 &status),
1981 &disabled),
1982 NULL),
1983 GNUNET_JSON_spec_mark_optional ( 1980 GNUNET_JSON_spec_mark_optional (
1984 GNUNET_JSON_spec_uint32 ("http_status", 1981 GNUNET_JSON_spec_uint32 ("http_status",
1985 &http_status), 1982 &http_status),
@@ -2013,7 +2010,8 @@ add_policy (json_t *state,
2013 continue; 2010 continue;
2014 } 2011 }
2015 if ( (MHD_HTTP_OK != http_status) || 2012 if ( (MHD_HTTP_OK != http_status) ||
2016 disabled) 2013 (0 != strcmp (status,
2014 "ok")) )
2017 { 2015 {
2018 /* skip provider, disabled or down */ 2016 /* skip provider, disabled or down */
2019 json_decref (methods); 2017 json_decref (methods);
@@ -2455,13 +2453,11 @@ update_expiration_cost (json_t *state,
2455 json_object_foreach (providers, url, provider) 2453 json_object_foreach (providers, url, provider)
2456 { 2454 {
2457 struct TALER_Amount annual_fee; 2455 struct TALER_Amount annual_fee;
2458 bool disabled = false; 2456 const char *status;
2459 uint32_t http_status = 0; 2457 uint32_t http_status = 0;
2460 struct GNUNET_JSON_Specification pspec[] = { 2458 struct GNUNET_JSON_Specification pspec[] = {
2461 GNUNET_JSON_spec_mark_optional ( 2459 GNUNET_JSON_spec_string ("status",
2462 GNUNET_JSON_spec_bool ("disabled", 2460 &status),
2463 &disabled),
2464 NULL),
2465 GNUNET_JSON_spec_mark_optional ( 2461 GNUNET_JSON_spec_mark_optional (
2466 GNUNET_JSON_spec_uint32 ("http_status", 2462 GNUNET_JSON_spec_uint32 ("http_status",
2467 &http_status), 2463 &http_status),
@@ -2477,12 +2473,12 @@ update_expiration_cost (json_t *state,
2477 pspec, 2473 pspec,
2478 NULL, NULL)) 2474 NULL, NULL))
2479 { 2475 {
2480 /* strange, skip as well */ 2476 /* likely down, skip */
2481 GNUNET_break_op (0);
2482 continue; 2477 continue;
2483 } 2478 }
2484 if ( (MHD_HTTP_OK != http_status) || 2479 if ( (MHD_HTTP_OK != http_status) ||
2485 disabled) 2480 (0 != strcmp (status,
2481 "ok")) )
2486 continue; /* skip providers that are down or disabled */ 2482 continue; /* skip providers that are down or disabled */
2487 if (0 > 2483 if (0 >
2488 TALER_amount_multiply (&fee, 2484 TALER_amount_multiply (&fee,
@@ -4228,13 +4224,11 @@ check_upload_size_limit (json_t *state,
4228 json_object_foreach (aps, url, ap) 4224 json_object_foreach (aps, url, ap)
4229 { 4225 {
4230 uint32_t limit = 0; 4226 uint32_t limit = 0;
4231 bool disabled = false; 4227 const char *status;
4232 uint32_t http_status = 0; 4228 uint32_t http_status = 0;
4233 struct GNUNET_JSON_Specification spec[] = { 4229 struct GNUNET_JSON_Specification spec[] = {
4234 GNUNET_JSON_spec_mark_optional ( 4230 GNUNET_JSON_spec_string ("status",
4235 GNUNET_JSON_spec_bool ("disabled", 4231 &status),
4236 &disabled),
4237 NULL),
4238 GNUNET_JSON_spec_mark_optional ( 4232 GNUNET_JSON_spec_mark_optional (
4239 GNUNET_JSON_spec_uint32 ("http_status", 4233 GNUNET_JSON_spec_uint32 ("http_status",
4240 &http_status), 4234 &http_status),
@@ -4256,7 +4250,8 @@ check_upload_size_limit (json_t *state,
4256 continue; 4250 continue;
4257 } 4251 }
4258 if ( (MHD_HTTP_OK != http_status) || 4252 if ( (MHD_HTTP_OK != http_status) ||
4259 disabled) 4253 (0 != strcmp (status,
4254 "ok")) )
4260 continue; 4255 continue;
4261 if (0 == limit) 4256 if (0 == limit)
4262 return GNUNET_SYSERR; 4257 return GNUNET_SYSERR;
@@ -5064,12 +5059,10 @@ ANASTASIS_REDUX_backup_begin_ (json_t *state,
5064 json_object_foreach (provider_list, url, prov) { 5059 json_object_foreach (provider_list, url, prov) {
5065 struct BackupStartStateProviderEntry *pe; 5060 struct BackupStartStateProviderEntry *pe;
5066 json_t *istate; 5061 json_t *istate;
5067 bool disabled = false; 5062 const char *status;
5068 struct GNUNET_JSON_Specification spec[] = { 5063 struct GNUNET_JSON_Specification spec[] = {
5069 GNUNET_JSON_spec_mark_optional ( 5064 GNUNET_JSON_spec_string ("status",
5070 GNUNET_JSON_spec_bool ("disabled", 5065 &status),
5071 &disabled),
5072 NULL),
5073 GNUNET_JSON_spec_end () 5066 GNUNET_JSON_spec_end ()
5074 }; 5067 };
5075 5068
@@ -5082,7 +5075,8 @@ ANASTASIS_REDUX_backup_begin_ (json_t *state,
5082 GNUNET_break_op (0); 5075 GNUNET_break_op (0);
5083 continue; 5076 continue;
5084 } 5077 }
5085 if (disabled) 5078 if (0 == strcmp (status,
5079 "disabled"))
5086 continue; 5080 continue;
5087 pe = GNUNET_new (struct BackupStartStateProviderEntry); 5081 pe = GNUNET_new (struct BackupStartStateProviderEntry);
5088 pe->bss = bss; 5082 pe->bss = bss;
diff --git a/src/reducer/anastasis_api_redux.c b/src/reducer/anastasis_api_redux.c
index 1dba576..b66eec3 100644
--- a/src/reducer/anastasis_api_redux.c
+++ b/src/reducer/anastasis_api_redux.c
@@ -493,13 +493,11 @@ notify_waiting (struct ConfigRequest *cr)
493 "authentication_providers", 493 "authentication_providers",
494 provider_list = json_object ())); 494 provider_list = json_object ()));
495 } 495 }
496 provider_list = json_object_get (w->state,
497 "authentication_providers");
498 GNUNET_assert (NULL != provider_list);
499
500 if (TALER_EC_NONE != cr->ec) 496 if (TALER_EC_NONE != cr->ec)
501 { 497 {
502 prov = GNUNET_JSON_PACK ( 498 prov = GNUNET_JSON_PACK (
499 GNUNET_JSON_pack_string ("status",
500 "error"),
503 GNUNET_JSON_pack_uint64 ("error_code", 501 GNUNET_JSON_pack_uint64 ("error_code",
504 cr->ec), 502 cr->ec),
505 GNUNET_JSON_pack_uint64 ("http_status", 503 GNUNET_JSON_pack_uint64 ("http_status",
@@ -525,6 +523,8 @@ notify_waiting (struct ConfigRequest *cr)
525 mj)); 523 mj));
526 } 524 }
527 prov = GNUNET_JSON_PACK ( 525 prov = GNUNET_JSON_PACK (
526 GNUNET_JSON_pack_string ("status",
527 "ok"),
528 GNUNET_JSON_pack_array_steal ("methods", 528 GNUNET_JSON_pack_array_steal ("methods",
529 methods_list), 529 methods_list),
530 TALER_JSON_pack_amount ("annual_fee", 530 TALER_JSON_pack_amount ("annual_fee",
@@ -754,6 +754,7 @@ begin_provider_config_check (const json_t *currencies,
754 &cur), 754 &cur),
755 GNUNET_JSON_spec_end () 755 GNUNET_JSON_spec_end ()
756 }; 756 };
757 json_t *prov;
757 758
758 if (GNUNET_OK != 759 if (GNUNET_OK !=
759 GNUNET_JSON_parse (provider, 760 GNUNET_JSON_parse (provider,
@@ -786,10 +787,14 @@ begin_provider_config_check (const json_t *currencies,
786 if (! found) 787 if (! found)
787 continue; 788 continue;
788 } 789 }
790 prov = GNUNET_JSON_PACK (
791 GNUNET_JSON_pack_string ("status",
792 "not-contacted"));
793 GNUNET_assert (NULL != prov);
789 GNUNET_assert (0 == 794 GNUNET_assert (0 ==
790 json_object_set_new (pl, 795 json_object_set_new (pl,
791 url, 796 url,
792 json_object ())); 797 prov));
793 check_config (url); 798 check_config (url);
794 } 799 }
795 GNUNET_assert (0 == 800 GNUNET_assert (0 ==