Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2019-07-16 00:40:09 +0300
committerStan Hu <stanhu@gmail.com>2019-07-16 00:40:09 +0300
commitfea51969fbc5fcb843b9cbb40e8a13faf117d032 (patch)
treea94a1db58fffe050be5115f70c68b362b6035cce /spec
parentb46cf4290b8efa5e17ea741d1a093042a8d5475a (diff)
parent97432c9366b433aafae67706c9efb5536e68e7f1 (diff)
Merge branch '64407-vfazio-quirk-omniauth-strategies-openidconnect' into 'master'
Convert client_auth_method to a Symbol for quirked OmniAuth providers Closes #64407 See merge request gitlab-org/gitlab-ce!30683
Diffstat (limited to 'spec')
-rw-r--r--spec/lib/gitlab/omniauth_initializer_spec.rb28
1 files changed, 28 insertions, 0 deletions
diff --git a/spec/lib/gitlab/omniauth_initializer_spec.rb b/spec/lib/gitlab/omniauth_initializer_spec.rb
index f9c0daf1ef1..ef5c93e5c6b 100644
--- a/spec/lib/gitlab/omniauth_initializer_spec.rb
+++ b/spec/lib/gitlab/omniauth_initializer_spec.rb
@@ -83,5 +83,33 @@ describe Gitlab::OmniauthInitializer do
subject.execute([cas3_config])
end
+
+ it 'converts client_auth_method to a Symbol for openid_connect' do
+ openid_connect_config = {
+ 'name' => 'openid_connect',
+ 'args' => { name: 'openid_connect', client_auth_method: 'basic' }
+ }
+
+ expect(devise_config).to receive(:omniauth).with(
+ :openid_connect,
+ { name: 'openid_connect', client_auth_method: :basic }
+ )
+
+ subject.execute([openid_connect_config])
+ end
+
+ it 'converts client_auth_method to a Symbol for strategy_class OpenIDConnect' do
+ openid_connect_config = {
+ 'name' => 'openid_connect',
+ 'args' => { strategy_class: OmniAuth::Strategies::OpenIDConnect, client_auth_method: 'jwt_bearer' }
+ }
+
+ expect(devise_config).to receive(:omniauth).with(
+ :openid_connect,
+ { strategy_class: OmniAuth::Strategies::OpenIDConnect, client_auth_method: :jwt_bearer }
+ )
+
+ subject.execute([openid_connect_config])
+ end
end
end