Skip to content

v22.1.1

Latest

Choose a tag to compare

@brandonlehmann brandonlehmann released this 02 Jun 00:30
7eec68e

A TypeScript/Node.js library for the RADIUS protocol (RFC 2865, RFC 2866, RFC 2868, RFC 2869) — packet parsing and construction, a UDP server and client, FreeRADIUS dictionary-based attribute resolution, and the protocol's authentication and password-encryption schemes.

Highlights

Packet model

  • Parse, construct, and serialize RADIUS packets per RFC 2865/2866/2868/2869.
  • Standard attributes, vendor-specific attributes (VSAs), extended and long-extended attributes, nested TLVs, and struct decoding.
  • Typed encode/decode for integer, string, text, octets, ipaddr, ipv6addr/prefix, and date values, with strict length and bounds checking on both paths.

Dictionary

  • FreeRADIUS-format dictionary loader with nested includes, vendor blocks, BEGIN/END-VENDOR scoping, and value mappings.
  • Bundled vendor dictionaries for attribute and value name resolution.

Server & Client

  • Asynchronous UDP Server and Client built on node:dgram, exposing packet and discard events with per-request tracking keyed by identifier and source.

Authentication

  • Request Authenticator generation from cryptographically secure random bytes, and Accounting-Request Authenticator computation per RFC 2866.
  • Message-Authenticator (attribute 80) HMAC-MD5 generation and constant-time verification, enforced by default for authenticated packets.
  • Opt-in allowMissingMessageAuthenticator / allowMismatchedMessageAuthenticator flags for interoperating with legacy CHAP/PAP equipment that omits attribute 80 (both default to false).

Password encryption

  • User-Password (RFC 2865) and Tunnel-Password (RFC 2868) encryption, with a unique salt generated per packet.

Requirements

  • Node.js >= 22

Installation

yarn add @gibme/radius
# or
npm install @gibme/radius

See the README for full usage and API documentation.