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

Commit

Permalink
Removed parser_classes and renderer_classes from JSONWebTokenAPIView
Browse files Browse the repository at this point in the history
  • Loading branch information
Jwpe committed May 29, 2015
1 parent fb0dcc1 commit 62b92eb
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 16 deletions.
8 changes: 0 additions & 8 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,6 @@ JWT_AUTH = {
'JWT_REFRESH_EXPIRATION_DELTA': datetime.timedelta(days=7),

'JWT_AUTH_HEADER_PREFIX': 'JWT',

'JWT_DEFAULT_RENDERER_CLASSES': (
'rest_framework.renderers.JSONRenderer',
),
}
```
This packages uses the JSON Web Token Python implementation, [PyJWT](https://github.com/jpadilla/pyjwt) and allows to modify some of it's available options.
Expand Down Expand Up @@ -238,10 +234,6 @@ Another common value used for tokens and Authorization headers is `Bearer`.

Default is `JWT`.

### JWT_DEFAULT_RENDERER_CLASSES

An iterable containing the renderer classes that will be applied to the responses from JWT views. If you want to modify the data structure of your responses, this is the best way to do so. Renderers are explained in detail in the [Django REST Framework documentation](http://www.django-rest-framework.org/api-guide/renderers/).

## Extending `JSONWebTokenAuthentication`

Right now `JSONWebTokenAuthentication` assumes that the JWT will come in the header. The JWT spec does not require this (see: [Making a service Call](https://developer.atlassian.com/static/connect/docs/concepts/authentication.html)). For example, the JWT may come in the querystring. The ability to send the JWT in the querystring is needed in cases where the user cannot set the header (for example the src element in HTML).
Expand Down
5 changes: 0 additions & 5 deletions rest_framework_jwt/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@
'JWT_REFRESH_EXPIRATION_DELTA': datetime.timedelta(days=7),

'JWT_AUTH_HEADER_PREFIX': 'JWT',

'JWT_DEFAULT_RENDERER_CLASSES': (
'rest_framework.renderers.JSONRenderer',
),
}

# List of settings that may be in string import notation.
Expand All @@ -48,7 +44,6 @@
'JWT_PAYLOAD_HANDLER',
'JWT_PAYLOAD_GET_USER_ID_HANDLER',
'JWT_RESPONSE_PAYLOAD_HANDLER',
'JWT_DEFAULT_RENDERER_CLASSES',
)

api_settings = APISettings(USER_SETTINGS, DEFAULTS, IMPORT_STRINGS)
3 changes: 0 additions & 3 deletions rest_framework_jwt/views.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from rest_framework.views import APIView
from rest_framework import status
from rest_framework import parsers
from rest_framework.response import Response

from rest_framework_jwt.settings import api_settings
Expand All @@ -20,8 +19,6 @@ class JSONWebTokenAPIView(APIView):
throttle_classes = ()
permission_classes = ()
authentication_classes = ()
parser_classes = (parsers.FormParser, parsers.JSONParser,)
renderer_classes = api_settings.JWT_DEFAULT_RENDERER_CLASSES

def get_serializer_context(self):
"""
Expand Down

0 comments on commit 62b92eb

Please sign in to comment.