[Python-modules-commits] [django-oauth-toolkit] 01/02: Imported Upstream version 0.8.1

Michael Fladischer fladi at moszumanska.debian.org
Tue Jun 23 19:54:03 UTC 2015


This is an automated email from the git hooks/post-receive script.

fladi pushed a commit to branch master
in repository django-oauth-toolkit.

commit 6c4c8464cdbec6177aac8acb0ee6b2174012cb38
Author: Michael Fladischer <FladischerMichael at fladi.at>
Date:   Fri Jun 19 17:49:54 2015 +0200

    Imported Upstream version 0.8.1
---
 .coveragerc                                        |   3 +
 .gitignore                                         |  47 +
 .pep8                                              |   3 +
 .travis.yml                                        |  28 +
 AUTHORS                                            |  15 +
 CONTRIBUTING.rst                                   |   5 +
 LICENSE                                            |  26 +
 MANIFEST.in                                        |   2 +
 README.rst                                         | 257 ++++++
 docs/Makefile                                      | 177 ++++
 docs/advanced_topics.rst                           |  74 ++
 docs/changelog.rst                                 | 165 ++++
 docs/conf.py                                       | 263 ++++++
 docs/contributing.rst                              |  99 +++
 docs/glossary.rst                                  |  41 +
 docs/index.rst                                     |  54 ++
 docs/install.rst                                   |  35 +
 docs/models.rst                                    |   5 +
 docs/rest-framework/getting_started.rst            | 234 +++++
 docs/rest-framework/permissions.rst                |  50 ++
 docs/rest-framework/rest-framework.rst             |   8 +
 docs/rfc.py                                        |  37 +
 docs/settings.rst                                  |  83 ++
 docs/tutorial/tutorial.rst                         |   9 +
 docs/tutorial/tutorial_01.rst                      | 149 ++++
 docs/tutorial/tutorial_02.rst                      |  65 ++
 docs/tutorial/tutorial_03.rst                      |  77 ++
 docs/views/application.rst                         |  12 +
 docs/views/class_based.rst                         |   3 +
 docs/views/details.rst                             |  26 +
 docs/views/function_based.rst                      |  65 ++
 docs/views/views.rst                               |  11 +
 oauth2_provider/__init__.py                        |   5 +
 oauth2_provider/admin.py                           |  13 +
 oauth2_provider/backends.py                        |  26 +
 oauth2_provider/compat.py                          |  39 +
 oauth2_provider/decorators.py                      |  84 ++
 oauth2_provider/exceptions.py                      |  17 +
 oauth2_provider/ext/__init__.py                    |   0
 oauth2_provider/ext/rest_framework/__init__.py     |   2 +
 .../ext/rest_framework/authentication.py           |  28 +
 oauth2_provider/ext/rest_framework/permissions.py  |  62 ++
 oauth2_provider/forms.py                           |  28 +
 oauth2_provider/generators.py                      |  46 +
 oauth2_provider/http.py                            |   9 +
 oauth2_provider/middleware.py                      |  34 +
 oauth2_provider/migrations/0001_initial.py         |  69 ++
 oauth2_provider/migrations/__init__.py             |   0
 oauth2_provider/models.py                          | 255 ++++++
 oauth2_provider/oauth2_backends.py                 | 147 ++++
 oauth2_provider/oauth2_validators.py               | 370 ++++++++
 oauth2_provider/settings.py                        | 137 +++
 oauth2_provider/south_migrations/0001_initial.py   | 159 ++++
 .../south_migrations/0002_adding_indexes.py        | 119 +++
 ...n_skip_authorization__chg_field_accesstoken_.py | 121 +++
 oauth2_provider/south_migrations/__init__.py       |   0
 oauth2_provider/templates/404.html                 |   6 +
 .../application_confirm_delete.html                |  19 +
 .../oauth2_provider/application_detail.html        |  42 +
 .../oauth2_provider/application_form.html          |  43 +
 .../oauth2_provider/application_list.html          |  20 +
 .../application_registration_form.html             |  10 +
 .../templates/oauth2_provider/authorize.html       |  40 +
 .../templates/oauth2_provider/base.html            |  51 ++
 oauth2_provider/tests/__init__.py                  |   0
 oauth2_provider/tests/models.py                    |   6 +
 oauth2_provider/tests/settings.py                  | 130 +++
 oauth2_provider/tests/test_application_views.py    |  81 ++
 oauth2_provider/tests/test_auth_backends.py        | 136 +++
 oauth2_provider/tests/test_authorization_code.py   | 954 +++++++++++++++++++++
 oauth2_provider/tests/test_client_credential.py    | 187 ++++
 oauth2_provider/tests/test_decorators.py           |  94 ++
 oauth2_provider/tests/test_generator.py            |  36 +
 oauth2_provider/tests/test_implicit.py             | 256 ++++++
 oauth2_provider/tests/test_mixins.py               |  96 +++
 oauth2_provider/tests/test_models.py               | 135 +++
 oauth2_provider/tests/test_oauth2_backends.py      |  18 +
 oauth2_provider/tests/test_oauth2_validators.py    | 104 +++
 oauth2_provider/tests/test_password.py             | 104 +++
 oauth2_provider/tests/test_rest_framework.py       | 155 ++++
 oauth2_provider/tests/test_scopes.py               | 458 ++++++++++
 oauth2_provider/tests/test_token_revocation.py     | 144 ++++
 oauth2_provider/tests/test_utils.py                |  17 +
 oauth2_provider/tests/test_validators.py           |  37 +
 oauth2_provider/tests/urls.py                      |  11 +
 oauth2_provider/urls.py                            |  21 +
 oauth2_provider/validators.py                      |  64 ++
 oauth2_provider/views/__init__.py                  |   4 +
 oauth2_provider/views/application.py               |  62 ++
 oauth2_provider/views/base.py                      | 191 +++++
 oauth2_provider/views/generic.py                   |  29 +
 oauth2_provider/views/mixins.py                    | 241 ++++++
 requirements/base.txt                              |   5 +
 requirements/optional.txt                          |   2 +
 requirements/project.txt                           |   2 +
 requirements/testing.txt                           |   3 +
 runtests.py                                        |  10 +
 setup.py                                           |  59 ++
 tox.ini                                            | 105 +++
 99 files changed, 8086 insertions(+)

diff --git a/.coveragerc b/.coveragerc
new file mode 100644
index 0000000..d1e8992
--- /dev/null
+++ b/.coveragerc
@@ -0,0 +1,3 @@
+[run]
+source = oauth2_provider
+omit = */migrations/*
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..227bc50
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,47 @@
+*.py[cod]
+
+*.swp
+
+# C extensions
+*.so
+
+# Packages
+*.egg
+*.egg-info
+dist
+build
+eggs
+parts
+bin
+var
+sdist
+develop-eggs
+.installed.cfg
+lib
+lib64
+__pycache__
+
+# Installer logs
+pip-log.txt
+
+# Unit test / coverage reports
+.coverage
+.tox
+nosetests.xml
+
+# Translations
+*.mo
+
+# Mr Developer
+.mr.developer.cfg
+.project
+.pydevproject
+
+# PyCharm stuff
+.idea
+
+# Sphinx build dir
+_build
+
+# Sqlite database files
+*.sqlite
diff --git a/.pep8 b/.pep8
new file mode 100644
index 0000000..b6bc68e
--- /dev/null
+++ b/.pep8
@@ -0,0 +1,3 @@
+[pep8]
+max-line-length = 120
+exclude = docs,migrations,.tox
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..d859c41
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,28 @@
+language: python
+python: "2.7"
+
+env:
+  - TOX_ENV=py26-django14
+  - TOX_ENV=py26-django15
+  - TOX_ENV=py26-django16
+  - TOX_ENV=py27-django14
+  - TOX_ENV=py27-django15
+  - TOX_ENV=py27-django16
+  - TOX_ENV=py27-django17
+  - TOX_ENV=py33-django15
+  - TOX_ENV=py33-django16
+  - TOX_ENV=py33-django17
+  - TOX_ENV=py34-django15
+  - TOX_ENV=py34-django16
+  - TOX_ENV=py34-django17
+  - TOX_ENV=docs
+
+install:
+  - pip install tox
+  - pip install coveralls
+
+script:
+  - tox -e $TOX_ENV
+
+after_success:
+  - coveralls
diff --git a/AUTHORS b/AUTHORS
new file mode 100644
index 0000000..8fa585f
--- /dev/null
+++ b/AUTHORS
@@ -0,0 +1,15 @@
+Authors
+=======
+
+Massimiliano Pippi
+Federico Frenguelli
+
+Contributors
+============
+
+Stéphane Raimbault
+Emanuele Palazzetti
+David Fischer
+Ash Christopher
+Rodney Richardson
+Hiroki Kiyohara
diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst
new file mode 100644
index 0000000..69be21a
--- /dev/null
+++ b/CONTRIBUTING.rst
@@ -0,0 +1,5 @@
+Contributing
+============
+
+Thanks for your interest! We love contributions, so please feel free to fix bugs, improve things, provide documentation. Just `follow the
+guidelines <https://django-oauth-toolkit.readthedocs.org/en/latest/contributing.html>`_ and submit a PR.
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..13606c9
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,26 @@
+Copyright (c) 2013, Massimiliano Pippi, Federico Frenguelli and contributors
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met: 
+
+1. Redistributions of source code must retain the above copyright notice, this
+   list of conditions and the following disclaimer. 
+2. Redistributions in binary form must reproduce the above copyright notice,
+   this list of conditions and the following disclaimer in the documentation
+   and/or other materials provided with the distribution. 
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+The views and conclusions contained in the software and documentation are those
+of the authors and should not be interpreted as representing official policies, 
+either expressed or implied, of the FreeBSD Project.
diff --git a/MANIFEST.in b/MANIFEST.in
new file mode 100644
index 0000000..8afbbaf
--- /dev/null
+++ b/MANIFEST.in
@@ -0,0 +1,2 @@
+include README.rst LICENSE
+recursive-include oauth2_provider/templates *.html
diff --git a/README.rst b/README.rst
new file mode 100644
index 0000000..a9c17b2
--- /dev/null
+++ b/README.rst
@@ -0,0 +1,257 @@
+Django OAuth Toolkit
+====================
+
+*OAuth2 goodies for the Djangonauts!*
+
+.. image:: https://badge.fury.io/py/django-oauth-toolkit.png
+    :target: http://badge.fury.io/py/django-oauth-toolkit
+
+.. image:: https://pypip.in/d/django-oauth-toolkit/badge.png
+        :target: https://crate.io/packages/django-oauth-toolkit?version=latest
+
+.. image:: https://travis-ci.org/evonove/django-oauth-toolkit.png
+   :alt: Build Status
+   :target: https://travis-ci.org/evonove/django-oauth-toolkit
+
+.. image:: https://coveralls.io/repos/evonove/django-oauth-toolkit/badge.png
+   :alt: Coverage Status
+   :target: https://coveralls.io/r/evonove/django-oauth-toolkit
+
+If you are facing one or more of the following:
+ * Your Django app exposes a web API you want to protect with OAuth2 authentication,
+ * You need to implement an OAuth2 authorization server to provide tokens management for your infrastructure,
+
+Django OAuth Toolkit can help you providing out of the box all the endpoints, data and logic needed to add OAuth2
+capabilities to your Django projects. Django OAuth Toolkit makes extensive use of the excellent
+`OAuthLib <https://github.com/idan/oauthlib>`_, so that everything is
+`rfc-compliant <http://tools.ietf.org/html/rfc6749>`_.
+
+Support
+-------
+
+If you need support please send a message to the `Django OAuth Toolkit Google Group <http://groups.google.com/group/django-oauth-toolkit>`_
+
+Contributing
+------------
+
+We love contributions, so please feel free to fix bugs, improve things, provide documentation. Just `follow the
+guidelines <https://django-oauth-toolkit.readthedocs.org/en/latest/contributing.html>`_ and submit a PR.
+
+Requirements
+------------
+
+* Python 2.6, 2.7, 3.3, 3.4
+* Django 1.4, 1.5, 1.6, 1.7
+
+Installation
+------------
+
+Install with pip::
+
+    pip install django-oauth-toolkit
+
+Add `oauth2_provider` to your `INSTALLED_APPS`
+
+.. code-block:: python
+
+    INSTALLED_APPS = (
+        ...
+        'oauth2_provider',
+    )
+
+
+If you need an OAuth2 provider you'll want to add the following to your urls.py.
+Notice that `oauth2_provider` namespace is mandatory.
+
+.. code-block:: python
+
+    urlpatterns = patterns(
+        ...
+        url(r'^o/', include('oauth2_provider.urls', namespace='oauth2_provider')),
+    )
+
+Documentation
+--------------
+
+The `full documentation <https://django-oauth-toolkit.readthedocs.org/>`_ is on *Read the Docs*.
+
+License
+-------
+
+django-oauth-toolkit is released under the terms of the **BSD license**. Full details in ``LICENSE`` file.
+
+Roadmap / Todo list (help wanted)
+---------------------------------
+
+* OAuth1 support
+* OpenID connector
+* Nonrel storages support
+
+Changelog
+---------
+
+0.8.1 [2015-04-27]
+~~~~~~~~~~~~~~~~~~
+
+* South migrations fixed. Added new django migrations.
+
+0.8.0 [2015-03-27]
+~~~~~~~~~~~~~~~~~~
+
+* Several docs improvements and minor fixes
+* #185: fixed vulnerabilities on Basic authentication
+* #173: ProtectResourceMixin now allows OPTIONS requests
+* Fixed client_id and client_secret characters set
+* #169: hide sensitive informations in error emails
+* #161: extend search to all token types when revoking a token
+* #160: return empty response on successful token revocation
+* #157: skip authorization form with ``skip_authorization_completely`` class field
+* #155: allow custom uri schemes
+* fixed ``get_application_model`` on Django 1.7
+* fixed non rotating refresh tokens
+* #137: fixed base template
+* customized ``client_secret`` lenght
+* #38: create access tokens not bound to a user instance for *client credentials* flow
+
+0.7.2 [2014-07-02]
+~~~~~~~~~~~~~~~~~~
+
+* Don't pin oauthlib
+
+0.7.1 [2014-04-27]
+~~~~~~~~~~~~~~~~~~
+
+* Added database indexes to the OAuth2 related models to improve performances.
+
+**Warning: schema migration does not work for sqlite3 database, migration should be performed manually**
+
+0.7.0 [2014-03-01]
+~~~~~~~~~~~~~~~~~~
+
+* Created a setting for the default value for approval prompt.
+* Improved docs
+* Don't pin django-braces and six versions
+
+**Backwards incompatible changes in 0.7.0**
+
+* Make Application model truly "swappable" (introduces a new non-namespaced setting OAUTH2_PROVIDER_APPLICATION_MODEL)
+
+0.6.1 [2014-02-05]
+~~~~~~~~~~~~~~~~~~
+
+* added support for `scope` query parameter keeping backwards compatibility for the original `scopes` parameter.
+* __str__ method in Application model returns content of `name` field when available
+
+0.6.0 [2014-01-26]
+~~~~~~~~~~~~~~~~~~
+
+* oauthlib 0.6.1 support
+* Django dev branch support
+* Python 2.6 support
+* Skip authorization form via `approval_prompt` parameter
+
+**Bugfixes**
+
+* Several fixes to the docs
+* Issue #71: Fix migrations
+* Issue #65: Use OAuth2 password grant with multiple devices
+* Issue #84: Add information about login template to tutorial.
+* Issue #64: Fix urlencode clientid secret
+
+0.5.0 [2013-09-17]
+~~~~~~~~~~~~~~~~~~
+
+* oauthlib 0.6.0 support
+
+**Backwards incompatible changes in 0.5.0**
+
+* `backends.py` module has been renamed to `oauth2_backends.py` so you should change your imports whether
+  you're extending this module
+
+**Bugfixes**
+
+* Issue #54: Auth backend proposal to address #50
+* Issue #61: Fix contributing page
+* Issue #55: Add support for authenticating confidential client with request body params
+* Issue #53: Quote characters in the url query that are safe for Django but not for oauthlib
+
+0.4.1 [2013-09-06]
+~~~~~~~~~~~~~~~~~~
+
+* Optimize queries on access token validation
+
+0.4.0 [2013-08-09]
+~~~~~~~~~~~~~~~~~~
+
+**New Features**
+
+* Add Application management views, you no more need the admin to register, update and delete your application.
+* Add support to configurable application model
+* Add support for function based views
+
+**Backwards incompatible changes in 0.4.0**
+
+* `SCOPE` attribute in settings is now a dictionary to store `{'scope_name': 'scope_description'}`
+* Namespace 'oauth2_provider' is mandatory in urls. See issue #36
+
+**Bugfixes**
+
+* Issue #25: Bug in the Basic Auth parsing in Oauth2RequestValidator
+* Issue #24: Avoid generation of client_id with ":" colon char when using HTTP Basic Auth
+* Issue #21: IndexError when trying to authorize an application
+* Issue #9: Default_redirect_uri is mandatory when grant_type is implicit, authorization_code or all-in-one
+* Issue #22: Scopes need a verbose description
+* Issue #33: Add django-oauth-toolkit version on example main page
+* Issue #36: Add mandatory namespace to urls
+* Issue #31: Add docstring to OAuthToolkitError and FatalClientError
+* Issue #32: Add docstring to validate_uris
+* Issue #34: Documentation tutorial part1 needs corsheaders explanation
+* Issue #36: Add mandatory namespace to urls
+* Issue #45: Add docs for AbstractApplication
+* Issue #47: Add docs for views decorators
+
+
+0.3.2 [2013-07-10]
+~~~~~~~~~~~~~~~~~~
+
+* Bugfix #37: Error in migrations with custom user on Django 1.5
+
+0.3.1 [2013-07-10]
+~~~~~~~~~~~~~~~~~~
+
+* Bugfix #27: OAuthlib refresh token refactoring
+
+0.3.0 [2013-06-14]
+~~~~~~~~~~~~~~~~~~
+
+* `Django REST Framework <http://django-rest-framework.org/>`_ integration layer
+* Bugfix #13: Populate request with client and user in validate_bearer_token
+* Bugfix #12: Fix paths in documentation
+
+**Backwards incompatible changes in 0.3.0**
+
+* `requested_scopes` parameter in ScopedResourceMixin changed to `required_scopes`
+
+0.2.1 [2013-06-06]
+~~~~~~~~~~~~~~~~~~
+
+* Core optimizations
+
+0.2.0 [2013-06-05]
+~~~~~~~~~~~~~~~~~~
+
+* Add support for Django1.4 and Django1.6
+* Add support for Python 3.3
+* Add a default ReadWriteScoped view
+* Add tutorial to docs
+
+0.1.0 [2013-05-31]
+~~~~~~~~~~~~~~~~~~
+
+* Support OAuth2 Authorization Flows
+
+0.0.0 [2013-05-17]
+~~~~~~~~~~~~~~~~~~
+
+* Discussion with Daniel Greenfeld at Django Circus
+* Ignition
diff --git a/docs/Makefile b/docs/Makefile
new file mode 100644
index 0000000..8e9b89e
--- /dev/null
+++ b/docs/Makefile
@@ -0,0 +1,177 @@
+# Makefile for Sphinx documentation
+#
+
+# You can set these variables from the command line.
+SPHINXOPTS    =
+SPHINXBUILD   = sphinx-build
+PAPER         =
+BUILDDIR      = _build
+
+# User-friendly check for sphinx-build
+ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
+$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/)
+endif
+
+# Internal variables.
+PAPEROPT_a4     = -D latex_paper_size=a4
+PAPEROPT_letter = -D latex_paper_size=letter
+ALLSPHINXOPTS   = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
+# the i18n builder cannot share the environment and doctrees with the others
+I18NSPHINXOPTS  = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
+
+.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
+
+help:
+	@echo "Please use \`make <target>' where <target> is one of"
+	@echo "  html       to make standalone HTML files"
+	@echo "  dirhtml    to make HTML files named index.html in directories"
+	@echo "  singlehtml to make a single large HTML file"
+	@echo "  pickle     to make pickle files"
+	@echo "  json       to make JSON files"
+	@echo "  htmlhelp   to make HTML files and a HTML help project"
+	@echo "  qthelp     to make HTML files and a qthelp project"
+	@echo "  devhelp    to make HTML files and a Devhelp project"
+	@echo "  epub       to make an epub"
+	@echo "  latex      to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
+	@echo "  latexpdf   to make LaTeX files and run them through pdflatex"
+	@echo "  latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
+	@echo "  text       to make text files"
+	@echo "  man        to make manual pages"
+	@echo "  texinfo    to make Texinfo files"
+	@echo "  info       to make Texinfo files and run them through makeinfo"
+	@echo "  gettext    to make PO message catalogs"
+	@echo "  changes    to make an overview of all changed/added/deprecated items"
+	@echo "  xml        to make Docutils-native XML files"
+	@echo "  pseudoxml  to make pseudoxml-XML files for display purposes"
+	@echo "  linkcheck  to check all external links for integrity"
+	@echo "  doctest    to run all doctests embedded in the documentation (if enabled)"
+
+clean:
+	rm -rf $(BUILDDIR)/*
+
+html:
+	$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
+	@echo
+	@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
+
+dirhtml:
+	$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
+	@echo
+	@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
+
+singlehtml:
+	$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
+	@echo
+	@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
+
+pickle:
+	$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
+	@echo
+	@echo "Build finished; now you can process the pickle files."
+
+json:
+	$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
+	@echo
+	@echo "Build finished; now you can process the JSON files."
+
+htmlhelp:
+	$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
+	@echo
+	@echo "Build finished; now you can run HTML Help Workshop with the" \
+	      ".hhp project file in $(BUILDDIR)/htmlhelp."
+
+qthelp:
+	$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
+	@echo
+	@echo "Build finished; now you can run "qcollectiongenerator" with the" \
+	      ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
+	@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/DjangoOAuthToolkit.qhcp"
+	@echo "To view the help file:"
+	@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/DjangoOAuthToolkit.qhc"
+
+devhelp:
+	$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
+	@echo
+	@echo "Build finished."
+	@echo "To view the help file:"
+	@echo "# mkdir -p $$HOME/.local/share/devhelp/DjangoOAuthToolkit"
+	@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/DjangoOAuthToolkit"
+	@echo "# devhelp"
+
+epub:
+	$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
+	@echo
+	@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
+
+latex:
+	$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+	@echo
+	@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
+	@echo "Run \`make' in that directory to run these through (pdf)latex" \
+	      "(use \`make latexpdf' here to do that automatically)."
+
+latexpdf:
+	$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+	@echo "Running LaTeX files through pdflatex..."
+	$(MAKE) -C $(BUILDDIR)/latex all-pdf
+	@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
+
+latexpdfja:
+	$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+	@echo "Running LaTeX files through platex and dvipdfmx..."
+	$(MAKE) -C $(BUILDDIR)/latex all-pdf-ja
+	@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
+
+text:
+	$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
+	@echo
+	@echo "Build finished. The text files are in $(BUILDDIR)/text."
+
+man:
+	$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
+	@echo
+	@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
+
+texinfo:
+	$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
+	@echo
+	@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
+	@echo "Run \`make' in that directory to run these through makeinfo" \
+	      "(use \`make info' here to do that automatically)."
+
+info:
+	$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
+	@echo "Running Texinfo files through makeinfo..."
+	make -C $(BUILDDIR)/texinfo info
+	@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
+
+gettext:
+	$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
+	@echo
+	@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
+
+changes:
+	$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
+	@echo
+	@echo "The overview file is in $(BUILDDIR)/changes."
+
+linkcheck:
+	$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
+	@echo
+	@echo "Link check complete; look for any errors in the above output " \
+	      "or in $(BUILDDIR)/linkcheck/output.txt."
+
+doctest:
+	$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
+	@echo "Testing of doctests in the sources finished, look at the " \
+	      "results in $(BUILDDIR)/doctest/output.txt."
+
+xml:
+	$(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml
+	@echo
+	@echo "Build finished. The XML files are in $(BUILDDIR)/xml."
+
+pseudoxml:
+	$(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
+	@echo
+	@echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."
diff --git a/docs/advanced_topics.rst b/docs/advanced_topics.rst
new file mode 100644
index 0000000..5579e0c
--- /dev/null
+++ b/docs/advanced_topics.rst
@@ -0,0 +1,74 @@
+Advanced topics
++++++++++++++++
+
+
+Extending the Application model
+===============================
+
+An Application instance represents a :term:`Client` on the :term:`Authorization server`. Usually an Application is
+issued to client's developers after they log in on an Authorization Server and pass in some data
+which identify the Application itself (let's say, the application name). Django OAuth Toolkit
+provides a very basic implementation of the Application model containing only the data strictly
+required during all the OAuth processes but you will likely need some extra info, like application
+logo, acceptance of some user agreement and so on.
+
+.. class:: AbstractApplication(models.Model)
+
+    This is the base class implementing the bare minimum for Django OAuth Toolkit to work
+
+    * :attr:`client_id` The client identifier issued to the client during the registration process as described in :rfc:`2.2`
+    * :attr:`user` ref to a Django user
+    * :attr:`redirect_uris` The list of allowed redirect uri. The string consists of valid URLs separated by space
+    * :attr:`client_type` Client type as described in :rfc:`2.1`
+    * :attr:`authorization_grant_type` Authorization flows available to the Application
+    * :attr:`client_secret` Confidential secret issued to the client during the registration process as described in :rfc:`2.2`
+    * :attr:`name` Friendly name for the Application
+
+Django OAuth Toolkit lets you extend the AbstractApplication model in a fashion like Django's
+custom user models.
+
+If you need, let's say, application logo and user agreement acceptance field, you can to this in
+your Django app (provided that your app is in the list of the INSTALLED_APPS in your settings
+module)::
+
+    from django.db import models
+    from oauth2_provider.models import AbstractApplication
+
+    class MyApplication(AbstractApplication):
+        logo = models.ImageField()
+        agree = models.BooleanField()
+
+Then you need to tell Django OAuth Toolkit which model you want to use to represent applications.
+Write something like this in your settings module::
+
+    OAUTH2_PROVIDER_APPLICATION_MODEL='your_app_name.MyApplication'
+
+That's all, now Django OAuth Toolkit will use your model wherever an Application instance is needed.
+
+    **Notice:** `OAUTH2_PROVIDER_APPLICATION_MODEL` is the only setting variable that is not namespaced, this
+    is because of the way Django currently implements swappable models.
+    See issue #90 (https://github.com/evonove/django-oauth-toolkit/issues/90) for details
+
+
+.. _skip-auth-form:
+
+Skip authorization form
+=======================
+
+Depending on the OAuth2 flow in use and the access token policy, users might be prompted  for the
+same authorization multiple times: sometimes this is acceptable or even desiderable but other it isn't.
+To control DOT behaviour you can use `approval_prompt` parameter when hitting the authorization endpoint.
+Possible values are:
+
+* `force` - users are always prompted for authorization.
+
+* `auto` - users are prompted only the first time, subsequent authorizations for the same application
+  and scopes will be automatically accepted.
+
+Skip authorization completely for trusted applications
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+You might want to completely bypass the authorization form, for instance if your application is an
+in-house product or if you already trust the application owner by other means. To this end, you have to
+set ``skip_authorization = True`` on the ``Application`` model, either programmaticaly or within the
+Django admin. Users will *not* be prompted for authorization, even on the first use of the application.
diff --git a/docs/changelog.rst b/docs/changelog.rst
new file mode 100644
index 0000000..3d876e9
--- /dev/null
+++ b/docs/changelog.rst
@@ -0,0 +1,165 @@
+Changelog
+=========
+
+0.8.1 [2015-04-27]
+------------------
+
+* South migrations fixed. Added new django migrations.
+
+
+0.8.0 [2015-03-27]
+------------------
+
+* Several docs improvements and minor fixes
+* #185: fixed vulnerabilities on Basic authentication
+* #173: ProtectResourceMixin now allows OPTIONS requests
+* Fixed client_id and client_secret characters set
+* #169: hide sensitive informations in error emails
+* #161: extend search to all token types when revoking a token
+* #160: return empty response on successful token revocation
+* #157: skip authorization form with ``skip_authorization_completely`` class field
+* #155: allow custom uri schemes
+* fixed ``get_application_model`` on Django 1.7
+* fixed non rotating refresh tokens
+* #137: fixed base template
+* customized ``client_secret`` lenght
+* #38: create access tokens not bound to a user instance for *client credentials* flow
+
+
+0.7.2 [2014-07-02]
+------------------
+
+* Don't pin oauthlib
+
+
+0.7.0 [2014-03-01]
+------------------
+
+* Created a setting for the default value for approval prompt.
+* Improved docs
+* Don't pin django-braces and six versions
+
+**Backwards incompatible changes in 0.7.0**
+
+* Make Application model truly "swappable" (introduces a new non-namespaced setting OAUTH2_PROVIDER_APPLICATION_MODEL)
+
+
+0.6.1 [2014-02-05]
+------------------
+
+ * added support for `scope` query parameter keeping backwards compatibility for the original `scopes` parameter.
+ * __str__ method in Application model returns name when available
+
+
+0.6.0 [2014-01-26]
+------------------
+
+ * oauthlib 0.6.1 support
+ * Django dev branch support
+ * Python 2.6 support
+ * Skip authorization form via `approval_prompt` parameter
+
+**Bugfixes**
+
+ * Several fixes to the docs
+ * Issue #71: Fix migrations
+ * Issue #65: Use OAuth2 password grant with multiple devices
+ * Issue #84: Add information about login template to tutorial.
+ * Issue #64: Fix urlencode clientid secret
+
+
+0.5.0 [2013-09-17]
+------------------
+
+ * oauthlib 0.6.0 support
+
+**Backwards incompatible changes in 0.5.0**
+
+ * backends.py module has been renamed to oauth2_backends.py so you should change your imports whether you're extending this module
+
+**Bugfixes**
+
+ * Issue #54: Auth backend proposal to address #50
+ * Issue #61: Fix contributing page
+ * Issue #55: Add support for authenticating confidential client with request body params
+ * Issue #53: Quote characters in the url query that are safe for Django but not for oauthlib
+
+0.4.1 [2013-09-06]
+------------------
+
+ * Optimize queries on access token validation
+
+0.4.0 [2013-08-09]
+------------------
+
+**New Features**
+
+ * Add Application management views, you no more need the admin to register, update and delete your application.
+ * Add support to configurable application model
+ * Add support for function based views
+
+**Backwards incompatible changes in 0.4.0**
+
+ * `SCOPE` attribute in settings is now a dictionary to store `{'scope_name': 'scope_description'}`
+ * Namespace 'oauth2_provider' is mandatory in urls. See issue #36
+
+**Bugfixes**
+
+ * Issue #25: Bug in the Basic Auth parsing in Oauth2RequestValidator
+ * Issue #24: Avoid generation of client_id with ":" colon char when using HTTP Basic Auth
+ * Issue #21: IndexError when trying to authorize an application
+ * Issue #9: Default_redirect_uri is mandatory when grant_type is implicit, authorization_code or all-in-one
+ * Issue #22: Scopes need a verbose description
+ * Issue #33: Add django-oauth-toolkit version on example main page
+ * Issue #36: Add mandatory namespace to urls
+ * Issue #31: Add docstring to OAuthToolkitError and FatalClientError
+ * Issue #32: Add docstring to validate_uris
+ * Issue #34: Documentation tutorial part1 needs corsheaders explanation
+ * Issue #36: Add mandatory namespace to urls
+ * Issue #45: Add docs for AbstractApplication
+ * Issue #47: Add docs for views decorators
+
+0.3.2 [2013-07-10]
+------------------
+
+ * Bugfix #37: Error in migrations with custom user on Django 1.5
+
+0.3.1 [2013-07-10]
+------------------
+
+ * Bugfix #27: OAuthlib refresh token refactoring
+
+0.3.0 [2013-06-14]
+----------------------
+
+ * `Django REST Framework <http://django-rest-framework.org/>`_ integration layer
+ * Bugfix #13: Populate request with client and user in validate_bearer_token
+ * Bugfix #12: Fix paths in documentation
+
+**Backwards incompatible changes in 0.3.0**
+
+ * `requested_scopes` parameter in ScopedResourceMixin changed to `required_scopes`
+
+0.2.1 [2013-06-06]
+------------------
+
+ * Core optimizations
+
+0.2.0 [2013-06-05]
+------------------
+
+ * Add support for Django1.4 and Django1.6
+ * Add support for Python 3.3
+ * Add a default ReadWriteScoped view
+ * Add tutorial to docs
+
+0.1.0 [2013-05-31]
+------------------
+
+ * Support OAuth2 Authorization Flows
+
+0.0.0 [2013-05-17]
+------------------
+
+ * Discussion with Daniel Greenfeld at Django Circus
+ * Ignition
diff --git a/docs/conf.py b/docs/conf.py
new file mode 100644
index 0000000..84880a1
--- /dev/null
+++ b/docs/conf.py
@@ -0,0 +1,263 @@
+# -*- coding: utf-8 -*-
+#
+# Django OAuth Toolkit documentation build configuration file, created by
+# sphinx-quickstart on Mon May 20 19:40:43 2013.
+#
+# This file is execfile()d with the current directory set to its containing dir.
+#
+# Note that not all possible configuration values are present in this
+# autogenerated file.
+#
+# All configuration values have a default; values that are commented out
+# serve to show the default.
+
... 7789 lines suppressed ...

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/django-oauth-toolkit.git



More information about the Python-modules-commits mailing list