eve-auth-and-secrets

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Eve Auth and Secrets

Eve 身份验证与密钥管理

Use this workflow to log in to Eve and manage secrets for your app.
使用此工作流登录Eve并管理你的应用密钥。

When to Use

适用场景

  • Setting up a new project profile
  • Authentication failures
  • Adding or rotating secrets
  • Secret interpolation errors during deploys
  • 设置新项目配置文件
  • 身份验证失败时
  • 添加或轮换密钥
  • 部署期间出现密钥插值错误时

Authentication

身份验证

bash
eve auth login
eve auth login --ttl 30                # custom token TTL (1-90 days)
eve auth status
Optional (sync local OAuth tokens for agent harnesses):
bash
eve auth sync
bash
eve auth login
eve auth login --ttl 30                # 自定义令牌TTL(1-90天)
eve auth status
可选操作(为agent harness同步本地OAuth令牌):
bash
eve auth sync

Token Minting (Admin)

令牌生成(管理员权限)

Mint tokens for bot/service users without SSH login:
bash
undefined
为机器人/服务用户生成令牌,无需SSH登录:
bash
undefined

Mint token for a bot user (creates user + membership if needed)

为机器人用户生成令牌(如需则创建用户及成员身份)

eve auth mint --email app-bot@example.com --org org_xxx
eve auth mint --email app-bot@example.com --org org_xxx

With custom TTL (1-90 days, default: server configured)

设置自定义TTL(1-90天,默认:服务器配置值)

eve auth mint --email app-bot@example.com --org org_xxx --ttl 90
eve auth mint --email app-bot@example.com --org org_xxx --ttl 90

Scope to project with admin role

限定项目范围并赋予管理员角色

eve auth mint --email app-bot@example.com --project proj_xxx --role admin

TTL is capped at the server's `EVE_AUTH_TOKEN_TTL_DAYS` env var (max 90 days).
eve auth mint --email app-bot@example.com --project proj_xxx --role admin

TTL上限为服务器的`EVE_AUTH_TOKEN_TTL_DAYS`环境变量值(最长90天)。

Project Secrets

项目密钥

bash
undefined
bash
undefined

Set a secret

设置密钥

eve secrets set API_KEY "your-api-key" --project proj_xxx
eve secrets set API_KEY "your-api-key" --project proj_xxx

List keys (no values)

列出密钥名称(不显示值)

eve secrets list --project proj_xxx
eve secrets list --project proj_xxx

Delete a secret

删除密钥

eve secrets delete API_KEY --project proj_xxx
undefined
eve secrets delete API_KEY --project proj_xxx
undefined

Secret Interpolation

密钥插值

Reference secrets in
.eve/manifest.yaml
using
${secret.KEY}
:
yaml
services:
  api:
    environment:
      API_KEY: ${secret.API_KEY}
.eve/manifest.yaml
中使用
${secret.KEY}
引用密钥:
yaml
services:
  api:
    environment:
      API_KEY: ${secret.API_KEY}

Local Secrets File

本地密钥文件

For local development, create
.eve/secrets.yaml
(gitignored):
yaml
API_KEY: local-dev-key
DB_PASSWORD: local-password
This file is used for local interpolation; production secrets come from the Eve API.
本地开发时,创建
.eve/secrets.yaml
(已加入git忽略):
yaml
API_KEY: local-dev-key
DB_PASSWORD: local-password
此文件用于本地插值;生产环境密钥来自Eve API。

Common Issues

常见问题

  • Not authenticated: run
    eve auth login
    .
  • Secret missing: confirm with
    eve secrets list
    and set the key.
  • Interpolation error: verify
    ${secret.KEY}
    spelling and that the secret exists.
  • 未通过身份验证:执行
    eve auth login
  • 密钥缺失:使用
    eve secrets list
    确认并设置密钥。
  • 插值错误:检查
    ${secret.KEY}
    的拼写及密钥是否存在。