diff options
author | David Zeuthen <davidz@redhat.com> | 2012-05-18 17:23:18 -0400 |
---|---|---|
committer | David Zeuthen <davidz@redhat.com> | 2012-05-18 17:29:01 -0400 |
commit | 3b7868b33033ed8dde17bb6b88ef461f4ecbb93f (patch) | |
tree | 744dbb782b5de49d672141ac091924fbebb1349a /test | |
parent | ff18d9a8a23f11f76babc696082750f3f4b74239 (diff) | |
download | polkit-3b7868b33033ed8dde17bb6b88ef461f4ecbb93f.tar.gz |
Make it possible for JS code to change details
For example, to set the authentication message, a JS function can
simply do
details["polkit.message"] = "Hey dude, XYZ, I need your password";
This can also be used to pass data back to the mechanism.
To make this work properly, we also introduce a slight change: the
a{ss} passed back to the mechanism (part of the AuthorizationResult
structure) will be initialized with the a{ss} the app passed itself in
the CheckAuthorization() call.
Signed-off-by: David Zeuthen <davidz@redhat.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/polkitbackend/polkitbackendlocalauthoritytest.c | 7 | ||||
-rw-r--r-- | test/polkitbackend/polkitbackendlocalauthorizationstoretest.c | 9 |
2 files changed, 4 insertions, 12 deletions
diff --git a/test/polkitbackend/polkitbackendlocalauthoritytest.c b/test/polkitbackend/polkitbackendlocalauthoritytest.c index 617c254..9fc7848 100644 --- a/test/polkitbackend/polkitbackendlocalauthoritytest.c +++ b/test/polkitbackend/polkitbackendlocalauthoritytest.c @@ -66,9 +66,6 @@ test_check_authorization_sync (const void *_ctx) PolkitDetails *details = polkit_details_new (); g_assert (details); - PolkitDetails *out_details = polkit_details_new (); - g_assert (out_details); - PolkitImplicitAuthorization auth; auth = polkit_backend_interactive_authority_check_authorization_sync ( @@ -80,8 +77,7 @@ test_check_authorization_sync (const void *_ctx) ctx->subject_is_active, ctx->action_id, details, - ctx->implicit, - out_details); + ctx->implicit); g_assert_cmpint (auth, ==, ctx->expect); @@ -90,7 +86,6 @@ test_check_authorization_sync (const void *_ctx) g_object_unref (subject); g_object_unref (user_for_subject); g_object_unref (details); - g_object_unref (out_details); } static void diff --git a/test/polkitbackend/polkitbackendlocalauthorizationstoretest.c b/test/polkitbackend/polkitbackendlocalauthorizationstoretest.c index 945e163..e787c17 100644 --- a/test/polkitbackend/polkitbackendlocalauthorizationstoretest.c +++ b/test/polkitbackend/polkitbackendlocalauthorizationstoretest.c @@ -89,8 +89,7 @@ test_lookup (void) details, &ret_any, &ret_inactive, - &ret_active, - NULL); + &ret_active); g_assert (ok); g_assert_cmpstr ("no", ==, polkit_implicit_authorization_to_string (ret_any)); g_assert_cmpstr ("auth_self", ==, polkit_implicit_authorization_to_string (ret_inactive)); @@ -109,8 +108,7 @@ test_lookup (void) details, &ret_any, &ret_inactive, - &ret_active, - NULL); + &ret_active); g_assert (ok); g_assert_cmpstr ("no", ==, polkit_implicit_authorization_to_string (ret_any)); g_assert_cmpstr ("auth_self", ==, polkit_implicit_authorization_to_string (ret_inactive)); @@ -124,8 +122,7 @@ test_lookup (void) details, &ret_any, &ret_inactive, - &ret_active, - NULL); + &ret_active); g_assert (!ok); } |