Skip to content

Commit

Permalink
add examples to flake8 build
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelgrinberg committed Mar 14, 2016
1 parent c443e7e commit 61b1b71
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
8 changes: 2 additions & 6 deletions examples/token_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
To gain access, you can use a command line HTTP client such as curl, passing
one of the tokens:
curl -X GET -H "Authorization: Bearer <insert-jwt-token-here>" http://localhost:5000/
curl -X GET -H "Authorization: Bearer <jwt-token>" http://localhost:5000/
The response should include the username, which is obtained from the JWT token.
"""
from flask import Flask, g
from flask_httpauth import HTTPBasicAuth, HTTPTokenAuth, MultiAuth
from flask_httpauth import HTTPTokenAuth
from itsdangerous import TimedJSONWebSignatureSerializer as JWT


Expand All @@ -24,10 +24,6 @@
auth = HTTPTokenAuth('Bearer')


def get_jwt(username, expires_in=3600):
return jwt.dumps({'username': username})


users = ['john', 'susan']
for user in users:
token = jwt.dumps({'username': user})
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ basepython=python
deps=
flake8
commands=
flake8 --exclude=".*" --ignore=E402 flask_httpauth.py tests
flake8 --exclude=".*" --ignore=E402 flask_httpauth.py tests examples

[testenv:py26]
basepython=python2.6
Expand Down

0 comments on commit 61b1b71

Please sign in to comment.