14
0

- Revert removing of 106-basic-auth.diff

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-bugzilla?expand=0&rev=53
This commit is contained in:
2021-10-26 05:58:46 +00:00
committed by Git OBS Bridge
parent b6bf25582d
commit 0ea36fb4e1
3 changed files with 51 additions and 1 deletions

42
106-basic-auth.diff Normal file
View File

@@ -0,0 +1,42 @@
---
bugzilla/base.py | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
--- a/bugzilla/base.py
+++ b/bugzilla/base.py
@@ -175,7 +175,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
@@ -212,6 +213,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")
@@ -253,6 +255,7 @@ class Bugzilla(object):
self._setcookiefile(cookiefile)
self._settokenfile(tokenfile)
self._setconfigpath(configpaths)
+ self._basic_auth = basic_auth
if url:
self.connect(url)
@@ -607,6 +610,9 @@ class Bugzilla(object):
if not self.password:
raise ValueError("missing password")
+ if self._basic_auth:
+ self._transport.set_basic_auth(self.user, self.password)
+
payload = {"login": self.user}
if restrict_login:
payload['restrict_login'] = True

View File

@@ -1,3 +1,8 @@
-------------------------------------------------------------------
Tue Oct 26 05:50:05 UTC 2021 - Matej Cepl <mcepl@suse.com>
- Revert removing of 106-basic-auth.diff
-------------------------------------------------------------------
Thu Oct 21 17:55:23 UTC 2021 - Marina Latini <marina.latini@suse.com>

View File

@@ -27,6 +27,9 @@ 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
# PATCH-FIX-UPSTREAM 106-basic-auth.diff bsc#1098219 mcepl@suse.com
# Fix basic authentication on bugzilla.suse.com
Patch0: 106-basic-auth.diff
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module requests}
BuildRequires: %{python_module setuptools}
@@ -34,7 +37,7 @@ 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