Class: Shakha::Config
- Inherits:
-
Object
- Object
- Shakha::Config
- Defined in:
- lib/shakha/config.rb
Instance Attribute Summary collapse
-
#app_origin ⇒ Object
Returns the value of attribute app_origin.
-
#google_client_id ⇒ Object
Returns the value of attribute google_client_id.
-
#google_client_secret ⇒ Object
Returns the value of attribute google_client_secret.
-
#issuer ⇒ Object
Returns the value of attribute issuer.
-
#key_id ⇒ Object
Returns the value of attribute key_id.
-
#rate_limiting_enabled ⇒ Object
Returns the value of attribute rate_limiting_enabled.
-
#service_secret ⇒ Object
Returns the value of attribute service_secret.
-
#service_url ⇒ Object
Returns the value of attribute service_url.
-
#session_lifetime ⇒ Object
Returns the value of attribute session_lifetime.
-
#signing_key ⇒ Object
Returns the value of attribute signing_key.
-
#verification_key ⇒ Object
Returns the value of attribute verification_key.
Instance Method Summary collapse
- #audience ⇒ Object
- #client_id ⇒ Object
- #embedded? ⇒ Boolean
-
#initialize ⇒ Config
constructor
A new instance of Config.
- #service_base_url ⇒ Object
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
17 18 19 20 21 |
# File 'lib/shakha/config.rb', line 17 def initialize @session_lifetime = 30.days @issuer = "https://shakha.dev" @rate_limiting_enabled = false end |
Instance Attribute Details
#app_origin ⇒ Object
Returns the value of attribute app_origin.
5 6 7 |
# File 'lib/shakha/config.rb', line 5 def app_origin @app_origin end |
#google_client_id ⇒ Object
Returns the value of attribute google_client_id.
5 6 7 |
# File 'lib/shakha/config.rb', line 5 def google_client_id @google_client_id end |
#google_client_secret ⇒ Object
Returns the value of attribute google_client_secret.
5 6 7 |
# File 'lib/shakha/config.rb', line 5 def google_client_secret @google_client_secret end |
#issuer ⇒ Object
Returns the value of attribute issuer.
5 6 7 |
# File 'lib/shakha/config.rb', line 5 def issuer @issuer end |
#key_id ⇒ Object
Returns the value of attribute key_id.
5 6 7 |
# File 'lib/shakha/config.rb', line 5 def key_id @key_id end |
#rate_limiting_enabled ⇒ Object
Returns the value of attribute rate_limiting_enabled.
5 6 7 |
# File 'lib/shakha/config.rb', line 5 def rate_limiting_enabled @rate_limiting_enabled end |
#service_secret ⇒ Object
Returns the value of attribute service_secret.
5 6 7 |
# File 'lib/shakha/config.rb', line 5 def service_secret @service_secret end |
#service_url ⇒ Object
Returns the value of attribute service_url.
5 6 7 |
# File 'lib/shakha/config.rb', line 5 def service_url @service_url end |
#session_lifetime ⇒ Object
Returns the value of attribute session_lifetime.
5 6 7 |
# File 'lib/shakha/config.rb', line 5 def session_lifetime @session_lifetime end |
#signing_key ⇒ Object
Returns the value of attribute signing_key.
5 6 7 |
# File 'lib/shakha/config.rb', line 5 def signing_key @signing_key end |
#verification_key ⇒ Object
Returns the value of attribute verification_key.
5 6 7 |
# File 'lib/shakha/config.rb', line 5 def verification_key @verification_key end |
Instance Method Details
#audience ⇒ Object
40 41 42 |
# File 'lib/shakha/config.rb', line 40 def audience client_id end |
#client_id ⇒ Object
33 34 35 36 37 38 |
# File 'lib/shakha/config.rb', line 33 def client_id return @client_id if defined?(@client_id) origin = URI.parse(app_origin).origin @client_id = "origin:#{origin}" end |
#embedded? ⇒ Boolean
23 24 25 |
# File 'lib/shakha/config.rb', line 23 def service_url.blank? end |
#service_base_url ⇒ Object
27 28 29 30 31 |
# File 'lib/shakha/config.rb', line 27 def service_base_url return app_origin if service_url.chomp("/") end |