Browse Source

Updated docs

pull/12/head
Marcos Pereira 7 years ago
parent
commit
bf7fbeea63
  1. 20
      docs/source/conf.py
  2. 22
      docs/source/index.md
  3. 100
      docs/source/index.rst

20
docs/source/conf.py

@ -31,7 +31,12 @@ import sphinx_rtd_theme
# Add any Sphinx extension module names here, as strings. They can be # Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones. # ones.
extensions = ['sphinx.ext.autodoc']
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.intersphinx',
'sphinx.ext.todo',
'sphinx.ext.viewcode',
]
# Add any paths that contain templates here, relative to this directory. # Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates'] templates_path = ['_templates']
@ -40,7 +45,7 @@ templates_path = ['_templates']
# You can specify multiple suffix as a list of string: # You can specify multiple suffix as a list of string:
# #
# source_suffix = ['.rst', '.md'] # source_suffix = ['.rst', '.md']
source_suffix = '.md'
source_suffix = '.rst'
# The master toctree document. # The master toctree document.
master_doc = 'index' master_doc = 'index'
@ -71,11 +76,14 @@ language = None
# This patterns also effect to html_static_path and html_extra_path # This patterns also effect to html_static_path and html_extra_path
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
add_function_parentheses = False
add_module_names = True
# The name of the Pygments (syntax highlighting) style to use. # The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx' pygments_style = 'sphinx'
# If true, `todo` and `todoList` produce output, else they produce nothing. # If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = False
todo_include_todos = True
# -- Options for HTML output ---------------------------------------------- # -- Options for HTML output ----------------------------------------------
@ -97,6 +105,12 @@ html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
# so a file named "default.css" will overwrite the builtin "default.css". # so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static'] html_static_path = ['_static']
html_use_smartypants = False
html_show_sourcelink = False
html_show_sphinx = False
html_show_copyright = True
# Custom sidebar templates, must be a dictionary that maps document names # Custom sidebar templates, must be a dictionary that maps document names
# to template names. # to template names.
# #

22
docs/source/index.md

@ -1,22 +0,0 @@
.. python-keycloak documentation master file, created by
sphinx-quickstart on Tue Aug 15 11:02:59 2017.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to python-keycloak's documentation!
===========================================
Contents:
.. toctree::
:maxdepth: 2
:caption: Contents:
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`

100
docs/source/index.rst

@ -0,0 +1,100 @@
.. python-keycloak documentation master file, created by
sphinx-quickstart on Tue Aug 15 11:02:59 2017.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
.. toctree::
:maxdepth: 2
:caption: Contents:
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
.. image:: https://travis-ci.org/marcospereirampj/python-keycloak.svg?branch=master
:target: https://travis-ci.org/marcospereirampj/python-keycloak
.. image:: https://readthedocs.org/projects/python-keycloak/badge/?version=latest
:target: http://python-keycloak.readthedocs.io/en/latest/?badge=latest
Welcome to python-keycloak's documentation!
===========================================
**python-keycloak** is a Python package providing access to the Keycloak API.
Installation
==================
Via Pypi Package::
$ pip install python-keycloak
Manually::
$ python setup.py install
Dependencies
==================
python-keycloak depends on:
* Python 3
* `requests <http://docs.python-requests.org/en/master/>`_
Tests Dependencies
------------------
* unittest
* `httmock <https://github.com/patrys/httmock>`_
Bug reports
==================
Please report bugs and feature requests at
`https://github.com/marcospereirampj/python-keycloak/issues <https://github.com/marcospereirampj/python-keycloak/issues>`_
Documentation
==================
The documentation for python-keycloak is available on `readthedocs <http://python-keycloak.readthedocs.io>`_.
Usage
=====
Main methods::
from keycloak import Keycloak
# Configure client
keycloak = Keycloak(server_url="http://localhost:8080/auth/",
client_id="example_client",
realm_name="example_realm",
client_secret_key="secret")
# Get WellKnow
config_well_know = keycloak.well_know()
# Get Token
token = keycloak.token("user", "password")
# Get Userinfo
userinfo = keycloak.userinfo(token['access_token'])
# Logout
keycloak.logout(token['refresh_token'])
# Get Certs
certs = keycloak.certs()
# Get RPT (Entitlement)
token = keycloak.token("user", "password")
rpt = keycloak.entitlement(token['access_token'], "resource_id")
# Instropect
keycloak.instropect(token['access_token'], rpt['rpt'])
Loading…
Cancel
Save