forked from wangziqi/gongxue-base
chore: harden production readiness gates
This commit is contained in:
@@ -45,7 +45,7 @@ Supabase Auth 可继续作为最终 JWT 用户体系目标;本地重构期先
|
||||
|
||||
## 短信 Provider
|
||||
|
||||
本地默认是 `AUTH_SMS_PROVIDER=mock`,仅开发环境返回 `debugCode`。生产环境如果仍为 mock,会直接拒绝发送。
|
||||
本地默认是 `AUTH_SMS_PROVIDER=mock`,仅开发环境返回 `debugCode`。生产环境只允许 `aliyun/aliyun-sms` 或 `tencent/tencent-sms`;如果仍为 mock 或写成未知 provider,API 启动和 `readiness:production` 都会直接失败。
|
||||
|
||||
真实 provider:
|
||||
|
||||
@@ -58,6 +58,7 @@ Supabase Auth 可继续作为最终 JWT 用户体系目标;本地重构期先
|
||||
- 租户级密钥写 `app_private.tenant_secrets(secret_scope='sms')` 或生产 Vault。
|
||||
- 前端只能看到 provider 是否启用、签名展示名、隐私协议链接等非敏感配置。
|
||||
- provider endpoint 默认使用官方域名,生产环境只允许 HTTPS 官方域名;本地测试可使用 `localhost/127.0.0.1` fake server。
|
||||
- `readiness:production:db` 会检查 active/testing 短信 provider 的 `signName/templateCode` 或 `smsSdkAppId/signName/templateId`,并阻断公开配置里的 secret-like 字段。
|
||||
|
||||
### 阿里云短信配置示例
|
||||
|
||||
@@ -196,6 +197,7 @@ body: { "code": "<qq oauth code>", "redirectUri": "https://h5.example.com/auth/q
|
||||
- `endpoint`、`userInfoEndpoint`、`openIdEndpoint` 默认使用官方 HTTPS 域名;生产环境不允许本地 HTTP fake endpoint。
|
||||
- `appSecret/clientSecret/AppKey` 必须存入 `app_private.tenant_secrets(secret_scope='oauth')`,不能进入 `configPublic`。
|
||||
- QQ 的 `redirectUri` 必须与 QQ 互联后台登记的一致;多租户自定义域名上线前需要逐个配置或设计统一授权中转域名。
|
||||
- `readiness:production:db` 会阻断 OAuth endpoint/redirectUri 为 HTTP、localhost 或非官方 provider endpoint,也会阻断 active/testing provider 缺少对应私密 `tenant_secrets`。
|
||||
|
||||
## 手机号绑定/换绑
|
||||
|
||||
@@ -282,6 +284,7 @@ body: { "code": "<qq oauth code>", "redirectUri": "https://h5.example.com/auth/q
|
||||
- 订单已支付时重复通知只返回幂等成功,不重复开通权益。
|
||||
- 支付成功事务内更新 `orders`、`payments`、`payment_events`、`entitlements`。
|
||||
- 支付密钥只允许放在 `app_private.tenant_secrets` 或生产 KMS/Vault。
|
||||
- `readiness:production:db` 会阻断微信支付缺 `appId/merchantId/merchantSerialNo/notifyUrl`、支付宝缺 `appId/notifyUrl`、notifyUrl/returnUrl/退款回调为 HTTP 或 localhost、provider endpoint 非官方域名、公开配置混入 `privateKey/apiV3Key/secret/token` 等密钥字段。
|
||||
|
||||
### 资金对账
|
||||
|
||||
|
||||
Reference in New Issue
Block a user