feat: 本机默认信任自己且不能移除

This commit is contained in:
Nixevol
2026-10-12 08:54:17 +08:00
parent 5e62af17f4
commit b7763bb800
3 changed files with 24 additions and 3 deletions
+13
View File
@@ -202,6 +202,19 @@ func (d *Data) normalize() {
if d.Results == nil {
d.Results = []CmdResult{}
}
d.ensureSelf()
}
func (d *Data) ensureSelf() {
if d.EndpointID == "" {
return
}
for _, it := range d.Trust {
if it == d.EndpointID {
return
}
}
d.Trust = append([]string{d.EndpointID}, d.Trust...)
}
func (s *Store) normalize() {