> For the complete documentation index, see [llms.txt](https://doc.duaer.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.duaer.com/zh/external-secrets.md).

# 在 Duaer 里使用外部密钥库

把外部密钥库接到 Duaer。
## 把 Duaer 连到密钥库 <a href="#connect-n8n-to-your-secrets-store" id="connect-n8n-to-your-secrets-store"></a>

1. 打开 Settings → External Secrets。
2. 按密钥库要求填写连接信息并保存。

界面帮助链到这一节。连接用的是密钥库访问方式，不是把每条密钥粘贴进 Duaer。未连接时，凭证字段选不到外部密钥，$secrets 也不可用。

## 在凭证里使用密钥 <a href="#use-secrets-in-n8n-credentials" id="use-secrets-in-n8n-credentials"></a>

密钥只出现在凭证字段的选择器里。选中后，Duaer 在运行时去取；界面与执行记录都不应出现明文。表达式补全里的 $secrets 同样不展示值，且仅在凭证字段可用。

不要把密钥写进节点参数或 [变量](/zh/code/variables.md)。能打开 Variables 的人就能看见变量值。

## 项目角色的访问 <a href="#access-for-project-roles" id="access-for-project-roles"></a>

在已许可外部密钥的实例上，v3 让项目 editor 与 admin 默认带上外部密钥范围，并去掉 Settings 里原来的开关。升级前若开关关闭，升级后这些角色会变宽。实例破坏性变更检查会链到这一节。

未许可的实例不受该检查影响。更细的切分仍走 [自定义角色](/zh/user-management/rbac/custom-roles.md)。
## Questions

### 外部密钥会显示在凭证界面上吗？

不会。Duaer 从已连接密钥库取值，只填进凭证字段；界面不显示明文。未连接时 $secrets 不可用。

### Duaer v3 之后谁能用外部密钥？

已许可的实例上，v3 起项目 editor 与 admin 默认带上外部密钥范围，并去掉 Settings 里原来的开关。

