diff --git a/106-basic-auth.diff b/106-basic-auth.diff index 4572d16..057da32 100644 --- a/106-basic-auth.diff +++ b/106-basic-auth.diff @@ -1,42 +1,10 @@ ---- python-bugzilla-3.2.0.orig/bugzilla/base.py 2022-01-12 19:09:08.000000000 +0100 -+++ python-bugzilla-3.2.0/bugzilla/base.py 2022-12-21 09:32:01.324613243 +0100 -@@ -174,7 +174,8 @@ - def __init__(self, url=-1, user=None, password=None, cookiefile=-1, - sslverify=True, tokenfile=-1, use_creds=True, api_key=None, - cert=None, configpaths=-1, -- force_rest=False, force_xmlrpc=False, requests_session=None): -+ force_rest=False, force_xmlrpc=False, requests_session=None, -+ basic_auth=False): - """ - :param url: The bugzilla instance URL, which we will connect - to immediately. Most users will want to specify this at -@@ -207,6 +208,7 @@ - :param requests_session: An optional requests.Session object the - API will use to contact the remote bugzilla instance. This - way the API user can set up whatever auth bits they may need. -+ :param basic_auth: Use headers with HTTP Basic authentication - """ - if url == -1: - raise TypeError("Specify a valid bugzilla url, or pass url=None") -@@ -246,6 +248,7 @@ - - self._settokenfile(tokenfile) - self._setconfigpath(configpaths) -+ self._basic_auth = basic_auth - - if url: - self.connect(url) -@@ -598,6 +601,8 @@ - raise ValueError("missing username") - if not self.password: - raise ValueError("missing password") -+ if self._basic_auth: -+ self._backend.set_basic_auth(self.user, self.password) - - payload = {"login": self.user} - if restrict_login: ---- python-bugzilla-3.2.0.orig/bugzilla/_backendxmlrpc.py 2022-01-12 19:09:08.000000000 +0100 -+++ python-bugzilla-3.2.0/bugzilla/_backendxmlrpc.py 2022-12-21 09:35:40.471278786 +0100 +--- + bugzilla/_backendxmlrpc.py | 14 ++++++++++++++ + bugzilla/base.py | 7 ++++++- + 2 files changed, 20 insertions(+), 1 deletion(-) + +--- a/bugzilla/_backendxmlrpc.py ++++ b/bugzilla/_backendxmlrpc.py @@ -2,6 +2,7 @@ # See the COPYING file in the top-level directory. @@ -45,17 +13,17 @@ import sys from xmlrpc.client import (Binary, Fault, ProtocolError, ServerProxy, Transport) -@@ -127,6 +128,9 @@ +@@ -127,6 +128,9 @@ class _BugzillaXMLRPCProxy(ServerProxy, # pylint: enable=no-member return ret -+ ++ + def clear_token(self): + self.__bugzillasession.set_token_value(None) class _BackendXMLRPC(_BackendBase): -@@ -142,6 +146,16 @@ +@@ -142,6 +146,16 @@ class _BackendXMLRPC(_BackendBase): def is_xmlrpc(self): return True @@ -72,3 +40,40 @@ def bugzilla_version(self): return self._xmlrpc_proxy.Bugzilla.version() +--- a/bugzilla/base.py ++++ b/bugzilla/base.py +@@ -177,7 +177,8 @@ class Bugzilla(object): + def __init__(self, url=-1, user=None, password=None, cookiefile=-1, + sslverify=True, tokenfile=-1, use_creds=True, api_key=None, + cert=None, configpaths=-1, +- force_rest=False, force_xmlrpc=False, requests_session=None): ++ force_rest=False, force_xmlrpc=False, requests_session=None, ++ basic_auth=False): + """ + :param url: The bugzilla instance URL, which we will connect + to immediately. Most users will want to specify this at +@@ -210,6 +211,7 @@ class Bugzilla(object): + :param requests_session: An optional requests.Session object the + API will use to contact the remote bugzilla instance. This + way the API user can set up whatever auth bits they may need. ++ :param basic_auth: Use headers with HTTP Basic authentication + """ + if url == -1: + raise TypeError("Specify a valid bugzilla url, or pass url=None") +@@ -249,6 +251,7 @@ class Bugzilla(object): + + self._settokenfile(tokenfile) + self._setconfigpath(configpaths) ++ self._basic_auth = basic_auth + + if url: + self.connect(url) +@@ -601,6 +604,8 @@ class Bugzilla(object): + raise ValueError("missing username") + if not self.password: + raise ValueError("missing password") ++ if self._basic_auth: ++ self._backend.set_basic_auth(self.user, self.password) + + payload = {"login": self.user} + if restrict_login: diff --git a/188-fix-api-key-leak.diff b/188-fix-api-key-leak.diff deleted file mode 100644 index 446b0b4..0000000 --- a/188-fix-api-key-leak.diff +++ /dev/null @@ -1,23 +0,0 @@ ---- a/bugzilla/_session.py 2021-10-05 22:49:16.000000000 +0200 -+++ b/bugzilla/_session.py 2023-09-25 17:22:39.763856790 +0200 -@@ -97,14 +97,14 @@ - if "timeout" not in kwargs: - kwargs["timeout"] = timeout - -- response = self._session.request(*args, **kwargs) -+ try: -+ response = self._session.request(*args, **kwargs) - -- if self._is_xmlrpc: -- # Yes this still appears to matter for properly decoding unicode -- # code points in bugzilla.redhat.com content -- response.encoding = "UTF-8" -+ if self._is_xmlrpc: -+ # Yes this still appears to matter for properly decoding unicode -+ # code points in bugzilla.redhat.com content -+ response.encoding = "UTF-8" - -- try: - response.raise_for_status() - except Exception as e: - # Scrape the api key out of the returned exception string diff --git a/_service b/_service index ea3c172..991c636 100644 --- a/_service +++ b/_service @@ -1,3 +1,15 @@ - - \ No newline at end of file + + 3.2.0+git + https://github.com/python-bugzilla/python-bugzilla.git + git + main + enable + + + + *.tar + gz + + + diff --git a/_servicedata b/_servicedata new file mode 100644 index 0000000..f74c978 --- /dev/null +++ b/_servicedata @@ -0,0 +1,4 @@ + + + https://github.com/python-bugzilla/python-bugzilla.git + 5eedea31bcef0f1ba7a22eb38aba1cdd9b3d7981 \ No newline at end of file diff --git a/python-bugzilla-3.2.0+git.1726768917.5eedea3.obscpio b/python-bugzilla-3.2.0+git.1726768917.5eedea3.obscpio new file mode 100644 index 0000000..b5d455d --- /dev/null +++ b/python-bugzilla-3.2.0+git.1726768917.5eedea3.obscpio @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3833f041b64f4b8ff63ba60c6153337d72cf09994be2d8fb33953f93b74e77ff +size 851468 diff --git a/python-bugzilla-3.2.0.tar.gz b/python-bugzilla-3.2.0.tar.gz deleted file mode 100644 index 49146fc..0000000 --- a/python-bugzilla-3.2.0.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:54967b21001e880b20c9303d5ac86b009142714ee6cdb473be363c41b207dd15 -size 113206 diff --git a/python-bugzilla.changes b/python-bugzilla.changes index 018e998..b29b01f 100644 --- a/python-bugzilla.changes +++ b/python-bugzilla.changes @@ -1,3 +1,19 @@ +------------------------------------------------------------------- +Fri Sep 20 19:54:11 UTC 2024 - mcepl@cepl.eu + +- Switch to Git source and update to version 3.2.0+git.1726768917.5eedea3: + * Use non-deprecated argument name in test-suite + * Fixed issue in `Bugzilla.fix_url` + * Prep for release 3.3.0 + * ci: bump actions/checkout from 3 to 4 + * ci: bump actions/setup-python from 4 to 5 + * Run functional RO tests in GitHub actions + * man: Regenerate bugzilla.1 + * man: Add section about `bugzillarc` + * Allow bug creation with an explicitly empty list of groups (closes #210) + * cli: Support `--field` and `--field-json` for `bugzilla attach` (#206) +- Remove upstreamed patch 188-fix-api-key-leak.diff + ------------------------------------------------------------------- Mon Sep 25 14:57:10 UTC 2023 - Julio González Gil diff --git a/python-bugzilla.obsinfo b/python-bugzilla.obsinfo new file mode 100644 index 0000000..76e3926 --- /dev/null +++ b/python-bugzilla.obsinfo @@ -0,0 +1,4 @@ +name: python-bugzilla +version: 3.2.0+git.1726768917.5eedea3 +mtime: 1726768917 +commit: 5eedea31bcef0f1ba7a22eb38aba1cdd9b3d7981 diff --git a/python-bugzilla.spec b/python-bugzilla.spec index 6d7cc50..4e28e1a 100644 --- a/python-bugzilla.spec +++ b/python-bugzilla.spec @@ -1,7 +1,7 @@ # # spec file for package python-bugzilla # -# Copyright (c) 2023 SUSE LLC +# Copyright (c) 2024 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -19,27 +19,26 @@ %define oldpython python %define skip_python2 1 Name: python-bugzilla -Version: 3.2.0 +Version: 3.2.0+git.1726768917.5eedea3 Release: 0 Summary: Python library for Bugzilla License: GPL-2.0-or-later Group: Development/Libraries/Python URL: https://github.com/python-bugzilla/python-bugzilla -Source: https://files.pythonhosted.org/packages/source/p/python-bugzilla/python-bugzilla-%{version}.tar.gz +# Source: https://files.pythonhosted.org/packages/source/p/python-bugzilla/python-bugzilla-%%{version}.tar.gz +Source: python-bugzilla-%{version}.tar.gz # PATCH-FIX-UPSTREAM 106-basic-auth.diff bsc#1098219 mcepl@suse.com # Fix basic authentication on bugzilla.suse.com Patch0: 106-basic-auth.diff -# PATCH-FIX-UPSTREAM pending https://github.com/python-bugzilla/python-bugzilla/pull/188 -# Fix API Key leak -Patch1: 188-fix-api-key-leak.diff BuildRequires: %{python_module pytest} BuildRequires: %{python_module requests} +BuildRequires: %{python_module responses} BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros Requires: python-requests Requires(post): update-alternatives -Requires(postun):update-alternatives +Requires(postun): update-alternatives Suggests: osc Conflicts: %{oldpython}-bugzillatools Obsoletes: python2-bugzilla @@ -82,6 +81,6 @@ export CFLAGS="%{optflags}" %python_alternative %{_bindir}/bugzilla %python_alternative %{_mandir}/man1/bugzilla.1%{ext_man} %{python_sitelib}/bugzilla -%{python_sitelib}/python_bugzilla-%{version}-py*.egg-info +%{python_sitelib}/python_bugzilla-3.3.0*-info %changelog