lib
This commit is contained in:
@@ -141,6 +141,11 @@ type Peer struct {
|
||||
// Null when the peer has not registered any organization data.
|
||||
Organization *organization.Organization `json:"organization,omitempty" bson:"organization,omitempty"`
|
||||
|
||||
// PolicyID references the Policy document that governs which inbound
|
||||
// libp2p streams are authorized for this peer.
|
||||
// When empty, all non-vital streams are denied by default.
|
||||
PolicyID string `json:"policy_id,omitempty" bson:"policy_id,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).
|
||||
@@ -157,6 +162,11 @@ func (ri *Peer) Extend(typ ...string) map[string][]tools.DataType {
|
||||
ext[t] = []tools.DataType{}
|
||||
}
|
||||
ext[t] = append(ext[t], tools.PEER)
|
||||
case "policy":
|
||||
if _, ok := ext[t]; !ok {
|
||||
ext[t] = []tools.DataType{}
|
||||
}
|
||||
ext[t] = append(ext[t], tools.POLICY)
|
||||
}
|
||||
}
|
||||
return ext
|
||||
|
||||
Reference in New Issue
Block a user