Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use proxy auth credentials during sync #357

Merged
merged 1 commit into from
Jul 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES/9065.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Use proxy auth credentials when syncing content from a Remote.
10 changes: 8 additions & 2 deletions pulp_container/app/downloaders.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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()

Expand Down