Use encryption instead of method
The method key is deprecated in the `gitlab_omniauth-ldap` gem.
This commit is contained in:
parent
6dbff9663d
commit
94b4c9f34f
2 changed files with 16 additions and 16 deletions
|
@ -50,7 +50,7 @@ module Gitlab
|
||||||
def omniauth_options
|
def omniauth_options
|
||||||
opts = base_options.merge(
|
opts = base_options.merge(
|
||||||
base: base,
|
base: base,
|
||||||
method: options['method'],
|
encryption: options['encryption'],
|
||||||
filter: omniauth_user_filter,
|
filter: omniauth_user_filter,
|
||||||
name_proc: name_proc
|
name_proc: name_proc
|
||||||
)
|
)
|
||||||
|
@ -158,7 +158,7 @@ module Gitlab
|
||||||
end
|
end
|
||||||
|
|
||||||
def encryption
|
def encryption
|
||||||
case options['method'].to_s
|
case options['encryption'].to_s
|
||||||
when 'ssl'
|
when 'ssl'
|
||||||
:simple_tls
|
:simple_tls
|
||||||
when 'tls'
|
when 'tls'
|
||||||
|
|
|
@ -23,9 +23,9 @@ describe Gitlab::LDAP::Config, lib: true do
|
||||||
it 'constructs basic options' do
|
it 'constructs basic options' do
|
||||||
stub_ldap_config(
|
stub_ldap_config(
|
||||||
options: {
|
options: {
|
||||||
'host' => 'ldap.example.com',
|
'host' => 'ldap.example.com',
|
||||||
'port' => 386,
|
'port' => 386,
|
||||||
'method' => 'plain'
|
'encryption' => 'plain'
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -39,11 +39,11 @@ describe Gitlab::LDAP::Config, lib: true do
|
||||||
it 'includes authentication options when auth is configured' do
|
it 'includes authentication options when auth is configured' do
|
||||||
stub_ldap_config(
|
stub_ldap_config(
|
||||||
options: {
|
options: {
|
||||||
'host' => 'ldap.example.com',
|
'host' => 'ldap.example.com',
|
||||||
'port' => 686,
|
'port' => 686,
|
||||||
'method' => 'ssl',
|
'encryption' => 'ssl',
|
||||||
'bind_dn' => 'uid=admin,dc=example,dc=com',
|
'bind_dn' => 'uid=admin,dc=example,dc=com',
|
||||||
'password' => 'super_secret'
|
'password' => 'super_secret'
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -64,11 +64,11 @@ describe Gitlab::LDAP::Config, lib: true do
|
||||||
it 'constructs basic options' do
|
it 'constructs basic options' do
|
||||||
stub_ldap_config(
|
stub_ldap_config(
|
||||||
options: {
|
options: {
|
||||||
'host' => 'ldap.example.com',
|
'host' => 'ldap.example.com',
|
||||||
'port' => 386,
|
'port' => 386,
|
||||||
'base' => 'ou=users,dc=example,dc=com',
|
'base' => 'ou=users,dc=example,dc=com',
|
||||||
'method' => 'plain',
|
'encryption' => 'plain',
|
||||||
'uid' => 'uid'
|
'uid' => 'uid'
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -76,7 +76,7 @@ describe Gitlab::LDAP::Config, lib: true do
|
||||||
host: 'ldap.example.com',
|
host: 'ldap.example.com',
|
||||||
port: 386,
|
port: 386,
|
||||||
base: 'ou=users,dc=example,dc=com',
|
base: 'ou=users,dc=example,dc=com',
|
||||||
method: 'plain',
|
encryption: 'plain',
|
||||||
filter: '(uid=%{username})'
|
filter: '(uid=%{username})'
|
||||||
)
|
)
|
||||||
expect(config.omniauth_options.keys).not_to include(:bind_dn, :password)
|
expect(config.omniauth_options.keys).not_to include(:bind_dn, :password)
|
||||||
|
|
Loading…
Reference in a new issue