Skip to content
This repository was archived by the owner on May 26, 2020. It is now read-only.

Commit 24d2567

Browse files
authored
Merge branch 'master' into update-tox
2 parents 3e4d3a5 + 2ec4fc7 commit 24d2567

File tree

10 files changed

+29
-15
lines changed

10 files changed

+29
-15
lines changed

.travis.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
python: '3.5'
2+
13
language: python
24

35
sudo: false
@@ -10,30 +12,40 @@ env:
1012
- TOX_ENV=py27-django1.8-drf3.2
1113
- TOX_ENV=py27-django1.8-drf3.3
1214
- TOX_ENV=py27-django1.8-drf3.4
15+
- TOX_ENV=py27-django1.8-drf3.5
1316

1417
- TOX_ENV=py27-django1.9-drf3.1
1518
- TOX_ENV=py27-django1.9-drf3.2
1619
- TOX_ENV=py27-django1.9-drf3.3
1720
- TOX_ENV=py27-django1.9-drf3.4
21+
- TOX_ENV=py27-django1.9-drf3.5
1822

1923
- TOX_ENV=py27-django1.10-drf3.4
24+
- TOX_ENV=py27-django1.10-drf3.5
2025

2126
- TOX_ENV=py33-django1.8-drf3.1
2227
- TOX_ENV=py33-django1.8-drf3.2
2328
- TOX_ENV=py33-django1.8-drf3.3
2429
- TOX_ENV=py33-django1.8-drf3.4
30+
- TOX_ENV=py33-django1.8-drf3.5
2531

2632
- TOX_ENV=py34-django1.8-drf3.1
2733
- TOX_ENV=py34-django1.8-drf3.2
2834
- TOX_ENV=py34-django1.8-drf3.3
2935
- TOX_ENV=py34-django1.8-drf3.4
36+
- TOX_ENV=py34-django1.8-drf3.5
3037

3138
- TOX_ENV=py34-django1.9-drf3.1
3239
- TOX_ENV=py34-django1.9-drf3.2
3340
- TOX_ENV=py34-django1.9-drf3.3
3441
- TOX_ENV=py34-django1.9-drf3.4
42+
- TOX_ENV=py34-django1.9-drf3.5
3543

3644
- TOX_ENV=py34-django1.10-drf3.4
45+
- TOX_ENV=py34-django1.10-drf3.5
46+
47+
- TOX_ENV=py35-django1.10-drf3.4
48+
- TOX_ENV=py35-django1.10-drf3.5
3749

3850
matrix:
3951
fast_finish: true

README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ If you want to know more about JWT, check out the following resources:
2222
Requirements
2323
------------
2424

25-
- Python (2.7, 3.3, 3.4)
25+
- Python (2.7, 3.3, 3.4, 3.5)
2626
- Django (1.8, 1.9, 1.10)
27-
- Django REST Framework (3.0, 3.1, 3.2, 3.3, 3.4)
27+
- Django REST Framework (3.0, 3.1, 3.2, 3.3, 3.4, 3.5)
2828

2929
Installation
3030
------------

docs/index.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ If you want to know more about JWT, check out the following resources:
2727

2828
## Requirements
2929

30-
- Python (2.7, 3.3, 3.4)
30+
- Python (2.7, 3.3, 3.4, 3.5)
3131
- Django (1.8, 1.9, 1.10)
32-
- Django REST Framework (3.0, 3.1, 3.2, 3.3, 3.4)
32+
- Django REST Framework (3.0, 3.1, 3.2, 3.3, 3.4, 3.5)
3333

3434
## Security
3535

@@ -59,9 +59,9 @@ REST_FRAMEWORK = {
5959
'rest_framework.permissions.IsAuthenticated',
6060
),
6161
'DEFAULT_AUTHENTICATION_CLASSES': (
62+
'rest_framework_jwt.authentication.JSONWebTokenAuthentication',
6263
'rest_framework.authentication.SessionAuthentication',
6364
'rest_framework.authentication.BasicAuthentication',
64-
'rest_framework_jwt.authentication.JSONWebTokenAuthentication',
6565
),
6666
}
6767
```
@@ -72,12 +72,12 @@ In your `urls.py` add the following URL route to enable obtaining a token via a
7272
from rest_framework_jwt.views import obtain_jwt_token
7373
#...
7474

75-
urlpatterns = patterns(
75+
urlpatterns = [
7676
'',
7777
# ...
7878

7979
url(r'^api-token-auth/', obtain_jwt_token),
80-
)
80+
]
8181
```
8282

8383
You can easily test if the endpoint is working by doing the following in your terminal, if you had a user created with the username **admin** and password **password123**.
@@ -99,7 +99,7 @@ $ curl -H "Authorization: JWT <your_token>" http://localhost:8000/protected-url/
9999
```
100100

101101
## Refresh Token
102-
If `JWT_ALLOW_REFRESH` is True, issued tokens can be "refreshed" to obtain a new brand token with renewed expiration time. Add a URL pattern like this:
102+
If `JWT_ALLOW_REFRESH` is True, **non-expired** tokens can be "refreshed" to obtain a brand new token with renewed expiration time. Add a URL pattern like this:
103103
```python
104104
from rest_framework_jwt.views import refresh_jwt_token
105105
# ...
@@ -217,7 +217,7 @@ Default is `True`.
217217

218218
### JWT_LEEWAY
219219

220-
> This allows you to validate an expiration time which is in the past but no very far. For example, if you have a JWT payload with an expiration time set to 30 seconds after creation but you know that sometimes you will process it after 30 seconds, you can set a leeway of 10 seconds in order to have some margin.
220+
This allows you to validate an expiration time which is in the past but not very far. For example, if you have a JWT payload with an expiration time set to 30 seconds after creation but you know that sometimes you will process it after 30 seconds, you can set a leeway of 10 seconds in order to have some margin.
221221

222222
Default is `0` seconds.
223223

requirements/testing.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ pytest-django==2.8.0
44
pytest-cov==1.6
55

66
# Mocking the datetime module.
7-
cryptography==1.2.2
7+
cryptography==1.2.3

rest_framework_jwt/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# -*- coding: utf-8 -*-
22

33
__title__ = 'djangorestframework-jwt'
4-
__version__ = '1.8.0'
4+
__version__ = '1.9.0'
55
__author__ = 'José Padilla'
66
__license__ = 'MIT'
77
__copyright__ = 'Copyright 2014-2016 Blimp LLC'

rest_framework_jwt/locale/en_US/LC_MESSAGES/django.po

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ msgid "User account is disabled."
4747
msgstr ""
4848

4949
#: serializers.py:76
50-
msgid "Unable to login with provided credentials."
50+
msgid "Unable to log in with provided credentials."
5151
msgstr ""
5252

5353
#: serializers.py:79

rest_framework_jwt/serializers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def validate(self, attrs):
6161
'user': user
6262
}
6363
else:
64-
msg = _('Unable to login with provided credentials.')
64+
msg = _('Unable to log in with provided credentials.')
6565
raise serializers.ValidationError(msg)
6666
else:
6767
msg = _('Must include "{username_field}" and "password".')

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ def get_package_data(package):
107107
'Programming Language :: Python :: 3',
108108
'Programming Language :: Python :: 3.3',
109109
'Programming Language :: Python :: 3.4',
110+
'Programming Language :: Python :: 3.5',
110111
'Topic :: Internet :: WWW/HTTP',
111112
]
112113
)

tests/test_serializers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def test_invalid_credentials(self):
6464
is_valid = serializer.is_valid()
6565

6666
expected_error = {
67-
'non_field_errors': ['Unable to login with provided credentials.']
67+
'non_field_errors': ['Unable to log in with provided credentials.']
6868
}
6969

7070
self.assertFalse(is_valid)

tox.ini

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[tox]
22
envlist =
33
py27-{flake8,docs},
4-
{py27,py33,py34}-django{1.8,1.9,1.10}-drf{3.1,3.2,3.3,3.4}
4+
{py27,py33,py34,py35}-django{1.8,1.9,1.10}-drf{3.1,3.2,3.3,3.4,3.5}
55

66
[testenv]
77
commands = ./runtests.py --fast {posargs} --verbose
@@ -15,6 +15,7 @@ deps =
1515
drf3.2: djangorestframework<3.3
1616
drf3.3: djangorestframework<3.4
1717
drf3.4: djangorestframework<3.5
18+
drf3.5: djangorestframework<3.6
1819
py27-django{1.8,1.9}-drf{3.1,3.2,3.3,3.4}: djangorestframework-oauth==1.0.1
1920
-rrequirements/testing.txt
2021

0 commit comments

Comments
 (0)