feat(tf): mocks

This commit is contained in:
Denis Gukov 2024-12-04 10:47:52 +00:00
parent 3018d614e8
commit 3f0c8846cd
2 changed files with 26 additions and 0 deletions

View File

@ -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")

21
api/terraform.go Normal file
View File

@ -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)
}