Skip to content

armgit / posta

Public Imported from GitHub
0

Self-hosted email delivery platform that enables applications to send emails via HTTP APIs while handling SMTP delivery, templates, storage, security, and analytics. Fully self-hostable alternative to services like SendGrid or Mailgun.

chore(dev): remove endpoints used to list user emails in development mode

Jonas Kanindaa9e46b9ab376
diff --git a/internal/routes/admin_routes.go b/internal/routes/admin_routes.go
index 517f6cf..403cbf7 100644
--- a/internal/routes/admin_routes.go
+++ b/internal/routes/admin_routes.go
@@ -344,34 +344,3 @@ func (r *Router) adminSSERoutes() []okapi.RouteDefinition {
},
}
}
-
-// devRoutes returns route definitions for development-only endpoints.
-func (r *Router) devRoutes() []okapi.RouteDefinition {
- devGroup := r.v1.Group("/dev").WithTags([]string{"Dev"})
-
- return []okapi.RouteDefinition{
- {
- Method: http.MethodGet,
- Path: "/emails",
- Handler: okapi.H(r.h.email.DevList),
- Group: devGroup,
- Summary: "List all emails (dev)",
- Description: "List all stored emails across all users. Only available in development mode.",
- Request: &handlers.ListRequest{},
- Response: &dto.PageableResponse[models.Email]{},
- },
- {
- Method: http.MethodGet,
- Path: "/emails/{id}",
- Handler: r.h.email.DevGet,
- Group: devGroup,
- Summary: "Get email (dev)",
- Description: "Get email details by UUID. Only available in development mode.",
- Response: &dto.Response[models.Email]{},
- Options: []okapi.RouteOption{
- okapi.DocPathParam("id", "string", "Email UUID"),
- okapi.DocErrorResponse(404, &dto.ErrorResponseBody{}),
- },
- },
- }
-}
diff --git a/internal/routes/routes.go b/internal/routes/routes.go
index d5fcda3..e7b44e7 100644
--- a/internal/routes/routes.go
+++ b/internal/routes/routes.go
@@ -234,10 +234,6 @@ func (r *Router) registerRoutes() {
r.app.Register(r.adminRoutes()...)
r.app.Register(r.adminSSERoutes()...)
- if r.cfg.DevMode {
- r.app.Register(r.devRoutes()...)
- }
-
// Dashboard UI (static files + SPA fallback)
webDir := r.cfg.WebDir
if info, err := os.Stat(webDir); err == nil && info.IsDir() {