Class: DeviseScim::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/devise_scim/configuration.rb

Constant Summary collapse

VALID_TENANCY =
%i[single multi].freeze
VALID_AUTH_METHODS =
%i[token oauth].freeze
VALID_DEPROVISION =
[false, true, :error].freeze
VALID_USER_EXCLUSIVITY =
%i[multiple one_to_one].freeze
VALID_EXCLUSIVITY_CONFLICT =
%i[error reassign].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/devise_scim/configuration.rb', line 27

def initialize
  @route_prefix             = "/scim/v2"
  @tenancy                  = :single
  @auth_method              = :token
  @token                    = nil
  @oauth_client_id          = nil
  @oauth_client_secret      = nil
  @devise_model             = "User"
  @tenant_model             = "DeviseScim::ScimTenant"
  @enable_groups            = false
  @soft_delete              = true
  @deprovision_manual_users = false
  @user_exclusivity         = :multiple
  @exclusivity_conflict     = :error
  @adapter                  = nil
end

Instance Attribute Details

#adapterObject

Returns the value of attribute adapter.



11
12
13
# File 'lib/devise_scim/configuration.rb', line 11

def adapter
  @adapter
end

#auth_methodObject

Returns the value of attribute auth_method.



11
12
13
# File 'lib/devise_scim/configuration.rb', line 11

def auth_method
  @auth_method
end

#deprovision_manual_usersObject

Returns the value of attribute deprovision_manual_users.



11
12
13
# File 'lib/devise_scim/configuration.rb', line 11

def deprovision_manual_users
  @deprovision_manual_users
end

#devise_modelObject

Returns the value of attribute devise_model.



11
12
13
# File 'lib/devise_scim/configuration.rb', line 11

def devise_model
  @devise_model
end

#enable_groupsObject

Returns the value of attribute enable_groups.



11
12
13
# File 'lib/devise_scim/configuration.rb', line 11

def enable_groups
  @enable_groups
end

#exclusivity_conflictObject

Returns the value of attribute exclusivity_conflict.



11
12
13
# File 'lib/devise_scim/configuration.rb', line 11

def exclusivity_conflict
  @exclusivity_conflict
end

#oauth_client_idObject

Returns the value of attribute oauth_client_id.



11
12
13
# File 'lib/devise_scim/configuration.rb', line 11

def oauth_client_id
  @oauth_client_id
end

#oauth_client_secretObject

Returns the value of attribute oauth_client_secret.



11
12
13
# File 'lib/devise_scim/configuration.rb', line 11

def oauth_client_secret
  @oauth_client_secret
end

#route_prefixObject

Returns the value of attribute route_prefix.



11
12
13
# File 'lib/devise_scim/configuration.rb', line 11

def route_prefix
  @route_prefix
end

#soft_deleteObject

Returns the value of attribute soft_delete.



11
12
13
# File 'lib/devise_scim/configuration.rb', line 11

def soft_delete
  @soft_delete
end

#tenancyObject

Returns the value of attribute tenancy.



11
12
13
# File 'lib/devise_scim/configuration.rb', line 11

def tenancy
  @tenancy
end

#tenant_modelObject

Returns the value of attribute tenant_model.



11
12
13
# File 'lib/devise_scim/configuration.rb', line 11

def tenant_model
  @tenant_model
end

#tokenObject

Returns the value of attribute token.



11
12
13
# File 'lib/devise_scim/configuration.rb', line 11

def token
  @token
end

#user_exclusivityObject

Returns the value of attribute user_exclusivity.



11
12
13
# File 'lib/devise_scim/configuration.rb', line 11

def user_exclusivity
  @user_exclusivity
end

Instance Method Details

#validate!Object



44
45
46
47
48
49
50
51
52
# File 'lib/devise_scim/configuration.rb', line 44

def validate!
  validate_enum!(:tenancy, tenancy, VALID_TENANCY)
  validate_enum!(:auth_method, auth_method, VALID_AUTH_METHODS)
  validate_enum!(:user_exclusivity, user_exclusivity, VALID_USER_EXCLUSIVITY)
  validate_enum!(:exclusivity_conflict, exclusivity_conflict, VALID_EXCLUSIVITY_CONFLICT)
  validate_deprovision!
  validate_oauth!
  validate_single_tenant_options!
end