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

Function TestUpdateAgentProtectionWrongOwner

internal/identity/protection_test.go:163–173  ·  view source on GitHub ↗

TestUpdateAgentProtectionWrongOwner: a config write keyed to a non-owner is a no-op that errors (tenant isolation at the store layer).

(t *testing.T)

Source from the content-addressed store, hash-verified

161// TestUpdateAgentProtectionWrongOwner: a config write keyed to a non-owner is a
162// no-op that errors (tenant isolation at the store layer).
163func TestUpdateAgentProtectionWrongOwner(t *testing.T) {
164 store, ctx, agentID, _ := newProtectionAgent(t, "prot-owner")
165 cfg := identity.ProtectionConfig{
166 InboundGatePolicy: "open", InboundGateAction: "flag", InboundScanSensitivity: "off",
167 OutboundGatePolicy: "open", OutboundGateAction: "flag", OutboundScanSensitivity: "off",
168 HITLTTLSeconds: 604800, HITLExpirationAction: "reject",
169 }
170 if err := store.UpdateAgentProtection(ctx, agentID, "someone-else", cfg); err == nil {
171 t.Fatal("expected error updating protection for non-owner, got nil")
172 }
173}
174
175// TestProtectionSensitivityBackfill guards the migration-045 backfill: a pre-045
176// agent with scan='on' whose new sensitivity column defaulted to 'off' must be

Callers

nothing calls this directly

Calls 2

newProtectionAgentFunction · 0.85
UpdateAgentProtectionMethod · 0.80

Tested by

no test coverage detected