MCPcopy Create free account
hub / github.com/aetherstate/GODMOD3.AI / getValidKeys

Function getValidKeys

api/middleware/auth.ts:20–31  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

18import { resolveTier, getTierConfig } from '../lib/tiers'
19
20function getValidKeys(): string[] | null {
21 const multi = process.env.GODMODE_API_KEYS
22 if (multi) {
23 const keys = multi.split(',').map(k => k.trim()).filter(Boolean)
24 if (keys.length > 0) return keys
25 }
26 const single = process.env.GODMODE_API_KEY
27 if (single) {
28 return [single.trim()]
29 }
30 return null // Auth disabled
31}
32
33/** Constant-time comparison of two strings (prevents timing attacks). */
34function safeEqual(a: string, b: string): boolean {

Callers 2

auth.tsFile · 0.70
apiKeyAuthFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected