From c1f65e6b51be3f27960877576bcfa45d807e53c2 Mon Sep 17 00:00:00 2001 From: Dennis Kliban Date: Mon, 12 Jul 2021 18:49:04 -0400 Subject: [PATCH] Use proxy auth credentials during sync fixes: #9065 https://pulp.plan.io/issues/9065 --- CHANGES/9065.bugfix | 1 + pulp_container/app/downloaders.py | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 CHANGES/9065.bugfix diff --git a/CHANGES/9065.bugfix b/CHANGES/9065.bugfix new file mode 100644 index 000000000..b68892d5a --- /dev/null +++ b/CHANGES/9065.bugfix @@ -0,0 +1 @@ +Use proxy auth credentials when syncing content from a Remote. diff --git a/pulp_container/app/downloaders.py b/pulp_container/app/downloaders.py index dc9bd959c..12e4dd722 100644 --- a/pulp_container/app/downloaders.py +++ b/pulp_container/app/downloaders.py @@ -58,7 +58,9 @@ async def _run(self, handle_401=True, extra_data=None): headers.update(auth_headers) # aiohttps does not allow to send auth argument and auth header together self.session._default_auth = None - async with self.session.get(self.url, headers=headers, proxy=self.proxy) as response: + async with self.session.get( + self.url, headers=headers, proxy=self.proxy, proxy_auth=self.proxy_auth + ) as response: try: response.raise_for_status() except ClientResponseError as e: @@ -131,7 +133,11 @@ async def update_token(self, response_auth_header, used_token, repo_name): basic = aiohttp.BasicAuth(self.remote.username, self.remote.password).encode() headers["Authorization"] = basic async with self.session.get( - token_url, headers=headers, proxy=self.proxy, raise_for_status=True + token_url, + headers=headers, + proxy=self.proxy, + proxy_auth=self.proxy_auth, + raise_for_status=True, ) as token_response: token_data = await token_response.text()