Class: Parse::Middleware::Authentication
- Inherits:
-
Faraday::Middleware
- Object
- Faraday::Middleware
- Parse::Middleware::Authentication
- Includes:
- Protocol
- Defined in:
- lib/parse/client/authentication.rb
Overview
This middleware handles sending the proper authentication headers to the Parse REST API endpoint.
Constant Summary
Constants included from Protocol
Protocol::API_KEY, Protocol::APP_ID, Protocol::CONTENT_TYPE, Protocol::CONTENT_TYPE_FORMAT, Protocol::EMAIL, Protocol::INSTALLATION_ID, Protocol::MASTER_KEY, Protocol::PASSWORD, Protocol::REVOCABLE_SESSION, Protocol::SERVER_URL, Protocol::SESSION_TOKEN
Instance Attribute Summary collapse
-
#api_key ⇒ String
The REST API Key for this Parse endpoint.
-
#application_id ⇒ String
The application id for this Parse endpoint.
-
#master_key ⇒ String
The Master key API Key for this Parse endpoint.
Instance Method Summary collapse
-
#initialize(adapter, options = {}) ⇒ Authentication
constructor
A new instance of Authentication.
Constructor Details
#initialize(adapter, options = {}) ⇒ Authentication
Returns a new instance of Authentication.
40 41 42 43 44 45 46 |
# File 'lib/parse/client/authentication.rb', line 40 def initialize(adapter, = {}) super(adapter) @application_id = [:application_id] @api_key = [:api_key] @master_key = [:master_key] @content_type = [:content_type] || CONTENT_TYPE_FORMAT end |
Instance Attribute Details
#api_key ⇒ String
Returns the REST API Key for this Parse endpoint.
23 24 25 |
# File 'lib/parse/client/authentication.rb', line 23 def api_key @api_key end |
#application_id ⇒ String
Returns the application id for this Parse endpoint.
21 22 23 |
# File 'lib/parse/client/authentication.rb', line 21 def application_id @application_id end |
#master_key ⇒ String
The Master key API Key for this Parse endpoint. This is optional. If provided, it will be sent in every request.
27 28 29 |
# File 'lib/parse/client/authentication.rb', line 27 def master_key @master_key end |