0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-01-06 20:40:08 -05:00

fix(connector-aliyun-sms): fix config guard, remove unnecessary fields (#1229)

* fix(connector-aliyun-sms): fix config guard, remove unnecessary fields
This commit is contained in:
Darcy Ye 2022-06-24 15:38:33 +08:00 committed by GitHub
parent 96f5badc52
commit 4ee775273a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 10 additions and 25 deletions

View file

@ -4,28 +4,19 @@
"signName": "<sign-name>",
"templates": [
{
"type": 0,
"type": 2,
"usageType": "SignIn",
"code": "<temporary-passcode>",
"name": "<sign-in-template-name>",
"content": "<sign-in-template-content>",
"remark": "<sign-in-template-remark>"
"templateCode": "<template-code>"
},
{
"type": 0,
"type": 2,
"usageType": "Register",
"code": "<temporary-passcode>",
"name": "<register-template-name>",
"content": "<register-template-content>",
"remark": "<register-template-remark>"
"templateCode": "<template-code>"
},
{
"type": 0,
"type": 2,
"usageType": "Test",
"code": "<temporary-passcode>",
"name": "<test-template-name>",
"content": "<test-template-content>",
"remark": "<test-template-remark>"
"templateCode": "<template-code>"
}
]
}

View file

@ -52,7 +52,7 @@ describe('sendMessage()', () => {
AccessKeyId: mockedConnectorConfig.accessKeyId,
PhoneNumbers: phoneTest,
SignName: mockedConnectorConfig.signName,
TemplateCode: 'code',
TemplateCode: 'TemplateCode',
TemplateParam: `{"code":"${codeTest}"}`,
}),
mockedConnectorConfig.accessKeySecret

View file

@ -43,7 +43,7 @@ export default class AliyunSmsConnector implements SmsConnector {
AccessKeyId: accessKeyId,
PhoneNumbers: phone,
SignName: signName,
TemplateCode: template.code,
TemplateCode: template.templateCode,
TemplateParam: JSON.stringify({ code }),
},
accessKeySecret

View file

@ -6,10 +6,7 @@ export const mockedConnectorConfig = {
{
type: 2,
usageType: 'SignIn',
code: 'code',
name: 'name',
content: 'content',
remark: 'remark',
templateCode: 'TemplateCode',
},
],
};

View file

@ -46,10 +46,7 @@ export type PublicParameters = {
const templateGuard = z.object({
type: z.nativeEnum(SmsTemplateType).default(2),
usageType: z.string(),
code: z.string(),
name: z.string().min(1).max(30),
content: z.string().min(1).max(500),
remark: z.string(),
templateCode: z.string(),
});
export const aliyunSmsConfigGuard = z.object({