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

Method handleDeleteAPIKey

internal/httpapi/apikeys.go:167–182  ·  view source on GitHub ↗
(ctx context.Context, in *deleteAPIKeyInput)

Source from the content-addressed store, hash-verified

165}
166
167func (s *Server) handleDeleteAPIKey(ctx context.Context, in *deleteAPIKeyInput) (*deleteAPIKeyOutput, error) {
168 user, err := s.requireAccountUser(ctx)
169 if err != nil {
170 return nil, err
171 }
172 if s.deps.DeleteAPIKey == nil {
173 return nil, NewError(http.StatusNotImplemented, "not_implemented", "API keys are not available on this deployment")
174 }
175 if err := s.deps.DeleteAPIKey(ctx, in.ID, user.ID); err != nil {
176 if errors.Is(err, identity.ErrAPIKeyNotFound) {
177 return nil, NewError(http.StatusNotFound, "not_found", "API key not found")
178 }
179 return nil, NewError(http.StatusInternalServerError, "internal_error", "failed to revoke API key")
180 }
181 return &deleteAPIKeyOutput{Status: http.StatusNoContent}, nil
182}

Callers

nothing calls this directly

Calls 3

requireAccountUserMethod · 0.95
NewErrorFunction · 0.85
DeleteAPIKeyMethod · 0.80

Tested by

no test coverage detected