diff --git a/docs/source/conf.py b/docs/source/conf.py index b354c21..7c0f2b4 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -60,9 +60,9 @@ author = 'Marcos Pereira' # built documents. # # The short X.Y version. -version = '0.9.0' +version = '0.10.0' # The full version, including alpha/beta/rc tags. -release = '0.9.0' +release = '0.10.0' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/docs/source/index.rst b/docs/source/index.rst index 8abc8d9..86f51ce 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -43,6 +43,7 @@ python-keycloak depends on: * Python 3 * `requests `_ * `python-jose `_ +* `simplejson `_ Tests Dependencies ------------------ @@ -169,14 +170,23 @@ Main methods:: # Get clients belonging to the realm Returns a list of clients belonging to the realm clients = keycloak_admin.get_clients() + # Get client - id (not client-id) from client by name + client_id=keycloak_admin.get_client_id("my-client") + # Get representation of the client - id of client (not client-id) - client = keycloak_admin.get_client(client_id='id-client') + client_roles = keycloak_admin.get_client_role(client_id=client_id) # Get all roles for the client - client_roles = keycloak_admin.get_client_role(client_id='id-client') + client_roles = keycloak_admin.get_client_role(client_id=client_id) + + # Create client role + keycloak_admin.create_client_role(client_id, "test") + # Get client role id from name + role_id = keycloak_admin.get_client_role_id(client_id=client_id, role_name="test") # Get all roles for the realm or client realm_roles = keycloak_admin.get_roles() - + # Assign client role to user. Note that BOTH role_name and role_id appear to be required. + keycloak_admin.assign_client_role(client_id=client_id, user_id=user_id, role_id=role_id, role_name="test") diff --git a/setup.py b/setup.py index 8a06a58..aeeb53c 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ from setuptools import setup setup( name='python-keycloak', - version='0.9.0', + version='0.10.0', url='https://bitbucket.org/agriness/python-keycloak', license='GNU General Public License - V3', author='Marcos Pereira', @@ -12,7 +12,7 @@ setup( keywords='keycloak openid', description=u'python-keycloak is a Python package providing access to the Keycloak API.', packages=['keycloak', 'keycloak.authorization', 'keycloak.tests'], - install_requires=['requests==2.18.3', 'httmock==1.2.5', 'python-jose==1.3.2'], + install_requires=['requests==2.18.3', 'httmock==1.2.5', 'python-jose==1.3.2', 'simplejson'], classifiers=[ 'Programming Language :: Python :: 3', 'License :: OSI Approved :: GNU General Public License v3 (GPLv3)',