forked from wangziqi/gongxue-base
fix: default tenant PNVS secrets to sms scope
This commit is contained in:
@@ -7996,6 +7996,31 @@ async function testTenantAdminOps() {
|
||||
assert.equal(authProvider.item?.secret?.hasSecretValue, true, 'auth provider should report masked secret status');
|
||||
assert.ok(!JSON.stringify(authProvider).includes('wechat-app-secret-smoke'), 'auth provider response must not include secret plaintext');
|
||||
|
||||
const pnvsAuthProvider = await request('/api/tenant-admin/auth-providers', {
|
||||
userId: TENANT_ADMIN_USER_ID,
|
||||
method: 'PUT',
|
||||
body: {
|
||||
provider: 'aliyun-pnvs',
|
||||
displayName: '阿里云短信认证',
|
||||
status: 'testing',
|
||||
configPublic: {
|
||||
signName: '短信签名',
|
||||
templateCode: 'SMS_123456789',
|
||||
endpoint: 'https://dypnsapi.aliyuncs.com',
|
||||
},
|
||||
secret: {
|
||||
secretJson: {
|
||||
accessKeyId: 'pnvs-access-key-id',
|
||||
accessKeySecret: 'pnvs-access-key-secret',
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
assert.equal(pnvsAuthProvider.item?.provider, 'aliyun-pnvs', 'tenant admin should upsert PNVS auth provider');
|
||||
assert.equal(pnvsAuthProvider.item?.configPublic?.secretRef, 'app_private.tenant_secrets:sms:aliyun-pnvs', 'PNVS auth provider should default secrets to sms scope');
|
||||
assert.equal(pnvsAuthProvider.item?.secret?.hasSecretJson, true, 'PNVS auth provider should report masked JSON secret status');
|
||||
assert.ok(!JSON.stringify(pnvsAuthProvider).includes('pnvs-access-key-secret'), 'PNVS auth provider response must not include secret plaintext');
|
||||
|
||||
const miniappLogin = await request('/api/auth/oauth/wechat-miniapp', {
|
||||
userId: false,
|
||||
method: 'POST',
|
||||
|
||||
Reference in New Issue
Block a user