Class: SpRailsSaml::Settings

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/sp-rails-saml/settings.rb

Overview

SAML2 settings for initializer.

Constant Summary collapse

RUBY_SAML_DEFAULT_SETTINGS =
{
  compress_request: true,
  skip_subject_confirmation: true,
  skip_conditions: true,
  skip_destination: false,
  want_assertions_signed: true,
  account_find_key: :id,
  user_find_key: :email,
  saml_response_user_find_key: :email
}.freeze

Class Attribute Summary collapse

Instance Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.account_classObject

Returns the value of attribute account_class.



30
31
32
# File 'lib/sp-rails-saml/settings.rb', line 30

def 
  @account_class
end

.account_find_keyObject

Returns the value of attribute account_find_key.



30
31
32
# File 'lib/sp-rails-saml/settings.rb', line 30

def 
  @account_find_key
end

.authn_contextObject

Returns the value of attribute authn_context.



30
31
32
# File 'lib/sp-rails-saml/settings.rb', line 30

def authn_context
  @authn_context
end

.authn_context_comparisonObject

Returns the value of attribute authn_context_comparison.



30
31
32
# File 'lib/sp-rails-saml/settings.rb', line 30

def authn_context_comparison
  @authn_context_comparison
end

.name_identifier_formatObject

Returns the value of attribute name_identifier_format.



30
31
32
# File 'lib/sp-rails-saml/settings.rb', line 30

def name_identifier_format
  @name_identifier_format
end

.saml_response_user_find_keyObject

Returns the value of attribute saml_response_user_find_key.



30
31
32
# File 'lib/sp-rails-saml/settings.rb', line 30

def saml_response_user_find_key
  @saml_response_user_find_key
end

.user_classObject

Returns the value of attribute user_class.



30
31
32
# File 'lib/sp-rails-saml/settings.rb', line 30

def user_class
  @user_class
end

.user_find_keyObject

Returns the value of attribute user_find_key.



30
31
32
# File 'lib/sp-rails-saml/settings.rb', line 30

def user_find_key
  @user_find_key
end

Instance Attribute Details

#account_classObject (readonly)

Returns the value of attribute account_class.



20
21
22
# File 'lib/sp-rails-saml/settings.rb', line 20

def 
  @account_class
end

#account_find_keyObject (readonly)

Returns the value of attribute account_find_key.



20
21
22
# File 'lib/sp-rails-saml/settings.rb', line 20

def 
  @account_find_key
end

#authn_contextObject (readonly)

Returns the value of attribute authn_context.



20
21
22
# File 'lib/sp-rails-saml/settings.rb', line 20

def authn_context
  @authn_context
end

#authn_context_comparisonObject (readonly)

Returns the value of attribute authn_context_comparison.



20
21
22
# File 'lib/sp-rails-saml/settings.rb', line 20

def authn_context_comparison
  @authn_context_comparison
end

#name_identifier_formatObject (readonly)

Returns the value of attribute name_identifier_format.



20
21
22
# File 'lib/sp-rails-saml/settings.rb', line 20

def name_identifier_format
  @name_identifier_format
end

#saml_response_user_find_keyObject (readonly)

Returns the value of attribute saml_response_user_find_key.



20
21
22
# File 'lib/sp-rails-saml/settings.rb', line 20

def saml_response_user_find_key
  @saml_response_user_find_key
end

#user_classObject (readonly)

Returns the value of attribute user_class.



20
21
22
# File 'lib/sp-rails-saml/settings.rb', line 20

def user_class
  @user_class
end

#user_find_keyObject (readonly)

Returns the value of attribute user_find_key.



20
21
22
# File 'lib/sp-rails-saml/settings.rb', line 20

def user_find_key
  @user_find_key
end

Class Method Details

.setup {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/sp-rails-saml/settings.rb', line 39

def setup
  yield self

  setting = SpRailsSaml::Settings.instance

  setting.instance_variable_set(:@name_identifier_format, SpRailsSaml::Settings.name_identifier_format)
  setting.instance_variable_set(:@authn_context, SpRailsSaml::Settings.authn_context)
  setting.instance_variable_set(:@authn_context_comparison, SpRailsSaml::Settings.authn_context_comparison)
  setting.instance_variable_set(:@user_class, SpRailsSaml::Settings.user_class)
  setting.instance_variable_set(:@account_class, SpRailsSaml::Settings.)
  setting.instance_variable_set(:@user_find_key, SpRailsSaml::Settings.user_find_key || RUBY_SAML_DEFAULT_SETTINGS[:user_find_key])
  setting.instance_variable_set(:@account_find_key, SpRailsSaml::Settings. || RUBY_SAML_DEFAULT_SETTINGS[:account_find_key])
  setting.instance_variable_set(:@saml_response_user_find_key,
                                SpRailsSaml::Settings.saml_response_user_find_key || RUBY_SAML_DEFAULT_SETTINGS[:saml_response_user_find_key])
end