Skip to content

Commit

Permalink
chore: change cors library for the config server (#850)
Browse files Browse the repository at this point in the history
  • Loading branch information
dbarrosop authored Apr 5, 2024
1 parent 879a749 commit 24d8b49
Show file tree
Hide file tree
Showing 17 changed files with 721 additions and 677 deletions.
8 changes: 2 additions & 6 deletions cmd/configserver/configserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import (
"os"

"github.com/99designs/gqlgen/graphql"
"github.com/gin-contrib/cors"
"github.com/gin-gonic/gin"
"github.com/google/uuid"
"github.com/nhost/be/services/mimir/graph"
cors "github.com/rs/cors/wrapper/gin"
"github.com/urfave/cli/v2"
)

Expand Down Expand Up @@ -141,11 +141,7 @@ func serve(cCtx *cli.Context) error {
cCtx.App.Version,
[]graphql.FieldMiddleware{},
gin.Recovery(),
cors.New(cors.Config{ //nolint: exhaustruct
AllowOrigins: []string{"https://local.dashboard.nhost.run"},
AllowMethods: []string{"GET", "POST"},
AllowCredentials: true,
}),
cors.Default(),
)
if err := r.Run(cCtx.String(bindFlag)); err != nil {
return fmt.Errorf("failed to run gin: %w", err)
Expand Down
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ require (
github.com/Yamashou/gqlgenc v0.19.3
github.com/charmbracelet/lipgloss v0.10.0
github.com/creack/pty v1.1.21
github.com/gin-contrib/cors v1.7.1
github.com/gin-gonic/gin v1.9.1
github.com/go-git/go-git/v5 v5.12.0
github.com/google/go-cmp v0.6.0
github.com/google/uuid v1.6.0
github.com/hashicorp/go-getter v1.7.3
github.com/nhost/be v0.0.0-20240403074641-7c96c314a29a
github.com/pelletier/go-toml/v2 v2.2.0
github.com/rs/cors/wrapper/gin v0.0.0-20240228164225-8d33ca4794ea
github.com/sirupsen/logrus v1.9.3
github.com/urfave/cli/v2 v2.27.1
github.com/wI2L/jsondiff v0.5.1
Expand Down Expand Up @@ -96,6 +96,7 @@ require (
github.com/prometheus/common v0.51.1 // indirect
github.com/prometheus/procfs v0.13.0 // indirect
github.com/rivo/uniseg v0.4.7 // indirect
github.com/rs/cors v1.8.1 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 // indirect
github.com/skeema/knownhosts v1.2.2 // indirect
Expand Down
6 changes: 4 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -296,8 +296,6 @@ github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSw
github.com/gabriel-vasile/mimetype v1.4.3 h1:in2uUcidCuFcDKtdcBxlR0rJ1+fsokWf+uqxgUFjbI0=
github.com/gabriel-vasile/mimetype v1.4.3/go.mod h1:d8uq/6HKRL6CGdk+aubisF/M5GcPfT7nKyLpA0lbSSk=
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
github.com/gin-contrib/cors v1.7.1 h1:s9SIppU/rk8enVvkzwiC2VK3UZ/0NNGsWfUKvV55rqs=
github.com/gin-contrib/cors v1.7.1/go.mod h1:n/Zj7B4xyrgk/cX1WCX2dkzFfaNm/xJb6oIUk7WTtps=
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=
github.com/gin-gonic/gin v1.9.1 h1:4idEAncQnU5cB7BeOkPtxjfCSye0AAm1R0RVIqJ+Jmg=
Expand Down Expand Up @@ -539,6 +537,10 @@ github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6L
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M=
github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA=
github.com/rs/cors v1.8.1 h1:OrP+y5H+5Md29ACTA9imbALaKHwOSUZkcizaG0LT5ow=
github.com/rs/cors v1.8.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU=
github.com/rs/cors/wrapper/gin v0.0.0-20240228164225-8d33ca4794ea h1:zDqxp+k0Xtoh+2gTtG2eODpGSrNbnqQ0WRO1ycox22g=
github.com/rs/cors/wrapper/gin v0.0.0-20240228164225-8d33ca4794ea/go.mod h1:gmu40DuK3SLdKUzGOUofS3UDZwyeOUy6ZjPPuaALatw=
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 h1:n661drycOFuPLCN3Uc8sB6B/s6Z4t2xvBgU1htSHuq8=
Expand Down
25 changes: 0 additions & 25 deletions vendor/github.com/gin-contrib/cors/.gitignore

This file was deleted.

39 changes: 0 additions & 39 deletions vendor/github.com/gin-contrib/cors/.golangci.yml

This file was deleted.

56 changes: 0 additions & 56 deletions vendor/github.com/gin-contrib/cors/.goreleaser.yaml

This file was deleted.

95 changes: 0 additions & 95 deletions vendor/github.com/gin-contrib/cors/README.md

This file was deleted.

Loading

0 comments on commit 24d8b49

Please sign in to comment.