-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removed everything non-essentual to mldap2 to make an "mldap-2.0"
release.
- Loading branch information
Showing
14 changed files
with
27 additions
and
3,225 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
include README.md | ||
recursive-include mldap/ | ||
recursive-include mldap2/ | ||
recursive-exclude * *.py[co] | ||
recursive-exclude * *.py[co] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
# MLDAP Doc | ||
|
||
`mldap` is a thin wrapper around the python-ldap library written to operate | ||
against our 2003-based Active Directory. | ||
|
||
Specifically, it is used to programmatically create, delete, modify, and | ||
query active directory via the LDAP protocol. | ||
`mldap2` is a thin wrapper around the python-ldap library written to | ||
operate against our 2003-based Active Directory.Specifically, it is | ||
used to programmatically create, delete, modify, and query active | ||
directory via the LDAP protocol by lifting the programmer away from | ||
the context of working with LDAP and filters to working with user | ||
attributes and groups. | ||
|
||
# GOTCHA'S | ||
|
||
|
@@ -19,27 +20,31 @@ adding `TLS_REQCERT allow` was a satisfactory work-around. | |
|
||
# INSTALLATION | ||
|
||
Drop mldap.py into your python include path and include it. You will need | ||
to create a configuration file for your network (default location is in | ||
/etc/ldap.creds). | ||
Drop mldap.py into your python include path and include it. | ||
|
||
credsfile example: | ||
``` | ||
[LDAP] | ||
SERVER=ldap://my.server.url | ||
[email protected] | ||
PASSWORD=some_base64_encoded_str= | ||
BASE=dc=my,dc=domain,dc=url | ||
DOMAIN=my.domain.url | ||
``` | ||
|
||
EXAMPLES | ||
======== | ||
# EXAMPLES | ||
|
||
## Basic connection, verify a user account. | ||
```python | ||
>>> include mldap | ||
>>> ad = mldap.mldap() | ||
>>> ad = mldap2.connect({'LDAP_USERNAME': 'your-ad-user@your-domain', | ||
... 'LDAP_PASSWORD': 'xxxxx', | ||
... 'LDAP_BASE': 'dc=YOUR,dc=DOMAIN'}) | ||
>>> ad.exists('some-username') | ||
True | ||
``` | ||
|
||
## Operate on a series of accounts (for instance, to change mail domains.) | ||
```python | ||
ad = mldap2.connect('''creds''') | ||
users = ad.getusers_by_filter('mail', '*@olddomain.com') | ||
for user in users: | ||
user.mail.replace('@olddomain.com', '@newdomain.com') # user.mail is just a string. | ||
user.commit() # updates any modified fields. | ||
``` | ||
|
||
## Help! | ||
``` | ||
>>> help(ad) | ||
``` |
Oops, something went wrong.