diff options
author | Jakub Hrozek <jhrozek@redhat.com> | 2014-04-15 15:42:15 +0200 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2014-05-13 21:47:05 +0200 |
commit | 2fbe9b9373dcdc28558da07690e57ff7a162a11d (patch) | |
tree | 82ea2ce083647b4eb250d8f5bde2fac7bfc2de13 /src/responder/ifp/ifp_iface_generated.c | |
parent | 6cbb9f0d7c6be2cd3553dcb548984bb98926d5cb (diff) | |
download | sssd-2fbe9b9373dcdc28558da07690e57ff7a162a11d.tar.gz sssd-2fbe9b9373dcdc28558da07690e57ff7a162a11d.tar.xz sssd-2fbe9b9373dcdc28558da07690e57ff7a162a11d.zip |
IFP: Add GetUserAttrs call
Adds a DBus method that allows the caller to retrieve attributes of a
user. The synopsis of the call is as follows:
<method name="GetUserAttr">
<arg type="s" name="user" direction="in"/>
<arg type="as" name="attr" direction="in"/>
<arg type="a{sv}" name="values" direction="out"/>
</method>
The return value is an array (one attribute per array member) of
dictionaries. The key of the dictionary is the attribute name, the value
is a variant containing the attribute values as strings.
If an attribute does not exist or is not permitted to be read, no error
is returned. If the users does not exist, the method returns an error.
In future patches this function will be marked as obsolete in favor of
object-oriented approach.
ifp_user_get_attr_unpack_msg is a separate function to allow extending
it in a later patch.
The function to check the cache validity duplicates quite a bit of code
with the NSS responder. The refactoring would be nice to get done along
with #843.
Reviewed-by: Pavel Březina <pbrezina@redhat.com>
Reviewed-by: Stef Walter <stefw@redhat.com>
Diffstat (limited to 'src/responder/ifp/ifp_iface_generated.c')
-rw-r--r-- | src/responder/ifp/ifp_iface_generated.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/responder/ifp/ifp_iface_generated.c b/src/responder/ifp/ifp_iface_generated.c index 57c67f8bc..ed8d65187 100644 --- a/src/responder/ifp/ifp_iface_generated.c +++ b/src/responder/ifp/ifp_iface_generated.c @@ -5,6 +5,19 @@ #include "sbus/sssd_dbus_meta.h" #include "ifp_iface_generated.h" +/* arguments for org.freedesktop.sssd.infopipe.GetUserAttr */ +const struct sbus_arg_meta infopipe_iface_GetUserAttr__in[] = { + { "user", "s" }, + { "attr", "as" }, + { NULL, } +}; + +/* arguments for org.freedesktop.sssd.infopipe.GetUserAttr */ +const struct sbus_arg_meta infopipe_iface_GetUserAttr__out[] = { + { "values", "a{sv}" }, + { NULL, } +}; + /* methods for org.freedesktop.sssd.infopipe */ const struct sbus_method_meta infopipe_iface__methods[] = { { @@ -14,6 +27,13 @@ const struct sbus_method_meta infopipe_iface__methods[] = { offsetof(struct infopipe_iface, Ping), NULL, /* no invoker */ }, + { + "GetUserAttr", /* name */ + infopipe_iface_GetUserAttr__in, + infopipe_iface_GetUserAttr__out, + offsetof(struct infopipe_iface, GetUserAttr), + NULL, /* no invoker */ + }, { NULL, } }; |