Skip to content

Commit ab84df7

Browse files
symptogjleclanche
authored andcommitted
Don't require write scope for introspection
Replacing `ReadWriteScopedResourceView` with `ScopedProtectedResourceView` fixes jazzband#555
1 parent c2ca9cc commit ab84df7

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

Diff for: .gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ pip-log.txt
2828
.cache
2929
.coverage
3030
.tox
31+
.pytest_cache/
3132
nosetests.xml
3233

3334
# Translations

Diff for: oauth2_provider/views/introspect.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
from django.views.decorators.csrf import csrf_exempt
1010

1111
from oauth2_provider.models import get_access_token_model
12-
from oauth2_provider.views import ReadWriteScopedResourceView
12+
from oauth2_provider.views import ScopedProtectedResourceView
1313

1414

1515
@method_decorator(csrf_exempt, name="dispatch")
16-
class IntrospectTokenView(ReadWriteScopedResourceView):
16+
class IntrospectTokenView(ScopedProtectedResourceView):
1717
"""
1818
Implements an endpoint for token introspection based
1919
on RFC 7662 https://tools.ietf.org/html/rfc7662

Diff for: tests/test_introspection_auth.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def setUp(self):
9696
user=self.resource_server_user, token="12345678900",
9797
application=self.application,
9898
expires=timezone.now() + datetime.timedelta(days=1),
99-
scope="read write introspection"
99+
scope="introspection"
100100
)
101101

102102
self.invalid_token = AccessToken.objects.create(

Diff for: tests/test_introspection_view.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def setUp(self):
3838
user=self.resource_server_user, token="12345678900",
3939
application=self.application,
4040
expires=timezone.now() + datetime.timedelta(days=1),
41-
scope="read write introspection"
41+
scope="introspection"
4242
)
4343

4444
self.valid_token = AccessToken.objects.create(

0 commit comments

Comments
 (0)