Class: Facebook::Messenger::Configuration::Providers::Environment
- Defined in:
- lib/facebook/messenger/configuration/providers/environment.rb
Overview
The default configuration provider for environment variables.
Instance Method Summary collapse
-
#access_token_for ⇒ Object
Return String of page access token.
-
#app_secret_for ⇒ Object
Return String of app secret of Facebook App.
- #fetch_app_secret_proof_enabled? ⇒ Boolean
- #valid_verify_token?(verify_token) ⇒ Boolean
Methods inherited from Base
Instance Method Details
#access_token_for ⇒ Object
Return String of page access token.
22 23 24 |
# File 'lib/facebook/messenger/configuration/providers/environment.rb', line 22 def access_token_for(*) ENV['ACCESS_TOKEN'] end |
#app_secret_for ⇒ Object
Return String of app secret of Facebook App. Make sure you are returning the app secret if you overwrite configuration provider class as this app secret is used to validate the incoming requests.
17 18 19 |
# File 'lib/facebook/messenger/configuration/providers/environment.rb', line 17 def app_secret_for(*) ENV['APP_SECRET'] end |
#fetch_app_secret_proof_enabled? ⇒ Boolean
26 27 28 |
# File 'lib/facebook/messenger/configuration/providers/environment.rb', line 26 def fetch_app_secret_proof_enabled? ENV['APP_SECRET_PROOF_ENABLED'] == 'true'.freeze end |
#valid_verify_token?(verify_token) ⇒ Boolean
9 10 11 |
# File 'lib/facebook/messenger/configuration/providers/environment.rb', line 9 def valid_verify_token?(verify_token) verify_token == ENV['VERIFY_TOKEN'] end |