From a9d95f8c0ca6e044a4269a33a314fc7bf8ebc83e9893b25dc7e185a6dbb850cf Mon Sep 17 00:00:00 2001 From: Axel Braun Date: Tue, 19 Apr 2022 18:13:50 +0000 Subject: [PATCH] - Version 6.0.17 * Werkzeug 2.0 compatibility added * fix_werkzeug_2.x.patch removed OBS-URL: https://build.opensuse.org/package/show/Application:ERP:GNUHealth:Factory/trytond?expand=0&rev=140 --- fix_werkzeug_2.x.patch | 52 ------------------------------------------ trytond.changes | 4 +++- trytond.spec | 9 +------- 3 files changed, 4 insertions(+), 61 deletions(-) delete mode 100644 fix_werkzeug_2.x.patch diff --git a/fix_werkzeug_2.x.patch b/fix_werkzeug_2.x.patch deleted file mode 100644 index 0fc88a1..0000000 --- a/fix_werkzeug_2.x.patch +++ /dev/null @@ -1,52 +0,0 @@ ---- a/trytond/protocols/wrappers.py -+++ b/trytond/protocols/wrappers.py -@@ -12,7 +12,6 @@ - from http import client as HTTPStatus - - from werkzeug.wrappers import Request as _Request, Response --from werkzeug.http import wsgi_to_bytes, bytes_to_wsgi - from werkzeug.datastructures import Authorization - from werkzeug.exceptions import abort, HTTPException - -@@ -113,7 +112,8 @@ - def parse_authorization_header(value): - if not value: - return -- value = wsgi_to_bytes(value) -+ if not isinstance(value, bytes): -+ value = value.encode('latin1') - try: - auth_type, auth_info = value.split(None, 1) - auth_type = auth_type.lower() -@@ -127,9 +127,9 @@ - except Exception: - return - return Authorization('session', { -- 'username': bytes_to_wsgi(username), -+ 'username': username.decode("latin1"), - 'userid': userid, -- 'session': bytes_to_wsgi(session), -+ 'session': session.decode("latin1"), - }) - - -@@ -214,16 +214,16 @@ - pool = Pool() - UserApplication = pool.get('res.user.application') - -- authorization = wsgi_to_bytes(request.headers['Authorization']) -+ authorization = request.headers['Authorization'] - try: - auth_type, auth_info = authorization.split(None, 1) - auth_type = auth_type.lower() - except ValueError: - abort(HTTPStatus.UNAUTHORIZED) -- if auth_type != b'bearer': -+ if auth_type != 'bearer': - abort(HTTPStatus.FORBIDDEN) - -- application = UserApplication.check(bytes_to_wsgi(auth_info), name) -+ application = UserApplication.check(auth_info, name) - if not application: - abort(HTTPStatus.FORBIDDEN) - transaction = Transaction() diff --git a/trytond.changes b/trytond.changes index edc7c6d..eb1b313 100644 --- a/trytond.changes +++ b/trytond.changes @@ -1,7 +1,9 @@ ------------------------------------------------------------------- Mon Apr 18 19:25:02 UTC 2022 - Axel Braun -- Version 6.0.17 - Bugfix Release +- Version 6.0.17 + * Werkzeug 2.0 compatibility added + * fix_werkzeug_2.x.patch removed ------------------------------------------------------------------- Mon Mar 7 14:27:27 UTC 2022 - Axel Braun diff --git a/trytond.spec b/trytond.spec index deaaac4..d811a8e 100644 --- a/trytond.spec +++ b/trytond.spec @@ -34,8 +34,7 @@ Source5: http://downloads.tryton.org/%{majorver}/%{name}-%{version}.tar.g Source6: https://keybase.io/cedrickrier/pgp_keys.asc?fingerprint=7C5A4360F6DF81ABA91FD54D6FF50AFE03489130#/%{name}.keyring Source7: openSUSE-trytond-setup Source20: %{name}.service -Patch0: fix_werkzeug_2.x.patch -Patch1: Update_changed_fields_6.0.diff +Patch0: Update_changed_fields_6.0.diff BuildRequires: fdupes BuildRequires: python3-Werkzeug BuildRequires: python3-bcrypt @@ -85,13 +84,7 @@ security. %setup -q cp %{SOURCE1} . -#Werkzeug2 is not compatible with Werkzeug 1.x, so we need a conditional patch -echo 0%{?suse_version} -%if 0%{?suse_version} >= 1550 %patch0 -p1 -%endif - -%patch1 -p1 %build %python3_build