Files
iam-service/.env.example
2026-02-03 10:17:11 +08:00

48 lines
2.1 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

SERVICE_NAME=iam-service
LOG_LEVEL=info
LOG_TO_FILE=false
LOG_DIR=./log
LOG_FILE_NAME=iam.log
DATABASE_URL=postgres://iam_service_user:iam_service_password@localhost:5432/iam_service_db
REDIS_URL=redis://localhost:6379/0
# JWT_SECRET服务端私密随机串不是 RS256 私钥)
# 作用:作为 refresh token 指纹HMACpepper用于 refresh_tokens.token_fingerprint 计算与校验。
# 要求:生产环境必须使用高强度随机值,定期轮换会导致现有 refresh token 全部失效(通常是可接受的)。
# openssl rand -base64 64
JWT_SECRET=please_replace_with_a_secure_random_string
# AUTH_CODE_JWT_SECRET授权码codeJWT 的对称签名密钥HS256
# 作用iam-service 用它签发/验签 5 分钟一次性 code/auth/login-code 与 /auth/code2token
# 要求:生产环境必须使用高强度随机值并妥善保管。
AUTH_CODE_JWT_SECRET=please_replace_with_a_secure_random_string
# CLIENT_SECRET_PREV_TTL_DAYSclientSecret 轮换后的旧密钥宽限期(天)。
# 作用:允许业务方平滑切换新密钥,宽限期内新旧 clientSecret 都可用于 /auth/code2token。
CLIENT_SECRET_PREV_TTL_DAYS=7
# JWT_KEY_IDRS256 key idkid会出现在 JWT header 与 JWKS 中,用于多 Key 管理与轮换。
JWT_KEY_ID=default
# JWT_PRIVATE_KEY_PEM / JWT_PUBLIC_KEY_PEMRS256 私钥/公钥PEM 文本)。
# 作用:签发 access token私钥与提供 JWKS公钥业务服务通常使用 JWKS 验签。
JWT_PRIVATE_KEY_PEM=
JWT_PUBLIC_KEY_PEM=
# JWT_JWKS_EXTRA_KEYS_JSON可选额外 JWKS keysJSON 数组),用于灰度轮换/多公钥共存。
JWT_JWKS_EXTRA_KEYS_JSON=
PORT=3000
# Optional: Scalar/OpenAPI example injection
IAM_DOCS_DEFAULT_TENANT_ID=
IAM_DOCS_DEFAULT_TOKEN=
IAM_DOCS_REQUIRE_TENANT_ID=0
IAM_DOCS_REQUIRE_TOKEN=0
# Optional: second-factor token for sensitive operations (tenant create, app delete)
IAM_SENSITIVE_ACTION_TOKEN=
# Optional: enable second-factor token for password reset (admin path uses this token too)
# (same IAM_SENSITIVE_ACTION_TOKEN header: X-Sensitive-Token)