Class: ActiveRecordApi::Request::TokenRetriever
- Inherits:
-
Methods
- Object
- Credentials
- Connection
- Methods
- ActiveRecordApi::Request::TokenRetriever
- Defined in:
- lib/active_record_api/request/token_retriever.rb
Instance Attribute Summary collapse
-
#credentials ⇒ Object
Returns the value of attribute credentials.
-
#host ⇒ Object
Returns the value of attribute host.
-
#token_path ⇒ Object
(also: #path)
Returns the value of attribute token_path.
Attributes inherited from Connection
#cache_store, #debug, #full_url, #timeout
Attributes inherited from Credentials
Instance Method Summary collapse
Methods inherited from Methods
#get, #health_endpoint, #post, #put, #query, #service_healthy?
Methods inherited from Connection
#authenticated_connection, #connection, #full_url_with_params, #http_cache_options, #service_url, #strip_double_slash, #strip_trailing_slash, #symbolize_array_response, #symbolize_response
Methods inherited from Credentials
Instance Attribute Details
#credentials ⇒ Object
Returns the value of attribute credentials.
5 6 7 |
# File 'lib/active_record_api/request/token_retriever.rb', line 5 def credentials @credentials end |
#host ⇒ Object
Returns the value of attribute host.
5 6 7 |
# File 'lib/active_record_api/request/token_retriever.rb', line 5 def host @host end |
#token_path ⇒ Object Also known as: path
Returns the value of attribute token_path.
5 6 7 |
# File 'lib/active_record_api/request/token_retriever.rb', line 5 def token_path @token_path end |
Instance Method Details
#fetch_token ⇒ Object
9 10 11 |
# File 'lib/active_record_api/request/token_retriever.rb', line 9 def fetch_token post(payload: credentials)[:token] end |
#headers ⇒ Object
13 14 15 |
# File 'lib/active_record_api/request/token_retriever.rb', line 13 def headers @headers ||= {} end |