From 16daf0673c9872163a556565d957405295cf29cd Mon Sep 17 00:00:00 2001 From: Tomasz Prus Date: Fri, 14 Dec 2018 00:10:50 +0100 Subject: [PATCH 1/2] feat: urllib3>1.23 CVE-2018-20060 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 25afef7c5..7765188be 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,6 +2,6 @@ certifi>=14.05.14 # MPL six>=1.9.0 # MIT python-dateutil>=2.5.3 # BSD setuptools>=21.0.0 # PSF/ZPL -urllib3>=1.19.1,!=1.21,<1.23 # MIT +urllib3>=1.23 # MIT pyyaml>=3.12 # MIT aiohttp>=2.3.10 # # Apache-2.0 From bd195901cc23394bc9f3512085a4c4e54835b3d1 Mon Sep 17 00:00:00 2001 From: Tomasz Prus Date: Fri, 14 Dec 2018 00:12:28 +0100 Subject: [PATCH 2/2] feat: remove dependency to urllib3 --- kubernetes_asyncio/config/kube_config.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/kubernetes_asyncio/config/kube_config.py b/kubernetes_asyncio/config/kube_config.py index 1598e93ea..0be8a850a 100644 --- a/kubernetes_asyncio/config/kube_config.py +++ b/kubernetes_asyncio/config/kube_config.py @@ -21,7 +21,6 @@ import os import tempfile -import urllib3 import yaml from kubernetes_asyncio.client import ApiClient, Configuration @@ -319,9 +318,9 @@ def _load_user_token(self): def _load_user_pass_token(self): if 'username' in self._user and 'password' in self._user: - self.token = urllib3.util.make_headers( - basic_auth=(self._user['username'] + ':' + - self._user['password'])).get('authorization') + basic_auth = self._user['username'] + ':' + self._user['password'] + self.token = 'Basic ' + base64.b64encode( + basic_auth.encode()).decode('utf-8') return True def _load_cluster_info(self):