Commit 4b584643 authored by James Edwards-Jones's avatar James Edwards-Jones

Exclude Group SAML from sign in buttons

Also excludes Group SAML from OmniauthCallbacksController methods
parent e8fbf7aa
......@@ -2,6 +2,18 @@ module EE
module AuthHelper
extend ::Gitlab::Utils::Override
GROUP_LEVEL_PROVIDERS = %i(group_saml).freeze
override :button_based_providers
def button_based_providers
super - GROUP_LEVEL_PROVIDERS
end
override :providers_for_base_controller
def providers_for_base_controller
super - GROUP_LEVEL_PROVIDERS
end
override :form_based_provider?
def form_based_provider?(name)
super || name.to_s == 'kerberos'
......
---
title: Exclude GroupSAML from sign in buttons
merge_request: 5449
author:
type: fixed
......@@ -12,6 +12,11 @@ describe AuthHelper do
expect(helper.button_based_providers).to include(:twitter)
end
it 'excludes group_saml' do
allow(helper).to receive(:auth_providers) { [:group_saml] }
expect(helper.button_based_providers).to eq([])
end
it 'returns empty array' do
allow(helper).to receive(:auth_providers) { [] }
expect(helper.button_based_providers).to eq([])
......@@ -28,6 +33,11 @@ describe AuthHelper do
allow(helper).to receive(:auth_providers) { [:twitter, :ldapmain] }
expect(helper.providers_for_base_controller).not_to include(:ldapmain)
end
it 'excludes group_saml' do
allow(helper).to receive(:auth_providers) { [:group_saml] }
expect(helper.providers_for_base_controller).to eq([])
end
end
describe "form_based_providers" do
......
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