Skip to content
代码片段 群组 项目
提交 2792c938 编辑于 作者: Catalin Irimie's avatar Catalin Irimie
浏览文件

Remove omniauth_initializer_fullhost_proc FF

This has been enabled by default in 15.0, this is cleaning
up the remaining FF logic.

Changelog: other
上级 90f0ee37
No related branches found
No related tags found
无相关合并请求
---
name: omniauth_initializer_fullhost_proc
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/82703
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/355579
milestone: '14.10'
type: development
group: group::geo
default_enabled: true
...@@ -11,14 +11,7 @@ module OmniAuth::Strategies ...@@ -11,14 +11,7 @@ module OmniAuth::Strategies
end end
end end
OmniAuth.config.full_host = OmniAuth.config.full_host = Gitlab::OmniauthInitializer.full_host
if Feature.feature_flags_available? && ::Feature.enabled?(:omniauth_initializer_fullhost_proc)
Gitlab::AppLogger.debug("Using OmniAuth proc initializer")
Gitlab::OmniauthInitializer.full_host
else
Gitlab::AppLogger.debug("Fallback to OmniAuth static full_host")
Settings.gitlab['base_url']
end
OmniAuth.config.allowed_request_methods = [:post] OmniAuth.config.allowed_request_methods = [:post]
# In case of auto sign-in, the GET method is used (users don't get to click on a button) # In case of auto sign-in, the GET method is used (users don't get to click on a button)
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
require 'spec_helper' require 'spec_helper'
RSpec.describe 'OmniAuth initializer for GitLab' do RSpec.describe 'OmniAuth initializer for GitLab' do
let(:load_omniauth_initializer) do def load_omniauth_initializer
load Rails.root.join('config/initializers/omniauth.rb') load Rails.root.join('config/initializers/omniauth.rb')
end end
...@@ -15,32 +15,15 @@ ...@@ -15,32 +15,15 @@
before do before do
allow(Settings).to receive(:gitlab).and_return({ 'base_url' => base_url }) allow(Settings).to receive(:gitlab).and_return({ 'base_url' => base_url })
allow(Gitlab::OmniauthInitializer).to receive(:full_host).and_return('proc') allow(Gitlab::OmniauthInitializer).to receive(:full_host).and_return('proc')
end
context 'with feature flags not available' do
before do
expect(Feature).to receive(:feature_flags_available?).and_return(false)
load_omniauth_initializer
end
it { is_expected.to eq(base_url) } load_omniauth_initializer
end end
context 'with the omniauth_initializer_fullhost_proc FF disabled' do # to clear existing mocks and prevent order-dependent failures
before do after(:all) do
stub_feature_flags(omniauth_initializer_fullhost_proc: false) load_omniauth_initializer
load_omniauth_initializer
end
it { is_expected.to eq(base_url) }
end end
context 'with the omniauth_initializer_fullhost_proc FF disabled' do it { is_expected.to eq('proc') }
before do
load_omniauth_initializer
end
it { is_expected.to eq('proc') }
end
end end
end end
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册