Class: Docker::Remote::BearerAuth
- Inherits:
-
Object
- Object
- Docker::Remote::BearerAuth
- Includes:
- Utils
- Defined in:
- lib/docker/remote/bearer_auth.rb
Instance Attribute Summary collapse
-
#params ⇒ Object
readonly
Returns the value of attribute params.
-
#password ⇒ Object
readonly
Returns the value of attribute password.
-
#repo ⇒ Object
readonly
Returns the value of attribute repo.
-
#username ⇒ Object
readonly
Returns the value of attribute username.
Instance Method Summary collapse
-
#initialize(params, repo, username, password) ⇒ BearerAuth
constructor
A new instance of BearerAuth.
- #make_get(path) ⇒ Object
Methods included from Utils
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
#params ⇒ Object (readonly)
Returns the value of attribute params.
10 11 12 |
# File 'lib/docker/remote/bearer_auth.rb', line 10 def params @params end |
#password ⇒ Object (readonly)
Returns the value of attribute password.
10 11 12 |
# File 'lib/docker/remote/bearer_auth.rb', line 10 def password @password end |
#repo ⇒ Object (readonly)
Returns the value of attribute repo.
10 11 12 |
# File 'lib/docker/remote/bearer_auth.rb', line 10 def repo @repo end |
#username ⇒ Object (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 |