Class: DependencyProxy::Registry

Inherits:
Object
  • Object
show all
Defined in:
app/models/dependency_proxy/registry.rb

Constant Summary collapse

AUTH_URL =
'https://auth.docker.io'
LIBRARY_URL =
'https://registry-1.docker.io/v2'
PROXY_AUTH_URL =
Gitlab::Utils.append_path(Gitlab.config.gitlab.url, "jwt/auth")

Class Method Summary collapse

Class Method Details

.auth_url(image) ⇒ Object



9
10
11
# File 'app/models/dependency_proxy/registry.rb', line 9

def auth_url(image)
  "#{AUTH_URL}/token?service=registry.docker.io&scope=repository:#{image_path(image)}:pull"
end

.authenticate_headerObject



21
22
23
# File 'app/models/dependency_proxy/registry.rb', line 21

def authenticate_header
  "Bearer realm=\"#{PROXY_AUTH_URL}\",service=\"#{::Auth::DependencyProxyAuthenticationService::AUDIENCE}\""
end

.blob_url(image, blob_sha) ⇒ Object



17
18
19
# File 'app/models/dependency_proxy/registry.rb', line 17

def blob_url(image, blob_sha)
  "#{LIBRARY_URL}/#{image_path(image)}/blobs/#{blob_sha}"
end

.manifest_url(image, tag) ⇒ Object



13
14
15
# File 'app/models/dependency_proxy/registry.rb', line 13

def manifest_url(image, tag)
  "#{LIBRARY_URL}/#{image_path(image)}/manifests/#{tag}"
end