Commit 7c2f5bb4 authored by Timothy Andrew's avatar Timothy Andrew

Fix build for !11963.

- Don't use `request.env['omniauth.params']` if it isn't present.

- Remove the `saml` section from the `gitlab.yml` test section. Some tests
  depend on this section not being initially present, so it can be overridden
  in the test. This MR doesn't add any tests for SAML, so we didn't really need
  this in the first place anyway.

- Clean up the test -> omniauth section of `gitlab.yml`
parent f1caa0b3
...@@ -153,6 +153,6 @@ class OmniauthCallbacksController < Devise::OmniauthCallbacksController ...@@ -153,6 +153,6 @@ class OmniauthCallbacksController < Devise::OmniauthCallbacksController
def remember_me? def remember_me?
request_params = request.env['omniauth.params'] request_params = request.env['omniauth.params']
request_params['remember_me'] == '1' (request_params['remember_me'] == '1') if request_params.present?
end end
end end
...@@ -619,15 +619,12 @@ test: ...@@ -619,15 +619,12 @@ test:
omniauth: omniauth:
enabled: true enabled: true
allow_single_sign_on: true allow_single_sign_on: true
block_auto_created_users: false
auto_link_saml_user: true
external_providers: [] external_providers: []
providers: providers:
- { name: 'cas3', - { name: 'cas3',
label: 'cas3', label: 'cas3',
args: { args: { url: 'https://sso.example.com',
url: 'https://sso.example.com',
disable_ssl_verification: false, disable_ssl_verification: false,
login_url: '/cas/login', login_url: '/cas/login',
service_validate_url: '/cas/p3/serviceValidate', service_validate_url: '/cas/p3/serviceValidate',
...@@ -635,11 +632,7 @@ test: ...@@ -635,11 +632,7 @@ test:
- { name: 'authentiq', - { name: 'authentiq',
app_id: 'YOUR_CLIENT_ID', app_id: 'YOUR_CLIENT_ID',
app_secret: 'YOUR_CLIENT_SECRET', app_secret: 'YOUR_CLIENT_SECRET',
args: { args: { scope: 'aq:name email~rs address aq:push' } }
scope: 'aq:name email~rs address aq:push'
}
}
- { name: 'github', - { name: 'github',
app_id: 'YOUR_APP_ID', app_id: 'YOUR_APP_ID',
app_secret: 'YOUR_APP_SECRET', app_secret: 'YOUR_APP_SECRET',
...@@ -663,24 +656,12 @@ test: ...@@ -663,24 +656,12 @@ test:
- { name: 'twitter', - { name: 'twitter',
app_id: 'YOUR_APP_ID', app_id: 'YOUR_APP_ID',
app_secret: 'YOUR_APP_SECRET' } app_secret: 'YOUR_APP_SECRET' }
- { name: 'saml',
label: 'Our SAML Provider',
groups_attribute: 'Groups',
external_groups: ['Contractors', 'Freelancers'],
args: {
assertion_consumer_service_url: 'https://gitlab.example.com/users/auth/saml/callback',
idp_cert_fingerprint: '43:51:43:a1:b5:fc:8b:b7:0a:3a:a9:b1:0f:66:73:a8',
idp_sso_target_url: 'https://login.example.com/idp',
issuer: 'https://gitlab.example.com',
name_identifier_format: 'urn:oasis:names:tc:SAML:2.0:nameid-format:transient'
} }
- { name: 'auth0', - { name: 'auth0',
args: { args: {
client_id: 'YOUR_AUTH0_CLIENT_ID', client_id: 'YOUR_AUTH0_CLIENT_ID',
client_secret: 'YOUR_AUTH0_CLIENT_SECRET', client_secret: 'YOUR_AUTH0_CLIENT_SECRET',
namespace: 'YOUR_AUTH0_DOMAIN' } } namespace: 'YOUR_AUTH0_DOMAIN' } }
ldap: ldap:
enabled: false enabled: false
servers: servers:
......
...@@ -118,6 +118,7 @@ module LoginHelpers ...@@ -118,6 +118,7 @@ module LoginHelpers
end end
allow(Gitlab::OAuth::Provider).to receive_messages(providers: [:saml], config_for: mock_saml_config) allow(Gitlab::OAuth::Provider).to receive_messages(providers: [:saml], config_for: mock_saml_config)
stub_omniauth_setting(messages) stub_omniauth_setting(messages)
expect_any_instance_of(Object).to receive(:omniauth_authorize_path).with(:user, "saml").and_return('/users/auth/saml') allow_any_instance_of(Object).to receive(:user_saml_omniauth_authorize_path).and_return('/users/auth/saml')
allow_any_instance_of(Object).to receive(:omniauth_authorize_path).with(:user, "saml").and_return('/users/auth/saml')
end end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment