feat: expand companion platform, device controls, and memoir workflows
ci / verify (push) Canceled after 0s
ci / verify (push) Canceled after 0s
Add customer and operator login, BLE provisioning, device fleet controls, call memory, memoir generation, and refreshed family and maintenance portals. Include API contracts, migrations, firmware sources, tests, assets, and deployment documentation.
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
package config
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestTencentSMSConfigRequiresCompleteCredentialsAndApprovedTemplate(t *testing.T) {
|
||||
c := OnboardingConfig{
|
||||
SMSLoginEnabled: true,
|
||||
SMSProvider: "tencent",
|
||||
MasterKey: strings.Repeat("ab", 32),
|
||||
EntryURL: "https://platform.example/onboarding/entry",
|
||||
TencentSMSSecretID: "id",
|
||||
TencentSMSSecretKey: "key",
|
||||
TencentSMSAppID: "1400006666",
|
||||
TencentSMSSignName: "安芯伴",
|
||||
TencentSMSTemplateID: "123456",
|
||||
}
|
||||
if err := c.validate(EnvironmentProd); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
c.TencentSMSSecretKey = ""
|
||||
if err := c.validate(EnvironmentProd); err == nil {
|
||||
t.Fatal("Tencent SMS accepted a missing secret key")
|
||||
}
|
||||
c.TencentSMSSecretKey = "key"
|
||||
c.TencentSMSTemplateID = "unapproved"
|
||||
if err := c.validate(EnvironmentProd); err == nil {
|
||||
t.Fatal("Tencent SMS accepted an invalid template ID")
|
||||
}
|
||||
c.SMSProvider = "unknown"
|
||||
if err := c.validate(EnvironmentProd); err == nil {
|
||||
t.Fatal("unknown SMS provider accepted")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user