(ctx context.Context, in *getProtectionInput)
| 143 | } |
| 144 | |
| 145 | func (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 | |
| 158 | func (s *Server) handlePutProtection(ctx context.Context, in *putProtectionInput) (*protectionOutput, error) { |
| 159 | if _, err := s.requireAccountScope(ctx); err != nil { |
nothing calls this directly
no test coverage detected