Files
hack/tools/scripts/llm-key-hunter/results/_cache/content/anandsunny0899_nexusgateway.json
T

1 line
16 KiB
JSON

{"repo": "anandsunny0899/nexusgateway", "files": {"config/config.go": {"59d352f836998216d4888581ed9bf70678834403": {"t": 1785745641.8931174, "n": 1391, "h": "c6547583259619be", "c": "package config\n\nimport (\n \"log\"\n \"os\"\n \"strings\"\n)\n\ntype Config struct {\n OpenAIKey string\n AnthropicKey string\n GroqKey string\n GeminiKey string\n DeepSeekKey string \n RedisURL string\n PineconeKey string\n PineconeHost string\n DBUrl string\n StripeSecretKey string\n StripeWebhookSecret string\n Port string\n}\n\nfunc LoadConfig() *Config {\n get := func(key string) string {\n return strings.TrimSpace(os.Getenv(key))\n }\n\n apiKey := get(\"OPENAI_API_KEY\")\n if apiKey == \"\" {\n log.Fatal(\"Error: OPENAI_API_KEY is not set\")\n }\n\n port := get(\"PORT\")\n if port == \"\" {\n port = \"8080\"\n }\n\n return &Config{\n OpenAIKey: apiKey,\n AnthropicKey: get(\"ANTHROPIC_API_KEY\"),\n GroqKey: get(\"GROQ_API_KEY\"),\n GeminiKey: get(\"GEMINI_API_KEY\"),\n DeepSeekKey: get(\"DEEPSEEK_API_KEY\"),\n RedisURL: get(\"REDIS_URL\"),\n PineconeKey: get(\"PINECONE_API_KEY\"),\n PineconeHost: get(\"PINECONE_HOST\"),\n DBUrl: get(\"DB_URL\"),\n StripeSecretKey: get(\"STRIPE_SECRET_KEY\"),\n StripeWebhookSecret: get(\"STRIPE_WEBHOOK_SECRET\"),\n Port: port,\n }\n}"}, "ef1b63fa3b0f908b2ad160563f495980d406ca63": {"t": 1785755203.6557565, "n": 1391, "h": "c6547583259619be", "c": "package config\n\nimport (\n \"log\"\n \"os\"\n \"strings\"\n)\n\ntype Config struct {\n OpenAIKey string\n AnthropicKey string\n GroqKey string\n GeminiKey string\n DeepSeekKey string \n RedisURL string\n PineconeKey string\n PineconeHost string\n DBUrl string\n StripeSecretKey string\n StripeWebhookSecret string\n Port string\n}\n\nfunc LoadConfig() *Config {\n get := func(key string) string {\n return strings.TrimSpace(os.Getenv(key))\n }\n\n apiKey := get(\"OPENAI_API_KEY\")\n if apiKey == \"\" {\n log.Fatal(\"Error: OPENAI_API_KEY is not set\")\n }\n\n port := get(\"PORT\")\n if port == \"\" {\n port = \"8080\"\n }\n\n return &Config{\n OpenAIKey: apiKey,\n AnthropicKey: get(\"ANTHROPIC_API_KEY\"),\n GroqKey: get(\"GROQ_API_KEY\"),\n GeminiKey: get(\"GEMINI_API_KEY\"),\n DeepSeekKey: get(\"DEEPSEEK_API_KEY\"),\n RedisURL: get(\"REDIS_URL\"),\n PineconeKey: get(\"PINECONE_API_KEY\"),\n PineconeHost: get(\"PINECONE_HOST\"),\n DBUrl: get(\"DB_URL\"),\n StripeSecretKey: get(\"STRIPE_SECRET_KEY\"),\n StripeWebhookSecret: get(\"STRIPE_WEBHOOK_SECRET\"),\n Port: port,\n }\n}"}, "f6d4fc43b1387cfffc7cc8a504a742a76605ff3b": {"t": 1785755210.3075237, "n": 2483, "h": "c34e2e36663b1c50", "c": "// package config\n\n// import (\n// \t\"log\"\n// \t\"os\"\n// \t\"strings\"\n// )\n\n// type Config struct {\n// \tOpenAIKey string\n// \tAnthropicKey string\n// \tRedisURL string\n// \tPineconeKey string\n// \tPineconeHost string\n// \tDBUrl string\n// \tStripeSecretKey string // <--- ADDED THIS\n// \tPort string\n// \tStripeWebhookSecret string\n// }\n\n// func LoadConfig() *Config {\n// \tapiKey := os.Getenv(\"OPENAI_API_KEY\")\n// \tif apiKey == \"\" {\n// \t\tlog.Fatal(\"Error: OPENAI_API_KEY is not set\")\n// \t}\n\n// \tredisURL := os.Getenv(\"REDIS_URL\")\n// \tpineconeKey := os.Getenv(\"PINECONE_API_KEY\")\n// \tpineconeHost := os.Getenv(\"PINECONE_HOST\")\n// \tdbUrl := os.Getenv(\"DB_URL\")\n\t\n// \t// NEW: Get Stripe Key\n// \tstripeKey := os.Getenv(\"STRIPE_SECRET_KEY\")\n\n// \tif dbUrl == \"\" {\n// \t\tlog.Println(\"⚠️ Warning: DB_URL is not set. Auth will fail.\")\n// \t}\n\n// \tport := os.Getenv(\"PORT\")\n// \tif port == \"\" {\n// \t\tport = \"8080\"\n// \t}\n\n// \treturn &Config{\n// \t\tOpenAIKey: apiKey,\n// \t\tRedisURL: redisURL,\n// \t\tPineconeKey: pineconeKey,\n// \t\tPineconeHost: pineconeHost,\n// \t\tDBUrl: dbUrl,\n// \t\tStripeSecretKey: stripeKey, // <--- ADDED THIS\n// \t\tPort: port,\n// \t\tStripeWebhookSecret: os.Getenv(\"STRIPE_WEBHOOK_SECRET\"),\n// \t\tAnthropicKey: os.Getenv(\"ANTHROPIC_API_KEY\"),\n// \t}\n// }\n\n\n\n\n\npackage config\n\nimport (\n\t\"log\"\n\t\"os\"\n\t\"strings\"\n)\n\ntype Config struct {\n\tOpenAIKey string\n\tAnthropicKey string\n\tGroqKey string\n\tGeminiKey string\n\tRedisURL string\n\tPineconeKey string\n\tPineconeHost string\n\tDBUrl string\n\tStripeSecretKey string\n\tStripeWebhookSecret string\n\tPort string\n}\n\nfunc LoadConfig() *Config {\n\tget := func(key string) string {\n\t\treturn strings.TrimSpace(os.Getenv(key))\n\t}\n\n\tapiKey := get(\"OPENAI_API_KEY\")\n\tif apiKey == \"\" {\n\t\tlog.Fatal(\"Error: OPENAI_API_KEY is not set\")\n\t}\n\n\tport := get(\"PORT\")\n\tif port == \"\" {\n\t\tport = \"8080\"\n\t}\n\n\treturn &Config{\n\t\tOpenAIKey: apiKey,\n\t\tAnthropicKey: get(\"ANTHROPIC_API_KEY\"),\n\t\tGroqKey: get(\"GROQ_API_KEY\"),\n\t\tGeminiKey: get(\"GEMINI_API_KEY\"),\n\t\tRedisURL: get(\"REDIS_URL\"),\n\t\tPineconeKey: get(\"PINECONE_API_KEY\"),\n\t\tPineconeHost: get(\"PINECONE_HOST\"),\n\t\tDBUrl: get(\"DB_URL\"),\n\t\tStripeSecretKey: get(\"STRIPE_SECRET_KEY\"),\n\t\tStripeWebhookSecret: get(\"STRIPE_WEBHOOK_SECRET\"),\n\t\tPort: port,\n\t}\n}"}, "a0a2835c7076242401fa27a93b59ac96c776e22c": {"t": 1785755211.8295348, "n": 2959, "h": "38aaa191e1f93f5f", "c": "// package config\n\n// import (\n// \t\"log\"\n// \t\"os\"\n// \t\"strings\"\n// )\n\n// type Config struct {\n// \tOpenAIKey string\n// \tAnthropicKey string\n// \tRedisURL string\n// \tPineconeKey string\n// \tPineconeHost string\n// \tDBUrl string\n// \tStripeSecretKey string // <--- ADDED THIS\n// \tPort string\n// \tStripeWebhookSecret string\n// }\n\n// func LoadConfig() *Config {\n// \tapiKey := os.Getenv(\"OPENAI_API_KEY\")\n// \tif apiKey == \"\" {\n// \t\tlog.Fatal(\"Error: OPENAI_API_KEY is not set\")\n// \t}\n\n// \tredisURL := os.Getenv(\"REDIS_URL\")\n// \tpineconeKey := os.Getenv(\"PINECONE_API_KEY\")\n// \tpineconeHost := os.Getenv(\"PINECONE_HOST\")\n// \tdbUrl := os.Getenv(\"DB_URL\")\n\t\n// \t// NEW: Get Stripe Key\n// \tstripeKey := os.Getenv(\"STRIPE_SECRET_KEY\")\n\n// \tif dbUrl == \"\" {\n// \t\tlog.Println(\"⚠️ Warning: DB_URL is not set. Auth will fail.\")\n// \t}\n\n// \tport := os.Getenv(\"PORT\")\n// \tif port == \"\" {\n// \t\tport = \"8080\"\n// \t}\n\n// \treturn &Config{\n// \t\tOpenAIKey: apiKey,\n// \t\tRedisURL: redisURL,\n// \t\tPineconeKey: pineconeKey,\n// \t\tPineconeHost: pineconeHost,\n// \t\tDBUrl: dbUrl,\n// \t\tStripeSecretKey: stripeKey, // <--- ADDED THIS\n// \t\tPort: port,\n// \t\tStripeWebhookSecret: os.Getenv(\"STRIPE_WEBHOOK_SECRET\"),\n// \t\tAnthropicKey: os.Getenv(\"ANTHROPIC_API_KEY\"),\n// \t}\n// }\n\n\npackage config\n\nimport (\n\t\"log\"\n\t\"os\"\n\t\"strings\"\n)\n\ntype Config struct {\n\tOpenAIKey string\n\tAnthropicKey string\n\tGroqKey string\n\tGeminiKey string\n\tRedisURL string\n\tPineconeKey string\n\tPineconeHost string\n\tDBUrl string\n\tStripeSecretKey string\n\tStripeWebhookSecret string\n\tPort string\n}\n\nfunc LoadConfig() *Config {\n\t// Helper function to clean environment variables (removes spaces/newlines)\n\tget := func(key string) string {\n\t\treturn strings.TrimSpace(os.Getenv(key))\n\t}\n\n\t// 1. Get and Clean all keys\n\tapiKey := get(\"OPENAI_API_KEY\")\n\tanthropicKey := get(\"ANTHROPIC_API_KEY\")\n\tgroqKey := get(\"GROQ_API_KEY\")\n\tgeminiKey := get(\"GEMINI_API_KEY\")\n\tredisURL := get(\"REDIS_URL\")\n\tpineconeKey := get(\"PINECONE_API_KEY\")\n\tpineconeHost := get(\"PINECONE_HOST\")\n\tdbUrl := get(\"DB_URL\")\n\tstripeKey := get(\"STRIPE_SECRET_KEY\")\n\twebhookSecret := get(\"STRIPE_WEBHOOK_SECRET\")\n\tport := get(\"PORT\")\n\n\t// 2. Validate Critical Keys\n\tif apiKey == \"\" {\n\t\tlog.Fatal(\"Error: OPENAI_API_KEY is not set\")\n\t}\n\tif dbUrl == \"\" {\n\t\tlog.Println(\"⚠️ Warning: DB_URL is not set. Auth will fail.\")\n\t}\n\tif port == \"\" {\n\t\tport = \"8080\"\n\t}\n\n\t// 3. Return the Clean Config\n\treturn &Config{\n\t\tOpenAIKey: apiKey,\n\t\tAnthropicKey: anthropicKey,\n\t\tGroqKey: groqKey,\n\t\tGeminiKey: geminiKey,\n\t\tRedisURL: redisURL,\n\t\tPineconeKey: pineconeKey,\n\t\tPineconeHost: pineconeHost,\n\t\tDBUrl: dbUrl,\n\t\tStripeSecretKey: stripeKey,\n\t\tStripeWebhookSecret: webhookSecret,\n\t\tPort: port,\n\t}\n}"}, "938b445a1644c8e8db0aaa8d8b97f47d4b90afed": {"t": 1785755213.671313, "n": 2771, "h": "dafc9ee07d467baa", "c": "// package config\n\n// import (\n// \t\"log\"\n// \t\"os\"\n// \t\"strings\"\n// )\n\n// type Config struct {\n// \tOpenAIKey string\n// \tAnthropicKey string\n// \tRedisURL string\n// \tPineconeKey string\n// \tPineconeHost string\n// \tDBUrl string\n// \tStripeSecretKey string // <--- ADDED THIS\n// \tPort string\n// \tStripeWebhookSecret string\n// }\n\n// func LoadConfig() *Config {\n// \tapiKey := os.Getenv(\"OPENAI_API_KEY\")\n// \tif apiKey == \"\" {\n// \t\tlog.Fatal(\"Error: OPENAI_API_KEY is not set\")\n// \t}\n\n// \tredisURL := os.Getenv(\"REDIS_URL\")\n// \tpineconeKey := os.Getenv(\"PINECONE_API_KEY\")\n// \tpineconeHost := os.Getenv(\"PINECONE_HOST\")\n// \tdbUrl := os.Getenv(\"DB_URL\")\n\t\n// \t// NEW: Get Stripe Key\n// \tstripeKey := os.Getenv(\"STRIPE_SECRET_KEY\")\n\n// \tif dbUrl == \"\" {\n// \t\tlog.Println(\"⚠️ Warning: DB_URL is not set. Auth will fail.\")\n// \t}\n\n// \tport := os.Getenv(\"PORT\")\n// \tif port == \"\" {\n// \t\tport = \"8080\"\n// \t}\n\n// \treturn &Config{\n// \t\tOpenAIKey: apiKey,\n// \t\tRedisURL: redisURL,\n// \t\tPineconeKey: pineconeKey,\n// \t\tPineconeHost: pineconeHost,\n// \t\tDBUrl: dbUrl,\n// \t\tStripeSecretKey: stripeKey, // <--- ADDED THIS\n// \t\tPort: port,\n// \t\tStripeWebhookSecret: os.Getenv(\"STRIPE_WEBHOOK_SECRET\"),\n// \t\tAnthropicKey: os.Getenv(\"ANTHROPIC_API_KEY\"),\n// \t}\n// }\n\n\n\n\npackage config\n\nimport (\n\t\"log\"\n\t\"os\"\n\t\"strings\"\n)\n\ntype Config struct {\n\tOpenAIKey string\n\tAnthropicKey string\n\tRedisURL string\n\tPineconeKey string\n\tPineconeHost string\n\tDBUrl string\n\tStripeSecretKey string\n\tStripeWebhookSecret string\n\tPort string\n}\n\nfunc LoadConfig() *Config {\n\t// Helper function to clean environment variables (removes spaces/newlines)\n\tget := func(key string) string {\n\t\treturn strings.TrimSpace(os.Getenv(key))\n\t}\n\n\t// 1. Get and Clean all keys\n\tapiKey := get(\"OPENAI_API_KEY\")\n\tanthropicKey := get(\"ANTHROPIC_API_KEY\")\n\tredisURL := get(\"REDIS_URL\")\n\tpineconeKey := get(\"PINECONE_API_KEY\")\n\tpineconeHost := get(\"PINECONE_HOST\")\n\tdbUrl := get(\"DB_URL\")\n\tstripeKey := get(\"STRIPE_SECRET_KEY\")\n\twebhookSecret := get(\"STRIPE_WEBHOOK_SECRET\")\n\tport := get(\"PORT\")\n\n\t// 2. Validate Critical Keys\n\tif apiKey == \"\" {\n\t\tlog.Fatal(\"Error: OPENAI_API_KEY is not set\")\n\t}\n\tif dbUrl == \"\" {\n\t\tlog.Println(\"⚠️ Warning: DB_URL is not set. Auth will fail.\")\n\t}\n\tif port == \"\" {\n\t\tport = \"8080\"\n\t}\n\n\t// 3. Return the Clean Config\n\treturn &Config{\n\t\tOpenAIKey: apiKey,\n\t\tAnthropicKey: anthropicKey,\n\t\tRedisURL: redisURL,\n\t\tPineconeKey: pineconeKey,\n\t\tPineconeHost: pineconeHost,\n\t\tDBUrl: dbUrl,\n\t\tStripeSecretKey: stripeKey,\n\t\tStripeWebhookSecret: webhookSecret,\n\t\tPort: port,\n\t}\n}"}, "3e3dbc310fb85e3104647650fd0a8b84f699006b": {"t": 1785755216.5187879, "n": 1097, "h": "9fc98224f0e1771d", "c": "package config\n\nimport (\n\t\"log\"\n\t\"os\"\n)\n\ntype Config struct {\n\tOpenAIKey string\n\tRedisURL string\n\tPineconeKey string\n\tPineconeHost string\n\tDBUrl string\n\tStripeSecretKey string // <--- ADDED THIS\n\tPort string\n\tStripeWebhookSecret string\n}\n\nfunc LoadConfig() *Config {\n\tapiKey := os.Getenv(\"OPENAI_API_KEY\")\n\tif apiKey == \"\" {\n\t\tlog.Fatal(\"Error: OPENAI_API_KEY is not set\")\n\t}\n\n\tredisURL := os.Getenv(\"REDIS_URL\")\n\tpineconeKey := os.Getenv(\"PINECONE_API_KEY\")\n\tpineconeHost := os.Getenv(\"PINECONE_HOST\")\n\tdbUrl := os.Getenv(\"DB_URL\")\n\t\n\t// NEW: Get Stripe Key\n\tstripeKey := os.Getenv(\"STRIPE_SECRET_KEY\")\n\n\tif dbUrl == \"\" {\n\t\tlog.Println(\"⚠️ Warning: DB_URL is not set. Auth will fail.\")\n\t}\n\n\tport := os.Getenv(\"PORT\")\n\tif port == \"\" {\n\t\tport = \"8080\"\n\t}\n\n\treturn &Config{\n\t\tOpenAIKey: apiKey,\n\t\tRedisURL: redisURL,\n\t\tPineconeKey: pineconeKey,\n\t\tPineconeHost: pineconeHost,\n\t\tDBUrl: dbUrl,\n\t\tStripeSecretKey: stripeKey, // <--- ADDED THIS\n\t\tPort: port,\n\t\tStripeWebhookSecret: os.Getenv(\"STRIPE_WEBHOOK_SECRET\"),\n\t}\n}"}, "63878a054867645fa548a330224508e104cef12f": {"t": 1785755219.017386, "n": 861, "h": "25d1dbe9d1b5eae4", "c": "package config\n\nimport (\n\t\"log\"\n\t\"os\"\n)\n\ntype Config struct {\n\tOpenAIKey string\n\tRedisURL string\n\tPineconeKey string\n\tPineconeHost string\n\tDBUrl string // <--- NEW\n\tPort string\n}\n\nfunc LoadConfig() *Config {\n\tapiKey := os.Getenv(\"OPENAI_API_KEY\")\n\tif apiKey == \"\" {\n\t\tlog.Fatal(\"Error: OPENAI_API_KEY is not set\")\n\t}\n\n\tredisURL := os.Getenv(\"REDIS_URL\")\n\tpineconeKey := os.Getenv(\"PINECONE_API_KEY\")\n\tpineconeHost := os.Getenv(\"PINECONE_HOST\")\n\n\t// NEW: Get Database URL\n\tdbUrl := os.Getenv(\"DB_URL\")\n\tif dbUrl == \"\" {\n\t\tlog.Println(\"⚠️ Warning: DB_URL is not set. Auth will fail.\")\n\t}\n\n\tport := os.Getenv(\"PORT\")\n\tif port == \"\" {\n\t\tport = \"8080\"\n\t}\n\n\treturn &Config{\n\t\tOpenAIKey: apiKey,\n\t\tRedisURL: redisURL,\n\t\tPineconeKey: pineconeKey,\n\t\tPineconeHost: pineconeHost,\n\t\tDBUrl: dbUrl, // <--- NEW\n\t\tPort: port,\n\t}\n}"}, "4678e7cebf84454d92ee57543b2586619a69b992": {"t": 1785755220.3657744, "n": 740, "h": "e216dc0d9ea5dd7b", "c": "package config\n\nimport (\n\t\"log\"\n\t\"os\"\n)\n\ntype Config struct {\n\tOpenAIKey string\n\tRedisURL string\n\tPineconeKey string // <--- You were missing this\n\tPineconeHost string // <--- You were missing this\n\tPort string\n}\n\nfunc LoadConfig() *Config {\n\tapiKey := os.Getenv(\"OPENAI_API_KEY\")\n\tif apiKey == \"\" {\n\t\tlog.Fatal(\"Error: OPENAI_API_KEY is not set\")\n\t}\n\n\tredisURL := os.Getenv(\"REDIS_URL\")\n\t\n\t// Get Pinecone variables\n\tpineconeKey := os.Getenv(\"PINECONE_API_KEY\")\n\tpineconeHost := os.Getenv(\"PINECONE_HOST\")\n\n\tport := os.Getenv(\"PORT\")\n\tif port == \"\" {\n\t\tport = \"8080\"\n\t}\n\n\treturn &Config{\n\t\tOpenAIKey: apiKey,\n\t\tRedisURL: redisURL,\n\t\tPineconeKey: pineconeKey,\n\t\tPineconeHost: pineconeHost,\n\t\tPort: port,\n\t}\n}"}, "258cbb687aec0f1b598190d784430884e386ba8e": {"t": 1785755222.0089762, "n": 486, "h": "fbba81c8994e86d6", "c": "package config\n\nimport (\n\t\"log\"\n\t\"os\"\n)\n\ntype Config struct {\n\tOpenAIKey string\n\tRedisURL string\n\tPort string\n}\n\nfunc LoadConfig() *Config {\n\tapiKey := os.Getenv(\"OPENAI_API_KEY\")\n\tif apiKey == \"\" {\n\t\tlog.Fatal(\"Error: OPENAI_API_KEY is not set\")\n\t}\n\n\t// We verify if the variable is being read\n\tredisURL := os.Getenv(\"REDIS_URL\")\n\n\tport := os.Getenv(\"PORT\")\n\tif port == \"\" {\n\t\tport = \"8080\"\n\t}\n\n\treturn &Config{\n\t\tOpenAIKey: apiKey,\n\t\tRedisURL: redisURL,\n\t\tPort: port,\n\t}\n}"}}}}