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 +4 -4
- data/CHANGELOG.md +17 -1
- data/README.md +2 -2
- data/TODO.md +8 -4
- data/lib/dry/monitor/ldap/logger.rb +2 -2
- data/lib/rom/ldap/client.rb +2 -2
- data/lib/rom/ldap/client/authentication.rb +0 -3
- data/lib/rom/ldap/client/operations.rb +3 -2
- data/lib/rom/ldap/dataset.rb +1 -1
- data/lib/rom/ldap/directory.rb +1 -1
- data/lib/rom/ldap/directory/env.rb +0 -2
- data/lib/rom/ldap/directory/operations.rb +4 -3
- data/lib/rom/ldap/expression.rb +1 -1
- data/lib/rom/ldap/extensions.rb +0 -1
- data/lib/rom/ldap/pdu.rb +1 -1
- data/lib/rom/ldap/schema/type_builder.rb +1 -1
- data/lib/rom/ldap/transaction.rb +0 -2
- data/lib/rom/ldap/version.rb +1 -1
- metadata +23 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7a44f158c5722e35b88676f3cdb5585b95cd1045ad2803777ce285795dce41f9
|
4
|
+
data.tar.gz: ef185f9d9829d8624351c1c43153f5fad0c8995cd1c2f9a80c7b6435ebac21ab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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]
|
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.
|
24
|
+
7. **Logging**
|
25
|
+
Directory instrumentation using dry-monitor to replace debug logging.
|
25
26
|
|
26
|
-
8.
|
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.
|
32
|
-
- Improve Yard docs, currently
|
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 |
|
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
|
|
data/lib/rom/ldap/client.rb
CHANGED
@@ -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(
|
28
|
-
|
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
|
|
data/lib/rom/ldap/dataset.rb
CHANGED
data/lib/rom/ldap/directory.rb
CHANGED
@@ -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(
|
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
|
-
|
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
|
|
data/lib/rom/ldap/expression.rb
CHANGED
data/lib/rom/ldap/extensions.rb
CHANGED
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
|
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
|
|
data/lib/rom/ldap/transaction.rb
CHANGED
@@ -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
|
data/lib/rom/ldap/version.rb
CHANGED
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.
|
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-
|
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
|
42
|
+
name: rom
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '5.
|
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.
|
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
|
-
|
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.
|
235
|
+
rubygems_version: 3.2.3
|
228
236
|
signing_key:
|
229
237
|
specification_version: 4
|
230
|
-
summary:
|
238
|
+
summary: LDAP support for ROM
|
231
239
|
test_files: []
|