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:
65
ts_shared/interfaces.ts
Normal file
65
ts_shared/interfaces.ts
Normal 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[];
|
||||
}
|
||||
Reference in New Issue
Block a user