Method: Docker::Remote::AuthInfo.from_header

Defined in:
lib/docker/remote/auth_info.rb

.from_header(header, creds) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/docker/remote/auth_info.rb', line 5

def from_header(header, creds)
  idx = header.index(' ')
  auth_type = header[0..idx].strip.downcase

  params = header[idx..-1].split(',').each_with_object({}) do |param, ret|
    key, value = param.split('=')
    ret[key.strip] = value.strip[1..-2]  # remove quotes
  end

  new(auth_type, params, creds)
end