diff --git a/Dockerfile b/Dockerfile index eb86ab774..d8006e6e7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -59,7 +59,7 @@ ENV GOPATH $HOME/go ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH" -COPY --from=builder /app/core / +COPY --from=builder /app / COPY templates /app/templates # test if the below command avoids loading the files later. diff --git a/README.md b/README.md index 33ea11501..847105d51 100644 --- a/README.md +++ b/README.md @@ -77,7 +77,7 @@ Solution: **Compage** - Automatically take care of all git processes like tagging, versioning, commits, PRs, etc. - Automatically enforce software supply chain security process like signing the source code for integrity and generating immutable ledger logs, generating SBOM, generating vulnerability report, and also generate configurations to auto - verify, validateStringInput & control the source code integrity and container image integrity for deployments, etc. in K8s env. + verify, validate & control the source code integrity and container image integrity for deployments, etc. in K8s env. - Automatically convert backend application related environment variables' content to configmaps, secrets, etc. to make the generated backend compatible to K8s of any flavor (K8s, K3s, TalOS, etc.) and also auto configs to support integration with Vault, cert-manager, external secrets, sealed secrets & Venafi tools for TLS/SSL and secrets diff --git a/templates/compage-template-go/frameworks/common-files/go.sum.tmpl b/templates/compage-template-go/frameworks/common-files/go.sum.tmpl index e77635aa7..854f039b6 100644 --- a/templates/compage-template-go/frameworks/common-files/go.sum.tmpl +++ b/templates/compage-template-go/frameworks/common-files/go.sum.tmpl @@ -74,7 +74,7 @@ github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1m github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= -github.com/envoyproxy/protoc-gen-validateStringInput v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= diff --git a/templates/compage-template-go/frameworks/go-gin-server/pkg/rest/server/controllers/nosqls-controller.go.tmpl b/templates/compage-template-go/frameworks/go-gin-server/pkg/rest/server/controllers/nosqls-controller.go.tmpl index b93bc384b..62ede0ef0 100644 --- a/templates/compage-template-go/frameworks/go-gin-server/pkg/rest/server/controllers/nosqls-controller.go.tmpl +++ b/templates/compage-template-go/frameworks/go-gin-server/pkg/rest/server/controllers/nosqls-controller.go.tmpl @@ -29,7 +29,7 @@ func New{{.CapsResourceNameSingular}}Controller() (*{{.CapsResourceNameSingular} {{ if .IsRESTCreateAllowed }} func ({{.SmallResourceNameSingular}}Controller *{{.CapsResourceNameSingular}}Controller) Create{{.CapsResourceNameSingular}}(context *gin.Context) { - // validateStringInput input + // validate input var input models.{{.CapsResourceNameSingular}} if err := context.ShouldBindJSON(&input); err != nil { log.Error(err) @@ -94,7 +94,7 @@ func ({{.SmallResourceNameSingular}}Controller *{{.CapsResourceNameSingular}}Con {{ if .IsRESTPutAllowed }} func ({{.SmallResourceNameSingular}}Controller *{{.CapsResourceNameSingular}}Controller) Update{{.CapsResourceNameSingular}}(context *gin.Context) { - // validateStringInput input + // validate input var input models.{{.CapsResourceNameSingular}} if err := context.ShouldBindJSON(&input); err != nil { log.Error(err) diff --git a/templates/compage-template-go/frameworks/go-gin-server/pkg/rest/server/controllers/sqls-controller.go.tmpl b/templates/compage-template-go/frameworks/go-gin-server/pkg/rest/server/controllers/sqls-controller.go.tmpl index db5841441..35d5d8383 100644 --- a/templates/compage-template-go/frameworks/go-gin-server/pkg/rest/server/controllers/sqls-controller.go.tmpl +++ b/templates/compage-template-go/frameworks/go-gin-server/pkg/rest/server/controllers/sqls-controller.go.tmpl @@ -30,7 +30,7 @@ func New{{.CapsResourceNameSingular}}Controller() (*{{.CapsResourceNameSingular} {{ if .IsRESTCreateAllowed }} func ({{.SmallResourceNameSingular}}Controller *{{.CapsResourceNameSingular}}Controller) Create{{.CapsResourceNameSingular}}(context *gin.Context) { - // validateStringInput input + // validate input var input models.{{.CapsResourceNameSingular}} if err := context.ShouldBindJSON(&input); err != nil { log.Error(err) @@ -99,7 +99,7 @@ func ({{.SmallResourceNameSingular}}Controller *{{.CapsResourceNameSingular}}Con {{ if .IsRESTPutAllowed }} func ({{.SmallResourceNameSingular}}Controller *{{.CapsResourceNameSingular}}Controller) Update{{.CapsResourceNameSingular}}(context *gin.Context) { - // validateStringInput input + // validate input var input models.{{.CapsResourceNameSingular}} if err := context.ShouldBindJSON(&input); err != nil { log.Error(err)