forked from pool/python-Authlib
- add py313-tests.patch
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-Authlib?expand=0&rev=31
This commit is contained in:
70
py313-tests.patch
Normal file
70
py313-tests.patch
Normal file
@@ -0,0 +1,70 @@
|
||||
From d282c1afad676cf8ed3670e60fd43516fc9615de Mon Sep 17 00:00:00 2001
|
||||
From: "Kai A. Hiller" <git@kaialexhiller.de>
|
||||
Date: Sun, 20 Oct 2024 16:56:25 +0200
|
||||
Subject: [PATCH] tests: Dereference LocalProxy before serialization
|
||||
|
||||
---
|
||||
.../test_oauth2/test_jwt_access_token.py | 30 +++++++++++++++----
|
||||
1 file changed, 25 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/tests/flask/test_oauth2/test_jwt_access_token.py b/tests/flask/test_oauth2/test_jwt_access_token.py
|
||||
index f4b8cf99..20feb1bb 100644
|
||||
--- a/tests/flask/test_oauth2/test_jwt_access_token.py
|
||||
+++ b/tests/flask/test_oauth2/test_jwt_access_token.py
|
||||
@@ -49,31 +49,51 @@ def create_resource_protector(app, validator):
|
||||
@require_oauth()
|
||||
def protected():
|
||||
user = db.session.get(User, current_token['sub'])
|
||||
- return jsonify(id=user.id, username=user.username, token=current_token)
|
||||
+ return jsonify(
|
||||
+ id=user.id,
|
||||
+ username=user.username,
|
||||
+ token=current_token._get_current_object(),
|
||||
+ )
|
||||
|
||||
@app.route('/protected-by-scope')
|
||||
@require_oauth('profile')
|
||||
def protected_by_scope():
|
||||
user = db.session.get(User, current_token['sub'])
|
||||
- return jsonify(id=user.id, username=user.username, token=current_token)
|
||||
+ return jsonify(
|
||||
+ id=user.id,
|
||||
+ username=user.username,
|
||||
+ token=current_token._get_current_object(),
|
||||
+ )
|
||||
|
||||
@app.route('/protected-by-groups')
|
||||
@require_oauth(groups=['admins'])
|
||||
def protected_by_groups():
|
||||
user = db.session.get(User, current_token['sub'])
|
||||
- return jsonify(id=user.id, username=user.username, token=current_token)
|
||||
+ return jsonify(
|
||||
+ id=user.id,
|
||||
+ username=user.username,
|
||||
+ token=current_token._get_current_object(),
|
||||
+ )
|
||||
|
||||
@app.route('/protected-by-roles')
|
||||
@require_oauth(roles=['student'])
|
||||
def protected_by_roles():
|
||||
user = db.session.get(User, current_token['sub'])
|
||||
- return jsonify(id=user.id, username=user.username, token=current_token)
|
||||
+ return jsonify(
|
||||
+ id=user.id,
|
||||
+ username=user.username,
|
||||
+ token=current_token._get_current_object(),
|
||||
+ )
|
||||
|
||||
@app.route('/protected-by-entitlements')
|
||||
@require_oauth(entitlements=['captain'])
|
||||
def protected_by_entitlements():
|
||||
user = db.session.get(User, current_token['sub'])
|
||||
- return jsonify(id=user.id, username=user.username, token=current_token)
|
||||
+ return jsonify(
|
||||
+ id=user.id,
|
||||
+ username=user.username,
|
||||
+ token=current_token._get_current_object(),
|
||||
+ )
|
||||
|
||||
return require_oauth
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
-------------------------------------------------------------------
|
||||
Thu Oct 31 09:13:27 UTC 2024 - Dirk Müller <dmueller@suse.com>
|
||||
|
||||
- add py313-tests.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sat Sep 28 20:03:15 UTC 2024 - Dirk Müller <dmueller@suse.com>
|
||||
|
||||
|
||||
@@ -25,7 +25,10 @@ Summary: Python library for building OAuth and OpenID Connect servers
|
||||
License: BSD-3-Clause
|
||||
URL: https://authlib.org/
|
||||
Source: https://github.com/lepture/%{modname}/archive/refs/tags/v%{version}.tar.gz#/%{modname}-%{version}.tar.gz
|
||||
Patch1: https://github.com/lepture/authlib/commit/d282c1afad676cf8ed3670e60fd43516fc9615de.patch#/py313-tests.patch
|
||||
BuildRequires: %{python_module pip}
|
||||
BuildRequires: %{python_module setuptools}
|
||||
BuildRequires: %{python_module wheel}
|
||||
BuildRequires: python-rpm-macros
|
||||
# SECTION test requirements
|
||||
BuildRequires: %{python_module anyio}
|
||||
@@ -53,16 +56,16 @@ BuildArch: noarch
|
||||
A Python library for building OAuth and OpenID Connect servers.
|
||||
|
||||
%prep
|
||||
%setup -q -n %{modname}-%{version}
|
||||
%autosetup -p1 -n %{modname}-%{version}
|
||||
# Remove the file containing the commercial license so licensedigger
|
||||
# doesn't complain about the dual license
|
||||
rm COMMERCIAL-LICENSE
|
||||
|
||||
%build
|
||||
%python_build
|
||||
%pyproject_wheel
|
||||
|
||||
%install
|
||||
%python_install
|
||||
%pyproject_install
|
||||
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
||||
|
||||
%check
|
||||
|
||||
Reference in New Issue
Block a user