diff options
Diffstat (limited to 'app/services/auth')
-rw-r--r-- | app/services/auth/container_registry_authentication_service.rb | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/app/services/auth/container_registry_authentication_service.rb b/app/services/auth/container_registry_authentication_service.rb index ba0b60abfe4..df1c9b2851c 100644 --- a/app/services/auth/container_registry_authentication_service.rb +++ b/app/services/auth/container_registry_authentication_service.rb @@ -4,8 +4,8 @@ module Auth AUDIENCE = 'container_registry' - def execute(capabilities: capabilities) - @capabilities = capabilities + def execute(capabilities:) + @capabilities = capabilities || [] return error('not found', 404) unless registry.enabled @@ -76,7 +76,7 @@ module Auth case requested_action when 'pull' - build_can_pull?(requested_project) || user_can_pull?(requested_project) + requested_project.public? || build_can_pull?(requested_project) || user_can_pull?(requested_project) when 'push' build_can_push?(requested_project) || user_can_push?(requested_project) else @@ -88,8 +88,6 @@ module Auth Gitlab.config.registry end - private - def build_can_pull?(requested_project) # Build can: # 1. pull from it's own project (for ex. a build) |