BigW Consortium Gitlab

Commit 1cf164f1 by Grzegorz Bizon

Fix private method visibility in container registry

parent c0ebfea6
...@@ -24,10 +24,14 @@ module Auth ...@@ -24,10 +24,14 @@ module Auth
token[:access] = names.map do |name| token[:access] = names.map do |name|
{ type: 'repository', name: name, actions: %w(*) } { type: 'repository', name: name, actions: %w(*) }
end end
token.encoded token.encoded
end end
def self.token_expire_at
Time.now + current_application_settings.container_registry_token_expire_delay.minutes
end
private private
def authorized_token(*accesses) def authorized_token(*accesses)
...@@ -35,7 +39,7 @@ module Auth ...@@ -35,7 +39,7 @@ module Auth
token.issuer = registry.issuer token.issuer = registry.issuer
token.audience = params[:service] token.audience = params[:service]
token.subject = current_user.try(:username) token.subject = current_user.try(:username)
token.expire_time = ContainerRegistryAuthenticationService.token_expire_at token.expire_time = self.class.token_expire_at
token[:access] = accesses.compact token[:access] = accesses.compact
token token
end end
...@@ -81,9 +85,5 @@ module Auth ...@@ -81,9 +85,5 @@ module Auth
def registry def registry
Gitlab.config.registry Gitlab.config.registry
end end
def self.token_expire_at
Time.now + current_application_settings.container_registry_token_expire_delay.minutes
end
end end
end end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment