Commit Graph

371 Commits

Author SHA1 Message Date
Patrick Mooney 8fd16ee255 Add resultError event to client
Detecting certain types of errors in encountered during any operation
(such as BusyError or UnavailableError) can be useful for making
client-wide decisions.
2014-07-25 13:35:15 -05:00
Patrick Mooney 0133e65865 Update CHANGES.md 2014-07-25 13:23:12 -05:00
Patrick Mooney b555463a90 Minor cleanup in SearchPager 2014-07-25 13:21:02 -05:00
Patrick Mooney d665378c0e Improve client paged search handling
Search response objects now include more instrumentation and control when
automatically fetching paged results.  See the SearchPager documentation
for more details.

Fix mcavage/node-ldapjs#203
2014-07-24 15:41:24 -05:00
Patrick Mooney 37ce094fc4 Add node.js 0.11 to Travis tests 2014-07-18 10:43:45 -05:00
Patrick Mooney abdd4890e5 Move client.connect into public API
In cases where a reconnect-enabled client has been manually disconnected
via unbind, it may be desirable to initiate a reconnect without
incurring other client actions.
2014-07-18 10:29:46 -05:00
Patrick Mooney 59bebe537b Make Attribute detection more strict
The old Attribute.isAttribute would allow objects lacking the toBer
method to be attached to Change objects.  This would result in errors
during serialization.

With the stricter Attribute detection, it's necessary to convert
Attribute-like objects containing type (string) and vals (array)
properties into real Attribute objects.  This precise detection is
necessary to avoid falling back to the object-keys-into-attributes

That other logic which will turn a well structured Attribute-like object
such as this:

  { type: 'valid', vals: ['something'] }

... and turn it into something broken like this:

  [
    { type: 'type', vals: ['valid'] },
    { type: 'vals', vals: ['something'] }
  ]
2014-07-17 13:33:02 -05:00
Patrick Mooney 48bd7bfe82 Fix message parsing for length-sensitive types
Certain LDAP messages (such as DeleteRequest) encode their contents as
raw bytes within the top-level sequence object.  As such, they rely
their length being passed to them when LDAPMessage decodes the sequence.

This was being done incorrectly, but would not manifest itself as a
problem unless controls followed the message.  If no controls were
present, then length of the sequence item was bounded by the message
itself and the parse would succeed.

Fix mcavage/node-ldapjs#212
2014-07-16 18:53:06 -05:00
Patrick Mooney 888d34ab7c Simplify and fix Change.apply tests for replace 2014-07-16 15:03:15 -05:00
Patrick Mooney a80cedd870 Add Change.apply method for object modification 2014-07-16 14:53:13 -05:00
Patrick Mooney 26e427f4a0 Update bunyan to 0.23.1 2014-07-14 16:07:22 -05:00
Patrick Mooney dd63fea6f7 Preserve raw Buffer value in Control objects
Fix mcavage/node-ldapjs#143
2014-07-14 14:47:56 -05:00
Patrick Mooney e30a5dab33 Fix scope option parsing in ldapjs-search util 2014-07-10 09:58:25 -05:00
Patrick Mooney 2939fa1fad Improve client request state tracking
- Handle abandoned requests properly
- Re-enable client abandon test
- Report client idleness correctly (even after abandons)

Fix mcavage/node-ldapjs#211
2014-07-09 13:40:17 -05:00
Patrick Mooney 6607d83b86 Add automatic bind support to client
The pooled client would automatically bind when initializing connections
if bindDN and bindCredentials were passed to during construction.
This convenience should be supported in the plain client too.
2014-07-08 21:44:01 -05:00
Patrick Mooney 643999f370 Update CHANGES.md 2014-07-08 15:53:20 -05:00
Patrick Mooney 7dabc16e47 Disable client abandon test
Abandon handling is not within spec in the ldapjs server and not
particularly robust in the client.  This test should be re-enabled when
both issues are fixed.
2014-07-08 15:29:05 -05:00
Patrick Mooney 3186f5eca1 Convert tests to use tape/istanbul/faucet 2014-07-08 15:09:26 -05:00
Patrick Mooney ee83d0e3ee Cleanup README formatting 2014-07-06 11:59:08 -05:00
Patrick Mooney 550e301083 Remove pooled client example 2014-07-06 01:01:28 -05:00
Patrick Mooney 343c5ab832 Merge dozoisch/patch-1
Close mcavage/node-ldapjs#206
2014-07-05 23:04:07 -05:00
Patrick Mooney 0509dd44c0 Fix circular dependency in controls 2014-07-01 18:36:47 -05:00
Patrick Mooney c8e52f1e6e Fix ldapjs-modify CLI argument parsing 2014-07-01 16:05:13 -05:00
Patrick Mooney 8f29f3b68d Merge ServerSideSort controls
Fix mcavage/node-ldapjs#187
2014-06-30 11:56:50 -05:00
Patrick Mooney aed6d2b043 Add optional error arg to client destroy event 2014-06-27 17:28:04 -05:00
Patrick Mooney 4bd454e608 Fix client initiation of multiple reconnect ops
If the client queue was enabled and requests were made during the
reconnect process (but after one unsuccessful connection attempt), they
would spawn concurrent reconnection attempts.
2014-06-27 16:48:13 -05:00
Patrick Mooney c7cd5da208 Improve client reconnect behavior
A client configured to reconnect should do so on socket close unless
unbind was called explicitly.  This covers cases where the connection
undergoes clean but unexpected termination.
2014-06-27 16:15:04 -05:00
Patrick Mooney 3edf9de578 Suppress setup errors after client.destroy
This allows clients to be destroyed during setupError events without
emitting errors from the connect/setup retry loop.
2014-06-26 12:05:34 -05:00
Patrick Mooney 28d3ed86e1 Refine client reconnection logic
- Emit setupError for errors during client setup
- Client accepts more generic options.reconnect
- Fix unbind hang in client.destroy
- Add tests for client reconnect/setup scenarios
2014-06-26 10:11:07 -05:00
Patrick Mooney 9e2bbe1072 Alter client queue parameters and error reporting
- Use 'queueDisable' as option for disabling client RequestQueue
- Throw more meaningful ConnectionError when enqueue fails
2014-06-25 14:38:26 -05:00
Hugo Dozois 26398393ee more info on .search arguments and filter strings 2014-06-24 23:36:54 -04:00
Patrick Mooney b49c2efed2 Fix socket close event handling in node.js 0.11.x
Fix mcavage/node-ldapjs#205
2014-06-24 18:41:11 -05:00
Patrick Mooney ea96468602 Use proper Change object detection in client 2014-06-24 17:43:25 -05:00
Patrick Mooney 1d2cf79bff Add ducktyping Change.isChange method
Similar to Filter.isFilter, this should help mitigate instanceof issues.
2014-06-24 14:14:17 -05:00
Patrick Mooney a0fd56d7b3 Fix reconnect abort logic on client.destroy() 2014-06-24 13:25:21 -05:00
Patrick Mooney 41f99c5b1a Merge pfmooney/gh-202
Fix mcavage/node-ldapjs#202
2014-06-24 11:06:09 -05:00
Patrick Mooney acfaa69a07 Fix client RequestQueue
- Reference documented queue parameters
- Add freeze/thaw methods
2014-06-24 11:04:23 -05:00
Patrick Mooney 3b101a7b2f Cease reconnection when client.destroy is called 2014-06-24 05:45:06 -05:00
Patrick Mooney 00956eaae5 Add ducktyping Filter.isFilter method
This should make some headway in avoiding instanceof pitfalls when
dealing with Filter objects.

Fix mcavage/node-ldapjs#123
2014-06-23 18:09:56 -05:00
Patrick Mooney 72bfb9b0f7 Major overhaul of client connection logic
- Remove PooledClient
- Add reconnect functionality to client
- Add 'idle' client event and options
2014-06-23 16:15:52 -05:00
Patrick Mooney f3e376d40b Alter presence testing for Attribute vals
Ignoring a null 'vals' options while constructing a new Attribute object
will more closely mimic the behavior prior to mcavage/node-ldapjs#178.
2014-06-23 13:37:35 -05:00
Patrick Mooney ebbc3830e3 Update changelog 2014-06-20 09:46:44 -05:00
Patrick Mooney 8cd59a5a5d Alter usage message style
Use sections and env hints per trentm's suggestion.
2014-06-19 19:19:36 -05:00
Patrick Mooney 3e43fb3d0c Replace nopt with dashdash
- Use dashdash for arg parsing
- Add bin/ldapjs-* to jsl/jsstyle checks
- Fix code style issues

Fix mcavage/node-ldapjs#201
2014-06-18 18:42:49 -05:00
Patrick Mooney f213b3e9a2 Allow configuration of derefAliases client option
Fix mcavage/node-ldapjs#134
2014-06-16 10:07:55 -05:00
Patrick Mooney 6c8dbf9a29 Use plans instead of timeouts for server tests 2014-06-16 09:40:07 -05:00
Patrick Mooney 4dffd178ad Update jsstyle version 2014-06-16 09:31:12 -05:00
Patrick Mooney 98a8bdc23c Add CHANGES.md 2014-06-16 09:12:02 -05:00
Patrick Mooney e8593f78ce Add ServerSideSortingResponseControl 2014-06-09 15:58:01 -07:00
Patrick Mooney 352e4bbfba Rename ServerSideSortingControl
ServerSideSortingRequestControl will be more consistent when
ServerSideSortingResponseControl is implemented.
2014-06-09 15:37:19 -07:00