Skip to content
Merged
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
10 changes: 7 additions & 3 deletions docker_registry_client_async/dockerregistryclientasync.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,9 +278,13 @@ async def _get_auth_token(
headers = {}
if credentials:
headers["Authorization"] = f"Basic {credentials}"
url = GENERIC_OAUTH2_URL_PATTERN.format(
bearer["realm"], bearer["service"], scope
)
if "service" not in bearer:
oauth2_url_pattern_without_service = "{0}?scope={1}&client_id=docker-registry-client-async"
url = oauth2_url_pattern_without_service.format(bearer["realm"], scope)
else:
url = GENERIC_OAUTH2_URL_PATTERN.format(
bearer["realm"], bearer["service"], scope
)
client_response = await client_session.get(
headers=headers,
raise_for_status=True,
Expand Down
Loading