rom-ldap 0.2.2 → 0.2.3

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
  SHA256:
3
- metadata.gz: d55b8ce14fb58a188849c42fe14bd2f544f6dfd92baed22b6f51e7606912f962
4
- data.tar.gz: aab10466f1913470ffee5d8f11920ebe7b47c28a4ab06af3a48b41c65406c03d
3
+ metadata.gz: 7a44f158c5722e35b88676f3cdb5585b95cd1045ad2803777ce285795dce41f9
4
+ data.tar.gz: ef185f9d9829d8624351c1c43153f5fad0c8995cd1c2f9a80c7b6435ebac21ab
5
5
  SHA512:
6
- metadata.gz: 3adec0a51363520adea1d39cd4c47adb697428390315bc282651299e840c59ea7c4c0eea05668a90cee8d49246fe4f77b4d1b63d482b3a693fde4462870b83b2
7
- data.tar.gz: c137ac63e72a7ca07d01e978acf2990dd2f5d49e3bf8a0ee2f869d593bb844839ed491d51a231e4cdb971439fe51f9d472fcb0e4c6023cba5305f13b10b05608
6
+ metadata.gz: 9b647474a05f2721cd4cf888c9c86514330f993f7dd0f31040f29d3853b0b4f465c8b9a7dc1a7ea2084e18607a84e92a1617f2d6b83f24bd18711864d6eb2085
7
+ data.tar.gz: 7595c3ec810a35feefda806cc85910a76e3e9e3d48b5ef0bbda0ba5127cf9c6630b89d75267b3cdcaa142debb8cf77745b3e5d291361323494713d9191b00c72
data/CHANGELOG.md CHANGED
@@ -1,8 +1,24 @@
1
1
  ## unreleased
2
2
 
3
3
  <!-- TODO -->
4
- [Compare v0.2.1...master](https://gitlab.com/peterdavidhamilton/rom-ldap/compare/v0.2.1...master)
4
+ [Compare v0.2.3...master](https://gitlab.com/peterdavidhamilton/rom-ldap/compare/v0.2.3...master)
5
5
 
6
+ # 0.2.3 / 2021-02-23
7
+
8
+ ### Fixed
9
+
10
+ - Compatibility with pre-release ROM 6.0 and Ruby 3.0
11
+
12
+ [Compare v0.2.2...v0.2.3](https://gitlab.com/peterdavidhamilton/rom-ldap/compare/v0.2.2...0.2.3)
13
+
14
+ # 0.2.2 / 2021-02-21
15
+
16
+ ### Changed
17
+
18
+ - CI/CD pipeline was failing because OpenDJ service requires more memory than the shared runners provide.
19
+ - Yanked 0.2.1 to edit the gem description and credit Net::LDAP team for their part in this gem.
20
+
21
+ [Compare v0.2.1...v0.2.2](https://gitlab.com/peterdavidhamilton/rom-ldap/compare/v0.2.1...0.2.2)
6
22
 
7
23
  # 0.2.1 / 2021-02-19
8
24
 
data/README.md CHANGED
@@ -10,7 +10,7 @@ This gem makes it easier to use LDAP in your project or even as your primary dat
10
10
 
11
11
  ## Requirements
12
12
 
13
- [ROM-LDAP][rom-ldap] is compatible with versions of [Ruby][ruby] from 2.4 to 2.7.
13
+ [ROM-LDAP][rom-ldap] is compatible with versions of [Ruby][ruby] 2.4 and above.
14
14
 
15
15
 
16
16
 
@@ -169,4 +169,4 @@ for a skeleton version of this same example applied to the [Ruby on Rails][rails
169
169
  [rom-rb]: https://rom-rb.org
170
170
  [rom-sql]: https://rom-rb.org/5.0/learn/sql
171
171
  [ruby]: https://www.ruby-lang.org/en/downloads
172
- [sequel]: http://sequel.jeremyevans.net
172
+ [sequel]: http://sequel.jeremyevans.net
data/TODO.md CHANGED
@@ -21,13 +21,17 @@
21
21
  Simple rudimentary RDMS.
22
22
  <https://www.openldap.org/doc/admin24/intro.html#LDAP%20vs%20RDBMS>
23
23
 
24
- 7. Directory instrumentation using dry-monitor to replace debug logging.
24
+ 7. **Logging**
25
+ Directory instrumentation using dry-monitor to replace debug logging.
25
26
 
26
- 8. `rom/devtools` integration.
27
+ 8. **ROM-RB**
28
+ Keep pace with other rom-rb improvements like `rom/devtools` integration.
27
29
 
30
+ 9. **CI/CD**
31
+ Speed up testing by only using OpenLDAP, with other vendors as optional extras (including Microsoft AD LDS).
28
32
 
29
33
  ## ONGOING
30
34
 
31
- - Improve Rspec coverage, currently 90% complete @ v0.1.0
32
- - Improve Yard docs, currently 72% complete @ v0.1.0
35
+ - Improve Rspec coverage, currently 90% complete @ v0.2.3
36
+ - Improve Yard docs, currently 76% complete @ v0.2.3
33
37
  - Ensure Rubocop style compliance
@@ -44,8 +44,8 @@ module Dry
44
44
  end
45
45
 
46
46
  def subscribe(notifications)
47
- notifications.subscribe(:ldap) do |time:, name:, query:|
48
- log_query(time, name, query)
47
+ notifications.subscribe(:ldap) do |ldap|
48
+ log_query(ldap[:time], ldap[:name], ldap[:query])
49
49
  end
50
50
  end
51
51
 
@@ -43,7 +43,7 @@ module ROM
43
43
  # @raise [BindError, SecureBindError]
44
44
  def open
45
45
  unless alive?
46
- @socket = Socket.new(options).call
46
+ @socket = Socket.new(**options).call
47
47
 
48
48
  # tls
49
49
  if ssl
@@ -51,7 +51,7 @@ module ROM
51
51
  sasl_bind # (mechanism:, credentials:, challenge:)
52
52
  end
53
53
 
54
- bind(auth) unless auth.nil? # simple auth
54
+ bind(**auth) unless auth.nil? # simple auth
55
55
  end
56
56
 
57
57
  yield(@socket)
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # rubocop:disable Lint/SuppressedException
4
3
  begin
5
4
  # TODO: Windows NTLM authentication
6
5
  # @see https://github.com/winrb/rubyntlm
@@ -8,8 +7,6 @@ begin
8
7
  rescue LoadError
9
8
  # ntlm_bind
10
9
  end
11
- # rubocop:enable Lint/SuppressedException
12
-
13
10
  module ROM
14
11
  module LDAP
15
12
  # @api private
@@ -24,8 +24,9 @@ module ROM
24
24
  # @yield [Hash] :search_referrals
25
25
  #
26
26
  # @api private
27
- def search(return_refs: true, **params)
28
- search_request = SearchRequest.new(params)
27
+ def search(**params)
28
+ return_refs = params.fetch(:return_refs, true)
29
+ search_request = SearchRequest.new(**params)
29
30
  request_type = pdu_lookup(:search_request)
30
31
  result_pdu = nil
31
32
 
@@ -96,7 +96,7 @@ module ROM
96
96
  #
97
97
  # @api public
98
98
  def with(overrides)
99
- self.class.new(options.merge(overrides))
99
+ self.class.new(**options.merge(overrides))
100
100
  end
101
101
 
102
102
  # @return [Hash] internal options
@@ -55,7 +55,7 @@ module ROM
55
55
  # @return [Client]
56
56
  #
57
57
  def client
58
- @client ||= Client.new(env.to_h)
58
+ @client ||= Client.new(**env.to_h)
59
59
  end
60
60
 
61
61
  # Expected method inside gateway.
@@ -16,7 +16,6 @@ module ROM
16
16
  # @see https://ldapwiki.com/wiki/LDAP%20URL
17
17
  # @see https://docs.oracle.com/cd/E19957-01/816-6402-10/url.htm
18
18
  #
19
- # rubocop:disable Lint/UriEscapeUnescape
20
19
  #
21
20
  # @api private
22
21
  class ENV
@@ -114,7 +113,6 @@ module ROM
114
113
  dn = config.fetch(:username, ::ENV['LDAPBINDDN']) || uri.user
115
114
  dn.gsub(PERCENT_SPACE, SPACE) if dn
116
115
  end
117
- # rubocop:enable Lint/UriEscapeUnescape
118
116
 
119
117
  # Override LDAPURI password with options or LDAPBINDPW
120
118
  #
@@ -25,9 +25,11 @@ module ROM
25
25
  #
26
26
  # @api public
27
27
  #
28
- def query(filter: DEFAULT_FILTER, **options)
28
+ def query(**options)
29
29
  set, counter = [], 0
30
30
 
31
+ filter = options.delete(:filter) || DEFAULT_FILTER
32
+
31
33
  # TODO: pageable and search referrals
32
34
  params = {
33
35
  base: base,
@@ -39,8 +41,7 @@ module ROM
39
41
  # https://tools.ietf.org/html/rfc4511#section-4.5.3
40
42
  }
41
43
 
42
- # pdu = client.search(params) do |search_referrals: |
43
- pdu = client.search(params) do |dn, attributes|
44
+ pdu = client.search(**params) do |dn, attributes|
44
45
  counter += 1
45
46
  logger.debug("#{counter}: #{dn}") if ::ENV['DEBUG']
46
47
 
@@ -22,7 +22,7 @@ module ROM
22
22
  # @api public
23
23
  def to_ber
24
24
  require 'rom/ldap/expression_encoder'
25
- ExpressionEncoder.new(options).call
25
+ ExpressionEncoder.new(**options).call
26
26
  end
27
27
 
28
28
  # Unbracketed filter string
@@ -34,7 +34,6 @@ module ROM
34
34
  require 'rom/ldap/extensions/optimised_json'
35
35
  end
36
36
 
37
-
38
37
  #=======================================
39
38
  # Autoloaded for Rails
40
39
  #=======================================
data/lib/rom/ldap/pdu.rb CHANGED
@@ -151,7 +151,7 @@ module ROM
151
151
  def result_controls
152
152
  ctrls.map do |control|
153
153
  oid, level, value = control
154
- value, level = level, false if level&.is_a?(String)
154
+ value, level = level, false if level.is_a?(String)
155
155
  ::OpenStruct.new(oid: oid, criticality: level, value: value)
156
156
  end
157
157
  end
@@ -61,7 +61,7 @@ module ROM
61
61
  # @api public
62
62
  def call(attribute_name, schema)
63
63
  attribute = find_attribute(attribute_name)
64
- primitive = map_type(attribute)
64
+ primitive = map_type(**attribute)
65
65
  ruby_type = Types.const_get(primitive)
66
66
  read_type = !attribute[:single] ? Types.const_get(Inflector.pluralize(primitive)) : ruby_type
67
67
 
@@ -16,13 +16,11 @@ module ROM
16
16
  @directory = directory
17
17
  end
18
18
 
19
- # rubocop:disable Lint/SuppressedException
20
19
  def run(opts = EMPTY_OPTS)
21
20
  directory.transaction(opts) { yield(self) }
22
21
  rescue ::ROM::Transaction::Rollback
23
22
  # noop
24
23
  end
25
- # rubocop:enable Lint/SuppressedException
26
24
 
27
25
  end
28
26
  end
@@ -9,7 +9,7 @@ module ROM
9
9
  MINOR = 2
10
10
 
11
11
  # The tiny version of ROM-LDAP. Only bumped for bugfix releases.
12
- TINY = 2
12
+ TINY = 3
13
13
 
14
14
  # The version of ROM-LDAP, as a string (e.g. "2.11.0")
15
15
  VERSION = [MAJOR, MINOR, TINY].join('.').freeze
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rom-ldap
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Hamilton
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-02-21 00:00:00.000000000 Z
11
+ date: 2021-02-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-transformer
@@ -39,19 +39,19 @@ dependencies:
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0.1'
41
41
  - !ruby/object:Gem::Dependency
42
- name: rom-core
42
+ name: rom
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: '5.0'
47
+ version: '5.2'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: '5.0'
54
+ version: '5.2'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: bundler
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -94,9 +94,7 @@ dependencies:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
96
  version: '3.9'
97
- description: |
98
- ROM-LDAP is a Ruby Object Mapper gateway adapter for LDAP.
99
- This gem is a reworking of NET::LDAP for use with ROM.
97
+ description: LDAP support for ROM
100
98
  email:
101
99
  - pete@peterdavidhamilton.com
102
100
  executables: []
@@ -208,14 +206,24 @@ files:
208
206
  homepage: https://rom-rb.org
209
207
  licenses:
210
208
  - MIT
211
- metadata: {}
212
- post_install_message:
209
+ metadata:
210
+ source_code_uri: https://gitlab.com/peterdavidhamilton/rom-ldap
211
+ bug_tracker_uri: https://gitlab.com/peterdavidhamilton/rom-ldap/issues
212
+ wiki_uri: https://gitlab.com/peterdavidhamilton/rom-ldap/wikis
213
+ documentation_uri: https://pdhamilton.uk/projects/rom-ldap
214
+ mailing_list_uri: https://discourse.rom-rb.org/
215
+ post_install_message: |
216
+ ROM-LDAP would not be possible without the hard work of contributors
217
+ to the ruby-net-ldap gem, whose code it is inspired by.
218
+
219
+ THANK YOU
220
+ https://pdhamilton.uk
213
221
  rdoc_options: []
214
222
  require_paths:
215
223
  - lib
216
224
  required_ruby_version: !ruby/object:Gem::Requirement
217
225
  requirements:
218
- - - "~>"
226
+ - - ">="
219
227
  - !ruby/object:Gem::Version
220
228
  version: '2.4'
221
229
  required_rubygems_version: !ruby/object:Gem::Requirement
@@ -224,8 +232,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
224
232
  - !ruby/object:Gem::Version
225
233
  version: '0'
226
234
  requirements: []
227
- rubygems_version: 3.1.4
235
+ rubygems_version: 3.2.3
228
236
  signing_key:
229
237
  specification_version: 4
230
- summary: lightweight directory adapter for ROM
238
+ summary: LDAP support for ROM
231
239
  test_files: []