more debug logging in ldap

This commit is contained in:
Garrett Mills 2020-08-20 08:03:07 -05:00
parent 61a304162d
commit 282c2cdd53
Signed by: garrettmills
GPG Key ID: D2BF5FBA8298F246

View File

@ -199,6 +199,20 @@ class UsersController extends LDAPController {
return target_ids return target_ids
} }
filter_to_obj(filter) {
if ( filter && filter.json ) {
const val = filter.json
for ( const prop in val ) {
if ( !val.hasOwnProperty(prop) ) continue
val[prop] = this.filter_to_obj(val[prop])
}
return val
}
return filter
}
// TODO flitter-orm chunk query // TODO flitter-orm chunk query
// TODO generalize scoped search logic // TODO generalize scoped search logic
async search_people(req, res, next) { async search_people(req, res, next) {
@ -265,7 +279,7 @@ class UsersController extends LDAPController {
this.output.debug(`Searching ${users.length} users...`) this.output.debug(`Searching ${users.length} users...`)
this.output.debug(`Request DN: ${req.dn}`) this.output.debug(`Request DN: ${req.dn}`)
this.output.debug(`Filter:`) this.output.debug(`Filter:`)
this.output.debug(req.filter.json) this.output.debug(this.filter_to_obj(req.filter.json))
for ( const user of users ) { for ( const user of users ) {
this.output.debug(`Checking ${user.uid}...`) this.output.debug(`Checking ${user.uid}...`)
this.output.debug(`DN: ${user.dn}`) this.output.debug(`DN: ${user.dn}`)