This commit is contained in:
mr
2026-04-17 09:45:00 +02:00
parent 883c0bec3d
commit 5cc04ee490
5 changed files with 73 additions and 5 deletions

View File

@@ -92,6 +92,12 @@ type Peer struct {
TrustScore float64 `json:"trust_score" bson:"trust_score" default:"100"`
BlacklistReason string `json:"blacklist_reason,omitempty" bson:"blacklist_reason,omitempty"`
BehaviorWarnings []BehaviorWarning `json:"behavior_warnings,omitempty" bson:"behavior_warnings,omitempty"`
// Volatile connectivity state — never persisted to DB (bson:"-").
// Set in-memory by oc-peer when it receives a PEER_OBSERVE_RESPONSE_EVENT.
// Considered offline when LastHeartbeat is older than 60 s (30 s interval + 30 s grace).
Online bool `json:"online" bson:"-"`
LastHeartbeat *time.Time `json:"last_heartbeat,omitempty" bson:"-"`
}
func (ao *Peer) VerifyAuth(callName string, request *tools.APIRequest) bool {