[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-anastasis] branch master updated: unify field name
From: |
gnunet |
Subject: |
[taler-anastasis] branch master updated: unify field name |
Date: |
Mon, 05 Jul 2021 00:46:23 +0200 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository anastasis.
The following commit(s) were added to refs/heads/master by this push:
new 4a418c7 unify field name
4a418c7 is described below
commit 4a418c743edae662092d522468e2075767e20335
Author: Christian Grothoff <grothoff@gnunet.org>
AuthorDate: Mon Jul 5 00:46:20 2021 +0200
unify field name
---
doc/anastasis.texi | 6 +++---
.../test_anastasis_reducer_add_authentication.sh | 2 +-
.../test_anastasis_reducer_done_policy_review.sh | 4 ++--
src/reducer/anastasis_api_backup_redux.c | 25 ++++++++++++++++++----
4 files changed, 27 insertions(+), 10 deletions(-)
diff --git a/doc/anastasis.texi b/doc/anastasis.texi
index 770d958..3a7605b 100644
--- a/doc/anastasis.texi
+++ b/doc/anastasis.texi
@@ -1850,7 +1850,7 @@ authentication method to remove. Note that the array is
0-indexed:
@example
@{
- "auth_method_index": 1
+ "authentication_method": 1
@}
@end example
@@ -1963,11 +1963,11 @@ An example for a possible argument would thus be:
@{
"policy": [
@{
- "auth_method_index": 1,
+ "authentication_method": 1,
"provider": "http://localhost:8088/"
@},
@{
- "auth_method_index": 3,
+ "authentication_method": 3,
"provider": "http://localhost:8089/"
@}
]
diff --git a/src/cli/test_anastasis_reducer_add_authentication.sh
b/src/cli/test_anastasis_reducer_add_authentication.sh
index 731ae59..7d69076 100755
--- a/src/cli/test_anastasis_reducer_add_authentication.sh
+++ b/src/cli/test_anastasis_reducer_add_authentication.sh
@@ -114,7 +114,7 @@ echo " OK"
echo -n "Test delete authentication ..."
anastasis-reducer -a \
- '{"auth_method_index": 2 }' \
+ '{"authentication_method": 2 }' \
delete_authentication $TFILE $SFILE
STATE=`jq -r -e .backup_state < $SFILE`
diff --git a/src/cli/test_anastasis_reducer_done_policy_review.sh
b/src/cli/test_anastasis_reducer_done_policy_review.sh
index 110296c..7052067 100755
--- a/src/cli/test_anastasis_reducer_done_policy_review.sh
+++ b/src/cli/test_anastasis_reducer_done_policy_review.sh
@@ -67,9 +67,9 @@ echo " OK"
echo -n "Test adding policy ..."
anastasis-reducer -a \
'{ "policy" : [
- { "auth_method_index" : 1,
+ { "authentication_method" : 1,
"provider" : "http://localhost:8088/" },
- { "auth_method_index" : 1,
+ { "authentication_method" : 1,
"provider" : "http://localhost:8089/" }
] }' \
add_policy \
diff --git a/src/reducer/anastasis_api_backup_redux.c
b/src/reducer/anastasis_api_backup_redux.c
index c3cfeb2..18d68b3 100644
--- a/src/reducer/anastasis_api_backup_redux.c
+++ b/src/reducer/anastasis_api_backup_redux.c
@@ -347,14 +347,14 @@ del_authentication (json_t *state,
return NULL;
}
idx = json_object_get (arguments,
- "auth_method_index");
+ "authentication_method");
if ( (NULL == idx) ||
(! json_is_integer (idx)) )
{
ANASTASIS_redux_fail_ (cb,
cb_cls,
TALER_EC_ANASTASIS_REDUCER_INPUT_INVALID,
- "'auth_method_index' must be a number");
+ "'authentication_method' must be a number");
return NULL;
}
@@ -1731,6 +1731,7 @@ add_policy (json_t *state,
if (NULL == arguments)
{
+ GNUNET_break (0);
ANASTASIS_redux_fail_ (cb,
cb_cls,
TALER_EC_ANASTASIS_REDUCER_INPUT_INVALID,
@@ -1741,6 +1742,7 @@ add_policy (json_t *state,
"policy");
if (! json_is_array (arg_array))
{
+ GNUNET_break (0);
ANASTASIS_redux_fail_ (cb,
cb_cls,
TALER_EC_ANASTASIS_REDUCER_INPUT_INVALID,
@@ -1751,6 +1753,7 @@ add_policy (json_t *state,
"policies");
if (! json_is_array (policies))
{
+ GNUNET_break (0);
ANASTASIS_redux_fail_ (cb,
cb_cls,
TALER_EC_ANASTASIS_REDUCER_STATE_INVALID,
@@ -1761,6 +1764,7 @@ add_policy (json_t *state,
"authentication_providers");
if (! json_is_object (auth_providers))
{
+ GNUNET_break (0);
ANASTASIS_redux_fail_ (cb,
cb_cls,
TALER_EC_ANASTASIS_REDUCER_STATE_INVALID,
@@ -1771,6 +1775,7 @@ add_policy (json_t *state,
"authentication_methods");
if (! json_is_array (auth_methods))
{
+ GNUNET_break (0);
ANASTASIS_redux_fail_ (cb,
cb_cls,
TALER_EC_ANASTASIS_REDUCER_STATE_INVALID,
@@ -1792,19 +1797,20 @@ add_policy (json_t *state,
uint32_t method_idx;
json_t *prov_methods;
const char *method_type;
-
struct GNUNET_JSON_Specification spec[] = {
GNUNET_JSON_spec_string ("provider",
&provider_url),
- GNUNET_JSON_spec_uint32 ("auth_method_index",
+ GNUNET_JSON_spec_uint32 ("authentication_method",
&method_idx),
GNUNET_JSON_spec_end ()
};
+
if (GNUNET_OK !=
GNUNET_JSON_parse (method,
spec,
NULL, NULL))
{
+ GNUNET_break (0);
json_decref (methods);
ANASTASIS_redux_fail_ (cb,
cb_cls,
@@ -1828,6 +1834,7 @@ add_policy (json_t *state,
provider_url);
if (NULL == prov_cfg)
{
+ GNUNET_break (0);
json_decref (methods);
ANASTASIS_redux_fail_ (cb,
cb_cls,
@@ -1840,6 +1847,7 @@ add_policy (json_t *state,
spec,
NULL, NULL))
{
+ GNUNET_break (0);
json_decref (methods);
ANASTASIS_redux_fail_ (cb,
cb_cls,
@@ -1850,6 +1858,7 @@ add_policy (json_t *state,
}
if (! json_is_array (prov_methods))
{
+ GNUNET_break (0);
json_decref (methods);
json_decref (prov_methods);
ANASTASIS_redux_fail_ (cb,
@@ -1867,6 +1876,7 @@ add_policy (json_t *state,
method_idx);
if (NULL == auth_method)
{
+ GNUNET_break (0);
json_decref (methods);
json_decref (prov_methods);
ANASTASIS_redux_fail_ (cb,
@@ -1879,6 +1889,7 @@ add_policy (json_t *state,
"type"));
if (NULL == method_type)
{
+ GNUNET_break (0);
json_decref (methods);
json_decref (prov_methods);
ANASTASIS_redux_fail_ (cb,
@@ -1910,6 +1921,7 @@ add_policy (json_t *state,
spec,
NULL, NULL))
{
+ GNUNET_break (0);
json_decref (methods);
json_decref (prov_methods);
ANASTASIS_redux_fail_ (cb,
@@ -1926,6 +1938,7 @@ add_policy (json_t *state,
}
if (! found)
{
+ GNUNET_break (0);
json_decref (methods);
json_decref (prov_methods);
ANASTASIS_redux_fail_ (cb,
@@ -1987,6 +2000,7 @@ update_policy (json_t *state,
if (NULL == arguments)
{
+ GNUNET_break (0);
ANASTASIS_redux_fail_ (cb,
cb_cls,
TALER_EC_ANASTASIS_REDUCER_INPUT_INVALID,
@@ -1997,6 +2011,7 @@ update_policy (json_t *state,
"policy_index");
if (! json_is_integer (idx))
{
+ GNUNET_break (0);
ANASTASIS_redux_fail_ (cb,
cb_cls,
TALER_EC_ANASTASIS_REDUCER_INPUT_INVALID,
@@ -2008,6 +2023,7 @@ update_policy (json_t *state,
"policies");
if (! json_is_array (policy_arr))
{
+ GNUNET_break (0);
ANASTASIS_redux_fail_ (cb,
cb_cls,
TALER_EC_ANASTASIS_REDUCER_STATE_INVALID,
@@ -2017,6 +2033,7 @@ update_policy (json_t *state,
if (0 != json_array_remove (policy_arr,
index))
{
+ GNUNET_break (0);
ANASTASIS_redux_fail_ (cb,
cb_cls,
TALER_EC_ANASTASIS_REDUCER_INPUT_INVALID_FOR_STATE,
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-anastasis] branch master updated: unify field name,
gnunet <=