ruby-ldapserver 0.5.2 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
metadata CHANGED
@@ -1,57 +1,92 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-ldapserver
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Candler
8
- autorequire:
8
+ - Florian Dejonckheere
9
+ - Lars Kanis
10
+ autorequire:
9
11
  bindir: bin
10
- cert_chain: []
11
- date: 2015-06-24 00:00:00.000000000 Z
12
+ cert_chain:
13
+ - |
14
+ -----BEGIN CERTIFICATE-----
15
+ MIIETTCCArWgAwIBAgIBATANBgkqhkiG9w0BAQsFADAoMSYwJAYDVQQDDB1sYXJz
16
+ L0RDPWdyZWl6LXJlaW5zZG9yZi9EQz1kZTAeFw0yMjAyMTQxMzMwNTZaFw0yMzAy
17
+ MTQxMzMwNTZaMCgxJjAkBgNVBAMMHWxhcnMvREM9Z3JlaXotcmVpbnNkb3JmL0RD
18
+ PWRlMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAwum6Y1KznfpzXOT/
19
+ mZgJTBbxZuuZF49Fq3K0WA67YBzNlDv95qzSp7V/7Ek3NCcnT7G+2kSuhNo1FhdN
20
+ eSDO/moYebZNAcu3iqLsuzuULXPLuoU0GsMnVMqV9DZPh7cQHE5EBZ7hlzDBK7k/
21
+ 8nBMvR0mHo77kIkapHc26UzVq/G0nKLfDsIHXVylto3PjzOumjG6GhmFN4r3cP6e
22
+ SDfl1FSeRYVpt4kmQULz/zdSaOH3AjAq7PM2Z91iGwQvoUXMANH2v89OWjQO/NHe
23
+ JMNDFsmHK/6Ji4Kk48Z3TyscHQnipAID5GhS1oD21/WePdj7GhmbF5gBzkV5uepd
24
+ eJQPgWGwrQW/Z2oPjRuJrRofzWfrMWqbOahj9uth6WSxhNexUtbjk6P8emmXOJi5
25
+ chQPnWX+N3Gj+jjYxqTFdwT7Mj3pv1VHa+aNUbqSPpvJeDyxRIuo9hvzDaBHb/Cg
26
+ 9qRVcm8a96n4t7y2lrX1oookY6bkBaxWOMtWlqIprq8JZXM9AgMBAAGjgYEwfzAJ
27
+ BgNVHRMEAjAAMAsGA1UdDwQEAwIEsDAdBgNVHQ4EFgQUOIdbSMr3VFrTCO9/cTM0
28
+ 0exHzBcwIgYDVR0RBBswGYEXbGFyc0BncmVpei1yZWluc2RvcmYuZGUwIgYDVR0S
29
+ BBswGYEXbGFyc0BncmVpei1yZWluc2RvcmYuZGUwDQYJKoZIhvcNAQELBQADggGB
30
+ AFWP7F/y3Oq3NgrqUOnjKOeDaBa7AqNhHS+PZg+C90lnJzMgOs4KKgZYxqSQVSab
31
+ SCEmzIO/StkXY4NpJ4fYLrHemf/fJy1wPyu+fNdp5SEEUwEo+2toRFlzTe4u4LdS
32
+ QC636nPPTMt8H3xz2wf/lUIUeo2Qc95Qt2BQM465ibbG9kmA3c7Sopx6yOabYOAl
33
+ KPRbOSEPiWYcF9Suuz8Gdf8jxEtPlnZiwRvnYJ+IHMq3XQCJWPpMzdDMbtlgHbXE
34
+ vq1zOTLMSYAS0UB3uionR4yo1hLz60odwkCm7qf0o2Ci/5OjtB0a89VuyqRU2vUJ
35
+ QH95WBjDJ6lCCW7J0mrMPnJQSUFTmufsU6jOChvPaCeAzW1YwrsP/YKnvwueG7ip
36
+ VOdW6RitjtFxhS7evRL0201+KUvLz12zZWWjOcujlQs64QprxOtiv/MiisKb1Ng+
37
+ oL1mUdzB8KrZL4/WbG5YNX6UTtJbIOu9qEFbBAy4/jtIkJX+dlNoFwd4GXQW1YNO
38
+ nA==
39
+ -----END CERTIFICATE-----
40
+ date: 2022-12-06 00:00:00.000000000 Z
12
41
  dependencies:
13
42
  - !ruby/object:Gem::Dependency
14
43
  name: bundler
15
44
  requirement: !ruby/object:Gem::Requirement
16
45
  requirements:
17
- - - "~>"
46
+ - - ">="
18
47
  - !ruby/object:Gem::Version
19
48
  version: '1.3'
49
+ - - "<"
50
+ - !ruby/object:Gem::Version
51
+ version: '3.0'
20
52
  type: :development
21
53
  prerelease: false
22
54
  version_requirements: !ruby/object:Gem::Requirement
23
55
  requirements:
24
- - - "~>"
56
+ - - ">="
25
57
  - !ruby/object:Gem::Version
26
58
  version: '1.3'
59
+ - - "<"
60
+ - !ruby/object:Gem::Version
61
+ version: '3.0'
27
62
  - !ruby/object:Gem::Dependency
28
63
  name: rake
29
64
  requirement: !ruby/object:Gem::Requirement
30
65
  requirements:
31
66
  - - "~>"
32
67
  - !ruby/object:Gem::Version
33
- version: '10.0'
68
+ version: '13.0'
34
69
  type: :development
35
70
  prerelease: false
36
71
  version_requirements: !ruby/object:Gem::Requirement
37
72
  requirements:
38
73
  - - "~>"
39
74
  - !ruby/object:Gem::Version
40
- version: '10.0'
75
+ version: '13.0'
41
76
  - !ruby/object:Gem::Dependency
42
- name: ruby-ldap
77
+ name: net-ldap
43
78
  requirement: !ruby/object:Gem::Requirement
44
79
  requirements:
45
80
  - - "~>"
46
81
  - !ruby/object:Gem::Version
47
- version: 0.9.16
82
+ version: '0.10'
48
83
  type: :development
49
84
  prerelease: false
50
85
  version_requirements: !ruby/object:Gem::Requirement
51
86
  requirements:
52
87
  - - "~>"
53
88
  - !ruby/object:Gem::Version
54
- version: 0.9.16
89
+ version: '0.10'
55
90
  - !ruby/object:Gem::Dependency
56
91
  name: rspec
57
92
  requirement: !ruby/object:Gem::Requirement
@@ -66,18 +101,36 @@ dependencies:
66
101
  - - "~>"
67
102
  - !ruby/object:Gem::Version
68
103
  version: '3.1'
104
+ - !ruby/object:Gem::Dependency
105
+ name: test-unit
106
+ requirement: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '3.0'
111
+ type: :development
112
+ prerelease: false
113
+ version_requirements: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: '3.0'
69
118
  description: ruby-ldapserver is a lightweight, pure-Ruby skeleton for implementing
70
119
  LDAP server applications.
71
- email: B.Candler@pobox.com
120
+ email:
121
+ - B.Candler@pobox.com
122
+ - florian@floriandejonckheere.be
123
+ - lars@greiz-reinsdorf.de
72
124
  executables: []
73
125
  extensions: []
74
126
  extra_rdoc_files: []
75
127
  files:
128
+ - ".github/workflows/ci.yml"
76
129
  - ".gitignore"
130
+ - CHANGELOG.md
77
131
  - COPYING
78
- - ChangeLog
79
132
  - Gemfile
80
- - README
133
+ - README.md
81
134
  - Rakefile
82
135
  - examples/README
83
136
  - examples/mkcert.rb
@@ -85,65 +138,74 @@ files:
85
138
  - examples/rbslapd2.rb
86
139
  - examples/rbslapd2.sql
87
140
  - examples/rbslapd3.rb
141
+ - examples/rbslapd4.rb
142
+ - examples/rbslapd5.rb
143
+ - examples/rbslapd6.rb
88
144
  - examples/speedtest.rb
89
145
  - lib/ldap/server.rb
90
146
  - lib/ldap/server/connection.rb
147
+ - lib/ldap/server/dn.rb
91
148
  - lib/ldap/server/filter.rb
92
149
  - lib/ldap/server/match.rb
93
150
  - lib/ldap/server/operation.rb
94
151
  - lib/ldap/server/preforkserver.rb
152
+ - lib/ldap/server/request.rb
95
153
  - lib/ldap/server/result.rb
154
+ - lib/ldap/server/router.rb
96
155
  - lib/ldap/server/schema.rb
97
156
  - lib/ldap/server/server.rb
98
157
  - lib/ldap/server/syntax.rb
99
158
  - lib/ldap/server/tcpserver.rb
159
+ - lib/ldap/server/trie.rb
100
160
  - lib/ldap/server/util.rb
101
161
  - lib/ldap/server/version.rb
102
162
  - ruby-ldapserver.gemspec
103
163
  - spec/operation_spec.rb
104
164
  - spec/spec_helper.rb
105
165
  - test/core.schema
166
+ - test/dn_test.rb
106
167
  - test/encoding_test.rb
107
168
  - test/filter_test.rb
108
169
  - test/match_test.rb
109
170
  - test/schema_test.rb
110
171
  - test/syntax_test.rb
111
172
  - test/test_helper.rb
173
+ - test/trie_test.rb
112
174
  - test/util_test.rb
113
- homepage: https://github.com/inscitiv/ruby-ldapserver
175
+ homepage: https://github.com/larskanis/ruby-ldapserver
114
176
  licenses: []
115
177
  metadata: {}
116
- post_install_message:
178
+ post_install_message:
117
179
  rdoc_options:
118
180
  - "--main"
119
- - README.txt
181
+ - README.md
120
182
  require_paths:
121
183
  - lib
122
184
  required_ruby_version: !ruby/object:Gem::Requirement
123
185
  requirements:
124
186
  - - ">="
125
187
  - !ruby/object:Gem::Version
126
- version: '1.9'
188
+ version: '2.3'
127
189
  required_rubygems_version: !ruby/object:Gem::Requirement
128
190
  requirements:
129
191
  - - ">="
130
192
  - !ruby/object:Gem::Version
131
193
  version: '0'
132
194
  requirements: []
133
- rubyforge_project:
134
- rubygems_version: 2.4.8
135
- signing_key:
195
+ rubygems_version: 3.3.7
196
+ signing_key:
136
197
  specification_version: 4
137
198
  summary: A pure-Ruby framework for building LDAP servers
138
199
  test_files:
139
200
  - spec/operation_spec.rb
140
201
  - spec/spec_helper.rb
141
202
  - test/core.schema
203
+ - test/dn_test.rb
142
204
  - test/encoding_test.rb
143
205
  - test/filter_test.rb
144
206
  - test/match_test.rb
145
207
  - test/schema_test.rb
146
208
  - test/syntax_test.rb
147
209
  - test/test_helper.rb
210
+ - test/trie_test.rb
148
211
  - test/util_test.rb
149
- has_rdoc:
metadata.gz.sig ADDED
Binary file
data/README DELETED
@@ -1,222 +0,0 @@
1
- CHANGES FROM VERSION 0.2 TO VERSION 0.3
2
- ---------------------------------------
3
-
4
- There have been substantial changes to ruby-ldapserver between version 0.2
5
- and version 0.3. If you have not been using 0.2, you can skip this section.
6
-
7
- Major API changes:
8
-
9
- * I have renamed module LDAPServer to module LDAP::Server, This means e.g.
10
- require 'ldapserver/connection' becomes require 'ldap/server/connection'
11
-
12
- * I have moved the result exceptions to be subclasses of LDAP::ResultError,
13
- for consistency with ruby-ldap, and named under LDAP::ResultError::<name> to
14
- group them together. Everything else remains under LDAP::Server.
15
-
16
- * The format of the parsed 'filter' parameter to Operation#search has
17
- changed. See filter.rb. In particular, the format of a :substrings filter
18
- has been changed (simplified).
19
-
20
- * The format of the 'modinfo' parameter to Operation#modify has changed. See
21
- the comment above 'def modify' in operation.rb
22
-
23
- * Attribute names are no longer automatically downcased. If you are running
24
- with a schema, however, then they will be converted into their preferred
25
- forms. That is, "OBJECTCLASS" will become "objectClass", "CommonName" will
26
- become "cn", and so on.
27
-
28
- Improvements include:
29
-
30
- * There is now an explicit object representing a server instance:
31
- "LDAP::Server". This bundles together the root DSE, the schema (if used),
32
- the subclass of Operation which you wish to use, and various other
33
- parameters such as ssl certificate data. It has methods run_tcpserver and
34
- run_prefork, making it straightforward to start a server. Both support SSL
35
- on connect. You can do require 'ldap/server' to get all the essential
36
- libraries for a server.
37
-
38
- * LDAP::Server :user and :group settings let you drop privileges after
39
- binding to port 389.
40
-
41
- * Schema support. Can load schemas in OpenLDAP format, publish them via
42
- LDAP, validate add/modify operations, use them to map attribute names to
43
- their 'standard' versions (e.g. "commonname" becomes "cn"), and perform
44
- case-insensitive comparisons where the schema mandates this. See classes
45
- LDAP::Server::Schema, LDAP::Server::ObjectClass, LDAP::Server::AttributeType,
46
- LDAP::Server::Syntax, LDAP::Server::MatchingRule, and examples/rbslapd3.rb.
47
-
48
- What is it?
49
- -----------
50
-
51
- ruby-ldapserver is a lightweight, pure Ruby skeleton for implementing LDAP
52
- server applications. It is intended primarily for when you wish to build a
53
- gateway from LDAP queries into some other protocol or database; it does not
54
- attempt to be a full implementation of the standard LDAP data model itself
55
- (although you could build one using this as a frontend)
56
-
57
- The Connection class handles incoming connections, decodes ASN1-formatted
58
- LDAP requests, and creates an Operation object for each request. The
59
- Operation object further parses the ASN1 request and invokes methods which
60
- you override to perform useful work. Responses and exceptions are converted
61
- back into ASN1 and returned to the client. Optionally, a collection of
62
- objects can be used to implement a Schema (e.g. normalize attribute names,
63
- validate add and modify operations, perform appropriate matching operations)
64
-
65
- Since it's written entirely in Ruby, it benefits from Ruby's threading
66
- engine.
67
-
68
- Target audience
69
- ---------------
70
-
71
- Technically-savvy Ruby applications developers; the sort of people who are
72
- happy to read RFCs and read code to work out what it does :-)
73
-
74
- The examples/ directory contains a few minimal LDAP servers which you can
75
- use as a starting point.
76
-
77
- Status
78
- ------
79
-
80
- This is an early release. It works for me as an LDAP protocol convertor; the
81
- Schema stuff has not been heavily tested by me.
82
-
83
- Libraries
84
- ---------
85
-
86
- ASN1 encoding and decoding is done using the 'openssl' extension, which is
87
- standard in the Ruby 1.8.2 base distribution. To check you have it, you
88
- should be able to run `ruby -ropenssl -e puts` with no error.
89
-
90
- However, I've found in the past that Linux machines don't always build the
91
- openssl extension when compiling Ruby from source. With Red Hat 9, the
92
- solution for me was, when building Ruby itself:
93
-
94
- # export CPPFLAGS="-I/usr/kerberos/include"
95
- # export LDFLAGS="-L/usr/kerberos/lib"
96
- # ./configure ...etc
97
-
98
- If you want to run the test suite then you'll need to install the ruby-ldap
99
- client library, and if you want to run examples/rbslapd3.rb then you'll need
100
- the prefork library. Both are available from <http://raa.ruby-lang.org/>.
101
-
102
- Protocol implementation
103
- -----------------------
104
-
105
- ruby-ldapserver tries to be a reasonably complete implementation of the
106
- message decoding and encoding components of LDAP. However, it does not
107
- synthesise or directly enforce the LDAP data model. It will advertise a
108
- schema in the root DSE if you configure one, and it provides helper
109
- functions which allow you to validate add and modify operations against a
110
- schema; but it's up to you to use them, if you wish. If you're just using
111
- LDAP as a convenient query interface into some other database, you probably
112
- don't care about schemas.
113
-
114
- If your clients permit it, you can violate the LDAP specification further,
115
- eliminating some of the gross design flaws of LDAP. For example, you can
116
- ditch the LDAP idea that a Distinguished Name must consist of
117
- attr=val,attr=val,attr=val... and use whatever is convenient as a primary
118
- key (e.g. "val1,val2,val3" or "id,table_name"). The 'add' operation could
119
- allocate DNs automatically from a sequence. There's no need for the data
120
- duplication where an LDAP entry must contain the same attr=val pair which is
121
- also the entry's RDN. Violations of the LDAP spec in this way are at your
122
- own risk.
123
-
124
- Threading issues
125
- ----------------
126
-
127
- The core of this library is the LDAP::Server::Connection object which handles
128
- communication with a single client, and the LDAP::Server::Operation object
129
- which handles a single request. Because the LDAP protocol allows a client to
130
- send multiple overlapping requests down the same TCP connection, I start a
131
- new Ruby thread for each Operation.
132
-
133
- If your Operation object deals with any global shared data, then it needs to
134
- do so in a thread-safe way. If this is new to you then see
135
- <http://www.rubycentral.com/book/tut_threads.html>
136
- <http://www.rubygarden.org/ruby?MultiThreading>
137
-
138
- For incoming client connections, I have supplied a simple tcpserver method
139
- which starts a new Ruby thread for each client. This works fine, but in a
140
- multi-CPU system, all LDAP server operations will be processed on one CPU;
141
- also with a very large number of concurrent client connections, you may find
142
- you hit the a max-filedescriptors-per-process limit.
143
-
144
- I have also provided a preforking server; see examples/rbslapd3.rb. In this
145
- case, your connections are handled in separate processes so they cannot
146
- share data directly in RAM.
147
-
148
- If you are using the default threading tcpserver, then beware that a number
149
- of Ruby extension libraries block the threading interpreter. In particular,
150
- the client library "ruby-ldap" blocks when waiting for a response from a
151
- remote server, since it's a wrapper around a C library which is unaware of
152
- Ruby's threading engine. This can cause your application to 'freeze'
153
- periodically. Either choose client libraries which play well with threading,
154
- or make sure each client is handled in a different process.
155
-
156
- For example, when talking to a MySQL database, you might want to choose
157
- "ruby-mysql" (which is a pure Ruby implementation of the MySQL protocol)
158
- rather than "mysql-ruby" (which is a wrapper around the C API, and blocks
159
- while waiting for responses from the server)
160
-
161
- Even with something like ruby-mysql, beware DNS lookups: resolver libraries
162
- can block too. There is a pure Ruby resolver replacement in the standard
163
- library: if you do
164
-
165
- require 'resolv-replace'
166
-
167
- this changes TCPSocket and friends to use it instead of the default C
168
- resolver. Or you could just hard-code IP addresses, or put entries in
169
- /etc/hosts for the machines you want to contact.
170
-
171
- Another threading issue to think about is abandoned and timed-out LDAP
172
- operations. The Connection object handles these by raising an
173
- LDAP::Server::Abandon or LDAP::Server::TimeLimitExceeded exception in the
174
- Operation thread, which you can either ignore or rescue. However, if in
175
- rescuing it you end up putting (say) a SQL connection back into a pool, you
176
- should beware that the SQL connection may still be mid-query, so it's
177
- probably better to discard it and use a fresh one next time.
178
-
179
- Performance
180
- -----------
181
-
182
- examples/speedtest.rb is a simple client which forks N processes, and in
183
- each process opens an LDAP connection, binds, and sends M search requests
184
- down it.
185
-
186
- Using speedtest.rb and rbslapd1.rb, running on the *same* machine
187
- (single-processor AMD Athlon 2500+) I achieve around 800 searches per second
188
- with N=1,M=1000 and 300-400 searches per second with N=10,M=100.
189
-
190
- To-do list
191
- ----------
192
-
193
- - handle and test generation of LDAP referrals properly
194
- - more cases in test suite: abandon, concurrency, performance tests, error
195
- handling
196
- - extensible match filters
197
- - extended operations
198
- RFC 2830 - Start TLS
199
- RFC 3062 - password modify
200
- RFC 2839 - whoami
201
- RFC 3909 - cancel
202
-
203
- References
204
- ----------
205
-
206
- - ftp://ftp.isi.edu/in-notes/rfc2251.txt (base protocol)
207
- - ftp://ftp.isi.edu/in-notes/rfc2252.txt (schema)
208
- - ftp://ftp.isi.edu/in-notes/rfc2253.txt (DN encoding)
209
- - http://www.itu.int/ITU-T/studygroups/com17/languages/X.680-0207.pdf
210
- - http://www.itu.int/ITU-T/studygroups/com10/languages/X.690_1297.pdf
211
-
212
- Contact
213
- -------
214
-
215
- You are very welcome to E-mail me with bug reports, patches, comments and
216
- suggestions for this software. However, please DON'T send me any general
217
- questions about LDAP, how LDAP works, how to apply LDAP in your particular
218
- situation, or questions about any other LDAP software. The `ldap@umich.edu`
219
- mailing list is probably the correct place to ask such questions. See:
220
- <http://listserver.itd.umich.edu/cgi-bin/lyris.pl?enter=ldap>
221
-
222
- Brian Candler <B.Candler@pobox.com>