MCPcopy Create free account
hub / github.com/Mnexa-AI/e2a / protectionViewFromIdentity

Function protectionViewFromIdentity

internal/httpapi/protection.go:81–93  ·  view source on GitHub ↗
(ag *identity.AgentIdentity)

Source from the content-addressed store, hash-verified

79}
80
81func protectionViewFromIdentity(ag *identity.AgentIdentity) ProtectionConfigView {
82 return ProtectionConfigView{
83 Inbound: ProtectionDirectionView{
84 Gate: ProtectionGateView{Policy: ag.InboundPolicy, Allowlist: orEmpty(ag.InboundAllowlist), Action: ag.InboundPolicyAction},
85 Scan: ProtectionScanView{Sensitivity: ag.InboundScanSensitivity},
86 },
87 Outbound: ProtectionDirectionView{
88 Gate: ProtectionGateView{Policy: ag.OutboundPolicy, Allowlist: orEmpty(ag.OutboundAllowlist), Action: ag.OutboundPolicyAction},
89 Scan: ProtectionScanView{Sensitivity: ag.OutboundScanSensitivity},
90 },
91 Holds: ProtectionHoldsView{TTLSeconds: ag.HITLTTLSeconds, OnExpiry: ag.HITLExpirationAction},
92 }
93}
94
95func protectionConfigFromView(v ProtectionConfigView) identity.ProtectionConfig {
96 return identity.ProtectionConfig{

Callers 2

handleGetProtectionMethod · 0.85
handlePutProtectionMethod · 0.85

Calls 1

orEmptyFunction · 0.85

Tested by

no test coverage detected