Skip to content

Releases: tacxou/parser_ldap_rfc4512

1.0.2

Choose a tag to compare

@tacxou tacxou released this 17 Dec 16:40

🐇 Bun-First Toolchain

Overview

Version 1.0.2 makes Bun the authoritative package manager, refreshes linting dependencies, and modernizes TypeScript output defaults. Parser logic, exported interfaces, and CLI behavior remain identical to 1.0.1.

Changes Since 1.0.1

  • Enforced Bun usage through .npmrc (engine-strict, package-manager bun@latest) and the packageManager field in package.json.
  • Declared type: module, raised the Node engine floor to 22, and refreshed dev dependencies (ESLint 9.39, @typescript-eslint 8.50, Peggy 5.0.6, etc.).
  • Updated tsconfig.json to module: es2022 with moduleResolution: bundler to align with Bun builds and modern bundlers.
  • Migrated ESLint configuration to .eslintrc.cjs for compatibility with ESM-aware Node runtimes while preserving the existing rule set.
  • Switched Makefile helper targets (ncu, ncu-upgrade) to bunx, keeping all tooling Bun-native.

Verification

git diff 1.0.1..HEAD → tooling and configuration updates only
git log 1.0.1..HEAD → 2 commits (tooling refactor, version bump)

Why 1.0.2?

  • Deliver a fully Bun-native developer experience with consistent package manager metadata.
  • Adopt the latest ESLint/@typescript-eslint stack compatible with Bun and Node 22.
  • Ensure TypeScript emit defaults match the ESM expectations of downstream consumers.

Stability Guarantees

  • No parser source, grammar, or CLI changes compared to 1.0.1.
  • Public TypeScript interfaces, error contracts, and relaxed-mode semantics remain stable.
  • Patch updates continue to avoid breaking API or CLI contracts.

Migration from 1.0.1

No code changes required for consumers. Allow the caret range to resolve to 1.0.2, ensure local environments meet the engine floor (node >= 22, bun >= 1.0), and keep using the existing rfc4512-parser CLI.

Quality & CI

  • ESLint now loads via CommonJS to stay compatible with Bun-driven lint runs.
  • Makefile automation (ncu, ncu-upgrade) uses bunx, aligning local scripts with the Bun-first toolchain.

Release Links


Full Changelog: 1.0.1...1.0.2

1.0.1

Choose a tag to compare

@tacxou tacxou released this 17 Dec 03:47

📇 Docs & CI Refresh

Overview

Version 1.0.1 realigns the distribution under the tacxou npm namespace, refreshes the public documentation, and hardens the CI and coverage pipeline. Parser code, exported interfaces, and CLI behavior remain identical to 1.0.0.

Changes Since 1.0.0

  • Published artifacts now use the npm scope @tacxou/parser_ldap_rfc4512, keeping naming consistent across channels.
  • README gains a new banner image, improved badge placement, and clearer feature highlights for prospective adopters.
  • Added Bun lockfile to guarantee reproducible dependency resolution for local development and CI builds.
  • Workflow adjustments ensure Codecov uploads reference the correct repository slug and credentials.

Verification

git diff 1.0.0..HEAD → documentation, workflow, and metadata updates only
git log 1.0.0..HEAD → 5 commits (docs, CI, metadata)

Why 1.0.1?

  • Ensure npm consumers receive the package under the maintainer-owned scope without breaking changes.
  • Present the project with refreshed visuals and download metrics for increased trust.
  • Lock Bun dependencies so repeatable builds match CI and release artifacts.

Stability Guarantees

  • Public TypeScript interfaces, parser grammar, and CLI commands remain unchanged from 1.0.0.
  • Error model and relaxed-mode semantics are preserved.
  • Patch updates will continue to avoid breaking contract changes.

Migration from 1.0.0

No code changes required. Update dependencies to @tacxou/parser_ldap_rfc4512 (or keep an existing caret range that now resolves to 1.0.1). CLI binaries installed globally under the new scope expose the same rfc4512-parser command.

Quality & CI

  • GitHub Actions workflow now runs Codecov Action v5 with explicit slug and token wiring for reliable uploads.
  • Matrix tests keep Node 18.x and 20.x coverage while builds remain Bun-based.

Release Links


Full Changelog: 1.0.0...1.0.1

1.0.0

Choose a tag to compare

@tacxou tacxou released this 08 Aug 17:49

📇 General Availability / First Stable SemVer

Overview

Version 1.0.0 is the first General Availability (GA) / stable semantic version of @tacxou/parser_ldap_rfc4512. It promotes the previously published 0.x pre-release line to a guaranteed stable API suitable for production use when parsing and validating LDAP schema definitions compliant with RFC 4512, plus pragmatic OpenLDAP extensions.

Note: Earlier 0.x tags (0.1.x / 0.2.0) were published as GitHub pre-releases. Any wording such as “First Stable Release” inside those notes referred to functional completeness, not semver stability. Version 1.0.0 is the first release carrying full semver stability guarantees.

Changes Since 0.2.0

There are no source or documentation changes between tag 0.2.0 and the commit being tagged as 1.0.0. This release only promotes the existing codebase to a stable semver. Verification:

  • git diff 0.2.0..HEAD → (no differences)
  • git log 0.2.0..HEAD → (no commits)

(Once the 1.0.0 tag is created, git diff 0.2.0..1.0.0 will likewise be empty.)

Why 1.0.0 Now?

  • Parser grammar & TypeScript interfaces proven through test suite.
  • Error model (typed enum + rich metadata) stable.
  • CLI behavior stable & documented.
  • OpenLDAP relaxed mode & X-* extensions feature set complete for declared scope.
  • No pending breaking design changes identified.

Stability Guarantees

From 1.0.0 forward:

  • Public TypeScript interfaces exposed by the build are stable (semver minor/patch will not introduce breaking changes).
  • CLI flags & exit semantics stable (changes, if any, require a major bump).
  • Error type enum identifiers and error object shape stable.
  • Relaxed mode option name / semantics stable.

Key Features (Carried Forward from 0.2.0)

  • PEG-based parsing of LDAP schema elements (attributeTypes, objectClasses, ldapSyntaxes, etc.).
  • Support for:
    • RFC 4512 core structures
    • X-* extensions & multiple X-* extensions per definition
    • Relaxed mode to tolerate non-strict legacy / OpenLDAP schemas
    • OpenLDAP cn=config style numeric index prefixes
  • Strongly typed TypeScript interfaces for schema entities
  • Structured error model (custom error class + enumerated error kinds + metadata)
  • CLI tool (rfc4512-parser) for parsing LDIF fragments / schema files
  • Build output for Node (dist/index.js, dist/cli.js)
  • Comprehensive tests (RFC compliance, relaxed mode, X- extensions, OpenLDAP samples)

Migration from 0.2.0

No action required. Update your dependency to ^1.0.0 (or keep caret range; no breakage expected). All previously working code continues to function identically.

Release Links

Looking Ahead (Non-Breaking Roadmap)

  • Diagnostic tiers (warnings vs errors)
  • Optional AST inspection / traversal helpers
  • Extended semantic validation (matching rules, syntax constraints)
  • Potential plugin hooks for custom extension semantics

Full Changelog: 0.2.0...1.0.0

0.2.0

0.2.0 Pre-release
Pre-release

Choose a tag to compare

@tacxou tacxou released this 07 Aug 18:01

📇 Unstable changes with X-* support

This version significantly improves support for custom LDAP extensions and OpenLDAP compatibility, introducing the necessary flexibility to parse extended schemas that are not strictly RFC 4512 compliant.

✨ New Features

🔧 X-* Extensions Support
Custom Extensions : Complete support for X-* extensions in schema definitions
Flexible Validation : Parsing of common extensions (X-ORIGIN, X-DEPRECATED, etc.)
Real Examples : Tests with mailSieveRuleSource, sambaSupportedEncryptionTypes
Multiple Extensions : Support for multiple X-* extensions in a single definition

🏗️ Advanced OpenLDAP Compatibility
cn=config Prefixes : Automatic handling of index prefixes like {57}
Relaxed Mode : relaxed option to parse non-strictly compliant schemas
OID Extraction : Utilities to extract OID and names from prefixed schemas
OpenLDAP Format : Complete support for cn=config formats

📚 Enhanced API
Parsing Options : RFC4512ParserOptions interface with relaxed mode
Extended Types : Updated interfaces to support extensions
Flexibility : Adaptive parsing based on configured options

🔍 Supported Components

X-* Extensions
X-ORIGIN : Origin indication for custom attributes/classes
X-DEPRECATED : Marking of obsolete elements
X-ORDERING : Custom ordering extensions
Multiple Extensions : Support for multiple extensions in a single definition

OpenLDAP cn=config
Numeric Prefixes : Automatic parsing of {index} prefixes
OID Extraction : Utilities to extract real OID values
Strict/Relaxed Mode : Choice between strict RFC compliance or OpenLDAP flexibility

🏗️ Technical Improvements
Extended PEG.js Grammar : Support for X-* extensions in the grammar
Adaptive Parser : Behavior adapted according to relaxed/strict options
Exhaustive Tests : Validation with real LDAP schemas (Dovecot, Samba, etc.)
Extended Coverage : Tests for all X-* and OpenLDAP use cases

📁 Usage Examples

Parsing with X-* Extensions

import { parseSchema } from '@tacxou/parser_ldap_rfc4512'

// Simple X-ORIGIN extension
const schemaWithExtension = `
  ( 1.3.6.1.4.1.4203.666.1.5
    NAME 'mailSieveRuleSource'
    DESC 'Sieve rule source'
    EQUALITY caseIgnoreMatch
    SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
    X-ORIGIN 'user defined'
  )
`

try {
  const result = parseSchema(schemaWithExtension)
  console.log('✅ Extension parsed:', result.extensions)
  // Output: { 'X-ORIGIN': 'user defined' }
} catch (error) {
  console.error('❌ Parse error:', error.message)
}

Relaxed Mode for OpenLDAP

import { parseSchema } from '@tacxou/parser_ldap_rfc4512'

// Schema with OpenLDAP prefix
const openldapSchema = `{57}( 2.5.4.3 NAME 'cn' DESC 'RFC4519: common name(s)' SUP name )`

try {
  const result = parseSchema(openldapSchema, { relaxed: true })
  console.log('✅ OpenLDAP schema parsed:', result.oid)
  // Output: "2.5.4.3" (prefix automatically removed)
} catch (error) {
  console.error('❌ Parse error:', error.message)
}

Multiple Extensions

// Support for multiple X-* extensions
const multipleExtensions = `
  ( 1.2.3.4.5
    NAME 'customAttribute'
    DESC 'Custom attribute with multiple extensions'
    SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
    X-ORIGIN 'Custom Schema'
    X-DEPRECATED 'Use newAttribute instead'
  )
`

const result = parseSchema(multipleExtensions)
console.log(result.extensions)
// Output: { 'X-ORIGIN': 'Custom Schema', 'X-DEPRECATED': 'Use newAttribute instead' }

🔄 Migration from v0.1.x

Backward Compatibility
No breaking changes - existing API remains 100% compatible
Existing parseSchema() functions continue to work
New optional parameters added without impact on existing code

New Optional Features

// v0.1.x - continues to work
const result = parseSchema(schema)

// v0.2.0 - new options available
const result = parseSchema(schema, { relaxed: true })

New Dependencies
No new external dependencies added
Internal improvements to existing PEG.js grammar
100% backward compatible

🧪 Testing and Quality
Extended Coverage : Complete tests for X-* extensions and OpenLDAP prefixes
Real Schemas : Validation with authentic Dovecot, Samba, OpenLDAP schemas
Strict/Relaxed Mode : Tests for both parsing modes
LDIF Samples : New example files for various extensions

📈 Metrics
~100% test coverage maintained
Complete support for common X-* extensions
Robust OpenLDAP cn=config compatibility
No regression on v0.1.x features

🎯 Upcoming Versions
Complete CLI Interface : Global rfc4512-parser command with extension handling
Advanced Validation : Semantic validation of extended schemas
Plugin System : Support for custom extension parsers
Enhanced Documentation : Complete guide for supported extensions

🚀 Installation

# Via npm
npm install @tacxou/parser_ldap_rfc4512

# Via bun  
bun add @tacxou/parser_ldap_rfc4512

🔗 Useful Links
GitHub Repository
NPM Package
Complete Documentation
Issues & Support


Full Changelog: 0.1.1...0.2.0

0.1.0

0.1.0 Pre-release
Pre-release

Choose a tag to compare

@tacxou tacxou released this 02 Aug 14:37

📇 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