Files
haiyushuke-website/content/guides/api_keys.mdx

27 lines
611 B
Plaintext
Raw Normal View History

2026-06-16 14:34:09 +08:00
---
title: API Key 管理
sidebarTitle: API Key
description: 创建、轮换与权限最佳实践
---
# API Key 管理
## 创建
控制台 → **设置 → API Key** → **创建**。建议命名包含环境与用途,例如 `prod-report-agent`。
## 存储
- 使用环境变量:`HAIYUSHUKE_API_KEY`
- 密钥管理系统KMS / Vault中保存勿提交至 Git
## 轮换流程
1. 创建新 Key
2. 在应用配置中灰度切换
3. 确认流量稳定后禁用旧 Key
## 泄露应急
若 Key 已泄露:立即 **禁用** 该 Key → 新建 → 排查仓库与 CI 日志是否残留。