diff --git a/CHANGES/9390.bugfix b/CHANGES/9390.bugfix new file mode 100644 index 000000000..28f9a5d39 --- /dev/null +++ b/CHANGES/9390.bugfix @@ -0,0 +1 @@ +Use proxy auth credentials of a Remote when syncing content. diff --git a/pulp_ansible/app/downloaders.py b/pulp_ansible/app/downloaders.py index b19bd8e78..a247a9769 100644 --- a/pulp_ansible/app/downloaders.py +++ b/pulp_ansible/app/downloaders.py @@ -130,7 +130,9 @@ async def _run_with_additional_headers(self, headers): more information. """ await asyncio.sleep(0.75) - 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, auth=self.auth + ) as response: self.raise_for_status(response) to_return = await self._handle_response(response) await response.release() @@ -159,7 +161,12 @@ async def get_or_update_token(self): } url = self.ansible_auth_url async with self.session.post( - url, data=form_payload, proxy=self.proxy, raise_for_status=True + url, + data=form_payload, + proxy=self.proxy, + proxy_auth=self.proxy_auth, + auth=self.auth, + raise_for_status=True, ) as response: token_data = await response.text()