1
0

Compare commits

4 Commits

Author SHA256 Message Date
c1cbb76649 Accepting request 1315319 from devel:languages:python:django
OBS-URL: https://build.opensuse.org/request/show/1315319
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-djangorestframework-simplejwt?expand=0&rev=9
2025-11-03 17:56:15 +00:00
9e28694865 - Update to 5.5.1 (CVE-2024-22513, bsc#1221568)
* Changed string formatting in views
  * Enhance BlacklistMixin with Generic Type for Accurate Type Inference
  * Improve type of Token.for_user to allow subclasses
  * Fix the Null value of the OutstandingToken of the BlacklistMixin.blacklist
  * Add option to allow inactive user authentication and token generation
  * Add support for EdDSA and other algorithms in jwt.algorithms.requires_cryptography
  * Drop Django <4.2, DRF <3.14, Python <3.9. Note, many deprecated versions are only
    officially not supported but probably still work fine.
  * Add specific "token expired" exceptions
  * Fix user_id type mismatch when user claim is not pk
  * Caching signing key
  * fix: add missing migration for token_blacklist app
  * docs: Add warning in docs for for_user usage
  * feat: log warning if token is being created for inactive user
  * fix: always stringify user_id claim
- Drop fix-tests.patch, merged upstream

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:django/python-djangorestframework-simplejwt?expand=0&rev=9
2025-11-03 14:28:58 +00:00
16b8f420ce Accepting request 1223466 from devel:languages:python:django
Forwarded request #1223408 from mcalabkova

- Add missing dependency

OBS-URL: https://build.opensuse.org/request/show/1223466
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-djangorestframework-simplejwt?expand=0&rev=8
2024-11-12 18:22:00 +00:00
ab7e7d9f04 - Add missing dependency
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:django/python-djangorestframework-simplejwt?expand=0&rev=7
2024-11-12 01:21:40 +00:00
5 changed files with 33 additions and 79 deletions

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:6c4bd37537440bc439564ebf7d6085e74c5411485197073f508ebdfa34bc9fae
size 94266

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e72c5572f51d7803021288e2057afcbd03f17fe11d484096f40a460abc76e87f
size 101265

View File

@@ -1,72 +0,0 @@
From 0b50ee6721155ce0f652d4c1f47dcbb10c191894 Mon Sep 17 00:00:00 2001
From: Mike <mike@zivix.com>
Date: Mon, 4 Dec 2023 17:48:36 -0800
Subject: [PATCH] Fix tests (#769)
---
rest_framework_simplejwt/utils.py | 5 ++---
tests/test_init.py | 5 ++---
tests/test_utils.py | 11 ++++-------
3 files changed, 8 insertions(+), 13 deletions(-)
Index: djangorestframework_simplejwt-5.3.1/rest_framework_simplejwt/utils.py
===================================================================
--- djangorestframework_simplejwt-5.3.1.orig/rest_framework_simplejwt/utils.py
+++ djangorestframework_simplejwt-5.3.1/rest_framework_simplejwt/utils.py
@@ -5,7 +5,6 @@ from typing import Callable
from django.conf import settings
from django.utils.functional import lazy
-from django.utils.timezone import is_naive, make_aware
def get_md5_hash_password(password: str) -> str:
@@ -16,8 +15,8 @@ def get_md5_hash_password(password: str)
def make_utc(dt: datetime) -> datetime:
- if settings.USE_TZ and is_naive(dt):
- return make_aware(dt, timezone=timezone.utc)
+ if settings.USE_TZ and dt.tzinfo is None:
+ return dt.replace(tzinfo=timezone.utc)
return dt
Index: djangorestframework_simplejwt-5.3.1/tests/test_utils.py
===================================================================
--- djangorestframework_simplejwt-5.3.1.orig/tests/test_utils.py
+++ djangorestframework_simplejwt-5.3.1/tests/test_utils.py
@@ -1,7 +1,6 @@
-from datetime import datetime, timedelta
+from datetime import datetime, timedelta, timezone
from django.test import TestCase
-from django.utils import timezone
from freezegun import freeze_time
from rest_framework_simplejwt.utils import (
@@ -24,11 +23,11 @@ class TestMakeUtc(TestCase):
with self.settings(USE_TZ=False):
dt = make_utc(dt)
- self.assertTrue(timezone.is_naive(dt))
+ self.assertTrue(dt.tzinfo is None)
with self.settings(USE_TZ=True):
dt = make_utc(dt)
- self.assertTrue(timezone.is_aware(dt))
+ self.assertTrue(dt.tzinfo is not None)
self.assertEqual(dt.utcoffset(), timedelta(seconds=0))
@@ -39,9 +38,7 @@ class TestAwareUtcnow(TestCase):
with freeze_time(now):
# Should return aware utcnow if USE_TZ == True
with self.settings(USE_TZ=True):
- self.assertEqual(
- timezone.make_aware(now, timezone=timezone.utc), aware_utcnow()
- )
+ self.assertEqual(now.replace(tzinfo=timezone.utc), aware_utcnow())
# Should return naive utcnow if USE_TZ == False
with self.settings(USE_TZ=False):

View File

@@ -1,3 +1,29 @@
-------------------------------------------------------------------
Mon Nov 3 09:29:49 UTC 2025 - Markéta Machová <mmachova@suse.com>
- Update to 5.5.1 (CVE-2024-22513, bsc#1221568)
* Changed string formatting in views
* Enhance BlacklistMixin with Generic Type for Accurate Type Inference
* Improve type of Token.for_user to allow subclasses
* Fix the Null value of the OutstandingToken of the BlacklistMixin.blacklist
* Add option to allow inactive user authentication and token generation
* Add support for EdDSA and other algorithms in jwt.algorithms.requires_cryptography
* Drop Django <4.2, DRF <3.14, Python <3.9. Note, many deprecated versions are only
officially not supported but probably still work fine.
* Add specific "token expired" exceptions
* Fix user_id type mismatch when user claim is not pk
* Caching signing key
* fix: add missing migration for token_blacklist app
* docs: Add warning in docs for for_user usage
* feat: log warning if token is being created for inactive user
* fix: always stringify user_id claim
- Drop fix-tests.patch, merged upstream
-------------------------------------------------------------------
Mon Nov 11 16:58:30 UTC 2024 - Markéta Machová <mmachova@suse.com>
- Add missing dependency
-------------------------------------------------------------------
Fri Jul 19 11:26:13 UTC 2024 - Markéta Machová <mmachova@suse.com>

View File

@@ -1,7 +1,7 @@
#
# spec file for package python-djangorestframework-simplejwt
#
# Copyright (c) 2024 SUSE LLC
# Copyright (c) 2025 SUSE LLC and contributors
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -18,16 +18,15 @@
%{?sle15_python_module_pythons}
Name: python-djangorestframework-simplejwt
Version: 5.3.1
Version: 5.5.1
Release: 0
Summary: JSON Web Token authentication for Django REST Framework
License: MIT
URL: https://github.com/davesque/django-rest-framework-simplejwt
Source: https://files.pythonhosted.org/packages/source/d/djangorestframework-simplejwt/djangorestframework_simplejwt-%{version}.tar.gz
# PATCH-FIX-UPSTREAM https://github.com/jazzband/djangorestframework-simplejwt/pull/769 Fix tests
Patch0: fix-tests.patch
BuildRequires: %{python_module Django}
BuildRequires: %{python_module PyJWT}
BuildRequires: %{python_module cryptography}
BuildRequires: %{python_module djangorestframework}
BuildRequires: %{python_module freezegun}
BuildRequires: %{python_module pip}
@@ -39,6 +38,7 @@ BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires: python-PyJWT
Requires: python-djangorestframework
Recommends: python-cryptography
Recommends: python-python-jose
BuildArch: noarch
%python_subpackages