返回 AiToEarn
aitoearn-auth.constants.ts
根目录 / project / aitoearn-backend / libs / aitoearn-auth / src / aitoearn-auth.constants.ts
1 export const IS_PUBLIC_KEY = Symbol('is_public')
2 export const IS_INTERNAL_KEY = Symbol('is_internal')
3
4 /**
5 * 标记某个路由额外支持从指定 header 读取 API Key 鉴权。
6 * metadata 值为 header 名(字符串),guard 会读取该 header 并尝试按 API Key 解析。
7 * 例如 @ApiKeyHeader('x-goog-api-key') 让 Gemini SDK 原生鉴权可用;
8 * @ApiKeyHeader('Authorization') 让 Bearer token 在 JWT 校验失败后兜底按 API Key 解析。
9 */
10 export const API_KEY_HEADER_KEY = Symbol('api_key_header')
11
11 lines TYPESCRIPT