forked from wangziqi/gongxue-base
fix: require PNVS SMS provider in production
This commit is contained in:
@@ -27,7 +27,7 @@ const safeBaseEnv = {
|
||||
const safeApiEnv = {
|
||||
...safeBaseEnv,
|
||||
CORS_ORIGIN: 'https://student.gongxue100.com,https://tenant-admin.gongxue100.com,https://platform-admin.gongxue100.com',
|
||||
AUTH_SMS_PROVIDER: 'aliyun',
|
||||
AUTH_SMS_PROVIDER: 'aliyun-pnvs',
|
||||
AUTH_CODE_PEPPER: 's3cure-prod-code-pepper-2026-06-30-abcdef',
|
||||
AUTH_SESSION_SECRET: 's3cure-prod-session-secret-2026-06-30-ghijkl',
|
||||
AUTH_JWT_JWKS_URL: 'https://auth.gongxue100.com/auth/v1/.well-known/jwks.json',
|
||||
@@ -69,8 +69,19 @@ const unsafeApiSmsProvider = runImport(apiConfigUrl, {
|
||||
assert.notEqual(unsafeApiSmsProvider.status, 0, 'production API config should reject unsupported SMS provider');
|
||||
assert.match(
|
||||
unsafeApiSmsProvider.output,
|
||||
/AUTH_SMS_PROVIDER must be aliyun\/aliyun-sms, aliyun-pnvs, or tencent\/tencent-sms/,
|
||||
'API config should name supported production SMS providers',
|
||||
/AUTH_SMS_PROVIDER must be aliyun-pnvs in production/,
|
||||
'API config should require PNVS for production SMS',
|
||||
);
|
||||
|
||||
const unsafeApiTraditionalSmsProvider = runImport(apiConfigUrl, {
|
||||
...safeApiEnv,
|
||||
AUTH_SMS_PROVIDER: 'aliyun',
|
||||
});
|
||||
assert.notEqual(unsafeApiTraditionalSmsProvider.status, 0, 'production API config should reject traditional Aliyun SMS provider');
|
||||
assert.match(
|
||||
unsafeApiTraditionalSmsProvider.output,
|
||||
/AUTH_SMS_PROVIDER must be aliyun-pnvs in production/,
|
||||
'API config should reject non-PNVS SMS providers in production',
|
||||
);
|
||||
|
||||
const unsafeApiStoragePublicBaseUrl = runImport(apiConfigUrl, {
|
||||
|
||||
Reference in New Issue
Block a user