feat(auth): implement API key authentication and enhance request handling

- Add AuthGuard to validate API key for public access.
- Create AuthModule to provide the AuthGuard globally.
- Update API request interceptor to automatically include API key for non-localhost requests.
- Modify .env and .env.example to include API_KEY configuration.
- Enhance API request handling with improved error logging and client IP detection.
This commit is contained in:
dmy
2026-01-16 11:26:02 +08:00
parent 9257c78e72
commit 300e930c64
7 changed files with 144 additions and 19 deletions

View File

@@ -24,4 +24,6 @@ PROXY_PORT=6000
LOG_LEVEL=info
# OpenAI API Key (用于 AI 推荐)
ARK_API_KEY=your_openai_api_key_here
ARK_API_KEY=your_openai_api_key_here
API_KEY=your_secure_api_key_here