vesse / node-ldapauth-fork

Simple node.js module to authenticate against an LDAP server
Other
127 stars 79 forks source link

Versatile group filter #36

Closed UXabre closed 8 years ago

UXabre commented 8 years ago

As mentioned in an issue some days ago, I have patched the groupfilter to allow for passing of a callback function next to the previously defined string. The first and only argument passed is the user object, which can be used to form a search filter string which needs to be returned.

I have tried out both the "old" functionality with a fixed string and tested it out with a dynamic filter:

groupSearchFilter: (user) => {
    return "(|(&(cn=*)(memberUid="+user.uid+"))(&(cn=*)(gidNumber="+user.gidNumber+")))";
}
UXabre commented 8 years ago

I have updated the pull request as per your comment. I have done it slightly different but I think it is in line with what you mentioned :-)

UXabre commented 8 years ago

Hello, Were you able to review the latest changes? Or did I overlook some things to be according to your specification? :-)

vesse commented 8 years ago

Hello,

Yes and then left to vacation and forgot the whole thing... Sorry about that.