Class: RackCAS::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/rack-cas/configuration.rb

Constant Summary collapse

SETTINGS =
[:fake, :fake_attributes, :server_url, :session_store, :exclude_path, :exclude_paths, :extra_attributes_filter,
:verify_ssl_cert, :renew, :use_saml_validation, :ignore_intercept_validator, :exclude_request_validator, :protocol,:redis_options]

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



15
16
17
# File 'lib/rack-cas/configuration.rb', line 15

def initialize
  @verify_ssl_cert = true
end

Instance Method Details

#extra_attributes_filterObject



19
20
21
# File 'lib/rack-cas/configuration.rb', line 19

def extra_attributes_filter
  Array(@extra_attributes_filter)
end

#update(settings_hash) ⇒ Object

Raises:

  • (ArgumentError)


23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/rack-cas/configuration.rb', line 23

def update(settings_hash)
  settings_hash.each do |setting, value|
    unless SETTINGS.include? setting.to_sym
      raise ArgumentError, "invalid setting: #{setting}"
    end

    public_send "#{setting}=", value
  end

  raise ArgumentError, 'server_url is required' unless server_url?
  if session_store? && !session_store.respond_to?(:destroy_session_by_cas_ticket)
    raise ArgumentError, 'session_store does not support single-sign-out'
  end
end