
Product
Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.
Node module that provides wrapper methods for ldapjs
client.
In your project root run from command line:
$ npm install -save ldapper
Let's start! Include in your node application ldapper
module:
//require object
var Ldapper = require('ldapper').Ldapper;
//or require factory
var factory = require('ldapper');
//create options
var options = {
domainControllers: ['192.168.99.100'],
searchScope: 'ou=users,dc=acme,dc=com',
root: {
dn: 'cn=admin,dc=acme,dc=com',
password: {
crypton: false,
value: 'admin'
}
}
};
//create an instance
var ldappermanager1 = new Ldapper(options);
//or use factory
var ldappermanager2 = factory.create(options);
ldappermanager1.find('|(cn=test*)(sn=test*)')
.then(function(res) {
console.log(res);
});
A Ldapper
instance can be created using factory or using the new
keyword.
var factory = require('ldapper');
var ldappermanager1 = factory.create();
//or
var Ldapper = require('ldapper').Ldapper;
var ldappermanager2 = new Ldapper();
The ldapper
module can be initialized with a configuration object.
Arguments
[options] {Object} Optional configuration
Returns
{Object} Get an instance
The configuration object allows you to overrides default values. If you don't specify any configuration, it uses a default object:
{
domainControllers: [],
searchScope: null,
searchOptions: {
scope: 'sub',
filter: '(objectclass=*)',
attributes: [],
sizeLimit: 0,
paged: false
},
root: {
dn: null,
password: {
crypton: false,
value: null
}
},
crypton: null,
ssl: false,
timeout: null,
connectTimeout: null,
strictdn: false
}
Search entries from ldap.
Arguments
[filter] {string} An ldap filter
[attributes] {Array} Specify returned attributes
[searchDn] {string} Search path
[options] {object} Overrides configuration for searchOptions
Returns
{Array} Returns a list of entries
Throws
{LDAPSearchError}
Get an entry from ldap.
Arguments
dn {string} Distinguished name
[attributes] {Array} Specify returned attributes
[options] {object} Overrides configuration for searchOptions
Returns
{Object} Returns the entry
Throws
{LDAPSearchError}
Get an entry from Active Directory by objectGuid.
Arguments
guid {string|Buffer} Object guid
[attributes] {Array} Specify returned attributes
[options] {object} Overrides configuration for searchOptions
Returns
{Object} Returns the entry
Throws
{LDAPSearchError}
Get an entry from Active Directory by objectSid.
Arguments
sid {string|Buffer} Object sid
[attributes] {Array} Specify returned attributes
[options] {object} Overrides configuration for searchOptions
Returns
{Object} Returns the entry
Throws
{LDAPSearchError}
Create a new entry into ldap.
Arguments
dn {string} Distinguished name to create
[entry] {Object} Attributes to set on ldap for entry
Returns
{bool} Returns success
Throws
{LDAPAddError}
Change an entry into ldap. The list of changes must be an object with these attributes:
op
one of these values [write
| append
| delete
]attr
the ldap attribute name to changeval
the ldap value to add/replace//Example:
var changes = [
//Add a new value or replace the old value if exists
{ op: 'write', attr: 'cn', val: 'test' },
//Append values to the attribute
{ op: 'append', attr: 'mail', val: 'test.02@acme.com' },
{ op: 'append', attr: 'mail', val: 'test.03@acme.com' },
//Delete all values for the given attribute
{ op: 'delete', attr: 'loginShell' }
//Delete only the value specified
{ op: 'delete', attr: 'mail', val: 'test.02@acme.com' }
]
Arguments
dn {string} Distinguished name to change
[changes] {Array|Object} A list of changes or a single change
Returns
{Object} Returns the changed entry
Throws
{LDAPChangeError}
Rename an entry into ldap.
Arguments
dn {string} Old distinguished name
newDn {string} New distinguished name
Returns
{bool} Returns success
Throws
{LDAPRenameError}
Delete an entry from ldap.
Arguments
dn {string} Distinguished name to delete
Returns
{bool} Returns success
Throws
{LDAPDeleteError}
Check if given credentials are valid on ldap.
Arguments
username {string} The username
password {string} The password
[authAttributes] {Array|string} Specify which attributes using for authentication
[retAttribute] {Array|string} Specify returned attributes
[searchDn] {string} Search path
Returns
{Object} Returns an object
Throws
{LDAPAuthenticationError}
The MIT License
Copyright (c) 2017 Michele Andreoli http://thinkingmik.com
FAQs
Node module that provides an ldapjs client
The npm package ldapper receives a total of 0 weekly downloads. As such, ldapper popularity was classified as not popular.
We found that ldapper 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.
Product
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.