Class: Gitlab::QA::Scenario::Test::Integration::InstanceSAML

Inherits:
SAML show all
Defined in:
lib/gitlab/qa/scenario/test/integration/instance_saml.rb

Instance Attribute Summary

Attributes inherited from SAML

#gitlab_name, #saml_component, #spec_suite

Instance Method Summary collapse

Methods inherited from SAML

#before_perform, #perform, #run_specs

Methods inherited from Gitlab::QA::Scenario::Template

perform, #perform

Constructor Details

#initializeInstanceSAML

Returns a new instance of InstanceSAML.



9
10
11
12
13
# File 'lib/gitlab/qa/scenario/test/integration/instance_saml.rb', line 9

def initialize
  @gitlab_name = 'gitlab-instance-saml'
  @spec_suite = 'Test::Integration::InstanceSAML'
  @saml_component = true
end

Instance Method Details

#configure(gitlab, saml) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/gitlab/qa/scenario/test/integration/instance_saml.rb', line 15

def configure(gitlab, saml)
  saml.set_entity_id(gitlab.address)
  saml.set_assertion_consumer_service("#{gitlab.address}/users/auth/saml/callback")
  saml.set_simple_saml_hostname

  gitlab.omnibus_config = <<~OMNIBUS
    gitlab_rails['omniauth_enabled'] = true;
    gitlab_rails['omniauth_allow_single_sign_on'] = ['saml'];
    gitlab_rails['omniauth_block_auto_created_users'] = false;
    gitlab_rails['omniauth_auto_link_saml_user'] = true;
    gitlab_rails['omniauth_providers'] = [
      {
        name: 'saml',
        args: {
                 assertion_consumer_service_url: '#{gitlab.address}/users/auth/saml/callback',
                 idp_cert_fingerprint: '11:9b:9e:02:79:59:cd:b7:c6:62:cf:d0:75:d9:e2:ef:38:4e:44:5f',
                 idp_sso_target_url: 'https://#{saml.hostname}:8443/simplesaml/saml2/idp/SSOService.php',
                 issuer: '#{gitlab.address}',
                 name_identifier_format: 'urn:oasis:names:tc:SAML:2.0:nameid-format:persistent'
               }
      }
    ];
  OMNIBUS
end