(info: TokenInfo)
| 404 | * Check rate limit for a client. Returns { allowed, retryAfterMs? }. |
| 405 | */ |
| 406 | export function checkRate(info: TokenInfo): { allowed: boolean; retryAfterMs?: number } { |
| 407 | if (info.clientId === 'root') return { allowed: true }; |
| 408 | return checkRateLimit(info.clientId, info.rateLimit); |
| 409 | } |
| 410 | |
| 411 | /** |
| 412 | * Record that a command was executed by this token. |
no test coverage detected