Skip to content

dj-wasabi/python-syncope

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Work in progress

Documentation Status Documentation Status

####Table of Contents

  1. Overview
  2. Requirements
  3. Syncope Version
  4. Installing this role
  5. Some Examples
  6. Documentation
  7. License

#Overview

python-syncope is an python wrapper around the Syncope Rest API. At the moment, only some user specific actions can be executed against an Syncope instance. Also basic python tests are missing and not all documentation is created.

#Requirements

  • requests

#Syncope Versions

At the moment, the python-syncope will only work on the Syncope 1.1.x releases. Goal is that it will support 1.2 too.

Python syncope 1.1 syncope 1.2
2.7

#Installation

pip install python-syncope

#Small example

How to use syncope:

import syncope
syn = syncope.Syncope(syncope_url="http://192.168.10.13:9080", username="admin", password="password")

print syn.suspend_user_by_name("puccini")
print syn.reactivate_user_by_name("puccini")
print syn.reactivate_user_by_name("puccini")

Output:

{u'status': u'suspended', u'username': u'puccini', u'creationDate': 1287572400000, u'derivedAttributes': [], u'failedLogins': 0, u'tokenExpireTime': None, u'memberships': [{u'derivedAttributes': [], u'roleName': u'artDirector', u'virtualAttributes': [], u'resources': [], u'roleId': 14, u'attributes': [], u'id': 7, u'propagationStatusTOs': []}], u'token': None, u'virtualAttributes': [], u'resources': [], u'lastLoginDate': None, u'changePwdDate': None, u'attributes': [{u'readonly': False, u'values': [u'Giacomo'], u'schema': u'firstname'}, {u'readonly': False, u'values': [u'Puccini'], u'schema': u'surname'}, {u'readonly': False, u'values': [u'Giacomo Puccini'], u'schema': u'fullname'}, {u'readonly': False, u'values': [u'puccini@apache.org'], u'schema': u'userId'}], u'password': u'5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', u'id': 5, u'propagationStatusTOs': []}
{u'status': u'active', u'username': u'puccini', u'creationDate': 1287572400000, u'derivedAttributes': [], u'failedLogins': 0, u'tokenExpireTime': None, u'memberships': [{u'derivedAttributes': [], u'roleName': u'artDirector', u'virtualAttributes': [], u'resources': [], u'roleId': 14, u'attributes': [], u'id': 7, u'propagationStatusTOs': []}], u'token': None, u'virtualAttributes': [], u'resources': [], u'lastLoginDate': None, u'changePwdDate': None, u'attributes': [{u'readonly': False, u'values': [u'Giacomo'], u'schema': u'firstname'}, {u'readonly': False, u'values': [u'Puccini'], u'schema': u'surname'}, {u'readonly': False, u'values': [u'Giacomo Puccini'], u'schema': u'fullname'}, {u'readonly': False, u'values': [u'puccini@apache.org'], u'schema': u'userId'}], u'password': u'5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', u'id': 5, u'propagationStatusTOs': []}
False

#Documentation

Documentation can be found at readthedocs

#License

python-syncope is licensed under the Apache License 2.0. Check the LICENSE file.