## Summary
Implements `PUT /v0/servers/{id}` admin edit endpoint to address part of
issue #182, providing an API-based solution for server moderation
without requiring direct database access.
- **New endpoint**: `PUT /v0/servers/{id}` for editing existing servers
- **Security**: Uses existing JWT auth with `PermissionActionEdit`
permissions
- **Anti-undelete protection**: Added `ServerStatusDeleted` status that
cannot be reverted
- **Full implementation**: Database, service, API, and comprehensive
test coverage
## Key Use Cases
- Mark malicious servers as `deleted` for takedown
- Update server metadata for moderation actions
Related to: https://github.com/modelcontextprotocol/registry/issues/182
(but that is not _done_ yet because we need admins to be able to login
(probably with #283), and need to add docs on how to do the takedown,
and probably guidelines on what we will/won't takedown)
15 lines
753 B
Go
15 lines
753 B
Go
package service
|
|
|
|
import "github.com/modelcontextprotocol/registry/internal/model"
|
|
|
|
// RegistryService defines the interface for registry operations with extension wrapper architecture
|
|
type RegistryService interface {
|
|
// List retrieves servers with extension wrapper format
|
|
List(cursor string, limit int) ([]model.ServerResponse, string, error)
|
|
// GetByID retrieves a single server by registry metadata ID with extension wrapper format
|
|
GetByID(id string) (*model.ServerResponse, error)
|
|
// Publish publishes a server with separated extensions
|
|
Publish(req model.PublishRequest) (*model.ServerResponse, error)
|
|
// EditServer updates an existing server with new details
|
|
EditServer(id string, req model.PublishRequest) (*model.ServerResponse, error)
|
|
}
|