Skip to content

0.1.0

Pre-release
Pre-release

Choose a tag to compare

@tacxou tacxou released this 02 Aug 14:37
· 30 commits to main since this release

πŸ“‡ First testable version πŸŽ‰

πŸ“¦ First Stable Release

This first stable version of the LDAP RFC 4512 parser provides a complete set of features for parsing and validating LDAP schema definitions.

✨ New Features

πŸ”§ Complete RFC 4512 Parser

  • Object Classes Support : Complete parsing of LDAP object classes (STRUCTURAL, AUXILIARY, ABSTRACT)
  • Attribute Types Support : Parsing of attribute types with all their properties
  • OID Validation : Validation of numeric object identifiers
  • Multiple Names Support : Handling of multiple NAME definitions

πŸ–₯️ Command Line Interface (CLI)

  • Global Command : rfc4512-parser available after installation
  • Multiple Input Formats : Parsing from command line or LDIF files
  • Multiple Output Formats : JSON and structured format support
  • Verbose Mode : Complete parsing details for debugging

πŸ“š Complete TypeScript API

  • Strict Types : TypeScript interfaces for all LDAP components
  • Error Handling : Detailed error system with error localization
  • Simple API : Easy-to-use parseSchema() function
  • ESM/CommonJS Support : Compatible with ES modules and CommonJS

πŸ” Supported Components

Object Classes

  • OID : Numeric object identifiers (e.g.: 2.5.6.6)
  • NAME : Single or multiple names in quotes
  • DESC : Text descriptions
  • SUP : Superior classes (inheritance)
  • Types : STRUCTURAL, AUXILIARY, ABSTRACT
  • MUST : Required attributes
  • MAY : Optional attributes

Attribute Types

  • Complete support for RFC 4512 attribute definitions
  • Syntax and constraint validation

πŸ§ͺ Testing and Quality

  • Complete Test Coverage : Unit tests for all components
  • CI/CD : GitHub Actions pipeline with automated testing
  • Coverage Reporting : Codecov integration for coverage tracking
  • Test Samples : Real LDAP schema examples

πŸ“ Usage Examples

As a Library

import { parseSchema } from '@tacxou/parser_ldap_rfc4512'

// Parse an object class definition
try {
  const result = parseSchema(`
    ( 2.5.6.6
      NAME 'person'
      DESC 'RFC2256: a person'
      SUP top
      STRUCTURAL
      MUST ( sn $ cn )
      MAY ( userPassword $ telephoneNumber $ description )
    )
  `)

  console.log('βœ… Successfully parsed:', result)
  // Output:
  // {
  //   oid: '2.5.6.6',
  //   name: 'person',
  //   desc: 'RFC2256: a person',
  //   sup: 'top',
  //   type: 'STRUCTURAL',
  //   must: ['sn', 'cn'],
  //   may: ['userPassword', 'telephoneNumber', 'description']
  // }
} catch (error) {
  console.error('❌ Parse error:', error.message)
}

Command Line Interface

# Global installation
npm install -g @tacxou/parser_ldap_rfc4512

# Parse a definition from command line
rfc4512-parser "( 2.5.6.6 NAME 'person' SUP top STRUCTURAL )"

# Parse from file
rfc4512-parser --input schema.ldif

# JSON output format
rfc4512-parser --input schema.ldif --format json

# Save result to file
rfc4512-parser --input schema.ldif --output result.json

# Verbose mode for more details
rfc4512-parser --input schema.ldif --verbose

πŸ› οΈ Technical Infrastructure

  • Runtime : Bun for optimal performance
  • Grammar : PEG.js for robust and precise parsing
  • TypeScript : Complete support with strict types
  • Build : Optimized build system with tree-shaking

πŸ“ˆ Metrics

  • ~100% test coverage on main components
  • Complete RFC 4512 support for Object Classes and Attribute Types
  • Robust CLI with complete error handling
  • Complete documentation with practical examples

πŸš€ Installation

# Via npm
npm install @tacxou/parser_ldap_rfc4512

# Via bun
bun add @tacxou/parser_ldap_rfc4512

# Installation globale pour CLI
npm install -g @tacxou/parser_ldap_rfc4512

πŸ”— Useful links


Full Changelog : https://github.com/tacxou/parser_ldap_rfc4512/commits/v0.1.0