- 新增 sdk.MachineFingerprint:Linux machine-id+DMI、macOS IOPlatformUUID,容器内 fail-closed - 文件模式在 bind.fp 存在时自动校验,无需显式 WithFingerprint;采集失败拒绝绑定 license - 新增 WithFingerprintFunc 支持容器读取挂载宿主 machine-id;在线激活同步使用自动指纹 - license 包新增 NormalizeFingerprint(sha256:64hex 校验与小写归一化) - 新增指纹绑定/采集失败/无绑定跳过等测试
15 lines
454 B
Go
15 lines
454 B
Go
//go:build !linux && !darwin
|
|
|
|
package sdk
|
|
|
|
import "errors"
|
|
|
|
// machineFields 其他平台暂无稳定硬件标识采集实现:仅使用 hostname 兜底。
|
|
// 生产接入应通过 WithFingerprint 或 WithFingerprintFunc 注入平台特定标识。
|
|
func machineFields() ([]string, error) {
|
|
if h := hostname(); h != "" && h != "unknown" {
|
|
return []string{"hostname:" + h}, nil
|
|
}
|
|
return nil, errors.New("sdk: 当前平台无法采集机器标识")
|
|
}
|