()
| 136 | } |
| 137 | |
| 138 | function nonce(): string { |
| 139 | const bytes = crypto.getRandomValues(new Uint8Array(16)); |
| 140 | return Array.from(bytes, (b) => b.toString(16).padStart(2, '0')).join(''); |
| 141 | } |
| 142 | |
| 143 | /** Best-effort brute-force cap on the shared password, keyed by client IP. */ |
| 144 | async function loginRateLimitOk(env: Env, request: Request): Promise<boolean> { |
no test coverage detected