
Research
PyPI Package Disguised as Instagram Growth Tool Harvests User Credentials
A deceptive PyPI package posing as an Instagram growth tool collects user credentials and sends them to third-party bot services.
ldap-filter
Advanced tools
The ldap-filter npm package is used to construct and parse LDAP (Lightweight Directory Access Protocol) filters. It provides a simple and intuitive way to create complex LDAP queries programmatically.
Constructing LDAP Filters
This feature allows you to construct LDAP filters using various filter types such as AndFilter, EqualityFilter, and PresenceFilter. The code sample demonstrates creating a filter that matches entries with a common name of 'John Doe' and a presence of the 'mail' attribute.
const ldap = require('ldap-filter');
const filter = new ldap.AndFilter({
filters: [
new ldap.EqualityFilter({ attribute: 'cn', value: 'John Doe' }),
new ldap.PresenceFilter({ attribute: 'mail' })
]
});
console.log(filter.toString()); // Output: (&(cn=John Doe)(mail=*))
Parsing LDAP Filters
This feature allows you to parse LDAP filter strings into filter objects. The code sample demonstrates parsing an LDAP filter string into an object representation.
const ldap = require('ldap-filter');
const filterString = '(&(cn=John Doe)(mail=*))';
const filter = ldap.parse(filterString);
console.log(filter);
Combining Filters
This feature allows you to combine multiple filters using logical operators like AND, OR, and NOT. The code sample demonstrates combining two filters using the AND operator.
const ldap = require('ldap-filter');
const filter1 = new ldap.EqualityFilter({ attribute: 'cn', value: 'John Doe' });
const filter2 = new ldap.PresenceFilter({ attribute: 'mail' });
const combinedFilter = new ldap.AndFilter({ filters: [filter1, filter2] });
console.log(combinedFilter.toString()); // Output: (&(cn=John Doe)(mail=*))
ldapjs is a comprehensive library for interacting with LDAP servers. It includes functionality for creating and parsing LDAP filters, similar to ldap-filter, but also provides additional features for managing LDAP connections, performing searches, and handling LDAP entries.
ldapauth-fork is a library focused on LDAP authentication. It includes some basic filter creation and parsing capabilities, but its primary purpose is to authenticate users against an LDAP server. It is less focused on the detailed construction and parsing of LDAP filters compared to ldap-filter.
activedirectory is a library for interacting with Active Directory, which includes LDAP functionality. It provides methods for querying and managing Active Directory entries, including filter creation and parsing. However, it is more specialized for Active Directory environments compared to the more general-purpose ldap-filter.
API for handling LDAP-style filters
Originally derived from the filter code in LDAPjs
MIT.
0.3.3
FAQs
API for handling LDAP-style filters
The npm package ldap-filter receives a total of 188,193 weekly downloads. As such, ldap-filter popularity was classified as popular.
We found that ldap-filter demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
A deceptive PyPI package posing as an Instagram growth tool collects user credentials and sends them to third-party bot services.
Product
Socket now supports pylock.toml, enabling secure, reproducible Python builds with advanced scanning and full alignment with PEP 751's new standard.
Security News
Research
Socket uncovered two npm packages that register hidden HTTP endpoints to delete all files on command.