summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2022-04-12 21:36:23 +0200
committerChristian Grothoff <christian@grothoff.org>2022-04-12 21:36:23 +0200
commitdc47351fef3a05a793603e2deb8559a25d194385 (patch)
tree4037db55df4568737bb4ecbfd3f528fb5e436ec9
parent1c72e1c8169c9ca6b935715502cb06413c577b0d (diff)
downloadanastasis-gtk-dc47351fef3a05a793603e2deb8559a25d194385.tar.gz
anastasis-gtk-dc47351fef3a05a793603e2deb8559a25d194385.tar.bz2
anastasis-gtk-dc47351fef3a05a793603e2deb8559a25d194385.zip
rename 'next' to 'select_version' and allow passing provider array
-rw-r--r--src/anastasis/anastasis-gtk_handle-main-window-forward-clicked.c43
1 files changed, 33 insertions, 10 deletions
diff --git a/src/anastasis/anastasis-gtk_handle-main-window-forward-clicked.c b/src/anastasis/anastasis-gtk_handle-main-window-forward-clicked.c
index e8860e7..23f2f06 100644
--- a/src/anastasis/anastasis-gtk_handle-main-window-forward-clicked.c
+++ b/src/anastasis/anastasis-gtk_handle-main-window-forward-clicked.c
@@ -445,7 +445,8 @@ forward_secret_selecting (void)
GtkTreeModel *model;
GtkTreeIter iter;
json_t *args;
- char *provider_url;
+ gchar *provider_url;
+ gchar *secret_name;
gint version;
gint mask;
@@ -473,22 +474,44 @@ forward_secret_selecting (void)
AG_SSMC_PROVIDER_URL, &provider_url,
AG_SSMC_POLICY_VERSION, &version,
AG_SSMC_ATTRIBUTE_MASK, &mask,
+ AG_SSMC_SECRET_NAME, &secret_name,
-1);
- args = GNUNET_JSON_PACK (
- GNUNET_JSON_pack_string ("provider_url",
- provider_url),
- GNUNET_JSON_pack_uint64 ("version",
- version),
- GNUNET_JSON_pack_uint64 ("mask",
- mask)
- );
+ {
+ json_t *providers;
+
+ providers = json_array ();
+ /* FIXME: should build array with _all_ providers
+ that provide the same policy here, instead of
+ just picking one of them...
+ => requires change in tree model or different
+ lookup. */
+ GNUNET_assert (NULL != providers);
+ GNUNET_assert (
+ 0 ==
+ json_array_append (
+ providers,
+ GNUNET_JSON_PACK (
+ GNUNET_JSON_pack_string ("url",
+ provider_url),
+ GNUNET_JSON_pack_uint64 ("version",
+ version))));
+ args = GNUNET_JSON_PACK (
+ GNUNET_JSON_pack_array_steal ("providers",
+ providers),
+ GNUNET_JSON_pack_uint64 ("attribute_mask",
+ mask),
+ GNUNET_JSON_pack_string ("secret_name",
+ secret_name)
+ );
+ }
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Proceeding with policy version %u at provider %s\n",
(unsigned int) version,
provider_url);
g_free (provider_url);
+ g_free (secret_name);
AG_ra = ANASTASIS_redux_action (AG_redux_state,
- "next",
+ "select_version",
args,
&AG_action_cb,
NULL);