gitlab_omniauth-ldap 2.0.1 → 2.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/omniauth-ldap/adaptor.rb +2 -1
- data/lib/omniauth-ldap/version.rb +1 -1
- data/spec/omniauth-ldap/adaptor_spec.rb +3 -8
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 490e5818be98881b26e804e7d75021b1a22aaca2
|
4
|
+
data.tar.gz: 185305045176824f1f43de77cf762fc0094a3db9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e74ed52e82763ff87707d60339b24107737dc03c62e25fca0897e18b25bf4cfa3a0af8eb27e7899ebb9141c90918eac200eb699394ff0165fef059a68d63760d
|
7
|
+
data.tar.gz: 20aff7c1a787d21313981cdc6849245306d17778602f368f8f11a0c5a3c69c08f16aaa4b57982d9d1e101512f3fc8890255f1d3b8cf1c19a40204eeb9f9bd378
|
@@ -69,6 +69,7 @@ module OmniAuth
|
|
69
69
|
hosts: @hosts,
|
70
70
|
host: @host,
|
71
71
|
port: @port,
|
72
|
+
encryption: encryption_options
|
72
73
|
}
|
73
74
|
@bind_method = @try_sasl ? :sasl : (@allow_anonymous||!@bind_dn||!@password ? :anonymous : :simple)
|
74
75
|
|
@@ -80,7 +81,6 @@ module OmniAuth
|
|
80
81
|
}
|
81
82
|
config[:auth] = @auth
|
82
83
|
@connection = Net::LDAP.new(config)
|
83
|
-
@connection.encryption(encryption_options)
|
84
84
|
end
|
85
85
|
|
86
86
|
#:base => "dc=yourcompany, dc=com",
|
@@ -109,6 +109,7 @@ module OmniAuth
|
|
109
109
|
|
110
110
|
def encryption_options
|
111
111
|
translated_method = translate_method
|
112
|
+
return nil unless translated_method
|
112
113
|
|
113
114
|
{
|
114
115
|
method: translated_method,
|
@@ -38,7 +38,7 @@ describe OmniAuth::LDAP::Adaptor do
|
|
38
38
|
adaptor.connection.port.should == 389
|
39
39
|
adaptor.connection.base.should == 'dc=intridea, dc=com'
|
40
40
|
adaptor.connection.instance_variable_get('@auth').should == {:method => :simple, :username => 'bind_dn', :password => 'password'}
|
41
|
-
adaptor.connection.instance_variable_get('@encryption').should ==
|
41
|
+
adaptor.connection.instance_variable_get('@encryption').should == nil
|
42
42
|
end
|
43
43
|
|
44
44
|
it 'should setup ldap connection with sasl-md5' do
|
@@ -93,14 +93,9 @@ describe OmniAuth::LDAP::Adaptor do
|
|
93
93
|
end
|
94
94
|
|
95
95
|
context 'when encryption is plain' do
|
96
|
-
it 'should set
|
96
|
+
it 'should set encryption to nil' do
|
97
97
|
adaptor = OmniAuth::LDAP::Adaptor.new({host: "192.168.1.145", encryption: 'plain', base: 'dc=intridea, dc=com', port: 389, uid: 'sAMAccountName'})
|
98
|
-
adaptor.connection.instance_variable_get('@encryption').should
|
99
|
-
end
|
100
|
-
|
101
|
-
it 'should set the encryption tls_options to empty' do
|
102
|
-
adaptor = OmniAuth::LDAP::Adaptor.new({host: "192.168.1.145", encryption: 'plain', base: 'dc=intridea, dc=com', port: 389, uid: 'sAMAccountName'})
|
103
|
-
adaptor.connection.instance_variable_get('@encryption').should include tls_options: {}
|
98
|
+
adaptor.connection.instance_variable_get('@encryption').should eq(nil)
|
104
99
|
end
|
105
100
|
end
|
106
101
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gitlab_omniauth-ldap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ping Yu
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-06-
|
11
|
+
date: 2017-06-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: omniauth
|