Class: RailsSso::Configuration
- Inherits:
-
Object
- Object
- RailsSso::Configuration
- Defined in:
- lib/rails_sso/configuration.rb
Instance Attribute Summary collapse
-
#access_token_mock ⇒ Object
Returns the value of attribute access_token_mock.
-
#application_controller ⇒ Object
Returns the value of attribute application_controller.
-
#failure_app ⇒ Object
Returns the value of attribute failure_app.
-
#magic_enabled ⇒ Object
Returns the value of attribute magic_enabled.
-
#profile_mocks ⇒ Object
Returns the value of attribute profile_mocks.
-
#provider_key ⇒ Object
Returns the value of attribute provider_key.
-
#provider_name ⇒ Object
Returns the value of attribute provider_name.
-
#provider_profile_path ⇒ Object
Returns the value of attribute provider_profile_path.
-
#provider_secret ⇒ Object
Returns the value of attribute provider_secret.
-
#provider_sign_out_path ⇒ Object
Returns the value of attribute provider_sign_out_path.
- #provider_url ⇒ Object
-
#test_mode ⇒ Object
Returns the value of attribute test_mode.
-
#use_cache ⇒ Object
Returns the value of attribute use_cache.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #oauth2_strategy_class ⇒ Object
- #profile_mock ⇒ Object
- #provider_callback_path ⇒ Object
- #test_mode? ⇒ Boolean
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
22 23 24 25 26 27 28 29 30 |
# File 'lib/rails_sso/configuration.rb', line 22 def initialize self.application_controller = "ApplicationController" self.magic_enabled = true self.use_cache = false self.test_mode = false self.profile_mocks = {} self.access_token_mock = nil self.failure_app = RailsSso::FailureApp end |
Instance Attribute Details
#access_token_mock ⇒ Object
Returns the value of attribute access_token_mock.
18 19 20 |
# File 'lib/rails_sso/configuration.rb', line 18 def access_token_mock @access_token_mock end |
#application_controller ⇒ Object
Returns the value of attribute application_controller.
3 4 5 |
# File 'lib/rails_sso/configuration.rb', line 3 def application_controller @application_controller end |
#failure_app ⇒ Object
Returns the value of attribute failure_app.
20 21 22 |
# File 'lib/rails_sso/configuration.rb', line 20 def failure_app @failure_app end |
#magic_enabled ⇒ Object
Returns the value of attribute magic_enabled.
4 5 6 |
# File 'lib/rails_sso/configuration.rb', line 4 def magic_enabled @magic_enabled end |
#profile_mocks ⇒ Object
Returns the value of attribute profile_mocks.
17 18 19 |
# File 'lib/rails_sso/configuration.rb', line 17 def profile_mocks @profile_mocks end |
#provider_key ⇒ Object
Returns the value of attribute provider_key.
8 9 10 |
# File 'lib/rails_sso/configuration.rb', line 8 def provider_key @provider_key end |
#provider_name ⇒ Object
Returns the value of attribute provider_name.
7 8 9 |
# File 'lib/rails_sso/configuration.rb', line 7 def provider_name @provider_name end |
#provider_profile_path ⇒ Object
Returns the value of attribute provider_profile_path.
11 12 13 |
# File 'lib/rails_sso/configuration.rb', line 11 def provider_profile_path @provider_profile_path end |
#provider_secret ⇒ Object
Returns the value of attribute provider_secret.
9 10 11 |
# File 'lib/rails_sso/configuration.rb', line 9 def provider_secret @provider_secret end |
#provider_sign_out_path ⇒ Object
Returns the value of attribute provider_sign_out_path.
12 13 14 |
# File 'lib/rails_sso/configuration.rb', line 12 def provider_sign_out_path @provider_sign_out_path end |
#provider_url ⇒ Object
55 56 57 58 59 |
# File 'lib/rails_sso/configuration.rb', line 55 def provider_url fail RailsSso::Error, "Provider url not set!" if @provider_url.nil? @provider_url end |
#test_mode ⇒ Object
Returns the value of attribute test_mode.
16 17 18 |
# File 'lib/rails_sso/configuration.rb', line 16 def test_mode @test_mode end |
#use_cache ⇒ Object
Returns the value of attribute use_cache.
14 15 16 |
# File 'lib/rails_sso/configuration.rb', line 14 def use_cache @use_cache end |
Instance Method Details
#oauth2_strategy_class ⇒ Object
36 37 38 |
# File 'lib/rails_sso/configuration.rb', line 36 def oauth2_strategy_class OmniAuth::Strategies.const_get("#{OmniAuth::Utils.camelize(provider_name.to_s)}") end |
#profile_mock ⇒ Object
45 46 47 48 49 |
# File 'lib/rails_sso/configuration.rb', line 45 def profile_mock profile_mocks.fetch(access_token_mock) do fail %Q{Mock "#{access_token_mock}" has not been setup!} end end |
#provider_callback_path ⇒ Object
32 33 34 |
# File 'lib/rails_sso/configuration.rb', line 32 def provider_callback_path "/sso/#{provider_name}/callback" end |
#test_mode? ⇒ Boolean
51 52 53 |
# File 'lib/rails_sso/configuration.rb', line 51 def test_mode? @test_mode end |