Class: Isaca::Rails::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/isaca/rails.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



105
106
107
108
109
110
# File 'lib/isaca/rails.rb', line 105

def initialize
  @redirect_for_consent = true
  @cache_sso = false
  @cache_sso_token_expires_in = 2.minutes
  @cache_sso_details_expires_in = 15.minutes
end

Instance Attribute Details

#cache_ssoObject

Whether or not Rails should cache ISACA SSO endpoints.

Isaca::Rails.configure {|config| config.cache_sso = false}

Default false



79
80
81
# File 'lib/isaca/rails.rb', line 79

def cache_sso
  @cache_sso
end

#cache_sso_details_expires_inObject

If cache_sso is true, user details caching should expire based on the given value. The duration of this cache will impact how frequently a user’s personal data is “synced”.

Isaca::Rails.configure {|config| config.cache_sso_details_expires_in = 15.minutes}

Default 15 minutes



96
97
98
# File 'lib/isaca/rails.rb', line 96

def cache_sso_details_expires_in
  @cache_sso_details_expires_in
end

#cache_sso_token_expires_inObject

If cache_sso is true, token caching should expire based on the given value. Keep in mind that if a user logs out of another ISACA service that the session cannot be validated until the cache expires [assuming a Token cookie still exists].

Isaca::Rails.configure {|config| config.cache_sso_token_expires_in = 2.minutes}

Default 2 minutes



88
89
90
# File 'lib/isaca/rails.rb', line 88

def cache_sso_token_expires_in
  @cache_sso_token_expires_in
end

#redirect_after_account_creationObject

Will append RedirectURL to Isaca Account creation wizard URI if value is not nil

Isaca::Rails.configure {|config| config.redirect_after_account_creation = “myapp.isaca.org”}

Default nil



103
104
105
# File 'lib/isaca/rails.rb', line 103

def 
  @redirect_after_account_creation
end

Whether or not users should be redirected and required to provide consent if they have not already.

Isaca::Rails.configure {|config| config.redirect_for_consent = ::Person}

Default true



72
73
74
# File 'lib/isaca/rails.rb', line 72

def redirect_for_consent
  @redirect_for_consent
end

#user_modelObject

ActiveRecord class that represents the users of your application. Should return an ActiveRecord class.

You can set the user_model in the configuration for this engine.

Isaca::Rails.configure {|config| config.user_model = ::Person}

Default ‘::User`



65
66
67
# File 'lib/isaca/rails.rb', line 65

def user_model
  @user_model
end