refactor: rename iot client to stateless gateway
This commit is contained in:
@@ -66,10 +66,9 @@ type PaymentConfig struct {
|
||||
Wechat WechatPayConfig `yaml:"Wechat"`
|
||||
}
|
||||
|
||||
// IoTConfig 保存 API、Worker 与 IoT Client 间的内部认证和地址。
|
||||
// IoTConfig 保存 API 与 IoT 链路间的内部认证配置。
|
||||
type IoTConfig struct {
|
||||
InternalServiceToken string `yaml:"InternalServiceToken"`
|
||||
ClientBaseURL string `yaml:"ClientBaseURL"`
|
||||
}
|
||||
|
||||
// SrvConfig 与仓库现有进程的配置结构保持一致。
|
||||
@@ -110,8 +109,8 @@ func New(srvKey string) {
|
||||
if Spec.Payment.ExpireMinutes <= 0 || Spec.Payment.RefundWindowDays <= 0 {
|
||||
panic("Payment expiration and refund window must be greater than zero")
|
||||
}
|
||||
if len(strings.TrimSpace(Spec.IoT.InternalServiceToken)) < 16 || !strings.HasPrefix(Spec.IoT.ClientBaseURL, "http") {
|
||||
panic("IoT internal token and client base URL are required")
|
||||
if len(strings.TrimSpace(Spec.IoT.InternalServiceToken)) < 16 {
|
||||
panic("IoT internal token is required")
|
||||
}
|
||||
registerURL, err := url.ParseRequestURI(Spec.Global.UserRegisterURL)
|
||||
if err != nil || (registerURL.Scheme != "http" && registerURL.Scheme != "https") || registerURL.Host == "" {
|
||||
|
||||
Reference in New Issue
Block a user