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.
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)
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.