summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2013-11-12 15:37:29 +0000
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2013-11-12 15:37:29 +0000
commit692946fe470eae3f3e9fa9453dec7d1f62cff7f2 (patch)
tree63910f057f5278fe163130db67eaf5d4f7aaf4be /tests
parentbdf7c51b8ab76917a46714df784e838f323938cb (diff)
Revert "Remove all notion of secret parameter"
Diffstat (limited to 'tests')
-rw-r--r--tests/twisted/dbus-account-plugin.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/twisted/dbus-account-plugin.c b/tests/twisted/dbus-account-plugin.c
index 9d79dc0a..d1c0bf14 100644
--- a/tests/twisted/dbus-account-plugin.c
+++ b/tests/twisted/dbus-account-plugin.c
@@ -1006,10 +1006,18 @@ test_dbus_account_plugin_get (const McpAccountStorage *storage,
while (g_hash_table_iter_next (&iter, &k, &v))
{
gchar *param_foo;
+ McpParameterFlags flags;
param_foo = g_strdup_printf ("param-%s", (const gchar *) k);
mcp_account_manager_set_value (am, account_name, param_foo, v);
+ flags = GPOINTER_TO_UINT (g_hash_table_lookup (
+ account->parameter_flags, k));
+
+ if (flags & MCP_PARAMETER_FLAG_SECRET)
+ mcp_account_manager_parameter_make_secret (am, account_name,
+ param_foo);
+
g_free (param_foo);
}
@@ -1018,6 +1026,7 @@ test_dbus_account_plugin_get (const McpAccountStorage *storage,
while (g_hash_table_iter_next (&iter, &k, &v))
{
gchar *param_foo;
+ guint32 flags;
gchar *escaped = mcp_account_manager_escape_variant_for_keyfile (am,
v);
@@ -1025,6 +1034,13 @@ test_dbus_account_plugin_get (const McpAccountStorage *storage,
mcp_account_manager_set_value (am, account_name, param_foo, escaped);
g_free (escaped);
+ flags = GPOINTER_TO_UINT (g_hash_table_lookup (account->parameter_flags,
+ k));
+
+ if (flags & MCP_PARAMETER_FLAG_SECRET)
+ mcp_account_manager_parameter_make_secret (am, account_name,
+ param_foo);
+
g_free (param_foo);
}
@@ -1037,12 +1053,17 @@ test_dbus_account_plugin_get (const McpAccountStorage *storage,
{
GVariant *v = g_hash_table_lookup (account->parameters, key + 6);
const gchar *s = g_hash_table_lookup (account->untyped_parameters, key + 6);
+ guint32 flags = GPOINTER_TO_UINT (
+ g_hash_table_lookup (account->parameter_flags, key + 6));
g_dbus_connection_emit_signal (self->bus, NULL,
TEST_DBUS_ACCOUNT_PLUGIN_PATH, TEST_DBUS_ACCOUNT_PLUGIN_IFACE,
"GetParameter",
g_variant_new_parsed ("(%o, %s)", account->path, key + 6), NULL);
+ if (flags & MCP_PARAMETER_FLAG_SECRET)
+ mcp_account_manager_parameter_make_secret (am, account_name, key);
+
if (v != NULL)
{
gchar *escaped = mcp_account_manager_escape_variant_for_keyfile (am,