diff --git a/backend/cmd/main.go b/backend/cmd/main.go index 8eb1ebf..69cab9a 100644 --- a/backend/cmd/main.go +++ b/backend/cmd/main.go @@ -211,7 +211,6 @@ func main() { jobsGroup.POST("", jobsHandlers.AddJob) jobsGroup.POST("/:id/wait", jobsHandlers.WaitJob) jobsGroup.GET("/metrics", jobsHandlers.GetJobMetrics) - jobsGroup.POST("/check_cmd", jobsHandlers.CheckCmd) } // Agent registration diff --git a/backend/internal/handlers/jobs.go b/backend/internal/handlers/jobs.go index cbfc016..e21eef7 100644 --- a/backend/internal/handlers/jobs.go +++ b/backend/internal/handlers/jobs.go @@ -4,7 +4,6 @@ import ( "errors" "fmt" "net/http" - "os/exec" "strconv" "time" @@ -192,42 +191,6 @@ func resolveCommand(c *gin.Context, svc *service.ScriptService, interpID int64, return command, nil } -// @Summary Check command path -// @Description Validates that a command binary exists on the system -// @Tags jobs -// @Accept json -// @Param body body CheckCmdIn true "Command to check" -// @Success 200 {object} CheckCmdOut -// @Failure 404 {object} map[string]string -// @Router /jobs/check_cmd [post] -func (h *JobsHandlers) CheckCmd(c *gin.Context) { - var in struct { - Command string `json:"command" binding:"required"` - } - if err := c.Bind(&in); err != nil { - c.JSON(http.StatusBadRequest, gin.H{"error": "invalid request"}) - return - } - - if _, err := exec.LookPath(in.Command); err != nil { - if errors.Is(err, exec.ErrNotFound) { - c.JSON(http.StatusNotFound, gin.H{"error": "command not found"}) - return - } - c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()}) - return - } - - c.JSON(http.StatusOK, CheckCmdOut{Exists: true}) -} - -type CheckCmdIn struct { - Command string `json:"command" binding:"required" example:"bash"` -} -type CheckCmdOut struct { - Exists bool `json:"exists"` -} - // JobMetricsOut is the response body for the job metrics endpoint. type JobMetricsOut struct { Total int `json:"total"`