package api import ( "net/http" "browser.local/platform/dto" ) // sourceRCONCommands is kept as legacy service plumbing but is not registered as a browser product route. func (h *coreHandlers) sourceRCONCommands(w http.ResponseWriter, r *http.Request) { if r.Method != http.MethodPost { writeMethodNotAllowed(w, http.MethodPost) return } request, err := decodeJSON[dto.SourceRCONCommandRequestBody](r) if err != nil { writeDecodeError(w, err) return } dispatch, err := h.core.DispatchSourceRCONCommandForSession(bearerToken(r), request.ToDomain(r.PathValue("id"))) if err != nil { writeServiceError(w, err) return } writeJSON(w, http.StatusAccepted, dto.SourceRCONCommandFromDomain(dispatch)) } // runSourceRCONInput godoc // @Summary Read one transient SCUM Source RCON command // @Description Returns the raw command exactly once only to the signed active Run lease; browser clients never receive this payload. // @Tags run-job-channel // @Accept json // @Produce json // @Param body body dto.SourceRCONExecutionInputRequest true "Fenced Source RCON input request" // @Success 200 {object} dto.SourceRCONExecutionInputResponse // @Failure 400 {object} dto.ErrorResponse // @Failure 401 {object} dto.ErrorResponse // @Failure 405 {object} dto.ErrorResponse // @Router /api/v1/run/jobs/source-rcon-input [post] func (h *coreHandlers) runSourceRCONInput(w http.ResponseWriter, r *http.Request) { if r.Method != http.MethodPost { writeMethodNotAllowed(w, http.MethodPost) return } request, err := decodeJSON[dto.SourceRCONExecutionInputRequest](r) if err != nil { writeDecodeError(w, err) return } input, err := h.core.GetSourceRCONExecutionInput(request.ToDomain()) if err != nil { writeServiceError(w, err) return } writeJSON(w, http.StatusOK, dto.SourceRCONExecutionInputFromDomain(input)) }