Class: Docker::Remote::BearerAuth
- Inherits:
-
Object
- Object
- Docker::Remote::BearerAuth
- Includes:
- Utils
- Defined in:
- lib/docker/remote/bearer_auth.rb
Instance Attribute Summary collapse
-
#auth_info ⇒ Object
readonly
Returns the value of attribute auth_info.
-
#creds ⇒ Object
readonly
Returns the value of attribute creds.
Instance Method Summary collapse
-
#initialize(auth_info, creds) ⇒ BearerAuth
constructor
A new instance of BearerAuth.
- #make_get(path) ⇒ Object
Methods included from Utils
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_info ⇒ Object (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 |
#creds ⇒ Object (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 |