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, :login_url, :service]

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration


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

def initialize
  @verify_ssl_cert = true
end

Instance Method Details

#extra_attributes_filterObject


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

def extra_attributes_filter
  Array(@extra_attributes_filter)
end

#update(settings_hash) ⇒ Object

Raises:

  • (ArgumentError)

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

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