diff options
Diffstat (limited to 'app/models/deploy_token.rb')
-rw-r--r-- | app/models/deploy_token.rb | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/app/models/deploy_token.rb b/app/models/deploy_token.rb index 1ab603b5ddf..60ecdf6c367 100644 --- a/app/models/deploy_token.rb +++ b/app/models/deploy_token.rb @@ -10,7 +10,6 @@ class DeployToken < ApplicationRecord read_package_registry write_package_registry].freeze GITLAB_DEPLOY_TOKEN_NAME = 'gitlab-deploy-token' DEPLOY_TOKEN_PREFIX = 'gldt-' - REQUIRED_DEPENDENCY_PROXY_SCOPES = %i[read_registry write_registry].freeze add_authentication_token_field :token, encrypted: :required, format_with_prefix: :prefix_for_deploy_token @@ -58,7 +57,7 @@ class DeployToken < ApplicationRecord def valid_for_dependency_proxy? group_type? && active? && - REQUIRED_DEPENDENCY_PROXY_SCOPES.all? { |scope| scope.in?(scopes) } + (Gitlab::Auth::REGISTRY_SCOPES & scopes).size == Gitlab::Auth::REGISTRY_SCOPES.size end def revoke! |