Commit Graph

5675 Commits

Author SHA1 Message Date
Jan Cholasta
3aa39547df Support attributes with multiple names in LDAPEntry. 2013-03-01 16:59:47 +01:00
Jan Cholasta
f17aa00ff0 Aggregate IPASimpleLDAPObject in LDAPEntry. 2013-03-01 16:59:47 +01:00
Jan Cholasta
8f46ca5dd2 Preserve case of attribute names in LDAPEntry. 2013-03-01 16:59:46 +01:00
Jan Cholasta
bb36683c84 Use the dn attribute of LDAPEntry to set/get DNs of entries.
Convert all code that uses the 'dn' key of LDAPEntry for this to use the dn
attribute instead.
2013-03-01 16:59:46 +01:00
Petr Viktorin
982b782777 Remove some uses of raw python-ldap
Part of the work for: https://fedorahosted.org/freeipa/ticket/2660
2013-03-01 16:59:46 +01:00
Petr Viktorin
29a02a3530 Use IPAdmin rather than raw python-ldap in ipactl
Add a new init argument, ldap_uri, to IPAdmin to make this possible.

Part of the work for: https://fedorahosted.org/freeipa/ticket/2660
2013-03-01 16:59:46 +01:00
Petr Viktorin
fe138877d3 Use IPAdmin rather than raw python-ldap in migration.bind
The get_base_dn function still uses python-ldap because
get_ipa_basedn is shared with client code, which doesn't have
access to uor LDAP wrappers.

Part of the work for: https://fedorahosted.org/freeipa/ticket/2660
2013-03-01 16:59:46 +01:00
Petr Viktorin
aef4c82f47 Do not use global variables in migration.py 2013-03-01 16:59:46 +01:00
Petr Viktorin
b39033cc65 Use ldap instead of _ldap in ipaldap
Part of the work for: https://fedorahosted.org/freeipa/ticket/2660
2013-03-01 16:59:46 +01:00
Petr Viktorin
334a0cdcdc Remove IPAdmin.unbind_s(), keep unbind()
The unbind and unbind_s functions do the same thing (both are synchronous).

In the low-level IPASimpleLDAPObject, unbind_s rather than unbind is kept.

Part of the work for: https://fedorahosted.org/freeipa/ticket/2660
2013-03-01 16:59:46 +01:00
Petr Viktorin
f7a4cceb97 Remove IPAdmin.simple_bind_s
Part of the work for: https://fedorahosted.org/freeipa/ticket/2660
2013-03-01 16:59:46 +01:00
Petr Viktorin
1ee66ffe03 Remove IPAdmin.sasl_interactive_bind_s
Also, rename remaining uses of SASL_AUTH to SASL_GSSAPI to better
reflect what it is.

Part of the work for: https://fedorahosted.org/freeipa/ticket/2660
2013-03-01 16:59:46 +01:00
Petr Viktorin
f9f6cd6e3a Replace IPAdmin.start_tls_s by an __init__ argument
Part of the work for: https://fedorahosted.org/freeipa/ticket/2660
2013-03-01 16:59:46 +01:00
Petr Viktorin
8f44811a95 Remove search_s and search_ext_s from IPAdmin
Part of the work for: https://fedorahosted.org/freeipa/ticket/2660
2013-03-01 16:59:46 +01:00
Petr Viktorin
d7bf70902b Proxy LDAP methods explicitly rather than using __getattr__
Part of the work for: https://fedorahosted.org/freeipa/ticket/2660
2013-03-01 16:59:46 +01:00
Petr Viktorin
fdd4169124 Inline waitForEntry in its only caller
Part of the work for: https://fedorahosted.org/freeipa/ticket/2660
2013-03-01 16:59:45 +01:00
Petr Viktorin
fc571da1af Inline inactivateEntry in its only caller
Part of the work for: https://fedorahosted.org/freeipa/ticket/2660
2013-03-01 16:59:45 +01:00
Petr Viktorin
5184c312f6 replace getEntry with get_entry (or get_entries if scope != SCOPE_BASE)
Part of the work for: https://fedorahosted.org/freeipa/ticket/2660
2013-03-01 16:59:45 +01:00
Petr Viktorin
d17f9020a8 Fix typo and traceback suppression in replication.py 2013-03-01 16:59:45 +01:00
Petr Viktorin
e815c1893d Replace deleteEntry with delete_entry
Part of the work for: https://fedorahosted.org/freeipa/ticket/2660
2013-03-01 16:59:45 +01:00
Petr Viktorin
f8ad7cb96f Replace addEntry with add_entry
Part of the work for: https://fedorahosted.org/freeipa/ticket/2660
2013-03-01 16:59:45 +01:00
Petr Viktorin
aaa41b2145 Rename LDAPConnection to LDAPClient
It does more than just connecting, so it should have more suitable
name.

Part of the work for: https://fedorahosted.org/freeipa/ticket/2660
2013-03-01 16:59:45 +01:00
Petr Viktorin
a173957865 Remove toTupleList and attrList from LDAPEntry
Part of the work for: https://fedorahosted.org/freeipa/ticket/2660
2013-03-01 16:59:45 +01:00
Petr Viktorin
4779865ea3 Replace getList by a get_entries method
The find_entries method is cumbersome to use: it requires keyword arguments
for simple uses, and callers are tempted to ignore the 'truncated' flag
it returns.
Introduce a simpler method, get_entries, that returns the found
list directly, and raises an errors if the list is truncated.
Replace the getList method by get_entries.

Part of the work for: https://fedorahosted.org/freeipa/ticket/2660
2013-03-01 16:59:45 +01:00
Petr Viktorin
f5c404c65d Replace entry.getValue by entry.single_value
Part of the work for: https://fedorahosted.org/freeipa/ticket/2660
2013-03-01 16:59:45 +01:00
Petr Viktorin
66eaf1220d Remove special-casing for missing and single-valued attributes in LDAPUpdate._entry_to_entity 2013-03-01 16:59:45 +01:00
Petr Viktorin
6eeb5ecbea Introduce LDAPEntry.single_value for getting single-valued attributes
Part of the work for: https://fedorahosted.org/freeipa/ticket/2660
2013-03-01 16:59:45 +01:00
Petr Viktorin
5271eb217c Replace IPAdmin.checkTask by replication.wait_for_task
The method was only used for waiting, not actual checking.

Part of the work for: https://fedorahosted.org/freeipa/ticket/2660
2013-03-01 16:59:45 +01:00
Petr Viktorin
b69f6983e4 Remove IPAdmin.get_dns_sorted_by_length
A simple sort(key=len) is simpler both implementation-wise and
semantics-wise.

Part of the work for: https://fedorahosted.org/freeipa/ticket/2660
2013-03-01 16:59:44 +01:00
Petr Viktorin
607ff478f5 Remove IPAdmin.updateEntry calls from fix_replica_agreements
Part of the work for: https://fedorahosted.org/freeipa/ticket/2660
2013-03-01 16:59:44 +01:00
Petr Viktorin
8be8d4ebfd Remove dbdir, binddn, bindpwd from IPAdmin
The dbdir logic was moved to replication.py, the only caller.
The binddn and bindpwd attributes were unused.

Part of the work for: https://fedorahosted.org/freeipa/ticket/2660
2013-03-01 16:59:44 +01:00
Petr Viktorin
1960945e28 Turn the LDAPError handler into a context manager
This has the advantage that the traceback is left intact if an error
other than LDAPError is raised.

Part of the work for: https://fedorahosted.org/freeipa/ticket/2660
2013-03-01 16:59:44 +01:00
Petr Viktorin
d11c337541 Remove unused bindcert and bindkey arguments to IPAdmin
Part of the work for: https://fedorahosted.org/freeipa/ticket/2660
2013-03-01 16:59:44 +01:00
Petr Viktorin
334ba2e79f Remove unused imports from ipaserver/install
Part of the work for: https://fedorahosted.org/freeipa/ticket/2660
2013-03-01 16:59:44 +01:00
Petr Viktorin
abb22806a7 Change {add,update,delete}_entry to take LDAPEntries
These methods currently take (dn, entry_attrs, normalize=True)
(or (dn, normalize=True) for delete).
Change them to also accept just an LDAPEntry.
For add and update, document the old style as deprecated.

Part of the work for: https://fedorahosted.org/freeipa/ticket/2660
2013-03-01 16:59:44 +01:00
Petr Viktorin
aa6fb75637 Replace add_s and delete_s by their newer equivalents
Part of the work for: https://fedorahosted.org/freeipa/ticket/2660
2013-03-01 16:59:44 +01:00
Petr Viktorin
66c7fd1323 Replace entry.setValue/setValues by item assignment
Part of the work for: https://fedorahosted.org/freeipa/ticket/2660
2013-03-01 16:59:44 +01:00
Petr Viktorin
c613caab67 Replace entry.getValues() by entry.get()
Part of the work for: https://fedorahosted.org/freeipa/ticket/2660
2013-03-01 16:59:44 +01:00
Petr Viktorin
b2dd8d7f05 Use update_entry with a single entry in adtrustinstance
Part of the work for: https://fedorahosted.org/freeipa/ticket/2660
2013-03-01 16:59:44 +01:00
Petr Viktorin
3dd4b36e1a Replace setValue by keyword arguments when creating entries
Part of the work for: https://fedorahosted.org/freeipa/ticket/2660
2013-03-01 16:59:44 +01:00
Jan Cholasta
6896626baa Remove the Entry class. 2013-03-01 16:59:43 +01:00
Jan Cholasta
c1d6937ea2 Remove the Entity class.
Move Entity functionality to LDAPEntry.
2013-03-01 16:59:43 +01:00
Jan Cholasta
8d92ca851c Add make_entry factory method to LDAPConnection.
Replace all occurences of Entry instantiation with calls to make_entry.
2013-03-01 16:59:43 +01:00
Petr Viktorin
d9b3c91d47 Implement some of IPAdmin's legacy methods in terms of LDAPConnection methods
These will serve as templates for changes in the calling code.

Part of the work for: https://fedorahosted.org/freeipa/ticket/2660
2013-03-01 16:59:43 +01:00
Petr Viktorin
a7a81238a8 Move entry add, update, remove, rename to LDAPConnection
Also remove _FORCE_REPLACE_ON_UPDATE_ATTRS which was never used.

Part of the work for: https://fedorahosted.org/freeipa/ticket/2660
2013-03-01 16:59:43 +01:00
Petr Viktorin
603d9ac418 Remove unused proxydn functionality from IPAdmin
Part of the work for: https://fedorahosted.org/freeipa/ticket/2660
2013-03-01 16:59:43 +01:00
Petr Viktorin
0c26913309 Move entry finding methods to LDAPConnection
The get_ipa_config method relies on IPA being installed.
Leave the implementation in ldap2, and add stub get_ipa_config that
simply returns an empty dictionary to LDAPConnection.

The get_members method contains an optimization that also relies on
the api object. The optimization is disabled in base LDAPConfig.

Part of the work for: https://fedorahosted.org/freeipa/ticket/2660
2013-03-01 16:59:43 +01:00
Petr Viktorin
ddee3aa900 Move filter making methods to LDAPConnection
Part of the work for: https://fedorahosted.org/freeipa/ticket/2660
2013-03-01 16:59:43 +01:00
Petr Viktorin
6fb115751c Move DN handling methods to LDAPConnection
ldap2 has "DN normalization" functionality, which silently adds the base
DN to DNs that don't already end with it.
This functionality is left in the ldap2 class only.

Part of the work for: https://fedorahosted.org/freeipa/ticket/2660
2013-03-01 16:59:43 +01:00
Petr Viktorin
44e15206d0 Move schema-related methods to LDAPConnection
Part of the work for: https://fedorahosted.org/freeipa/ticket/2660
2013-03-01 16:59:43 +01:00