From ebb13541b6d2d8cf03b7ddeb2ccbdf68caac14af508dd57600121e7e90d9a6b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Fri, 13 Dec 2024 11:33:03 +0100 Subject: [PATCH] Sync from SUSE:SLFO:Main python-httpbin revision 2622bde9270ab25481976533766a2d06 --- flask3.patch | 109 ----------------------------------------- httpbin-0.10.1.tar.gz | 3 -- httpbin-0.10.2.tar.gz | 3 ++ python-httpbin.changes | 8 +++ python-httpbin.spec | 6 +-- 5 files changed, 13 insertions(+), 116 deletions(-) delete mode 100644 flask3.patch delete mode 100644 httpbin-0.10.1.tar.gz create mode 100644 httpbin-0.10.2.tar.gz diff --git a/flask3.patch b/flask3.patch deleted file mode 100644 index 24ab8c8..0000000 --- a/flask3.patch +++ /dev/null @@ -1,109 +0,0 @@ -From c1d9e33049263fed3cb27806a97f094acc350905 Mon Sep 17 00:00:00 2001 -From: Nate Prewitt -Date: Thu, 12 Oct 2023 08:30:42 -0700 -Subject: [PATCH] Support Flask 3.0 (#29) - ---- - httpbin/core.py | 8 +++----- - httpbin/helpers.py | 21 ++++++++++++++++----- - pyproject.toml | 3 +-- - 3 files changed, 20 insertions(+), 12 deletions(-) - -diff --git a/httpbin/core.py b/httpbin/core.py -index 5c1783a1..a82c1b88 100644 ---- a/httpbin/core.py -+++ b/httpbin/core.py -@@ -32,7 +32,7 @@ - from werkzeug.wrappers import Response - except ImportError: # werkzeug < 2.1 - from werkzeug.wrappers import BaseResponse as Response --from werkzeug.http import parse_authorization_header -+ - from flasgger import Swagger, NO_SANITIZER - - from . import filters -@@ -47,6 +47,7 @@ - H, - ROBOT_TXT, - ANGRY_ASCII, -+ parse_authorization_header, - parse_multi_value_header, - next_stale_after_value, - digest_challenge_response, -@@ -636,16 +637,13 @@ def redirect_to(): - args_dict = request.args.items() - args = CaseInsensitiveDict(args_dict) - -- # We need to build the response manually and convert to UTF-8 to prevent -- # werkzeug from "fixing" the URL. This endpoint should set the Location -- # header to the exact string supplied. - response = app.make_response("") - response.status_code = 302 - if "status_code" in args: - status_code = int(args["status_code"]) - if status_code >= 300 and status_code < 400: - response.status_code = status_code -- response.headers["Location"] = args["url"].encode("utf-8") -+ response.headers["Location"] = args["url"] - - return response - -diff --git a/httpbin/helpers.py b/httpbin/helpers.py -index b29e1835..836c8026 100644 ---- a/httpbin/helpers.py -+++ b/httpbin/helpers.py -@@ -13,8 +13,14 @@ - import time - import os - from hashlib import md5, sha256, sha512 --from werkzeug.http import parse_authorization_header - from werkzeug.datastructures import WWWAuthenticate -+from werkzeug.http import dump_header -+ -+try: -+ from werkzeug.http import parse_authorization_header -+except ImportError: # werkzeug < 2.3 -+ from werkzeug.datastructures import Authorization -+ parse_authorization_header = Authorization.from_header - - from flask import request, make_response - from six.moves.urllib.parse import urlparse, urlunparse -@@ -466,9 +472,14 @@ def digest_challenge_response(app, qop, algorithm, stale = False): - ]), algorithm) - opaque = H(os.urandom(10), algorithm) - -- auth = WWWAuthenticate("digest") -- auth.set_digest('me@kennethreitz.com', nonce, opaque=opaque, -- qop=('auth', 'auth-int') if qop is None else (qop,), algorithm=algorithm) -- auth.stale = stale -+ values = { -+ 'realm': 'me@kennethreitz.com', -+ 'nonce': nonce, -+ 'opaque': opaque, -+ 'qop': dump_header(('auth', 'auth-int') if qop is None else (qop,)), -+ 'algorithm': algorithm, -+ 'stale': stale, -+ } -+ auth = WWWAuthenticate("digest", values=values) - response.headers['WWW-Authenticate'] = auth.to_header() - return response -diff --git a/pyproject.toml b/pyproject.toml -index 020457ec..9454e569 100644 ---- a/pyproject.toml -+++ b/pyproject.toml -@@ -31,14 +31,13 @@ classifiers = [ - "Programming Language :: Python :: 3.12", - ] - dependencies = [ -- "Flask", -+ "flask >= 2.2.4", - "brotlicffi", - "decorator", - "flasgger", - 'greenlet < 3.0; python_version<"3.12"', - 'greenlet >= 3.0.0a1; python_version>="3.12.0rc0"', - 'importlib-metadata; python_version<"3.8"', -- "werkzeug >= 0.14.1", - "six", - ] - diff --git a/httpbin-0.10.1.tar.gz b/httpbin-0.10.1.tar.gz deleted file mode 100644 index 74844d4..0000000 --- a/httpbin-0.10.1.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:7b8596beb0e75a7b653c39d1f3cf263d6d5c476d29e1df6f7bb2b70bf9f06a3d -size 107058 diff --git a/httpbin-0.10.2.tar.gz b/httpbin-0.10.2.tar.gz new file mode 100644 index 0000000..a030199 --- /dev/null +++ b/httpbin-0.10.2.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:632148698261c8684ea2d2b624cdea845b402b1fe91736e89df886408c6317a9 +size 107327 diff --git a/python-httpbin.changes b/python-httpbin.changes index 1bda103..b265f03 100644 --- a/python-httpbin.changes +++ b/python-httpbin.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Tue Oct 1 14:35:38 UTC 2024 - John Paul Adrian Glaubitz + +- Update to 0.10.2 + * Added support for Flask 3.0 +- Drop flask3.patch, merged upstream +- Update Requires from setup.py + ------------------------------------------------------------------- Tue Oct 24 13:30:26 UTC 2023 - Markéta Machová diff --git a/python-httpbin.spec b/python-httpbin.spec index b88f608..bb5ccf5 100644 --- a/python-httpbin.spec +++ b/python-httpbin.spec @@ -19,14 +19,12 @@ %define modname httpbin %{?sle15_python_module_pythons} Name: python-httpbin -Version: 0.10.1 +Version: 0.10.2 Release: 0 Summary: HTTP Request and Response Service License: MIT URL: https://github.com/psf/httpbin Source: https://files.pythonhosted.org/packages/source/h/%{modname}/%{modname}-%{version}.tar.gz -# PATCH-FIX-UPSTREAM https://github.com/psf/httpbin/pull/29 Support Flask 3.0 -Patch: flask3.patch BuildRequires: %{python_module Brotli} BuildRequires: %{python_module Flask >= 2.2.4} BuildRequires: %{python_module Werkzeug >= 2.0} @@ -41,7 +39,7 @@ BuildRequires: fdupes BuildRequires: python-rpm-macros Requires: python-Brotli Requires: python-Flask >= 2.2.4 -Requires: python-Werkzeug >= 2.0 +Requires: python-Werkzeug >= 2.2.2 Requires: python-decorator Requires: python-flasgger Requires: python-gevent