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

Method handleGetProtection

internal/httpapi/protection.go:145–156  ·  view source on GitHub ↗
(ctx context.Context, in *getProtectionInput)

Source from the content-addressed store, hash-verified

143}
144
145func (s *Server) handleGetProtection(ctx context.Context, in *getProtectionInput) (*protectionOutput, error) {
146 // Protection config is account administration — an agent-scoped credential
147 // (the screened entity) must not read its own detection tuning (#13).
148 if _, err := s.requireAccountScope(ctx); err != nil {
149 return nil, err
150 }
151 ag, err := s.resolveOwnedAgent(ctx, in.Address)
152 if err != nil {
153 return nil, err
154 }
155 return &protectionOutput{Body: protectionViewFromIdentity(ag)}, nil
156}
157
158func (s *Server) handlePutProtection(ctx context.Context, in *putProtectionInput) (*protectionOutput, error) {
159 if _, err := s.requireAccountScope(ctx); err != nil {

Callers

nothing calls this directly

Calls 3

requireAccountScopeMethod · 0.95
resolveOwnedAgentMethod · 0.95

Tested by

no test coverage detected