Commit Graph

94 Commits

Author SHA1 Message Date
James Sumners 1f12eca334
Add integration tests (#571)
* Initial integration test, um, test

* Hack in service

* Add integration test for issue #480

* Add fix for issue #418

* Add fix for issue #370
2019-11-16 10:48:00 -05:00
James Sumners 5a31abaed0
Clean up options checking and add some tests 2019-09-29 09:09:18 -04:00
Soisik Froger fa6ffb4504
Merge branch 'next' into next-vls-controls 2019-09-21 17:55:30 +02:00
Tony Brix ed70fd7615 test escaped single hex char at end of filter 2019-09-18 14:46:49 -05:00
Tony Brix ecfefa7ff0 fix escapedToHex capturing \ 2019-09-18 14:35:10 -05:00
James Sumners db8d5f5ccb
Merge branch 'next' into next-vls-controls 2019-09-08 07:34:14 -04:00
sinistersig 06b1804d32 Ensure toString is not called on buffers 2019-09-06 11:27:37 +01:00
Soisik Froger 311c94ef15 Virtual List View control support 2019-09-04 12:13:51 +02:00
James Sumners 92341e770a
Refactor MessageTracker into testable module 2019-08-30 10:50:02 -04:00
James Sumners 2e1ef78108
Refactor client RequestQueue into testable module (#548)
* Refactor client RequestQueue into testable module

* Update test/lib/client/request-queue/enqueue.test.js

Co-Authored-By: Tony Brix <tony@brix.ninja>

* Update test/lib/client/request-queue/enqueue.test.js

Co-Authored-By: Tony Brix <tony@brix.ninja>

* Update test/lib/client/request-queue/enqueue.test.js

Co-Authored-By: Tony Brix <tony@brix.ninja>
2019-08-28 19:15:09 -04:00
James Sumners 528a78bad3
Add test for issue #480 2019-08-28 14:38:04 -04:00
James Sumners 9a8f60767b
Resolve issue #336 2019-08-27 19:01:47 -04:00
James Sumners e2c9b12430
Apply standard linting to the code base (#539)
* Apply standard linting to the code base

* Specify files to lint

* Run lint as first stage

* Update travis config
2019-08-27 17:11:49 -04:00
James Sumners 6b514b97df
Refactor tests to be independent of each other 2019-08-27 14:17:33 -04:00
James Sumners 210d4c6d37
Convert tests back to node-tap 2019-08-27 09:11:52 -04:00
James Sumners bdbc1b1dbd
Merge pull request #529 from dododedodonl/next
Store buffer on extended request
2019-08-27 08:23:34 -04:00
James Sumners a4b8b119a5
Fix privileged port access in tests 2019-08-27 08:06:41 -04:00
dododedodonl b87e4bb288 store buffer on extended request 2019-08-27 14:04:45 +02:00
Stéphane Talbot e4264f7940 add a callback optionnal parameter for server.close method (#528)
* add a callback optionnal parameter for server.close method

net and tls server.close method accept an optional callback parameter.
ldapjs server.close method delegates to net or tls server.close method and accept now an optional callback parameter...

* add tests for server.close callback
2019-08-27 07:57:29 -04:00
James Sumners f1acfee9de
Merge pull request #522 from UziTech/update-uuid
update uuid and tests to work with windows
2019-08-26 12:12:34 -04:00
Tony Brix 400af20e23 Update ldap filter (#521)
* update ldap-filter v0.3.3

* allow escaped characters

* remove failing tests

* remove arrow function

* remove template string
2019-08-26 09:59:21 -04:00
James Sumners ac55fba157
Merge pull request #405 from pbatey/master
destroy socket if auto-bind fails
2019-08-26 07:52:22 -04:00
Manfred Steiner b66da2c76e rebase to branch next, fixing issue #434 (can delete attributes) 2019-08-26 08:22:26 +02:00
Phil Batey 5f21dbf4cd destroy socket if auto-bind fails 2019-08-25 16:58:23 -06:00
Tony Brix 2ce7468ac2 update uuid and tests to work with windows 2019-08-25 12:27:39 -05:00
James Sumners 2e2a0783bf
Create new instances of the null logger to remove potential side effects 2019-08-24 21:04:23 -04:00
James Sumners e9e8033fda
Remove dependency on Bunyan 2019-08-24 20:51:40 -04:00
Patrick Mooney 69c72dc45f Clean up DN asserts and tests 2015-11-02 22:55:25 -06:00
Patrick Mooney dcce6ebe1e Clean up getters/setters in errors 2015-11-02 22:31:02 -06:00
Patrick Mooney cefd6f484d Move Change getters/setters to prototype 2015-10-31 09:50:23 -05:00
Patrick Mooney 5b8cbb755b Fix strict DN parsing in server 2015-10-31 09:03:53 -05:00
Patrick Mooney e8607819e2 Move server getters/setters to prototype 2015-10-31 08:34:51 -05:00
Patrick Mooney ccfd821700 Fix style/lint issues 2015-10-27 21:27:47 -05:00
Chris Broome 05445cb6ec Move Attribute getters/setters into prototype 2015-10-27 21:02:13 -05:00
Patrick Mooney c10a1a6faf Clean up client handling of end/error for searches 2015-10-15 21:49:34 -05:00
Patrick Mooney acc1ca8f43 Match objectClass case-insensitively in EqualityFilter
Fix mcavage/node-ldapjs#277
2015-06-29 20:20:06 -05:00
Patrick Mooney 821569c2c4 Implement client-side StartTLS support 2015-05-13 22:26:42 -05:00
Patrick Mooney ec062d370c Improve empty DN handling
- Use more strict comparisons for client input asserts
- Fix baseObject comparison in SearchRequest initialization
- Alter default error for server route fallthrough
2015-04-25 20:53:50 -05:00
Matt Simerson 19f2c16783 Allow simple client bind with empty credentials
Fix mcavage/node-ldapjs#254
2015-04-13 23:40:58 -05:00
Patrick Mooney 495ea2afce Overhaul DN parsing and formatting
Certain applications depend upon DN string formatting in a manner more
strict than specified in the RFC.  To enable format transcription and
reproduction, some changes were made to how DNs are converted to/from
strings.

- Store RDN strings raw instead of escaped
- Record formatting details during DN/RDN parsing
- Add DN.format method to control format recreation
- Remove DN.spaced method in favor of DN.setFormat

Fix mcavage/node-ldapjs#176
2015-02-17 15:35:06 -06:00
Patrick Mooney 22b04f3a94 Move filter parsing into separate module 2014-10-16 17:00:14 -05:00
Patrick Mooney 408e7c9f99 Support invalid DNs in client/server
Some LDAP implementations (mainly AD and Outlook) accept and/or output
DNs that are not valid.  To support interaction with these invalid DNs a
strictDN flag (default: true) has been added to the client and server
constructors.  Setting this flag to false will allow use of
non-conforming DNs.

When disabling strictDN in the ldapjs client, strings which wouldn't
parse into a DN can then be passed to the ldap operation methods.  It
also means that some methods (such as search) may return results with
string-formatted DNs instead of DN objects.

When disabling strictDN in the ldapjs server, incoming requests that
contain invalid DNs will be routed to the default ('') handler for that
operation type.  It is your responsiblity to differentiate between
string-type and object-type DNs in those handlers.

Fix mcavage/node-ldapjs#222
Fix mcavage/node-ldapjs#146
Fix mcavage/node-ldapjs#113
Fix mcavage/node-ldapjs#104
2014-09-30 18:39:19 -05:00
Patrick Mooney 92362e01f3 Improve parser error handling
- Wrap parser errors with VError
- Catch initial potential sequence errors
- Improve parser test coverage
- Emit parser errors instead of implicitly logging

Fix mcavage/node-ldapjs#221
2014-09-16 15:23:21 -05:00
Patrick Mooney b70bdaa26b Cleanup lint/cruft 2014-07-29 10:21:57 -05:00
Patrick Mooney de16802a16 Fix SearchPager bugs, improve test coverage 2014-07-25 14:16:31 -05:00
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 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 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