Bug 21074 - Allow trusted applications to provide details
Summary: Allow trusted applications to provide details
Status: RESOLVED FIXED
Alias: None
Product: PolicyKit
Classification: Unclassified
Component: daemon (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: David Zeuthen (not reading bugmail)
QA Contact: David Zeuthen (not reading bugmail)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-04-06 14:01 UTC by David Zeuthen (not reading bugmail)
Modified: 2009-09-13 11:08 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description David Zeuthen (not reading bugmail) 2009-04-06 14:01:02 UTC
This request was originally filed here

 https://bugzilla.redhat.com/show_bug.cgi?id=494145

The thinking is that we could allow trusted applications (e.g. running as uid 0 or similar), such as devkit-disks-daemon or packagekitd, to pass in 

 o A message for the primary text for an authentication dialog; and
 o A set of key/value pairs to show in the details tab

for the CheckAuthorization() D-Bus call. Then we can pass this on to the authentication agent running in the session. 

There's an interesting issue with translations here; either we'd need the caller of CheckAuthorization() to pass in all possible translations or we could do a ping-pong thing or something else. It's probably easier to do the former.
Comment 1 David Zeuthen (not reading bugmail) 2009-04-06 14:22:59 UTC
Thinking more about it, it is probably more elegant to do it this way

 - the authentication agent provides a preferred locale when registering
   with the polkit daemon

 - CheckAuthorization() takes a hash table of key/value pairs; e.g.

   "device-file" -> "/dev/sdb1"
   "mount-point" -> "/media/EOS_DIGITAL"
   "device-label" -> "EOS_DIGITAL"

   that depends on the action. If the caller of CheckAuthorization() is
   not trusted (e.g. not uid 0) we just error out with FAILED.

 - the provider of the action supply a .so file (e.g. a GIOModule) along
   with the .policy that provides one or more extension points to handle the
   translation / formatting.

   If the set of key/value pairs are empty (e.g. caller of CheckAuthorzation
   is not trusted) we fall back to the message in the .policy file.

   Otherwise we call into the code in the .so file to get the translated
   messages (with LANG set to whatever we need)
Comment 2 David Zeuthen (not reading bugmail) 2009-09-13 11:08:59 UTC
This was implemented some time ago.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.