/** * Challenge-based authentication for remote messengers * Ported from vscode-chonky-remote-pilot */ /** * Manages authentication via 6-digit challenge codes and trusted users */ export declare class ChallengeAuth { private onShowCode; private onNotify; private onSendMessage?; private onSaveAuth?; /** Invoked by the `/shutdown` admin command, after the ack reply is sent. */ private onShutdown?; /** Returns the text shown by the `/session` admin command. */ private onSessionInfo?; private challenges; private trustedUsers; private channelAuth; private blockedUsers; constructor(onShowCode: (code: string, username: string) => void, onNotify: (message: string, level?: "info" | "warning" | "error") => void, onSendMessage?: ((chatId: string, message: string) => Promise) | undefined, onSaveAuth?: (() => void) | undefined, /** Invoked by the `/shutdown` admin command, after the ack reply is sent. */ onShutdown?: (() => void | Promise) | undefined, /** Returns the text shown by the `/session` admin command. */ onSessionInfo?: (() => string) | undefined); /** * Initialize auth state from config */ loadFromConfig(config: { trustedUsers?: string[]; channels?: Record; }): void; /** * Export auth state for config persistence */ exportConfig(): { trustedUsers: string[]; channels: Record; }; /** * Check if a user is authorized to send messages * Handles challenge creation, validation, and channel authorization */ checkAuthorization(userId: string, chatId: string, username: string, isGroupChat: boolean, wasMentioned: boolean, sendMessage?: (chatId: string, message: string) => Promise, transport?: string): Promise; /** * Initiate or validate a challenge */ private initiateChallenge; /** * Handle admin commands in DM * Returns true if command was handled */ handleAdminCommand(text: string, _chatId: string, userId: string, sendMessage: (text: string) => Promise, transport?: string): Promise; /** * Validate a challenge code entered by the user */ private validateChallenge; /** * Generate a random 6-digit code */ private generateCode; /** * Get help text for admin commands */ private getHelpText; /** * Get current stats with detailed user info */ getStats(): { trustedUsers: number; channels: number; usersByTransport: Record; }; } //# sourceMappingURL=challenge-auth.d.ts.map