mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Merge.
This commit is contained in:
@@ -14,8 +14,6 @@ Requires: PyKerberos
|
||||
|
||||
%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
|
||||
|
||||
%define pkgpythondir %{python_sitelib}/ipa
|
||||
|
||||
%description
|
||||
Ipa is a server for identity, policy, and audit.
|
||||
|
||||
@@ -33,8 +31,7 @@ rm -rf %{buildroot}
|
||||
|
||||
%files
|
||||
%defattr(-,root,root,-)
|
||||
%dir %{pkgpythondir}
|
||||
%{pkgpythondir}/*
|
||||
%{python_sitelib}/*
|
||||
%config(noreplace) %{_sysconfdir}/ipa/ipa.conf
|
||||
|
||||
%changelog
|
||||
|
||||
@@ -14,8 +14,6 @@ Requires: PyKerberos
|
||||
|
||||
%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
|
||||
|
||||
%define pkgpythondir %{python_sitelib}/ipa
|
||||
|
||||
%description
|
||||
Ipa is a server for identity, policy, and audit.
|
||||
|
||||
@@ -33,8 +31,7 @@ rm -rf %{buildroot}
|
||||
|
||||
%files
|
||||
%defattr(-,root,root,-)
|
||||
%dir %{pkgpythondir}
|
||||
%{pkgpythondir}/*
|
||||
%{python_sitelib}/*
|
||||
%config(noreplace) %{_sysconfdir}/ipa/ipa.conf
|
||||
|
||||
%changelog
|
||||
|
||||
@@ -19,14 +19,10 @@
|
||||
|
||||
#!/usr/bin/python
|
||||
|
||||
import sys
|
||||
|
||||
import ipa.rpcclient as rpcclient
|
||||
import entity
|
||||
import user
|
||||
import group
|
||||
import ipa
|
||||
import config
|
||||
import radius_util
|
||||
|
||||
class IPAClient:
|
||||
|
||||
@@ -129,14 +129,14 @@ LDAP_NO_CONFIG = gen_error_code(
|
||||
"IPA configuration not found")
|
||||
|
||||
#
|
||||
# Input errors (sample - replace me)
|
||||
# Function input errors
|
||||
#
|
||||
INPUT_CATEGORY = 0x0002
|
||||
|
||||
INPUT_INVALID_ERROR = gen_error_code(
|
||||
INPUT_INVALID_PARAMETER = gen_error_code(
|
||||
INPUT_CATEGORY,
|
||||
0x0001,
|
||||
"Illegal input")
|
||||
"Invalid parameter(s)")
|
||||
|
||||
#
|
||||
# Connection errors
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#
|
||||
|
||||
SHARE_DIR = "/usr/share/ipa/"
|
||||
PLUGINS_SHARE_DIR = "/usr/share/ipa/plugins"
|
||||
|
||||
import string
|
||||
import tempfile
|
||||
|
||||
@@ -79,7 +79,7 @@ RADIUS_USER = 'radiusd'
|
||||
RADIUS_IPA_KEYTAB_FILEPATH = os.path.join(RADIUS_PKG_CONFIG_DIR, 'ipa.keytab')
|
||||
RADIUS_LDAP_ATTR_MAP_FILEPATH = os.path.join(RADIUS_PKG_CONFIG_DIR, 'ldap.attrmap')
|
||||
RADIUSD_CONF_FILEPATH = os.path.join(RADIUS_PKG_CONFIG_DIR, 'radiusd.conf')
|
||||
RADIUSD_CONF_TEMPLATE_FILEPATH = os.path.join(ipautil.SHARE_DIR, 'radius.radiusd.conf.template')
|
||||
RADIUSD_CONF_TEMPLATE_FILEPATH = os.path.join(ipautil.PLUGINS_SHARE_DIR, 'radius.radiusd.conf.template')
|
||||
|
||||
RADIUSD = '/usr/sbin/radiusd'
|
||||
|
||||
|
||||
@@ -24,11 +24,8 @@ import socket
|
||||
import config
|
||||
from krbtransport import KerbTransport
|
||||
from kerberos import GSSError
|
||||
import os
|
||||
import base64
|
||||
import user
|
||||
import ipa
|
||||
from ipa import ipaerror, ipautil
|
||||
from ipa import config
|
||||
|
||||
# Some errors to catch
|
||||
# http://cvs.fedora.redhat.com/viewcvs/ldapserver/ldap/servers/plugins/pam_passthru/README?root=dirsec&rev=1.6&view=auto
|
||||
@@ -36,7 +33,7 @@ from ipa import ipaerror, ipautil
|
||||
class RPCClient:
|
||||
|
||||
def __init__(self):
|
||||
ipa.config.init_config()
|
||||
config.init_config()
|
||||
|
||||
def server_url(self):
|
||||
"""Build the XML-RPC server URL from our configuration"""
|
||||
@@ -47,25 +44,6 @@ class RPCClient:
|
||||
authentication"""
|
||||
return xmlrpclib.ServerProxy(self.server_url(), KerbTransport())
|
||||
|
||||
def convert_entry(self,ent):
|
||||
# Convert into a dict. We need to handle multi-valued attributes as well
|
||||
# so we'll convert those into lists.
|
||||
obj={}
|
||||
for (k) in ent:
|
||||
k = k.lower()
|
||||
if obj.get(k) is not None:
|
||||
if isinstance(obj[k],list):
|
||||
obj[k].append(ent[k].strip())
|
||||
else:
|
||||
first = obj[k]
|
||||
obj[k] = ()
|
||||
obj[k].append(first)
|
||||
obj[k].append(ent[k].strip())
|
||||
else:
|
||||
obj[k] = ent[k]
|
||||
|
||||
return obj
|
||||
|
||||
# Higher-level API
|
||||
|
||||
def get_aci_entry(self, sattrs=None):
|
||||
@@ -168,7 +146,8 @@ class RPCClient:
|
||||
|
||||
def get_user_by_email(self,email,sattrs=None):
|
||||
"""Get a specific user's entry. Return as a dict of values.
|
||||
Multi-valued fields are represented as lists.
|
||||
Multi-valued fields are represented as lists. The result is a
|
||||
dict.
|
||||
"""
|
||||
server = self.setup_server()
|
||||
if sattrs is None:
|
||||
@@ -245,7 +224,7 @@ class RPCClient:
|
||||
return ipautil.unwrap_binary_data(result)
|
||||
|
||||
def get_all_users (self):
|
||||
"""Return a list containing a User object for each existing user."""
|
||||
"""Return a list containing a dict for each existing user."""
|
||||
|
||||
server = self.setup_server()
|
||||
try:
|
||||
@@ -258,7 +237,7 @@ class RPCClient:
|
||||
return ipautil.unwrap_binary_data(result)
|
||||
|
||||
def find_users (self, criteria, sattrs=None, searchlimit=0, timelimit=-1):
|
||||
"""Return a list: counter followed by a User object for each user that
|
||||
"""Return a list: counter followed by a dict for each user that
|
||||
matches the criteria. If the results are truncated, counter will
|
||||
be set to -1"""
|
||||
|
||||
@@ -381,6 +360,8 @@ class RPCClient:
|
||||
except socket.error, (value, msg):
|
||||
raise xmlrpclib.Fault(value, msg)
|
||||
|
||||
return ipautil.unwrap_binary_data(result)
|
||||
|
||||
def find_groups (self, criteria, sattrs=None, searchlimit=0, timelimit=-1):
|
||||
"""Return a list containing a Group object for each group that matches
|
||||
the criteria."""
|
||||
|
||||
@@ -34,7 +34,7 @@ def setup_package():
|
||||
|
||||
try:
|
||||
setup(
|
||||
name = "freeipa-python",
|
||||
name = "ipa",
|
||||
version = "0.5.0",
|
||||
license = "GPL",
|
||||
author = "Karl MacMillan, et.al.",
|
||||
|
||||
Reference in New Issue
Block a user