diff --git a/api/router.go b/api/router.go index bb4faa33..0ab67e15 100644 --- a/api/router.go +++ b/api/router.go @@ -100,6 +100,11 @@ func Route() *mux.Router { publicWebHookRouter.Use(StoreMiddleware, JSONMiddleware) publicWebHookRouter.Path("/integrations/{integration_alias}").HandlerFunc(ReceiveIntegration).Methods("POST", "GET", "OPTIONS") + publicWebHookRouter.Path("/terraform/{alias}").HandlerFunc(getTerraformState).Methods("GET") + publicWebHookRouter.Path("/terraform/{alias}").HandlerFunc(addTerraformState).Methods("POST") + publicWebHookRouter.Path("/terraform/{alias}").HandlerFunc(lockTerraformState).Methods("LOCK") + publicWebHookRouter.Path("/terraform/{alias}").HandlerFunc(unlockTerraformState).Methods("UNLOCK") + authenticatedWS := r.PathPrefix(webPath + "api").Subrouter() authenticatedWS.Use(JSONMiddleware, authenticationWithStore) authenticatedWS.Path("/ws").HandlerFunc(sockets.Handler).Methods("GET", "HEAD") diff --git a/api/terraform.go b/api/terraform.go new file mode 100644 index 00000000..2ab59b49 --- /dev/null +++ b/api/terraform.go @@ -0,0 +1,21 @@ +//go:build !pro + +package api + +import "net/http" + +func getTerraformState(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotFound) +} + +func addTerraformState(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotFound) +} + +func lockTerraformState(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotFound) +} + +func unlockTerraformState(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotFound) +}