mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-10-03 22:19:42 +02:00
Create 6 domain-focused config files in src/config/ to centralize operational tuning knobs that were scattered across 15+ source files: - server-timing.ts: SSE batching, state debounce, scheduled runs, error recovery - auth-config.ts: session TTL, rate limits, hook timeout - tunnel-config.ts: QR token rotation, tunnel process lifecycle - terminal-limits.ts: input length, terminal cols/rows, session name - ai-defaults.ts: AI model string, idle/plan context limits - team-config.ts: poll interval, cache sizes Eliminates all cross-file duplicates: - AI model string: 5 occurrences → 1 (config only) - STATS_COLLECTION_INTERVAL_MS: 2 → 1 - timeout: 10000 in hooks-config: 6 → 0 (now HOOK_TIMEOUT_MS) - MAX_TRACKED_AGENTS shadow: removed, imports from map-limits Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
36 lines
1.2 KiB
TypeScript
36 lines
1.2 KiB
TypeScript
/**
|
|
* @fileoverview Authentication, rate limiting, and hook security constants.
|
|
*
|
|
* Controls auth session lifecycle, brute-force protection,
|
|
* and Claude Code hook timeouts.
|
|
*
|
|
* @module config/auth-config
|
|
*/
|
|
|
|
// ============================================================================
|
|
// Session Cookies
|
|
// ============================================================================
|
|
|
|
/** Auth session cookie TTL — matches autonomous run length (ms) */
|
|
export const AUTH_SESSION_TTL_MS = 24 * 60 * 60 * 1000;
|
|
|
|
/** Max concurrent auth sessions per server */
|
|
export const MAX_AUTH_SESSIONS = 100;
|
|
|
|
// ============================================================================
|
|
// Rate Limiting
|
|
// ============================================================================
|
|
|
|
/** Max failed auth attempts per IP before 429 rejection */
|
|
export const AUTH_FAILURE_MAX = 10;
|
|
|
|
/** Failed auth attempt tracking window (ms) */
|
|
export const AUTH_FAILURE_WINDOW_MS = 15 * 60 * 1000;
|
|
|
|
// ============================================================================
|
|
// Hooks
|
|
// ============================================================================
|
|
|
|
/** Timeout for Claude Code hook curl commands (ms) */
|
|
export const HOOK_TIMEOUT_MS = 10000;
|