Files
NODEDC_MISSION_CORE/apps/node-agent/internal/routers/profile.go
T
DCCONSTRUCTIONS 5d56237124 feat(routers): add observed router inventory and scoped controls
Separate router discovery, evidence and authorized control from device runtime. Add Node/Core contracts and reusable operator surfaces.
2026-10-29 09:09:59 +03:00

26 lines
802 B
Go

package routers
import (
_ "embed"
"encoding/json"
)
// The factory profile is embedded in the versioned Node package. A clean host
// needs no manually installed monitor, cron, secret file or network override.
//
//go:embed profile.json
var profileJSON []byte
func profileValid() bool {
var p struct {
Schema string `json:"schema"`
Poll int `json:"poll_seconds"`
Devices int `json:"max_devices"`
Events int `json:"journal_events"`
Days int `json:"journal_days"`
Network bool `json:"network_changes"`
Router bool `json:"router_changes"`
}
return json.Unmarshal(profileJSON, &p) == nil && p.Schema == "missioncore.router-observation-profile/v1" && p.Poll == 10 && p.Devices == maxDevices && p.Events == maxEvents && p.Days == 7 && !p.Network && p.Router
}