github-ldap 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/github-ldap.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "github-ldap"
5
- spec.version = "1.0.0"
5
+ spec.version = "1.0.1"
6
6
  spec.authors = ["David Calavera"]
7
7
  spec.email = ["david.calavera@gmail.com"]
8
8
  spec.description = %q{Ldap authentication for humans}
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 encryptation = check_encryptation(options[:encryptation])
18
- @ldap.encryptation(encryptation)
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 check_encryptation(encryptation)
91
- return unless encryptation
90
+ def check_encryption(encryption)
91
+ return unless encryption
92
92
 
93
- case auth_method.downcase.to_sym
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: github-ldap
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: