-
Notifications
You must be signed in to change notification settings - Fork 473
Replace internal controls with @ldapjs/controls #797
Conversation
2a37835
to
c40e13d
Compare
I'm running into some issues here. I do not think the VirtualListView control code in this repo is correct. The spec for the control is defined at https://datatracker.ietf.org/doc/html/draft-ietf-ldapext-ldapv3-vlv-07#section-6.1. The spec says that the target offset is a
But the docs I have been able to find indicate that (See also https://www.oss.com/asn1/resources/asn1-made-simple/asn1-quick-reference/choice.html) In order to determine the truth of the matter, I am attempting to build an integration test suite against a server that is known to implement the VLV control correctly. This has resulted in: So far, the But the I am hesitant to use the
At the moment, I'm thinking the OpenDJ route is the better route IF I can get a response from that team about the bug I am encountering. Or if I can find a way around it. @soisik since you implemented this control in #553, any input you can provide here would be helpful. I am also considering removing support for the control until such time as we can write proper integration tests for it. In fact, that is likely the path I will take so that I can get |
🤔 the UnboundId SDK includes a bare bones in-memory directory server: |
To this end, I have started https://github.com/ldapjs/docker-test-unboundid. But I've done all I can stand to do on this right now. Next time I work on this, I will be skipping the VLV controls because they cannot be accurately tested. We can revisit them after v3 ships unless someone else wants to put in the time to build a working integration test image. |
After some further reading about ASN.1 due to working on another aspect this overall work, I have determined the answer to the above question about the First, we need the spec's ASN.1 declaration for the control:
The answer is actually in my above comment:
This, for me, is a difficult to parse sentence that says: if the value of the CHOICE is a SEQUENCE, then the tag is the SEQUENCE tag. However, a bit of extra knowledge is required: Thus, if we are encoding the VLV request control for a Given the above, we can assume the code for the VLV control is correct. However, we still do not have a way to write a verifiable integration test. Therefore, I am likely to continue with the plan of shipping v3 with the VLV controls disabled. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
* Replace internal controls with @ldapjs/controls * Replace EntryChangeNotificationControl * Replace PagedResultsControl * Replace ServerSideSortingRequestControl * Replace ServerSideSortingResponseControl * Replace VLV controls * Reduce coverage requirement * Fix dependency qualifier
* Replace internal controls with @ldapjs/controls * Replace EntryChangeNotificationControl * Replace PagedResultsControl * Replace ServerSideSortingRequestControl * Replace ServerSideSortingResponseControl * Replace VLV controls * Reduce coverage requirement * Fix dependency qualifier
Please include a minimal reproducible example |
When this PR is completed, it will remove all code that implements LDAP controls internally and replace their usage with the
@ldapjs/controls
module. This is a step toward making the client and server code separate. The ultimate goal being: