diff --git a/api/plugin.go b/api/plugin.go index 4e01e10..72f2320 100644 --- a/api/plugin.go +++ b/api/plugin.go @@ -2,11 +2,8 @@ package api import ( "encoding/hex" - "encoding/json" "fmt" "net/http" - "os" - "path/filepath" "strings" gtypes "github.com/ethereum/go-ethereum/core/types" @@ -185,28 +182,6 @@ func (s *Server) DeletePluginPolicyById(c echo.Context) error { }) } -func (s *Server) GetPolicySchema(c echo.Context) error { - pluginID := c.Request().Header.Get("plugin_id") // this is a unique identifier; this won't be needed once the DCA and Payroll are separate services - if pluginID == "" { - return c.JSON(http.StatusBadRequest, NewErrorResponse("missing required header: plugin_id")) - } - - // TODO: need to deal with both DCA and Payroll plugins - keyPath := filepath.Join("plugin", pluginID, "dcaPluginUiSchema.json") - jsonData, err := os.ReadFile(keyPath) - if err != nil { - return c.JSON(http.StatusInternalServerError, NewErrorResponse("failed to read plugin schema")) - } - - var data map[string]interface{} - jsonErr := json.Unmarshal(jsonData, &data) - if jsonErr != nil { - s.logger.WithError(jsonErr).Error("Failed to parse plugin schema") - return c.JSON(http.StatusInternalServerError, NewErrorResponse("failed to parse plugin schema")) - } - return c.JSON(http.StatusOK, data) -} - func (s *Server) GetRecipeSpecification(c echo.Context) error { recipeSpec, err := s.plugin.GetRecipeSpecification() if err != nil { diff --git a/api/server.go b/api/server.go index 03f274d..c92e70f 100644 --- a/api/server.go +++ b/api/server.go @@ -39,7 +39,6 @@ type Server struct { policyService service.Policy plugin plugin.Spec logger *logrus.Logger - mode string } // NewServer returns a new server. diff --git a/config-plugin.yaml b/config-plugin.yaml index 97b167c..eeaf2a4 100644 --- a/config-plugin.yaml +++ b/config-plugin.yaml @@ -6,7 +6,6 @@ server: verifier_url: "http://localhost:8081" base_config_path: /etc/vultisig vaults_file_path: test/vaults - mode: plugin plugin: type: fees