ff
This commit is contained in:
26
content/guides/api_keys.mdx
Normal file
26
content/guides/api_keys.mdx
Normal file
@@ -0,0 +1,26 @@
|
||||
---
|
||||
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 日志是否残留。
|
||||
Reference in New Issue
Block a user