Accepting request 1179344 from devel:languages:python

OBS-URL: https://build.opensuse.org/request/show/1179344
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-elastic-transport?expand=0&rev=11
This commit is contained in:
Ana Guerrero 2024-06-09 18:18:42 +00:00 committed by Git OBS Bridge
commit 834fdec1fd
5 changed files with 13 additions and 93 deletions

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:56f52c45254bb73f64336a4b59e097702517f0603036559ac56b5a92782e0fda
size 75950

BIN
elastic-transport-python-8.13.1.tar.gz (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -1,3 +1,12 @@
-------------------------------------------------------------------
Thu Jun 6 09:45:48 UTC 2024 - Markéta Machová <mmachova@suse.com>
- Update to 8.13.1
* Fixed requests 2.32 compatibility
* Fixed TypeError when two nodes are declared dead at the same time
* Added TransportApiResponse
- Drop merged requests232.patch
-------------------------------------------------------------------
Mon May 27 04:24:39 UTC 2024 - Steve Kowalik <steven.kowalik@suse.com>

View File

@ -18,14 +18,12 @@
%{?sle15_python_module_pythons}
Name: python-elastic-transport
Version: 8.13.0
Version: 8.13.1
Release: 0
Summary: Transport classes and utilities shared among Python Elastic client libraries
License: Apache-2.0
URL: https://github.com/elastic/elastic-transport-python
Source: https://github.com/elastic/elastic-transport-python/archive/refs/tags/v%{version}.tar.gz#/elastic-transport-python-%{version}.tar.gz
# PATCH-FIX-UPSTREAM https://github.com/elastic/elastic-transport-python/pull/164 Fix requests 2.32 compatibility
Patch0: requests232.patch
# PATCH-FIX-UPSTREAM gh#elastic/elastic-transport-python#163
Patch1: remove-mock.patch
BuildRequires: %{python_module base >= 3.7}

View File

@ -1,87 +0,0 @@
From d49d5dda344f0a458c020a8a3c0032480e6b57d5 Mon Sep 17 00:00:00 2001
From: Quentin Pradet <quentin.pradet@elastic.co>
Date: Thu, 23 May 2024 11:48:10 +0400
Subject: [PATCH 1/3] Fix requests 2.32 compatibility
---
elastic_transport/_node/_http_requests.py | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/elastic_transport/_node/_http_requests.py b/elastic_transport/_node/_http_requests.py
index 19cec37..e439865 100644
--- a/elastic_transport/_node/_http_requests.py
+++ b/elastic_transport/_node/_http_requests.py
@@ -169,7 +169,16 @@ def __init__(self, config: NodeConfig):
)
# Preload the HTTPConnectionPool so initialization issues
# are raised here instead of in perform_request()
- adapter.get_connection(self.base_url) # type: ignore[no-untyped-call]
+ if hasattr(adapter, "get_connection_with_tls_context"):
+ adapter.get_connection_with_tls_context(
+ requests.Request(url=self.base_url), verify=self.session.verify
+ )
+ else:
+ # elastic-transport is not vulnerable to CVE-2024-35195 because it uses
+ # requests.Session and an SSLContext without using the verify parameter.
+ # We should remove this branch when requiring requests 2.32 or later.
+ adapter.get_connection(self.base_url) # type: ignore [no-untyped-call]
+
self.session.mount(prefix=f"{self.scheme}://", adapter=adapter)
def perform_request(
From 56d1e6832d0b438ee7cee3ab0f8dea6a14a89eb8 Mon Sep 17 00:00:00 2001
From: Quentin Pradet <quentin.pradet@elastic.co>
Date: Thu, 23 May 2024 11:59:42 +0400
Subject: [PATCH 2/3] Fix lint
---
elastic_transport/_node/_http_requests.py | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/elastic_transport/_node/_http_requests.py b/elastic_transport/_node/_http_requests.py
index e439865..4b2d502 100644
--- a/elastic_transport/_node/_http_requests.py
+++ b/elastic_transport/_node/_http_requests.py
@@ -170,14 +170,16 @@ def __init__(self, config: NodeConfig):
# Preload the HTTPConnectionPool so initialization issues
# are raised here instead of in perform_request()
if hasattr(adapter, "get_connection_with_tls_context"):
+ request = requests.Request(url=self.base_url)
+ prepared_request = self.session.prepare_request(request)
adapter.get_connection_with_tls_context(
- requests.Request(url=self.base_url), verify=self.session.verify
+ prepared_request, verify=self.session.verify
)
else:
# elastic-transport is not vulnerable to CVE-2024-35195 because it uses
# requests.Session and an SSLContext without using the verify parameter.
# We should remove this branch when requiring requests 2.32 or later.
- adapter.get_connection(self.base_url) # type: ignore [no-untyped-call]
+ adapter.get_connection(self.base_url)
self.session.mount(prefix=f"{self.scheme}://", adapter=adapter)
From 8a222e2c9b81dc9f7a1e4583de59ecc0d4c4d803 Mon Sep 17 00:00:00 2001
From: Quentin Pradet <quentin.pradet@elastic.co>
Date: Thu, 23 May 2024 12:02:53 +0400
Subject: [PATCH 3/3] Fix prepared request
---
elastic_transport/_node/_http_requests.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/elastic_transport/_node/_http_requests.py b/elastic_transport/_node/_http_requests.py
index 4b2d502..941e3cc 100644
--- a/elastic_transport/_node/_http_requests.py
+++ b/elastic_transport/_node/_http_requests.py
@@ -170,7 +170,7 @@ def __init__(self, config: NodeConfig):
# Preload the HTTPConnectionPool so initialization issues
# are raised here instead of in perform_request()
if hasattr(adapter, "get_connection_with_tls_context"):
- request = requests.Request(url=self.base_url)
+ request = requests.Request(method="GET", url=self.base_url)
prepared_request = self.session.prepare_request(request)
adapter.get_connection_with_tls_context(
prepared_request, verify=self.session.verify