github-ldap 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/github-ldap.gemspec +1 -1
- data/lib/github/ldap.rb +5 -5
- data/test/ldap_test.rb +10 -0
- metadata +1 -1
data/github-ldap.gemspec
CHANGED
data/lib/github/ldap.rb
CHANGED
@@ -14,8 +14,8 @@ module GitHub
|
|
14
14
|
|
15
15
|
@ldap.authenticate(options[:admin_user], options[:admin_password])
|
16
16
|
|
17
|
-
if
|
18
|
-
@ldap.
|
17
|
+
if encryption = check_encryption(options[:encryptation])
|
18
|
+
@ldap.encryption(encryption)
|
19
19
|
end
|
20
20
|
end
|
21
21
|
|
@@ -87,10 +87,10 @@ module GitHub
|
|
87
87
|
# encryptation: is the encryptation method, either 'ssl', 'tls', 'simple_tls' or 'start_tls'.
|
88
88
|
#
|
89
89
|
# Returns the real encryptation type.
|
90
|
-
def
|
91
|
-
return unless
|
90
|
+
def check_encryption(encryption)
|
91
|
+
return unless encryption
|
92
92
|
|
93
|
-
case
|
93
|
+
case encryption.downcase.to_sym
|
94
94
|
when :ssl, :simple_tls
|
95
95
|
:simple_tls
|
96
96
|
when :tls, :start_tls
|
data/test/ldap_test.rb
CHANGED
@@ -91,4 +91,14 @@ class GitHubLdapTest < Minitest::Test
|
|
91
91
|
assert !ldap.authenticate!('calavera', 'secret'),
|
92
92
|
"Expected `authenticate!` to not return an user"
|
93
93
|
end
|
94
|
+
|
95
|
+
def test_simple_tls
|
96
|
+
assert_equal :simple_tls, @ldap.check_encryption(:ssl)
|
97
|
+
assert_equal :simple_tls, @ldap.check_encryption(:simple_tls)
|
98
|
+
end
|
99
|
+
|
100
|
+
def test_start_tls
|
101
|
+
assert_equal :start_tls, @ldap.check_encryption(:tls)
|
102
|
+
assert_equal :start_tls, @ldap.check_encryption(:start_tls)
|
103
|
+
end
|
94
104
|
end
|