forked from pool/python-bugzilla
- 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 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-bugzilla?expand=0&rev=61
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user