ons-ldap 1.1.1 → 1.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a26677d48b299687a9befb8db90b15e9790303d6
4
- data.tar.gz: 1d1e6bcafbe9e33d41ce8156b37f14d64fdd8107
3
+ metadata.gz: db3e9abf832ade895a814cb4b38c3977a9c7f808
4
+ data.tar.gz: df4413d0f4f571708bfdc749e8bbe91f27f0f883
5
5
  SHA512:
6
- metadata.gz: c5ddbab2503dc7bee8b79d481809817f906140d0ffa674aab7ad2eeb13e8e8b55850a228030e110a70fb897aa0ba7f6611aecbead273d09ac24a8d6f16472a53
7
- data.tar.gz: 1008bd795276fda4543e7bcac6f3096061ea36e926e0001c8fea5e7dae1690de0634b019062915dbb73b5e66662e0cd37d3ea5d5a68f718e0cc5ac4e8ec9055d
6
+ metadata.gz: a49f167e74a0a2d7589a638acfad6535ed87aef3d7859da5c3725042bf42a756392b3efc96df658687f593c7e0dff0973f9c0ab5ae3ec13ca39db880ce073a87
7
+ data.tar.gz: fa5614ea9a2fe476317f9448881c2793f994ccf679f91ddbe92b290a938521ffb958f122dbff33c7e5beb657b59388b46dbb69a6e94bfc61bf92f536c6cbfa9d
data/README.md CHANGED
@@ -26,9 +26,6 @@ user_entry.user_id #=> 'johntopley'
26
26
  user_entry.display_name #=> 'John Topley'
27
27
  user_entry.token # 2FA token, stored in LDAP's employeeNumber field for expediency
28
28
  user_entry.groups #=> ['admins', 'users']
29
-
30
- # Pass false as the last initializer argument to use a non-TLS connection:
31
- ldap_connection = LDAPConnection.new(host, port, base, groups, logger, false)
32
29
  ```
33
30
 
34
31
  ## Testing
@@ -11,16 +11,14 @@ class LDAPConnection
11
11
  attr_accessor :base
12
12
  attr_accessor :groups
13
13
  attr_accessor :logger
14
- attr_accessor :encrypted
15
14
  end
16
15
 
17
- def initialize(host, port, base, groups, logger, encrypted = true)
16
+ def initialize(host, port, base, groups, logger)
18
17
  self.class.host = host
19
18
  self.class.port = port.to_i
20
19
  self.class.base = base
21
20
  self.class.groups = groups
22
21
  self.class.logger = logger
23
- self.class.encrypted = encrypted
24
22
  end
25
23
 
26
24
  def authenticate(username, password)
@@ -29,8 +27,7 @@ class LDAPConnection
29
27
  # Have to use the username DN format below for the bind operation to succeed.
30
28
  auth = { method: :simple, username: "uid=#{username},ou=Users,#{self.class.base}", password: password }
31
29
 
32
- Net::LDAP.open(host: self.class.host, port: self.class.port, base: self.class.base, auth: auth) do |ldap|
33
- ldap.encryption = :simple_tls if self.class.encrypted?
30
+ Net::LDAP.open(host: self.class.host, port: self.class.port, encryption: :simple_tls, base: self.class.base, auth: auth) do |ldap|
34
31
  unless ldap.bind
35
32
  result = ldap.get_operation_result
36
33
  self.class.logger.error "LDAP authentication failed for '#{username}': #{result.message} (#{result.code})"
@@ -2,7 +2,7 @@ module ONSLDAP
2
2
  module Version
3
3
  MAJOR = 1
4
4
  MINOR = 1
5
- TINY = 1
5
+ TINY = 2
6
6
  end
7
7
  VERSION = [Version::MAJOR, Version::MINOR, Version::TINY].compact * '.'
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ons-ldap
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Topley
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-02-11 00:00:00.000000000 Z
12
+ date: 2017-02-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: net-ldap