Project

Profile

Help

Issue #3239

closed

POST /api/v3/users/{user_id}/jwt_reset/ returns HTTP 500

Added by Ichimonji10 almost 7 years ago. Updated over 5 years ago.

Status:
CLOSED - NOTABUG
Priority:
Normal
Assignee:
-
Category:
-
Sprint/Milestone:
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
Platform Release:
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Sprint:
Quarter:

Description

Under Pulp 3, POST requests to /api/v3/users/{user_id}/jwt_reset/ should invalidate all of a user's existing tokens. Currently, POSTS to this URL instead cause an HTTP 500 error. A peek into `journalctl -p 0..3` shows this entry:

Jan 02 12:33:56 fedora-26-pulp-3 pulp[1427]: django.request:ERROR: Internal Server Error: /api/v3/users/399f2f05-4e00-4c06-b931-a37ea70bf6f4/jwt_reset/
                                             Traceback (most recent call last):
                                               File "/home/pulp/pulpvenv/lib64/python3.6/site-packages/django/core/handlers/exception.py", line 41, in inner
                                                 response = get_response(request)
                                               File "/home/pulp/pulpvenv/lib64/python3.6/site-packages/django/core/handlers/base.py", line 249, in _legacy_get_response
                                                 response = self._get_response(request)
                                               File "/home/pulp/pulpvenv/lib64/python3.6/site-packages/django/core/handlers/base.py", line 187, in _get_response
                                                 response = self.process_exception_by_middleware(e, request)
                                               File "/home/pulp/pulpvenv/lib64/python3.6/site-packages/django/core/handlers/base.py", line 185, in _get_response
                                                 response = wrapped_callback(request, *callback_args, **callback_kwargs)
                                               File "/home/pulp/pulpvenv/lib64/python3.6/site-packages/django/views/decorators/csrf.py", line 58, in wrapped_view
                                                 return view_func(*args, **kwargs)
                                               File "/home/pulp/pulpvenv/lib64/python3.6/site-packages/rest_framework/viewsets.py", line 95, in view
                                                 return self.dispatch(request, *args, **kwargs)
                                               File "/home/pulp/pulpvenv/lib64/python3.6/site-packages/rest_framework/views.py", line 494, in dispatch
                                                 response = self.handle_exception(exc)
                                               File "/home/pulp/pulpvenv/lib64/python3.6/site-packages/rest_framework/views.py", line 454, in handle_exception
                                                 self.raise_uncaught_exception(exc)
                                               File "/home/pulp/pulpvenv/lib64/python3.6/site-packages/rest_framework/views.py", line 491, in dispatch
                                                 response = handler(request, *args, **kwargs)
                                             TypeError: jwt_reset() got an unexpected keyword argument 'pk'

This error is reproductible on both Fedora 25 and 26. I'm currently testing against the vesion of Pulp published to PyPI (3.0.0a14).

This error can be reproduced with Pulp Smash, though you will need to disable a call to self.skipTest in its source code if this issue is still active: python -m unittest discover pulp_smash.tests.pulp3.pulpcore.api_v3.test_auth.JWTResetTestCase.

Also available in: Atom PDF