Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Hawk authentication backend #13

Merged
merged 1 commit into from
Jan 27, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 41 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,49 @@
language: python
python:
- "2.6"
- "2.7"
- "3.3"
- "3.4"
- "3.5"
- "3.6"

matrix:
include:
- python: 2.6
env:
- WITH_JWT=false
WITH_HAWK=true
- python: 2.7
env:
- WITH_JWT=true
WITH_HAWK=true
- python: 3.3
env:
- WITH_JWT=false
WITH_HAWK=false
SETUPTOOLS="setuptools<40.0.0"
- python: 3.4
env:
- WITH_JWT=true
WITH_HAWK=true
- python: 3.5
env:
- WITH_JWT=true
WITH_HAWK=true
- python: 3.6
env:
- WITH_JWT=true
WITH_HAWK=true
- python: 3.7
dist: xenial
env:
- WITH_JWT=true
WITH_HAWK=true

before_install:
- pip install --upgrade pytest

install: "pip install -r requirements-dev.txt"
install:
- "[[ -n \"$SETUPTOOLS\" ]] && pip install \"$SETUPTOOLS\" || true"
- "pip install -r requirements-dev.txt"
- "\"$WITH_JWT\" && pip install \"pyjwt>=1.7.0,<2.0.0\" || true"
- "\"$WITH_HAWK\" && pip install \"mohawk>=1.0.0,<2.0.0\" || true"

script: py.test --cov-report term-missing --cov=falcon_auth
script:
- py.test --cov-report term-missing --cov=falcon_auth

after_success:
- coveralls
- coveralls
26 changes: 24 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ Install the extension with pip, or easy\_install.

$ pip install -U falcon-auth

If you wish to use the optional backends, specify those dependencies, too.

.. code:: bash

$ pip install -U falcon-auth[backend-hawk,backend-jwt]

Usage
-----

Expand Down Expand Up @@ -123,9 +129,25 @@ credentials(username and password) encoded using ``base64`` and a prefix (typica
Implements a Simple Token Based Authentication Scheme where HTTP ``Authorization``
header contains a prefix (typically Token) followed by an `API Token`

+ **JWT Authentication**
+ **JWT Authentication (Python 2.7, 3.4+)**

Token based authentication using the `JSON Web Token standard <https://jwt.io/introduction/>`__
If you wish to use this backend, be sure to add the optional dependency to your requirements (See Python `"extras" <https://www.python.org/dev/peps/pep-0508/#extras>`__):

.. code:: text

falcon-auth[backend-jwt]


+ **Hawk Authentication (Python 2.6+, 3.4+)**

Token based authentication using the `Hawk "Holder-Of-Key Authentication Scheme" <https://github.com/hueniverse/hawk>`__
If you wish to use this backend, be sure to add the optional dependency to your requirements (See Python `"extras" <https://www.python.org/dev/peps/pep-0508/#extras>`__):

.. code:: text

falcon-auth[backend-hawk]


+ **Dummy Authentication**

Expand All @@ -134,7 +156,7 @@ Backend which does not perform any authentication checks
+ **Multi Backend Authentication**

A Backend which comprises of multiple backends and requires any of them to authenticate
the request successfully
the request successfully.

Tests
-----
Expand Down
Loading