Class: Gitlab::Auth::Saml::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/gitlab/auth/saml/config.rb

Constant Summary collapse

DEFAULT_PROVIDER_NAME =
'saml'

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(provider = DEFAULT_PROVIDER_NAME) ⇒ Config

Returns a new instance of Config.



15
16
17
# File 'lib/gitlab/auth/saml/config.rb', line 15

def initialize(provider = DEFAULT_PROVIDER_NAME)
  @provider = provider
end

Class Method Details

.enabled?Boolean

Returns:

  • (Boolean)


8
9
10
# File 'lib/gitlab/auth/saml/config.rb', line 8

def enabled?
  ::AuthHelper.saml_providers.any?
end

Instance Method Details

#admin_groupsObject



35
36
37
# File 'lib/gitlab/auth/saml/config.rb', line 35

def admin_groups
  options[:admin_groups]
end

#external_groupsObject



31
32
33
# File 'lib/gitlab/auth/saml/config.rb', line 31

def external_groups
  options[:external_groups]
end

#groupsObject



27
28
29
# File 'lib/gitlab/auth/saml/config.rb', line 27

def groups
  options[:groups_attribute]
end

#optionsObject



19
20
21
# File 'lib/gitlab/auth/saml/config.rb', line 19

def options
  Gitlab::Auth::OAuth::Provider.config_for(@provider)
end

#upstream_two_factor_authn_contextsObject



23
24
25
# File 'lib/gitlab/auth/saml/config.rb', line 23

def upstream_two_factor_authn_contexts
  options.args[:upstream_two_factor_authn_contexts]
end