feat(smartradius): Implement full RADIUS server and client with RFC 2865/2866 compliance, including packet handling, authenticators, attributes, secrets manager, client APIs, and comprehensive tests and documentation

This commit is contained in:
2026-02-01 17:40:36 +00:00
parent 5a6a3cf66e
commit be9f49fff9
45 changed files with 11694 additions and 70 deletions

65
ts_shared/interfaces.ts Normal file
View File

@@ -0,0 +1,65 @@
/**
* RADIUS Protocol Core Interfaces
* Based on RFC 2865 (Authentication) and RFC 2866 (Accounting)
*/
import { ERadiusCode } from './enums.js';
/**
* Attribute value type
*/
export type TAttributeValueType = 'text' | 'string' | 'address' | 'integer' | 'time' | 'vsa';
/**
* Attribute definition
*/
export interface IAttributeDefinition {
type: number;
name: string;
valueType: TAttributeValueType;
encrypted?: boolean;
}
/**
* Raw attribute (type-length-value)
*/
export interface IRadiusAttribute {
type: number;
value: Buffer;
}
/**
* Parsed attribute with named value
*/
export interface IParsedAttribute {
type: number;
name: string;
value: string | number | Buffer;
rawValue: Buffer;
}
/**
* Vendor-Specific Attribute
*/
export interface IVendorSpecificAttribute {
vendorId: number;
vendorType: number;
vendorValue: Buffer;
}
/**
* RADIUS Packet structure
*/
export interface IRadiusPacket {
code: ERadiusCode;
identifier: number;
authenticator: Buffer;
attributes: IRadiusAttribute[];
}
/**
* Parsed RADIUS packet with named attributes
*/
export interface IParsedRadiusPacket extends IRadiusPacket {
parsedAttributes: IParsedAttribute[];
}