Class: TrainPlugins::Rest::Basic
- Inherits:
-
AuthHandler
- Object
- AuthHandler
- TrainPlugins::Rest::Basic
- Defined in:
- lib/train-rest/auth_handler/basic.rb
Overview
Authentication via HTTP Basic Authentication
Instance Attribute Summary
Attributes inherited from AuthHandler
Instance Method Summary collapse
Methods inherited from AuthHandler
#auth_headers, descendants, #initialize, #login, #logout, name
Constructor Details
This class inherits a constructor from TrainPlugins::Rest::AuthHandler
Instance Method Details
#auth_parameters ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/train-rest/auth_handler/basic.rb', line 14 def auth_parameters { headers: { "Authorization" => format("Basic %s", Base64.encode64([:username] + ":" + [:password]).chomp), }, } end |
#check_options ⇒ Object
9 10 11 12 |
# File 'lib/train-rest/auth_handler/basic.rb', line 9 def raise ArgumentError.new("Need username for Basic authentication") unless [:username] raise ArgumentError.new("Need password for Basic authentication") unless [:password] end |