MCPcopy Create free account
hub / github.com/dwgx/WindsurfAPI / validateApiKey

Function validateApiKey

src/auth.js:1854–1865  ·  view source on GitHub ↗
(key)

Source from the content-addressed store, hash-verified

1852}
1853
1854export function validateApiKey(key) {
1855 let effectiveKey = config.apiKey;
1856 if (_apiKeyResolver) {
1857 try {
1858 const v = _apiKeyResolver();
1859 if (typeof v === 'string') effectiveKey = v;
1860 } catch { /* keep env fallback */ }
1861 }
1862 if (!effectiveKey) return isLocalBindHost(_bindHost);
1863 if (!key) return false;
1864 return safeEqualString(key, effectiveKey);
1865}
1866
1867// ─── Brute-force lockout (v2.0.56, CLIProxyAPI-style) ─────────────────
1868// Track failed dashboard auth attempts per client IP. After

Callers 2

routeFunction · 0.90

Calls 2

isLocalBindHostFunction · 0.85
safeEqualStringFunction · 0.85

Tested by

no test coverage detected