fix: default PNVS secrets to sms scope

This commit is contained in:
Codex
2026-07-03 22:48:08 +08:00
parent 0a60609a67
commit f5e449f34b
2 changed files with 8 additions and 1 deletions

View File

@@ -51,7 +51,12 @@ function parseSecretRef(value: unknown): { scope: TenantSecretScope; key: string
function defaultSecretScope(provider: string): TenantSecretScope {
const normalized = provider.toLowerCase().replace(/[_\s]/g, '-');
if (normalized.includes('sms') || normalized === 'aliyun' || normalized === 'tencent') return 'sms';
if (
normalized.includes('sms') ||
normalized === 'aliyun' ||
normalized === 'aliyun-pnvs' ||
normalized === 'tencent'
) return 'sms';
if (normalized.includes('pay') || normalized.includes('alipay')) return 'payment';
return 'oauth';
}