func (s *Manager) HandleRunnerApplySecret(admin *admin.Manager) http.HandlerFunc {
	return func(w http.ResponseWriter, r *http.Request) {
		token := utils.GetTokenFromHeader(r)
		vars := mux.Vars(r)
		projectID := vars["project"]
		ctx, cancel := context.WithTimeout(r.Context(), 60*time.Second)
		defer cancel()
		reqParams, err := admin.IsTokenValid(ctx, token, "secret", "modify", map[string]string{"project": projectID, "id": vars["id"]})
		if err != nil {
			_ = helpers.Logger.LogError(helpers.GetRequestID(ctx), fmt.Sprintf("Unable to forward  runner request failed to validate token -%v", err), err, nil)
			_ = helpers.Response.SendErrorResponse(ctx, w, http.StatusUnauthorized, err)
			return
		}
		reqParams = utils.ExtractRequestParams(r, reqParams, nil)
		s.forwardRequestToRunner(ctx, w, r, admin, reqParams)
	}
}
HandleRunnerApplySecret handles requests of the runner
package syncman
import (
	"bufio"
	"bytes"
	"encoding/json"
	"errors"
	"fmt"
	"io"
	"io/ioutil"
	"net/http"
	"strings"
	"time"
	"github.com/gorilla/mux"
	"github.com/spaceuptech/helpers"
	"golang.org/x/net/context"
	"github.com/spaceuptech/space-cloud/gateway/managers/admin"
	"github.com/spaceuptech/space-cloud/gateway/model"
	"github.com/spaceuptech/space-cloud/gateway/utils"
)
func (s *Manager) HandleRunnerRequests(admin *admin.Manager) http.HandlerFunc {
	return func(w http.ResponseWriter, r *http.Request) {
		token := utils.GetTokenFromHeader(r)
		ctx, cancel := context.WithTimeout(r.Context(), 60*time.Second)
		defer cancel()
		reqParams, err := admin.IsTokenValid(ctx, token, "runner", "modify", nil)
		if err != nil {
			_ = helpers.Logger.LogError(helpers.GetRequestID(ctx), fmt.Sprintf("Unable to forward runner request failed to validate token -%v", err), err, nil)
			_ = helpers.Response.SendErrorResponse(ctx, w, http.StatusUnauthorized, err)
			return
		}
		reqParams = utils.ExtractRequestParams(r, reqParams, nil)
		s.forwardRequestToRunner(ctx, w, r, admin, reqParams)
	}
}