diff options
| author | Palica <palica+gitlab@liguros.net> | 2020-06-23 22:35:08 +0200 |
|---|---|---|
| committer | Palica <palica+gitlab@liguros.net> | 2020-06-23 22:35:08 +0200 |
| commit | ecdac123787b96ce6649f0f91da12ea6458cc2b1 (patch) | |
| tree | b89c74d9e6fe6e8aebc4c77bcbeb4ab73214127d /dev-python/boto | |
| parent | 1be72aa41cf41dedadeecf59dca9f01de6381f5e (diff) | |
| download | baldeagleos-repo-ecdac123787b96ce6649f0f91da12ea6458cc2b1.tar.gz baldeagleos-repo-ecdac123787b96ce6649f0f91da12ea6458cc2b1.tar.xz baldeagleos-repo-ecdac123787b96ce6649f0f91da12ea6458cc2b1.zip | |
Updating liguros repo
Diffstat (limited to 'dev-python/boto')
| -rw-r--r-- | dev-python/boto/Manifest | 1 | ||||
| -rw-r--r-- | dev-python/boto/boto-2.49.0-r2.ebuild | 38 | ||||
| -rw-r--r-- | dev-python/boto/boto-2.49.0.ebuild | 27 | ||||
| -rw-r--r-- | dev-python/boto/files/boto-2.49.0-py38.patch | 54 | ||||
| -rw-r--r-- | dev-python/boto/files/boto-try-to-add-SNI-support-v2.patch | 93 | ||||
| -rw-r--r-- | dev-python/boto/metadata.xml | 14 |
6 files changed, 227 insertions, 0 deletions
diff --git a/dev-python/boto/Manifest b/dev-python/boto/Manifest new file mode 100644 index 000000000000..880178074c3e --- /dev/null +++ b/dev-python/boto/Manifest @@ -0,0 +1 @@ +DIST boto-2.49.0.tar.gz 1478498 BLAKE2B 6a897ea162f5f4bd34a2d488a3e3897f7f2f5b8707dd0922c01b6a0b90ea577223bf3e588b6685bda1f2bc0e92af426711fcba67a70377183465a530065c6c84 SHA512 2175cf30cd25bbc05812e83e5ade7668c3e21b1bb09aa1b43f0f0ac7d6967a646394fb52c9be673ebb65618c5b33a52d6f31f6da702f5cd1d6c9a18169476dd4 diff --git a/dev-python/boto/boto-2.49.0-r2.ebuild b/dev-python/boto/boto-2.49.0-r2.ebuild new file mode 100644 index 000000000000..0e774e24a221 --- /dev/null +++ b/dev-python/boto/boto-2.49.0-r2.ebuild @@ -0,0 +1,38 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 +PYTHON_COMPAT=( python3_{6..9} ) +DISTUTILS_USE_SETUPTOOLS=bdepend +inherit distutils-r1 + +DESCRIPTION="Amazon Web Services API" +HOMEPAGE="https://github.com/boto/boto https://pypi.org/project/boto/" +SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz" + +LICENSE="MIT" +SLOT="0" +KEYWORDS="amd64 arm arm64 ppc sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos" + +PATCHES=( + # taken from https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=909545 + "${FILESDIR}/boto-try-to-add-SNI-support-v2.patch" + "${FILESDIR}"/${P}-py38.patch +) + +distutils_enable_tests nose + +src_prepare() { + # broken, not worth fixing + rm tests/unit/cloudfront/test_signed_urls.py || die + # fix tests + mkdir -p "${HOME}"/.ssh || die + : > "${HOME}"/.ssh/known_hosts || die + + distutils-r1_src_prepare +} + +python_test() { + nosetests -v tests/unit || + die "Tests fail with ${EPYTHON}" +} diff --git a/dev-python/boto/boto-2.49.0.ebuild b/dev-python/boto/boto-2.49.0.ebuild new file mode 100644 index 000000000000..ed057dd745cf --- /dev/null +++ b/dev-python/boto/boto-2.49.0.ebuild @@ -0,0 +1,27 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 +PYTHON_COMPAT=( python3_{6,7} ) + +inherit distutils-r1 + +DESCRIPTION="Amazon Web Services API" +HOMEPAGE="https://github.com/boto/boto https://pypi.org/project/boto/" +SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz" + +LICENSE="MIT" +SLOT="0" +KEYWORDS="amd64 arm arm64 ppc sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos" +IUSE="test" + +DEPEND=" + dev-python/setuptools[${PYTHON_USEDEP}] + test? ( dev-python/nose[${PYTHON_USEDEP}] )" + +# requires Amazon Web Services keys to pass some tests +RESTRICT="test" + +python_test() { + "${PYTHON}" tests/test.py -v || die "Tests fail with ${EPYTHON}" +} diff --git a/dev-python/boto/files/boto-2.49.0-py38.patch b/dev-python/boto/files/boto-2.49.0-py38.patch new file mode 100644 index 000000000000..0052c6e32e86 --- /dev/null +++ b/dev-python/boto/files/boto-2.49.0-py38.patch @@ -0,0 +1,54 @@ +diff --git a/boto/ecs/item.py b/boto/ecs/item.py +index 79177a31..292b05af 100644 +--- a/boto/ecs/item.py ++++ b/boto/ecs/item.py +@@ -21,7 +21,7 @@ + + + import xml.sax +-import cgi ++import html + from boto.compat import six, StringIO + + class ResponseGroup(xml.sax.ContentHandler): +@@ -67,7 +67,7 @@ class ResponseGroup(xml.sax.ContentHandler): + return None + + def endElement(self, name, value, connection): +- self._xml.write("%s</%s>" % (cgi.escape(value).replace("&amp;", "&"), name)) ++ self._xml.write("%s</%s>" % (html.escape(value).replace("&amp;", "&"), name)) + if len(self._nodepath) == 0: + return + obj = None +diff --git a/tests/unit/utils/test_utils.py b/tests/unit/utils/test_utils.py +index db15b56d..89d1a524 100644 +--- a/tests/unit/utils/test_utils.py ++++ b/tests/unit/utils/test_utils.py +@@ -85,7 +85,7 @@ class TestPassword(unittest.TestCase): + def hmac_hashfunc(cls, msg): + if not isinstance(msg, bytes): + msg = msg.encode('utf-8') +- return hmac.new(b'mysecretkey', msg) ++ return hmac.new(b'mysecretkey', msg, digestmod='MD5') + + class HMACPassword(Password): + hashfunc = hmac_hashfunc +@@ -95,15 +95,15 @@ class TestPassword(unittest.TestCase): + password.set('foo') + + self.assertEquals(str(password), +- hmac.new(b'mysecretkey', b'foo').hexdigest()) ++ hmac.new(b'mysecretkey', b'foo', digestmod='MD5').hexdigest()) + + def test_constructor(self): +- hmac_hashfunc = lambda msg: hmac.new(b'mysecretkey', msg) ++ hmac_hashfunc = lambda msg: hmac.new(b'mysecretkey', msg, digestmod='MD5') + + password = Password(hashfunc=hmac_hashfunc) + password.set('foo') + self.assertEquals(password.str, +- hmac.new(b'mysecretkey', b'foo').hexdigest()) ++ hmac.new(b'mysecretkey', b'foo', digestmod='MD5').hexdigest()) + + + class TestPythonizeName(unittest.TestCase): diff --git a/dev-python/boto/files/boto-try-to-add-SNI-support-v2.patch b/dev-python/boto/files/boto-try-to-add-SNI-support-v2.patch new file mode 100644 index 000000000000..76ae2cd3964b --- /dev/null +++ b/dev-python/boto/files/boto-try-to-add-SNI-support-v2.patch @@ -0,0 +1,93 @@ +From f5e7f6c98b46ff622f60a4661ffc9ce07216d109 Mon Sep 17 00:00:00 2001 +From: Sebastian Andrzej Siewior <sebastian@breakpoint.cc> +Date: Sat, 29 Sep 2018 21:47:11 +0200 +Subject: [PATCH] boto: try to add SNI support + +Add SNI support. Newer OpenSSL (with TLS1.3) fail to connect if the +hostname is missing. + +Link: https://bugs.debian.org/bug=909545 +Tested-by: Witold Baryluk <witold.baryluk@gmail.com> +Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc> +--- + boto/connection.py | 19 ++++++++++--------- + boto/https_connection.py | 22 +++++++++++----------- + 2 files changed, 21 insertions(+), 20 deletions(-) + +diff --git a/boto/connection.py b/boto/connection.py +index 34b428f101df7..b4867a7657465 100644 +--- a/boto/connection.py ++++ b/boto/connection.py +@@ -824,23 +824,24 @@ DEFAULT_CA_CERTS_FILE = os.path.join(os.path.dirname(os.path.abspath(boto.cacert + h = http_client.HTTPConnection(host) + + if self.https_validate_certificates and HAVE_HTTPS_CONNECTION: ++ context = ssl.create_default_context() ++ context.verify_mode = ssl.CERT_REQUIRED ++ context.check_hostname = True ++ + msg = "wrapping ssl socket for proxied connection; " + if self.ca_certificates_file: + msg += "CA certificate file=%s" % self.ca_certificates_file ++ context.load_verify_locations(cafile=self.ca_certificates_file) + else: + msg += "using system provided SSL certs" ++ context.load_default_certs() + boto.log.debug(msg) + key_file = self.http_connection_kwargs.get('key_file', None) + cert_file = self.http_connection_kwargs.get('cert_file', None) +- sslSock = ssl.wrap_socket(sock, keyfile=key_file, +- certfile=cert_file, +- cert_reqs=ssl.CERT_REQUIRED, +- ca_certs=self.ca_certificates_file) +- cert = sslSock.getpeercert() +- hostname = self.host.split(':', 0)[0] +- if not https_connection.ValidateCertificateHostname(cert, hostname): +- raise https_connection.InvalidCertificateException( +- hostname, cert, 'hostname mismatch') ++ if key_file: ++ context.load_cert_chain(certfile=cert_file, keyfile=key_file) ++ ++ sslSock = context.wrap_socket(sock, server_hostname=host) + else: + # Fallback for old Python without ssl.wrap_socket + if hasattr(http_client, 'ssl'): +diff --git a/boto/https_connection.py b/boto/https_connection.py +index ddc31a152292e..a5076f6f9b261 100644 +--- a/boto/https_connection.py ++++ b/boto/https_connection.py +@@ -119,20 +119,20 @@ from boto.compat import six, http_client + sock = socket.create_connection((self.host, self.port), self.timeout) + else: + sock = socket.create_connection((self.host, self.port)) ++ ++ context = ssl.create_default_context() ++ context.verify_mode = ssl.CERT_REQUIRED ++ context.check_hostname = True ++ if self.key_file: ++ context.load_cert_chain(certfile=self.cert_file, keyfile=self.key_file) ++ + msg = "wrapping ssl socket; " + if self.ca_certs: + msg += "CA certificate file=%s" % self.ca_certs ++ context.load_verify_locations(cafile=self.ca_certs) + else: + msg += "using system provided SSL certs" ++ context.load_default_certs() + boto.log.debug(msg) +- self.sock = ssl.wrap_socket(sock, keyfile=self.key_file, +- certfile=self.cert_file, +- cert_reqs=ssl.CERT_REQUIRED, +- ca_certs=self.ca_certs) +- cert = self.sock.getpeercert() +- hostname = self.host.split(':', 0)[0] +- if not ValidateCertificateHostname(cert, hostname): +- raise InvalidCertificateException(hostname, +- cert, +- 'remote hostname "%s" does not match ' +- 'certificate' % hostname) ++ ++ self.sock = context.wrap_socket(sock, server_hostname=self.host) +-- +2.19.0 + diff --git a/dev-python/boto/metadata.xml b/dev-python/boto/metadata.xml new file mode 100644 index 000000000000..913bbc49d5c9 --- /dev/null +++ b/dev-python/boto/metadata.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="project"> + <email>python@gentoo.org</email> + <name>Python</name> + </maintainer> + <upstream> + <remote-id type="google-code">boto</remote-id> + <remote-id type="pypi">boto</remote-id> + <remote-id type="github">boto/boto</remote-id> + </upstream> + <origin>gentoo-staging</origin> +</pkgmetadata> |
