Class: TrainPlugins::Rest::AuthtypeApikey
- Inherits:
-
AuthHandler
- Object
- AuthHandler
- TrainPlugins::Rest::AuthtypeApikey
- Defined in:
- lib/train-rest/auth_handler/authtype-apikey.rb
Overview
Authentication via “Apikey” type in Authorization headers.
Could not find a norm for this, just references in e.g. ElasticSearch & Cloud Conformity APIs.
Instance Attribute Summary
Attributes inherited from AuthHandler
Instance Method Summary collapse
Methods inherited from AuthHandler
#auth_headers, descendants, #initialize, #login, #logout, name, #renew_session, #renewal_needed?
Constructor Details
This class inherits a constructor from TrainPlugins::Rest::AuthHandler
Instance Method Details
#auth_parameters ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/train-rest/auth_handler/authtype-apikey.rb', line 15 def auth_parameters { headers: { "Authorization" => format("Apikey %s", [:apikey]), }, } end |
#check_options ⇒ Object
11 12 13 |
# File 'lib/train-rest/auth_handler/authtype-apikey.rb', line 11 def raise ArgumentError.new("Need :apikey for `Authorization: Apikey` authentication") unless [:apikey] end |