diff options
author | Nico von Geyso <Nico.Geyso@FU-Berlin.de> | 2012-09-20 13:05:42 +0200 |
---|---|---|
committer | Nico von Geyso <Nico.Geyso@FU-Berlin.de> | 2012-09-20 13:45:53 +0200 |
commit | eb07f6e414551125a216f8556ffac77010feb60b (patch) | |
tree | 0d3831bd0f1d2d1d0ffca2959380944a2e95ef78 /README | |
parent | 4dddc4d5d2643c6f561a3f79b82aec16381a58d7 (diff) | |
download | web-eb07f6e414551125a216f8556ffac77010feb60b.tar.gz web-eb07f6e414551125a216f8556ffac77010feb60b.tar.bz2 web-eb07f6e414551125a216f8556ffac77010feb60b.zip |
Updated AccountService API
AccountService is now stateless. That means every request needs its own authentication
request (bind).
Usage examples:
* register a new user
>> service = AccountService(LDAP_HOST, LDAP_BASE_DN,SERVICES)
>> foo = Account('foo','foo@bar.de', password='bar')
>> service.register(foo, LDAP_ADMIN_USER, LDAP_ADMIN_PASS)
* authenticate a new user
>> service = AccountService(LDAP_HOST, LDAP_BASE_DN,SERVICES)
>> foo = service.auth('foo', 'bar')
* updates an account
>> foo.change_mail('a@b.de')
>> foo.change_password('bar2') # changes root password
>> foo.change_password('bar2', 'gitlab') # changes password for gitlab
>> service.update(foo) # save changes in ldap backend
# save changes in ldap backend as admin user
>> service.update(foo, LDAP_ADMIN_USER, LDAP_ADMIN_USER)
* delete an account
>> service = AccountService(LDAP_HOST, LDAP_BASE_DN,SERVICES)
>> service.delete(Account)
>> service.delete('foo')
* find accounts
>> service = AccountService(LDAP_HOST, LDAP_BASE_DN,SERVICES)
>> all_accounts = service.find(LDAP_ADMIN_USER, LDAP_ADMIN_PASS)
>> print([x.uid for x in all_accounts])
Diffstat (limited to 'README')
0 files changed, 0 insertions, 0 deletions