Manage users, groups and services of the ETH Identity and Access Management system (IAM)
Project description
ETHZ IAM Webservice
Manage users, groups and services of the ETH Identity and Access Management system (IAM)
Synopsis
Beginning
import ethz_iam_webservice
import getpass
e = ethz_iam_webservice.login('admin4iam', getpass.getpass())
Person
person = e.get_person('name@example.com')
person = e.get_person('some_username')
person = e.get_person(123456) # npid, the identifer of every person
person.usernames # an array of dicts of usernames
person.data # the whole response
person.firstname
person.familyname
person.email
# etc.
User
user = person.new_user('username', 'password', 'description')
user = e.get_user('username')
user.services # returns an array of dicts of services
user.grant_service("LDAPS")
user.grant_service("Active Directory")
user.grant_service("WLAN_VPN")
user.revoke_service("LDAP")
user.delete() # Method currently not allowed
user.add_to_group('groupname')
user.remove_from_group('groupname')
Group and Group Members
group = e.get_group('groupname')
group.data # all data received from webservice
group.members # returns array of usernames or group-names
group.gidNumber
...
group.add_members('some', 'new', 'members')
group.set_members('just', 'these')
group.del_members('remove', 'these', 'members')
groups = e.get_groups(agroup='ID SIS')
groups = e.get_groups(name='starts_with*')
groups = e.get_groups(agroup='ID SIS', name='starts_with*')
Mailinglists
ml = e.get_mailinglist('ID.SIS.SSDM')
ml = e.get_mailinglist('sis@id.ethz.ch')
ml.name
ml.mail
ml.gidNumber
ml.groupType
ml.displayName
...
ml.members # returns all (direct) members of that list
ml.add_members('user1', 'user2')
ml.del_members('user3, 'user4')
See also FAQ
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file ethz_iam_webservice-0.0.5.tar.gz
.
File metadata
- Download URL: ethz_iam_webservice-0.0.5.tar.gz
- Upload date:
- Size: 4.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9d754b10bd4c453d201ede091b6c2364fb5f78f175e0b2a75e037a448b19d5a4 |
|
MD5 | 6c9e33ecf04e489b828f02f232551322 |
|
BLAKE2b-256 | 41415978b460a1f5f66f161516a0584c4aa084bec5759107023af15cbdc10499 |