#14 支持设置密码签名类型
This commit is contained in:
parent
8e4302495e
commit
30954e08fe
|
@ -69,6 +69,7 @@ const (
|
||||||
type DeviceConfig struct {
|
type DeviceConfig struct {
|
||||||
Id string
|
Id string
|
||||||
Password string
|
Password string
|
||||||
|
VerifyTimestamp bool
|
||||||
Servers string
|
Servers string
|
||||||
Qos byte
|
Qos byte
|
||||||
BatchSubDeviceSize int
|
BatchSubDeviceSize int
|
||||||
|
@ -130,6 +131,7 @@ func (lcc *LogCollectionConfig) getEndTime() string {
|
||||||
type baseIotDevice struct {
|
type baseIotDevice struct {
|
||||||
Id string // 设备Id,平台又称为deviceId
|
Id string // 设备Id,平台又称为deviceId
|
||||||
Password string // 设备密码
|
Password string // 设备密码
|
||||||
|
VerifyTimestamp bool
|
||||||
AuthType uint8 // 鉴权类型,0:密码认证;1:x.509证书认证
|
AuthType uint8 // 鉴权类型,0:密码认证;1:x.509证书认证
|
||||||
ServerCaPath string // 平台CA证书
|
ServerCaPath string // 平台CA证书
|
||||||
CertFilePath string // 设备证书路径
|
CertFilePath string // 设备证书路径
|
||||||
|
@ -320,7 +322,11 @@ func assembleClientId(device *baseIotDevice) string {
|
||||||
segments := make([]string, 4)
|
segments := make([]string, 4)
|
||||||
segments[0] = device.Id
|
segments[0] = device.Id
|
||||||
segments[1] = "0"
|
segments[1] = "0"
|
||||||
segments[2] = "0"
|
if device.VerifyTimestamp {
|
||||||
|
segments[2] = "1"
|
||||||
|
} else {
|
||||||
|
segments[2] = "0"
|
||||||
|
}
|
||||||
segments[3] = timeStamp()
|
segments[3] = timeStamp()
|
||||||
|
|
||||||
return strings.Join(segments, "_")
|
return strings.Join(segments, "_")
|
||||||
|
|
Loading…
Reference in New Issue