diff options
author | Simo Sorce <ssorce@redhat.com> | 2007-10-01 17:33:16 -0400 |
---|---|---|
committer | Simo Sorce <ssorce@redhat.com> | 2007-10-01 17:33:16 -0400 |
commit | cfac4acf9fb152d685e342bd5adabb5ec2fa2c74 (patch) | |
tree | 07320a043e63ca21db1df716a47115984407d6ba /ipa-python/rpcclient.py | |
parent | 5750ebdd831f7f3e2dd5c08031a258ee448c7afa (diff) | |
download | freeipa-cfac4acf9fb152d685e342bd5adabb5ec2fa2c74.tar.gz freeipa-cfac4acf9fb152d685e342bd5adabb5ec2fa2c74.tar.xz freeipa-cfac4acf9fb152d685e342bd5adabb5ec2fa2c74.zip |
Rely more on kerberos.
Don't read ipa.conf to get the realm, the kerberos libs do that for you.
Use the krbPrincipalName to change passwords
Make it possible to specify the principal at user creation.
Mail is not a required attribute so far, don't require it.
Diffstat (limited to 'ipa-python/rpcclient.py')
-rw-r--r-- | ipa-python/rpcclient.py | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/ipa-python/rpcclient.py b/ipa-python/rpcclient.py index 9f02b374..0327357d 100644 --- a/ipa-python/rpcclient.py +++ b/ipa-python/rpcclient.py @@ -84,7 +84,7 @@ class RPCClient: raise xmlrpclib.Fault(value, msg) return ipautil.unwrap_binary_data(result) - + def get_user_by_dn(self,dn,sattrs=None): """Get a specific user. If sattrs is not None then only those attributes will be returned, otherwise all available @@ -101,6 +101,22 @@ class RPCClient: return ipautil.unwrap_binary_data(result) + def get_user_by_principal(self,principal,sattrs=None): + """Get a specific user. If sattrs is not None then only those + attributes will be returned, otherwise all available + attributes are returned. The result is a dict.""" + server = self.setup_server() + if sattrs is None: + sattrs = "__NONE__" + try: + result = server.get_user_by_principal(principal, sattrs) + except xmlrpclib.Fault, fault: + raise ipaerror.gen_exception(fault.faultCode, fault.faultString) + except socket.error, (value, msg): + raise xmlrpclib.Fault(value, msg) + + return ipautil.unwrap_binary_data(result) + def get_users_by_manager(self,manager_dn,sattrs=None): """Gets the users that report to a manager. If sattrs is not None then only those @@ -212,7 +228,7 @@ class RPCClient: return result - def modifyPassword(self,uid,oldpass,newpass): + def modifyPassword(self,principal,oldpass,newpass): """Modify a user's password""" server = self.setup_server() @@ -220,7 +236,7 @@ class RPCClient: oldpass = "__NONE__" try: - result = server.modifyPassword(uid,oldpass,newpass) + result = server.modifyPassword(principal,oldpass,newpass) except xmlrpclib.Fault, fault: raise ipaerror.gen_exception(fault.faultCode, fault.faultString) except socket.error, (value, msg): |