Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-httpbin for openSUSE:Factory checked in at 2023-10-26 17:11:59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-httpbin (Old) and /work/SRC/openSUSE:Factory/.python-httpbin.new.24901 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-httpbin" Thu Oct 26 17:11:59 2023 rev:9 rq:1119999 version:0.10.1 Changes: -------- --- /work/SRC/openSUSE:Factory/python-httpbin/python-httpbin.changes 2023-06-22 23:25:10.045633293 +0200 +++ /work/SRC/openSUSE:Factory/.python-httpbin.new.24901/python-httpbin.changes 2023-10-26 17:12:16.727552730 +0200 @@ -1,0 +2,26 @@ +Tue Oct 24 13:30:26 UTC 2023 - Markéta Machová <[email protected]> + +- Use Brotli instead of dropped brotlicffi + +------------------------------------------------------------------- +Thu Oct 19 08:11:44 UTC 2023 - Markéta Machová <[email protected]> + +- Repackage, new active upstream + * In their words: We were unable to get ahold of the folks at postmanlabs to + maintain the original project, and httpbin is used for other packages + within the python ecosystem, such as pytest-httpbin which is in turn used + by packages such as requests so we have forked this package. That means + that httpbin.org is not actually backed by this repo, but the httpbin + package is. Confusing right? + * Drop now unneeded _service, changes in the *spec +- Update to 0.10.1 + * Override docker image port with HTTPBIN_PORT + * A number of fixes for code rot, thanks @mgorny and @tjni +- Drop upstreamed/no-longer-needed patches: + * fix-setup-py.patch + * httpbin-pr674-wekzeug2.1.patch + * werkzeug.patch + * support-werkzeug-2.3.patch +- Add flask3.patch to support Flask 3.0 + +------------------------------------------------------------------- Old: ---- _service fix-setup-py.patch httpbin-pr674-wekzeug2.1.patch python-httpbin-0.7.0+git20181107.f8ec666.tar.xz support-werkzeug-2.3.patch werkzeug.patch New: ---- flask3.patch httpbin-0.10.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-httpbin.spec ++++++ --- /var/tmp/diff_new_pack.qpUPb4/_old 2023-10-26 17:12:17.435578733 +0200 +++ /var/tmp/diff_new_pack.qpUPb4/_new 2023-10-26 17:12:17.439578880 +0200 @@ -16,44 +16,35 @@ # -# The PyPI version is 0.7.0 but the metadata reads an internal file with version 0.9.2 -%define internalversion 0.9.2 +%define modname httpbin %{?sle15_python_module_pythons} Name: python-httpbin -Version: 0.7.0+git20181107.f8ec666 +Version: 0.10.1 Release: 0 Summary: HTTP Request and Response Service License: MIT -URL: https://github.com/Runscope/httpbin -Source: python-httpbin-%{version}.tar.xz -# PATCH-FIX-UPSTREAM werkzeug.patch -- gh#postmanlabs/httpbin#555 -Patch0: werkzeug.patch -# PATCH-FIX-UPSTREAM fix-setup-py.patch -- gh#postmanlabs/httpbin#553 -Patch1: fix-setup-py.patch -# PATCH-FIX-UPSTREAM httpbin-pr674-wekzeug2.1.patch -- gh#postmanlabs/httpbin#674 -Patch2: httpbin-pr674-wekzeug2.1.patch -# PATCH-FIX-OPENSUSE Support Werkzeug >= 2.3 -Patch3: support-werkzeug-2.3.patch +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.1} -BuildRequires: %{python_module MarkupSafe} +BuildRequires: %{python_module Flask >= 2.2.4} BuildRequires: %{python_module Werkzeug >= 2.0} BuildRequires: %{python_module decorator} BuildRequires: %{python_module flasgger} BuildRequires: %{python_module gevent} -BuildRequires: %{python_module itsdangerous} +BuildRequires: %{python_module pip} BuildRequires: %{python_module pytest} BuildRequires: %{python_module setuptools} +BuildRequires: %{python_module wheel} BuildRequires: fdupes BuildRequires: python-rpm-macros Requires: python-Brotli -Requires: python-Flask >= 2.1 -Requires: python-MarkupSafe +Requires: python-Flask >= 2.2.4 Requires: python-Werkzeug >= 2.0 Requires: python-decorator Requires: python-flasgger Requires: python-gevent -Requires: python-itsdangerous Requires: python-six BuildArch: noarch %python_subpackages @@ -69,16 +60,17 @@ All endpoint responses are JSON-encoded. %prep -%autosetup -p1 -chmod -x httpbin/templates/forms-post.html +%autosetup -p1 -n %{modname}-%{version} +# we are running CPython, let us use Brotli instead of brotlicffi (they should be compatible) +sed -i 's/brotlicffi/brotli/' httpbin/filters.py %build export LANG=en_US.UTF-8 -%python_build +%pyproject_wheel %install export LANG=en_US.UTF-8 -%python_install +%pyproject_install %python_expand %fdupes %{buildroot}%{$python_sitelib} %check @@ -88,5 +80,5 @@ %doc README.md %license LICENSE %{python_sitelib}/httpbin -%{python_sitelib}/httpbin-%{internalversion}*-info +%{python_sitelib}/httpbin-%{version}*-info ++++++ flask3.patch ++++++ >From c1d9e33049263fed3cb27806a97f094acc350905 Mon Sep 17 00:00:00 2001 From: Nate Prewitt <[email protected]> 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('[email protected]', nonce, opaque=opaque, - qop=('auth', 'auth-int') if qop is None else (qop,), algorithm=algorithm) - auth.stale = stale + values = { + 'realm': '[email protected]', + '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", ]
