New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ldapjs-type-parsers

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ldapjs-type-parsers

A collection of functions to parse raw buffers from LDAPJS

  • 0.1.5
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
22
decreased by-40.54%
Maintainers
1
Weekly downloads
 
Created
Source

Functions

coerceEntry(entry)Object

Coerce an ldapjs entry into an object with keys (using entry.object as a base) (This uses module.attributeTransforms to map attribute names to type parsers. Many of the names present are Active-Directory-LDAP specific and I don't honestly know how well it works on other instances)

parseInteger8(buffer)Number

Parse an LDAP Interger8 buffer into a Number

bufferToPEMCertString(buffer)String

Parse an LDAP OctetString buffer into a base 64 encoded certificate string with line breaks every 64 characters. (this should match the content in a .pem certificate file)

PEMCertStringToBuffer(str)Buffer

Parse a base 64 encoded certificate string into a buffer representing an LDAP OctetString.

parseGeneralizedDate(buffer)Date

Parse an LDAP GeneralizedDate buffer into a javascript Date object

toGeneralizedDateString(date)String

Convert a javascript Date object into an LDAP GeneralizedDate string (Can be converted to a buffer with Buffer.from(str, 'utf8) but the most common use-case is in ldapjs filters, which take a string)

parseIntegerDate(buffer)Date

Parse an LDAP IntegerDate buffer into a javascript Date object

toIntegerDateString(date)String

Convert a javascript Date object into an LDAP IntegerDate string (Can be converted to a buffer with Buffer.from(str, 'utf8) but the most common use-case is in ldapjs filters, which take a string)

parseLargeInteger(buffer, NumberType)Date

Parse an LDAP IntegerDate buffer into a javascript Date object

parseObjectSID(buffer)String

Parse an LDAP ObjectSID buffer into a string

toObjectSIDBuffer(str)Buffer

Convert an objectSID string into an LDAP ObjectSID buffer

parseObjectGUID(buffer)String

Parse an LDAP ObjectGUID buffer into a string

toObjectGUIDBuffer(str)Buffer

Convert an ObjectGUID string into an LDAP ObjectGUID buffer

parseBoolean(buffer)Boolean

Parse an LDAP Boolean buffer into a javascript Boolean

toBooleanString(buffer)String

Convert a javascript Boolean into a string representation of an LDAP Boolean

parseUnicodeString(buffer)String

Parse an LDAP UnicodeString buffer into a javascript String

parseUserAccountControl(buffer)Object

Parse an LDAP UserAccountControl buffer into a javascript Object

parseSAMAccountType(buffer)Object

Parse an LDAP SAMAccountType buffer into a javascript Object

coerceEntry(entry) ⇒ Object

Coerce an ldapjs entry into an object with keys (using entry.object as a base) (This uses module.attributeTransforms to map attribute names to type parsers. Many of the names present are Active-Directory-LDAP specific and I don't honestly know how well it works on other instances)

Kind: global function
Returns: Object - An object in the form { sAMAccountName: 'PickleRick', objectSid: 'S-1-5-21-3231561394-915883793-4011936924-6446' }

ParamTypeDescription
entryObjectAn entry object retuend from ldapjs

parseInteger8(buffer) ⇒ Number

Parse an LDAP Interger8 buffer into a Number

Kind: global function
Returns: Number - A Number

ParamTypeDescription
bufferBufferA buffer representing an attribute of type Integer8.

bufferToPEMCertString(buffer) ⇒ String

Parse an LDAP OctetString buffer into a base 64 encoded certificate string with line breaks every 64 characters. (this should match the content in a .pem certificate file)

Kind: global function
Returns: String - A Base64 string

ParamTypeDescription
bufferBufferA buffer representing an LDAP attribute of type OctetString

PEMCertStringToBuffer(str) ⇒ Buffer

Parse a base 64 encoded certificate string into a buffer representing an LDAP OctetString.

Kind: global function
Returns: Buffer - A buffer representing an LDAP attribute of type OctetString.

ParamTypeDescription
strStringA Base64 string

parseGeneralizedDate(buffer) ⇒ Date

Parse an LDAP GeneralizedDate buffer into a javascript Date object

Kind: global function
Returns: Date - A Date object

ParamTypeDescription
bufferBufferA buffer representing an LDAP GeneralizedDate attribute.

toGeneralizedDateString(date) ⇒ String

Convert a javascript Date object into an LDAP GeneralizedDate string (Can be converted to a buffer with Buffer.from(str, 'utf8) but the most common use-case is in ldapjs filters, which take a string)

Kind: global function
Returns: String - - A String in the format "YYYYMMDDHHMMSS.mmmZ" eg."20211225070000.000Z"

ParamTypeDescription
dateDateA Date object

parseIntegerDate(buffer) ⇒ Date

Parse an LDAP IntegerDate buffer into a javascript Date object

Kind: global function
Returns: Date - A Date object

ParamTypeDescription
bufferBufferA buffer representing an LDAP IntegerDate attribute.

toIntegerDateString(date) ⇒ String

Convert a javascript Date object into an LDAP IntegerDate string (Can be converted to a buffer with Buffer.from(str, 'utf8) but the most common use-case is in ldapjs filters, which take a string)

Kind: global function
Returns: String - - A string representation of an integer

ParamTypeDescription
dateDateA Date object

parseLargeInteger(buffer, NumberType) ⇒ Date

Parse an LDAP IntegerDate buffer into a javascript Date object

Kind: global function
Returns: Date - A Date object

ParamTypeDescription
bufferBufferA buffer representing an LDAP IntegerDate attribute.
NumberTypefunctionA constructor for the Type of Number you want returned (defaults to String). You can supply "BigInt" here, if your environment supports it.

parseObjectSID(buffer) ⇒ String

Parse an LDAP ObjectSID buffer into a string

Kind: global function
Returns: String - An ObjectSID string eg S-1-5-21-3231561394-915883793-4011936924-6446

ParamTypeDescription
bufferBufferA buffer representing an LDAP ObjectSID attribute.

toObjectSIDBuffer(str) ⇒ Buffer

Convert an objectSID string into an LDAP ObjectSID buffer

Kind: global function
Returns: Buffer - A buffer representing an LDAP ObjectSID

ParamTypeDescription
strStringAn ObjectSID string eg. S-1-5-21-3231561394-915883793-4011936924-6446

parseObjectGUID(buffer) ⇒ String

Parse an LDAP ObjectGUID buffer into a string

Kind: global function
Returns: String - An ObjectSID string eg S-1-5-21-3231561394-915883793-4011936924-6446

ParamTypeDescription
bufferBufferA buffer representing an LDAP ObjectGUID attribute.

toObjectGUIDBuffer(str) ⇒ Buffer

Convert an ObjectGUID string into an LDAP ObjectGUID buffer

Kind: global function
Returns: Buffer - A buffer representing an LDAP ObjectGUID attribute

ParamTypeDescription
strStringAn ObjectGUID string eg. 1E633E26-741B-4D0E-94C7-64D8DED0791F

parseBoolean(buffer) ⇒ Boolean

Parse an LDAP Boolean buffer into a javascript Boolean

Kind: global function
Returns: Boolean - A javascript Boolean

ParamTypeDescription
bufferBufferA buffer representing an LDAP Boolean attribute.

toBooleanString(buffer) ⇒ String

Convert a javascript Boolean into a string representation of an LDAP Boolean

Kind: global function
Returns: String - An upper case javascript string. Either "TRUE" or "FALSE"

ParamTypeDescription
bufferBooleanA buffer representing an LDAP Boolean attribute

parseUnicodeString(buffer) ⇒ String

Parse an LDAP UnicodeString buffer into a javascript String

Kind: global function
Returns: String - A javascript String

ParamTypeDescription
bufferBufferA buffer representing an LDAP UnicodeString attribute

parseUserAccountControl(buffer) ⇒ Object

Parse an LDAP UserAccountControl buffer into a javascript Object

Kind: global function
Returns: Object - A javascript Object with Boolean properties representing each possible flag in a UserAccountControl bitmask eg: { accountDisabled: true, lockedOut: false, ...}

ParamTypeDescription
bufferBufferA buffer representing an LDAP UserAccountControl attribute

parseSAMAccountType(buffer) ⇒ Object

Parse an LDAP SAMAccountType buffer into a javascript Object

Kind: global function
Returns: Object - A javascript Object with Boolean properties representing each possible flag in a SAMAccountType bitmask eg: { userObject: true, normalUserAccount: true, ...}

ParamTypeDescription
bufferBufferA buffer representing an LDAP SAMAccountType attribute

Keywords

FAQs

Package last updated on 09 Nov 2021

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc