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(params, repo, username, password) ⇒ BearerAuth

Returns a new instance of BearerAuth.



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

def initialize(params, repo, username, password)
  @params = params
  @repo = repo
  @username = username
  @password = password
end

Instance Attribute Details

#paramsObject (readonly)

Returns the value of attribute params.



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

def params
  @params
end

#passwordObject (readonly)

Returns the value of attribute password.



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

def password
  @password
end

#repoObject (readonly)

Returns the value of attribute repo.



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

def repo
  @repo
end

#usernameObject (readonly)

Returns the value of attribute username.



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

def username
  @username
end

Instance Method Details

#make_get(path) ⇒ Object



19
20
21
22
23
# File 'lib/docker/remote/bearer_auth.rb', line 19

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