Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix mapping of insufficient scopes return value to access denied exception #8251

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

Merged
merged 1 commit into from
May 4, 2023
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
2 changes: 2 additions & 0 deletions localstack/utils/container_utils/docker_cmd_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,8 @@ def push_image(self, docker_image: str) -> None:
raise AccessDenied(docker_image)
if "requesting higher privileges than access token allows" in to_str(e.stdout):
raise AccessDenied(docker_image)
if "access token has insufficient scopes" in to_str(e.stdout):
raise AccessDenied(docker_image)
if "does not exist" in to_str(e.stdout):
raise NoSuchImage(docker_image)
if "connection refused" in to_str(e.stdout):
Expand Down
2 changes: 2 additions & 0 deletions localstack/utils/container_utils/docker_sdk_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,8 @@ def push_image(self, docker_image: str) -> None:
raise AccessDenied(docker_image)
if "requesting higher privileges than access token allows" in to_str(result):
raise AccessDenied(docker_image)
if "access token has insufficient scopes" in to_str(result):
raise AccessDenied(docker_image)
if "connection refused" in to_str(result):
raise RegistryConnectionError(result)
raise ContainerException(result)
Expand Down