-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ad.find
always returns group membership
#82
Comments
The snippet of code you posted looks fine. Have you tried enabling trace level logging? https://github.com/jsumners/node-activedirectory#opts |
Hi @jsumners thx for the reply. I can't install Is there any other logger package I can use for example |
You can use any logger that supports the Log4j-style interface. But |
I needed to install windows build tools. Now the logger is working and I might have an idea why it's not working. When I see the output of the filter from find "2217_all" it finds the groups AND also the members. Some of these groups have well over 1000 members. Is there a way to disable it, so it doesnt search for members too? My config looks like this:
Here is a screenshot of a log that works because it's just one group, but you can see that it resolves the members, which it shouldn't right (look at member array this is a huge array with all members)? This would explain the dc disconnect since it's simple too huge. With "all_2217*" it finds about 30 groups with nested groups inside and I think more then 10.000 users combined. I want to just find the groups without resolving members. And when I click on a group I make another api call to: Thx so much for your help! |
The |
Yeah but it's ok to find 100 users and 100 groups. But why is it also resolving the members of the group(s)? Thx for your work @jsumners :) |
Because you told it to -- node-activedirectory/lib/components/find.js Lines 138 to 151 in 7b0cf44
|
But where in my code have I told the
And the test route:
|
Maybe there is a bug. If so, a PR to fix it is welcome. Please remember to include unit tests. |
|
ad.find
always returns group membership
@jsumners Is there some kind of Contribute guide or guidelines for this repo? For example is there some kind of mock server? I'm a bit lost, would be my first issue on github I try to solve :D |
This repo follows typical Node.js community module conventions. You can run |
Ok, sorry one more question. How to start the mock server? In the tests/mockServer direcotry in index.js you export the server.listen function but I don't know where the entry file is and where I can start it with |
The tests automatically start it and query against it. |
Ahhh okay so I make changes to the find function that I think will solve the problem and then I write a test against it. Then I run the suite. I think I get it. |
It would be better to write a failing test first, but, yes, that is the way. |
My assumption was that this will fail, but it passes. So on the mock server it appears to be working. Maybe anyone that sees this could take a look? Or is my test faulty? I think testing this function won't bring much, since it is working and it returns just the result without the resolved members. It's just in the log. So it resolves it somewhere. Need to dive deeper Edit: the closest Ive gotten is here:
I logged it but this also does not add the |
Maybe I'm a little late to the party, but isn't it simpler just to add the includeMemberships: [] to the opts object? I think by default memberships are returned for users by design (and maybe also for groups), and that is why you're seeing this extra info. Advise if that makes sense or if a PR is truly needed so as to understand if this is truly a bug or not. Thank you. |
Hi guys,
Problem:
When you search with the method
find
it will resolve the group members internally, but returns the search results without the resolved members. In my oppinion it should not resolve it in the first place when no options withincludeMembership
has been provided. But right now it does it internally (you can only find out if you enable logging like stated in the docs) but it's returning the correct result. This is consuming very much ressources, imagine finding 100 groups with 200 users each. But you only want the groups without the users.Why did I encounter this problem? When I searched for specific groups in my company, the server crashed. It was just a too big search, since it found about 50 groups and some of these groups have groups inside it with 1000's of users.
OLD ERROR / initial Issue:
I have a basic api route that looks like this:
When I go to this route with "activedirectory2" installed I get this error:
But it also logs the results before. So it somehow resolves like this:==> It logs undefined, so it doesn't resolve, but I get the response on the client, I see all the groups and users! After that the Server crashed and I can't make another call. Weird O.oIt finds the results and sends it.But then somehow it also runs the error line and sends the error too.After the fist error there is a second in the console (don't get why, I just send the error and return):
Full Error:
When I use the other package "activedirectory" this works fine, but I can't use this package because in this I have the bug that was resolved with 2.0 "Fix illegal escaping".
Whats funny too is when the search term is another one like "cn=admins" it works and I don't get this error, although I find many more groups and users then with "cn=all_2217".
Any ideas why this api route first sends the response and then also sends the 401, and why I get the ldap error from my dc server? I tried several dc servers that have ldap same error. With exact same setup it works on the little brother "activedirectory".
I also tried to
npm install activedirectory2@next
but that doesn't help.Thx so much and btw: Awesome Library!!
The text was updated successfully, but these errors were encountered: