update ldapjs EqualityFilter to allow Buffer values (#43150)

This commit is contained in:
David Recuenco 2020-03-20 16:51:08 +01:00 committed by GitHub
parent 72cbb29562
commit 565c410e2d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 1 deletions

View File

@ -366,7 +366,7 @@ declare class Filter {
export function parseFilter(filterString: string): Filter;
export class EqualityFilter extends Filter {
constructor(options: { attribute: string, value: string })
constructor(options: { attribute: string, value: string | Buffer })
}
export class PresenceFilter extends Filter {

View File

@ -72,6 +72,19 @@ let equalityFilter = new ldap.EqualityFilter({
});
equalityFilter.matches({ cn: 'foo' });
let objectGUID = Buffer.from([
0x02, 0xa9, 0xe3, 0x6f,
0x58, 0x11,
0x18, 0x49,
0xb5, 0x60,
0x60, 0xad, 0x50, 0x86, 0x18, 0xc9
]);
let equalityFilterBuffer = new ldap.EqualityFilter({
attribute: 'objectGUID',
value: objectGUID
});
equalityFilterBuffer.matches({ objectGUID });
let presenceFilter = new ldap.PresenceFilter({
attribute: 'cn'
});