diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-05-30 17:12:50 +0200 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-05-31 13:23:13 +0200 |
commit | 846d111f1d07e62e295ea778b85ada9088be2f31 (patch) | |
tree | 283a58e566cdaa42d003875713940daaaa2635ec /app/services/auth | |
parent | ba81c91255aac2d724ceb94e3eb91f912227e2eb (diff) | |
download | gitlab-ce-846d111f1d07e62e295ea778b85ada9088be2f31.tar.gz |
Add Application Setting to configure Container Registry token expire delay (default 5min)
Diffstat (limited to 'app/services/auth')
-rw-r--r-- | app/services/auth/container_registry_authentication_service.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/app/services/auth/container_registry_authentication_service.rb b/app/services/auth/container_registry_authentication_service.rb index 5090bd8f6e6..56e567c9eed 100644 --- a/app/services/auth/container_registry_authentication_service.rb +++ b/app/services/auth/container_registry_authentication_service.rb @@ -1,5 +1,7 @@ module Auth class ContainerRegistryAuthenticationService < BaseService + include CurrentSettings + AUDIENCE = 'container_registry' def execute @@ -17,6 +19,7 @@ module Auth token = JSONWebToken::RSAToken.new(registry.key) token.issuer = registry.issuer token.audience = AUDIENCE + token.expire_time = token.issued_at + current_application_settings.container_registry_token_expire_delay.minutes token[:access] = names.map do |name| { type: 'repository', name: name, actions: %w(*) } end |