Class: Docker::Remote::BearerAuth

Inherits:
Object
  • Object
show all
Includes:
Utils
Defined in:
lib/docker/remote/bearer_auth.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Utils

#potentially_raise_error!

Constructor Details

#initialize(auth_info, creds) ⇒ BearerAuth

Returns a new instance of BearerAuth.



12
13
14
15
# File 'lib/docker/remote/bearer_auth.rb', line 12

def initialize(auth_info, creds)
  @auth_info = auth_info
  @creds = creds
end

Instance Attribute Details

#auth_infoObject (readonly)

Returns the value of attribute auth_info.



10
11
12
# File 'lib/docker/remote/bearer_auth.rb', line 10

def auth_info
  @auth_info
end

#credsObject (readonly)

Returns the value of attribute creds.



10
11
12
# File 'lib/docker/remote/bearer_auth.rb', line 10

def creds
  @creds
end

Instance Method Details

#make_get(path) ⇒ Object



17
18
19
20
21
# File 'lib/docker/remote/bearer_auth.rb', line 17

def make_get(path)
  Net::HTTP::Get.new(path).tap do |request|
    request['Authorization'] = "Bearer #{token}"
  end
end