381c1c7 add whoami command

4 files Authored by abbra 7 years ago, Committed by mbasti 7 years ago,
    add whoami command
    
    Whoami command allows to query details about currently
    authenticated identity. The command returns following information:
    
      * object class name
      * function to call to get actual details about the object
      * arguments to pass to the function
    
    There are five types of objects that could bind to IPA using their
    credentials. `ipa whoami` call expects one of the following:
    
      * users
      * staged users
      * hosts
      * Kerberos services
      * ID user override from the default trust view
    
    The latter category of objects is automatically mapped by SASL GSSAPI
    mapping rule in 389-ds for users from trusted Active Directory forests.
    
    The command is expected to be used by Web UI to define proper view for
    the authenticated identity. It is not visible in the command line
    interface is `ipa` command.
    
    Below is an example of how communication looks like for a host
    principal:
    
       # kinit -k
       # ipa console
       (Custom IPA interactive Python console)
       >>> api.Command.whoami()
       {u'command': u'host_show/1', u'object': u'host', u'arguments': (u'ipa.example.com',)}
       >>>
    
    Fixes https://pagure.io/freeipa/issue/6643
    
    Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
    
        
file modified
+7 -0
file modified
+2 -2
file modified
+5 -0