Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: DEPR USE-JWT-COOKIE header - Part 1 #35401

Merged
merged 1 commit into from
Aug 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions openedx/core/djangoapps/user_authn/tests/test_cookies.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,6 @@ def _copy_cookies_to_request(self, response, request):
for key, val in response.cookies.items()
}

def _set_use_jwt_cookie_header(self, request):
request.META['HTTP_USE_JWT_COOKIE'] = 'true'

def _assert_recreate_jwt_from_cookies(self, response, can_recreate):
"""
If can_recreate is True, verifies that a JWT can be properly recreated
Expand Down Expand Up @@ -133,7 +130,6 @@ def test_set_logged_in_deprecated_cookies(self):
@patch.dict("django.conf.settings.FEATURES", {"DISABLE_SET_JWT_COOKIES_FOR_TESTS": False})
def test_set_logged_in_jwt_cookies(self):
setup_login_oauth_client()
self._set_use_jwt_cookie_header(self.request)
response = cookies_api.set_logged_in_cookies(self.request, HttpResponse(), self.user)
self._assert_cookies_present(response, cookies_api.ALL_LOGGED_IN_COOKIE_NAMES)
self._assert_consistent_expires(response, num_of_unique_expires=2)
Expand All @@ -153,7 +149,6 @@ def test_delete_and_are_logged_in_cookies_set(self):
@patch.dict("django.conf.settings.FEATURES", {"DISABLE_SET_JWT_COOKIES_FOR_TESTS": False})
def test_refresh_jwt_cookies(self):
setup_login_oauth_client()
self._set_use_jwt_cookie_header(self.request)
response = cookies_api.get_response_with_refreshed_jwt_cookies(self.request, self.user)
data = json.loads(response.content.decode('utf8').replace("'", '"'))
assert data['success'] is True
Expand Down
Loading