From 3c601caf02e8e73ec092efa35ec218074a75cf1e Mon Sep 17 00:00:00 2001 From: Vargha Csongor Date: Sun, 22 Dec 2024 21:33:46 +0100 Subject: [PATCH 01/11] move auth to auth --- .github/workflows/auth-service-cd.yml | 5 +- .github/workflows/auth-service-ci.yml | 9 +- .github/workflows/go_build.yml | 4 +- .github/workflows/go_test.yml | 5 +- .github/workflows/pkg-ci.yml | 15 ++ auth-service/go.mod | 49 ------ {auth-service => cmd/auth}/auth.go | 0 {auth-service => cmd/auth}/dockerfile | 0 {auth-service => cmd/auth}/main.go | 7 +- cmd/backend/dockerfile | 16 ++ cmd/backend/main.go | 106 +++++++++++++ go.mod | 55 +++++++ auth-service/go.sum => go.sum | 143 ++++++++---------- {utilities => pkg}/fileExists.go | 2 +- {utilities => pkg}/fileExists_test.go | 2 +- .../gin/healthcheck/health_check.go | 2 +- .../gin/healthcheck/health_check_test.go | 2 +- .../setup_https_server.go | 2 +- .../logger_setup.go => pkg/setup_logger.go | 2 +- utilities/go.mod | 32 ---- utilities/go.sum | 86 ----------- 21 files changed, 279 insertions(+), 265 deletions(-) create mode 100644 .github/workflows/pkg-ci.yml delete mode 100644 auth-service/go.mod rename {auth-service => cmd/auth}/auth.go (100%) rename {auth-service => cmd/auth}/dockerfile (100%) rename {auth-service => cmd/auth}/main.go (95%) create mode 100644 cmd/backend/dockerfile create mode 100644 cmd/backend/main.go create mode 100644 go.mod rename auth-service/go.sum => go.sum (51%) rename {utilities => pkg}/fileExists.go (89%) rename {utilities => pkg}/fileExists_test.go (96%) rename utilities/gin_liveness/liveness.go => pkg/gin/healthcheck/health_check.go (97%) rename utilities/gin_liveness/liveness_test.go => pkg/gin/healthcheck/health_check_test.go (99%) rename utilities/server_setup.go => pkg/setup_https_server.go (98%) rename utilities/logger_setup.go => pkg/setup_logger.go (97%) delete mode 100644 utilities/go.mod delete mode 100644 utilities/go.sum diff --git a/.github/workflows/auth-service-cd.yml b/.github/workflows/auth-service-cd.yml index 49a8038..61dfd11 100644 --- a/.github/workflows/auth-service-cd.yml +++ b/.github/workflows/auth-service-cd.yml @@ -3,7 +3,8 @@ name: Release Auth service to Docker Hub and Deploy to Kubernetes on: push: paths: - - "auth-service/**" + - "cmd/auth/**" + - "pkg/**" - "deployment/auth-service/**" - ".github/workflows/auth-service-cd.yml" @@ -46,6 +47,6 @@ jobs: uses: docker/build-push-action@v5 with: push: true - context: "{{defaultContext}}:auth-service" + context: "{{defaultContext}}:cmd/auth" tags: vcscsvcscs/gheritage-auth-service:${{steps.create_image_tag.outputs.result}} platforms: linux/arm64 diff --git a/.github/workflows/auth-service-ci.yml b/.github/workflows/auth-service-ci.yml index a7bc90e..d96d428 100644 --- a/.github/workflows/auth-service-ci.yml +++ b/.github/workflows/auth-service-ci.yml @@ -2,19 +2,20 @@ name: Authentication service Continuous Integration on: push: paths: - - "auth-service/**" + - "cmd/auth/**" + - "pkg/**" jobs: lint: uses: ./.github/workflows/go_lint.yml with: - working-directory: 'auth-service' + working-directory: 'cmd/auth' build: needs: lint uses: ./.github/workflows/go_build.yml with: - working-directory: 'auth-service' + working-directory: 'cmd/auth' test: needs: build uses: ./.github/workflows/go_test.yml with: - working-directory: 'auth-service' \ No newline at end of file + working-directory: 'cmd/auth' \ No newline at end of file diff --git a/.github/workflows/go_build.yml b/.github/workflows/go_build.yml index 97f0473..1c471d6 100644 --- a/.github/workflows/go_build.yml +++ b/.github/workflows/go_build.yml @@ -20,10 +20,8 @@ jobs: - name: Install dependencies run: | - cd ${{ inputs.working-directory }} go get - name: Build run: | - cd ${{ inputs.working-directory }} - go build . \ No newline at end of file + go build ${{ inputs.working-directory }} \ No newline at end of file diff --git a/.github/workflows/go_test.yml b/.github/workflows/go_test.yml index 2e4223d..2fab8bc 100644 --- a/.github/workflows/go_test.yml +++ b/.github/workflows/go_test.yml @@ -10,17 +10,16 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Setup Go 1.22.x' + - name: Setup Go 1.23.x' uses: actions/setup-go@v5 with: - go-version: '1.22.x' + go-version: '1.23.x' - name: Display Go version run: go version - name: Install dependencies run: | - cd ${{ inputs.working-directory }} go get - name: Run tests diff --git a/.github/workflows/pkg-ci.yml b/.github/workflows/pkg-ci.yml new file mode 100644 index 0000000..6a5eda7 --- /dev/null +++ b/.github/workflows/pkg-ci.yml @@ -0,0 +1,15 @@ +name: Common Package Continuous Integration +on: + push: + paths: + - "pkg/**" +jobs: + lint: + uses: ./.github/workflows/go_lint.yml + with: + working-directory: 'pkg' + test: + needs: lint + uses: ./.github/workflows/go_test.yml + with: + working-directory: 'pkg' \ No newline at end of file diff --git a/auth-service/go.mod b/auth-service/go.mod deleted file mode 100644 index de346d4..0000000 --- a/auth-service/go.mod +++ /dev/null @@ -1,49 +0,0 @@ -module github.com/vcscsvcscs/GenerationsHeritage/auth-service - -go 1.22.2 - -require ( - github.com/gin-contrib/cors v1.7.2 - github.com/gin-gonic/gin v1.9.1 - github.com/vcscsvcscs/GenerationsHeritage/utilities v0.0.0-20240414091827-ffde94d457cb - github.com/zitadel/zitadel-go/v3 v3.0.0-next.2 -) - -require ( - github.com/bytedance/sonic v1.11.6 // indirect - github.com/bytedance/sonic/loader v0.1.1 // indirect - github.com/cloudwego/base64x v0.1.4 // indirect - github.com/cloudwego/iasm v0.2.0 // indirect - github.com/gabriel-vasile/mimetype v1.4.3 // indirect - github.com/gin-contrib/sse v0.1.0 // indirect - github.com/go-jose/go-jose/v3 v3.0.1 // indirect - github.com/go-playground/locales v0.14.1 // indirect - github.com/go-playground/universal-translator v0.18.1 // indirect - github.com/go-playground/validator/v10 v10.20.0 // indirect - github.com/goccy/go-json v0.10.2 // indirect - github.com/gorilla/securecookie v1.1.2 // indirect - github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/cpuid/v2 v2.2.7 // indirect - github.com/kr/text v0.2.0 // indirect - github.com/leodido/go-urn v1.4.0 // indirect - github.com/mattn/go-isatty v0.0.20 // indirect - github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect - github.com/modern-go/reflect2 v1.0.2 // indirect - github.com/muhlemmer/gu v0.3.1 // indirect - github.com/pelletier/go-toml/v2 v2.2.1 // indirect - github.com/sirupsen/logrus v1.9.3 // indirect - github.com/twitchyliquid64/golang-asm v0.15.1 // indirect - github.com/ugorji/go/codec v1.2.12 // indirect - github.com/zitadel/logging v0.5.0 // indirect - github.com/zitadel/oidc/v3 v3.5.1 // indirect - github.com/zitadel/schema v1.3.0 // indirect - golang.org/x/arch v0.7.0 // indirect - golang.org/x/crypto v0.22.0 // indirect - golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 // indirect - golang.org/x/net v0.24.0 // indirect - golang.org/x/oauth2 v0.19.0 // indirect - golang.org/x/sys v0.19.0 // indirect - golang.org/x/text v0.14.0 // indirect - google.golang.org/protobuf v1.34.0 // indirect - gopkg.in/yaml.v3 v3.0.1 // indirect -) diff --git a/auth-service/auth.go b/cmd/auth/auth.go similarity index 100% rename from auth-service/auth.go rename to cmd/auth/auth.go diff --git a/auth-service/dockerfile b/cmd/auth/dockerfile similarity index 100% rename from auth-service/dockerfile rename to cmd/auth/dockerfile diff --git a/auth-service/main.go b/cmd/auth/main.go similarity index 95% rename from auth-service/main.go rename to cmd/auth/main.go index 6e9da79..9344808 100644 --- a/auth-service/main.go +++ b/cmd/auth/main.go @@ -10,9 +10,8 @@ import ( "time" "github.com/gin-gonic/gin" - "github.com/vcscsvcscs/GenerationsHeritage/utilities" - "github.com/vcscsvcscs/GenerationsHeritage/utilities/gin_liveness" - + utilities "github.com/vcscsvcscs/GenerationsHeritage/pkg" + "github.com/vcscsvcscs/GenerationsHeritage/pkg/gin/healthcheck" "github.com/zitadel/zitadel-go/v3/pkg/authorization" "github.com/zitadel/zitadel-go/v3/pkg/authorization/oauth" "github.com/zitadel/zitadel-go/v3/pkg/http/middleware" @@ -40,7 +39,7 @@ func main() { utilities.SetupLogger(*logToFileAndStd, *logToFile) - hc := gin_liveness.New() + hc := healthcheck.New() router := gin.Default() router.Use(gin.Recovery()) diff --git a/cmd/backend/dockerfile b/cmd/backend/dockerfile new file mode 100644 index 0000000..d1ff741 --- /dev/null +++ b/cmd/backend/dockerfile @@ -0,0 +1,16 @@ +FROM arm64v8/golang:1.22.2-alpine as build + +WORKDIR /app + +COPY . . + +RUN GOOS=linux GOARCH=arm64 go build -o backend + +RUN apk update && apk add ca-certificates && update-ca-certificates + +FROM arm64v8/busybox:1.36.1 + +COPY --from=build /etc/ssl/certs /etc/ssl/certs +COPY --from=build /app/backend /app/ + +CMD [ "/app/backend" ] \ No newline at end of file diff --git a/cmd/backend/main.go b/cmd/backend/main.go new file mode 100644 index 0000000..8c79840 --- /dev/null +++ b/cmd/backend/main.go @@ -0,0 +1,106 @@ +package main + +import ( + "context" + "flag" + "log" + "os" + "os/signal" + "syscall" + "time" + + "github.com/gin-contrib/cors" + "github.com/gin-gonic/gin" + "github.com/vcscsvcscs/GenerationsHeritage/cmd/backend/handlers" + utilities "github.com/vcscsvcscs/GenerationsHeritage/pkg" + "github.com/vcscsvcscs/GenerationsHeritage/pkg/gin/healthcheck" + "github.com/vcscsvcscs/GenerationsHeritage/pkg/memgraph" + //"github.com/zitadel/zitadel-go/v3/pkg/authorization" + //"github.com/zitadel/zitadel-go/v3/pkg/authorization/oauth" + //"github.com/zitadel/zitadel-go/v3/pkg/zitadel" +) + +var ( + cert = flag.String("cert", "/etc/gh-backend/ssl/tls.crt", "Specify the path of TLS cert") + key = flag.String("key", "/etc/gh-backend/ssl/tls.key", "Specify the path of TLS key") + httpsPort = flag.String("https", ":443", "Specify port for http secure hosting(example for format :443)") + httpPort = flag.String("http", ":80", "Specify port for http hosting(example for format :80)") + zitadelAccessKey = flag.String("zitadel-access-key", "/etc/gh-backend/zitadel/api-key.json", "Specify the path of Zitadel access key") + zitadelURI = flag.String("zitadel-uri", "zitadel.varghacsongor.hu", "Specify the Zitadel URI") + memgraphURI = flag.String("memgraph", "bolt+ssc://memgraph:7687", "Specify the Memgraph database URI") + memgraphUser = flag.String("memgraph-user", "", "Specify the Memgraph database user") + memgraphPass = flag.String("memgraph-pass", "", "Specify the Memgraph database password") + release = flag.Bool("release", false, "Set true to release build") + logToFile = flag.Bool("log-to-file", false, "Set true to log to file") + logToFileAndStd = flag.Bool("log-to-file-and-std", false, "Set true to log to file and std") + requestTimeout = time.Duration(*flag.Int("request-timeout", 20, "Set request timeout in seconds")) +) + +func main() { + flag.Parse() + if *release { + gin.SetMode(gin.ReleaseMode) + } + + utilities.SetupLogger(*logToFileAndStd, *logToFile) + + hc := healthcheck.New() + + memgraphDriver := memgraph.InitDatabase(*memgraphURI, *memgraphUser, *memgraphPass) + + router := gin.Default() + router.Use(cors.New(cors.Config{ + AllowOrigins: []string{"http://localhost:5173", "http://localhost", "https://heritagebackend.varghacsongor.hu", "https://feature-add-frontend.generationsheritage.pages.dev/", "https://csalad.varghacsongor.hu/"}, + AllowCredentials: true, + AllowHeaders: []string{"Authorization", "id", "Content-Type"}, + MaxAge: 12 * time.Hour, + })) + router.Use(gin.Recovery()) + + ctx := context.Background() + + // Initiate the authorization by providing a zitadel configuration and a verifier. + // This example will use OAuth2 Introspection for this, therefore you will also need to provide the downloaded api key.json + //authZ, err := authorization.New(ctx, zitadel.New(*zitadelURI), oauth.DefaultAuthorization(*zitadelAccessKey)) + //if err != nil { + // log.Println("zitadel sdk could not initialize", "error", err) + // os.Exit(1) + //} + + // Initialize the HTTP middleware by providing the authorization + //mw := middleware.New(authZ) + + //router.Use(auth(mw)) + router.GET("/health", hc.HealthCheckHandler()) + router.GET("/person", handlers.ViewPerson(memgraphDriver)) + router.POST("/person", handlers.CreatePerson(memgraphDriver)) + router.DELETE("/person", handlers.DeletePerson(memgraphDriver)) + router.PUT("/person", handlers.UpdatePerson(memgraphDriver)) + router.POST("/relationship", handlers.CreateRelationship(memgraphDriver)) + router.DELETE("/relationship", handlers.DeleteRelationship(memgraphDriver)) + router.PUT("/relationship", handlers.VerifyRelationship(memgraphDriver)) + router.POST("/createRelationshipAndPerson", handlers.CreateRelationshipAndPerson(memgraphDriver)) + router.GET("/familyTree", handlers.ViewFamiliyTree(memgraphDriver)) + + server := utilities.SetupHttpsServer(router, *cert, *key, *httpsPort, *httpPort, requestTimeout) + + // Wait for interrupt signal to gracefully shutdown the server with some time to finish requests. + quit := make(chan os.Signal, 1) + // kill (no param) default send syscall.SIGTERM + // kill -2 is syscall.SIGINT + // kill -9 is syscall.SIGKILL but can't be caught, so don't need to add it + signal.Notify(quit, syscall.SIGINT, syscall.SIGTERM, os.Interrupt) + <-quit + log.Println("Shutting down server...") + + // The context is used to inform the server it has some seconds to finish + // the request it is currently handling + ctx, cancel := context.WithTimeout(context.Background(), requestTimeout*time.Second) + defer cancel() + + if err := server.Shutdown(ctx); err != nil { + log.Fatal("Server forced to shutdown:", err) + } + + log.Println("Server exiting") +} diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..e927816 --- /dev/null +++ b/go.mod @@ -0,0 +1,55 @@ +module github.com/vcscsvcscs/GenerationsHeritage + +go 1.23 + +require ( + github.com/gin-contrib/cors v1.7.2 + github.com/gin-gonic/gin v1.10.0 + github.com/google/uuid v1.6.0 + github.com/neo4j/neo4j-go-driver/v5 v5.27.0 + github.com/zitadel/zitadel-go/v3 v3.3.2 + golang.org/x/net v0.33.0 +) + +require ( + github.com/bytedance/sonic v1.12.6 // indirect + github.com/bytedance/sonic/loader v0.2.1 // indirect + github.com/cloudwego/base64x v0.1.4 // indirect + github.com/cloudwego/iasm v0.2.0 // indirect + github.com/gabriel-vasile/mimetype v1.4.7 // indirect + github.com/gin-contrib/sse v0.1.0 // indirect + github.com/go-jose/go-jose/v4 v4.0.4 // indirect + github.com/go-logr/logr v1.4.2 // indirect + github.com/go-logr/stdr v1.2.2 // indirect + github.com/go-playground/locales v0.14.1 // indirect + github.com/go-playground/universal-translator v0.18.1 // indirect + github.com/go-playground/validator/v10 v10.23.0 // indirect + github.com/goccy/go-json v0.10.4 // indirect + github.com/gorilla/securecookie v1.1.2 // indirect + github.com/json-iterator/go v1.1.12 // indirect + github.com/klauspost/cpuid/v2 v2.2.9 // indirect + github.com/leodido/go-urn v1.4.0 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect + github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect + github.com/modern-go/reflect2 v1.0.2 // indirect + github.com/muhlemmer/gu v0.3.1 // indirect + github.com/pelletier/go-toml/v2 v2.2.3 // indirect + github.com/sirupsen/logrus v1.9.3 // indirect + github.com/twitchyliquid64/golang-asm v0.15.1 // indirect + github.com/ugorji/go/codec v1.2.12 // indirect + github.com/zitadel/logging v0.6.1 // indirect + github.com/zitadel/oidc/v3 v3.33.1 // indirect + github.com/zitadel/schema v1.3.0 // indirect + go.opentelemetry.io/auto/sdk v1.1.0 // indirect + go.opentelemetry.io/otel v1.33.0 // indirect + go.opentelemetry.io/otel/metric v1.33.0 // indirect + go.opentelemetry.io/otel/trace v1.33.0 // indirect + golang.org/x/arch v0.12.0 // indirect + golang.org/x/crypto v0.31.0 // indirect + golang.org/x/exp v0.0.0-20241217172543-b2144cdd0a67 // indirect + golang.org/x/oauth2 v0.24.0 // indirect + golang.org/x/sys v0.28.0 // indirect + golang.org/x/text v0.21.0 // indirect + google.golang.org/protobuf v1.36.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect +) diff --git a/auth-service/go.sum b/go.sum similarity index 51% rename from auth-service/go.sum rename to go.sum index d70d67b..5654be1 100644 --- a/auth-service/go.sum +++ b/go.sum @@ -1,29 +1,32 @@ -github.com/bytedance/sonic v1.11.6 h1:oUp34TzMlL+OY1OUWxHqsdkgC/Zfc85zGqw9siXjrc0= -github.com/bytedance/sonic v1.11.6/go.mod h1:LysEHSvpvDySVdC2f87zGWf6CIKJcAvqab1ZaiQtds4= -github.com/bytedance/sonic/loader v0.1.1 h1:c+e5Pt1k/cy5wMveRDyk2X4B9hF4g7an8N3zCYjJFNM= +github.com/bmatcuk/doublestar/v4 v4.7.1 h1:fdDeAqgT47acgwd9bd9HxJRDmc9UAmPpc+2m0CXv75Q= +github.com/bmatcuk/doublestar/v4 v4.7.1/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc= +github.com/bytedance/sonic v1.12.6 h1:/isNmCUF2x3Sh8RAp/4mh4ZGkcFAX/hLrzrK3AvpRzk= +github.com/bytedance/sonic v1.12.6/go.mod h1:B8Gt/XvtZ3Fqj+iSKMypzymZxw/FVwgIGKzMzT9r/rk= github.com/bytedance/sonic/loader v0.1.1/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU= +github.com/bytedance/sonic/loader v0.2.1 h1:1GgorWTqf12TA8mma4DDSbaQigE2wOgQo7iCjjJv3+E= +github.com/bytedance/sonic/loader v0.2.1/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU= github.com/cloudwego/base64x v0.1.4 h1:jwCgWpFanWmN8xoIUHa2rtzmkd5J2plF/dnLS6Xd/0Y= github.com/cloudwego/base64x v0.1.4/go.mod h1:0zlkT4Wn5C6NdauXdJRhSKRlJvmclQ1hhJgA0rcu/8w= github.com/cloudwego/iasm v0.2.0 h1:1KNIy1I1H9hNNFEEH3DVnI4UujN+1zjpuk6gwHLTssg= github.com/cloudwego/iasm v0.2.0/go.mod h1:8rXZaNYT2n95jn+zTI1sDr+IgcD2GVs0nlbbQPiEFhY= -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -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/gabriel-vasile/mimetype v1.4.7 h1:SKFKl7kD0RiPdbht0s7hFtjl489WcQ1VyPW8ZzUMYCA= +github.com/gabriel-vasile/mimetype v1.4.7/go.mod h1:GDlAgAyIRT27BhFl53XNAFtfjzOkLaF35JdEG0P7LtU= github.com/gin-contrib/cors v1.7.2 h1:oLDHxdg8W/XDoN/8zamqk/Drgt4oVZDvaV0YmvVICQw= github.com/gin-contrib/cors v1.7.2/go.mod h1:SUJVARKgQ40dmrzgXEVxj2m7Ig1v1qIboQkPDTQ9t2E= 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= -github.com/gin-gonic/gin v1.9.1/go.mod h1:hPrL7YrpYKXt5YId3A/Tnip5kqbEAP+KLuI3SUcPTeU= -github.com/go-chi/chi/v5 v5.0.10 h1:rLz5avzKpjqxrYwXNfmjkrYYXOyLJd37pz53UFHC6vk= -github.com/go-chi/chi/v5 v5.0.10/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8= -github.com/go-jose/go-jose/v3 v3.0.1 h1:pWmKFVtt+Jl0vBZTIpz/eAKwsm6LkIxDVVbFHKkchhA= -github.com/go-jose/go-jose/v3 v3.0.1/go.mod h1:RNkWWRld676jZEYoV3+XK8L2ZnNSvIsxFMht0mSX+u8= -github.com/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY= -github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/gin-gonic/gin v1.10.0 h1:nTuyha1TYqgedzytsKYqna+DfLos46nTv2ygFy86HFU= +github.com/gin-gonic/gin v1.10.0/go.mod h1:4PMNQiOhvDRa013RKVbsiNwoyezlm2rm0uX/T7kzp5Y= +github.com/go-chi/chi/v5 v5.1.0 h1:acVI1TYaD+hhedDJ3r54HyA6sExp3HfXq7QWEEY/xMw= +github.com/go-chi/chi/v5 v5.1.0/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8= +github.com/go-jose/go-jose/v4 v4.0.4 h1:VsjPI33J0SB9vQM6PLmNjoHqMQNGPiZ0rHL7Ni7Q6/E= +github.com/go-jose/go-jose/v4 v4.0.4/go.mod h1:NKb5HO1EZccyMpiZNbdUw/14tiXNyUJh188dfnMCAfc= +github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= +github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s= @@ -32,18 +35,17 @@ github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/o github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= -github.com/go-playground/validator/v10 v10.20.0 h1:K9ISHbSaI0lyB2eWMPJo+kOS/FBExVwjEviJTixqxL8= -github.com/go-playground/validator/v10 v10.20.0/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM= -github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= -github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= -github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/go-playground/validator/v10 v10.23.0 h1:/PwmTwZhS0dPkav3cdK9kV1FsAmrL8sThn8IHr/sO+o= +github.com/go-playground/validator/v10 v10.23.0/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM= +github.com/goccy/go-json v0.10.4 h1:JSwxQzIqKfmFX1swYPpUThQZp/Ka4wzJdK0LWVytLPM= +github.com/goccy/go-json v0.10.4/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/uuid v1.5.0 h1:1p67kYwdtXjb0gL0BPiP1Av9wiZPo5A8z2cWkTZ+eyU= -github.com/google/uuid v1.5.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/gorilla/securecookie v1.1.2 h1:YCIWL56dvtr73r6715mJs5ZvhtnY73hBvEF8kXD8ePA= github.com/gorilla/securecookie v1.1.2/go.mod h1:NfCASbcHqRSY+3a8tlWJwsQap2VX5pwzwo4h3eOamfo= github.com/jeremija/gosubmit v0.2.7 h1:At0OhGCFGPXyjPYAsCchoBUhE099pcBXmsb4iZqROIc= @@ -51,11 +53,11 @@ github.com/jeremija/gosubmit v0.2.7/go.mod h1:Ui+HS073lCFREXBbdfrJzMB57OI/bdxTiL github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= -github.com/klauspost/cpuid/v2 v2.2.7 h1:ZWSB3igEs+d0qvnxR/ZBzXVmxkgt8DdzP6m9pfuVLDM= -github.com/klauspost/cpuid/v2 v2.2.7/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= +github.com/klauspost/cpuid/v2 v2.2.9 h1:66ze0taIn2H33fBvCkXuv9BmCwDfafmiIVpKV9kKGuY= +github.com/klauspost/cpuid/v2 v2.2.9/go.mod h1:rqkxqrZ1EhYM9G+hXH7YdowN5R5RGN6NK4QwQ3WMXF8= github.com/knz/go-libedit v1.10.1/go.mod h1:MZTVkCWyz0oBc7JOWP3wNAzd002ZbM/5hgShxwh4x8M= -github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= -github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ= @@ -71,76 +73,66 @@ github.com/muhlemmer/gu v0.3.1 h1:7EAqmFrW7n3hETvuAdmFmn4hS8W+z3LgKtrnow+YzNM= github.com/muhlemmer/gu v0.3.1/go.mod h1:YHtHR+gxM+bKEIIs7Hmi9sPT3ZDUvTN/i88wQpZkrdM= github.com/muhlemmer/httpforwarded v0.1.0 h1:x4DLrzXdliq8mprgUMR0olDvHGkou5BJsK/vWUetyzY= github.com/muhlemmer/httpforwarded v0.1.0/go.mod h1:yo9czKedo2pdZhoXe+yDkGVbU0TJ0q9oQ90BVoDEtw0= -github.com/pelletier/go-toml/v2 v2.2.1 h1:9TA9+T8+8CUCO2+WYnDLCgrYi9+omqKXyjDtosvtEhg= -github.com/pelletier/go-toml/v2 v2.2.1/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs= +github.com/neo4j/neo4j-go-driver/v5 v5.27.0 h1:YdsIxDjAQbjlP/4Ha9B/gF8Y39UdgdTwCyihSxy8qTw= +github.com/neo4j/neo4j-go-driver/v5 v5.27.0/go.mod h1:Vff8OwT7QpLm7L2yYr85XNWe9Rbqlbeb9asNXJTHO4k= +github.com/pelletier/go-toml/v2 v2.2.3 h1:YmeHyLY8mFWbdkNWwpr+qIL2bEqT0o95WSdkNHvL12M= +github.com/pelletier/go-toml/v2 v2.2.3/go.mod h1:MfCQTFTvCcUyyvvwm1+G6H/jORL20Xlb6rzQu9GuUkc= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -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.10.1 h1:L0uuZVXIKlI1SShY2nhFfo44TYvDPQ1w4oFkUJNfhyo= -github.com/rs/cors v1.10.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= +github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= +github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= +github.com/rs/cors v1.11.1 h1:eU3gRzXLRK57F5rKMGMZURNdIG4EoAmX8k94r9wXWHA= +github.com/rs/cors v1.11.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= -github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= github.com/ugorji/go/codec v1.2.12 h1:9LC83zGrHhuUA9l16C9AHXAqEV/2wBQ4nkvumAE65EE= github.com/ugorji/go/codec v1.2.12/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= -github.com/vcscsvcscs/GenerationsHeritage/utilities v0.0.0-20240414091827-ffde94d457cb h1:fU736we2gQQRMOWP/su7sCiUFmrXTKBN0s8LG5k7bOE= -github.com/vcscsvcscs/GenerationsHeritage/utilities v0.0.0-20240414091827-ffde94d457cb/go.mod h1:aQlmG6BiGFmOFxzAkWTJDzm1EzdCJ4OEETXTUkWJaLk= -github.com/zitadel/logging v0.5.0 h1:Kunouvqse/efXy4UDvFw5s3vP+Z4AlHo3y8wF7stXHA= -github.com/zitadel/logging v0.5.0/go.mod h1:IzP5fzwFhzzyxHkSmfF8dsyqFsQRJLLcQmwhIBzlGsE= -github.com/zitadel/oidc/v3 v3.5.1 h1:7gyrxRNqX5eZYai2KhzPj8MhBZ7I3YpviQeX1Lp4j4U= -github.com/zitadel/oidc/v3 v3.5.1/go.mod h1:R8sF5DPR98QQnOoyySsaNqI4NcF/VFMkf/XoYiBUuXQ= +github.com/zitadel/logging v0.6.1 h1:Vyzk1rl9Kq9RCevcpX6ujUaTYFX43aa4LkvV1TvUk+Y= +github.com/zitadel/logging v0.6.1/go.mod h1:Y4CyAXHpl3Mig6JOszcV5Rqqsojj+3n7y2F591Mp/ow= +github.com/zitadel/oidc/v3 v3.33.1 h1:e3w9PDV0Mh50/ZiJWtzyT0E4uxJ6RXll+hqVDnqGbTU= +github.com/zitadel/oidc/v3 v3.33.1/go.mod h1:zkoZ1Oq6CweX3BaLrftLEGCs6YK6zDpjjVGZrP10AWU= github.com/zitadel/schema v1.3.0 h1:kQ9W9tvIwZICCKWcMvCEweXET1OcOyGEuFbHs4o5kg0= github.com/zitadel/schema v1.3.0/go.mod h1:NptN6mkBDFvERUCvZHlvWmmME+gmZ44xzwRXwhzsbtc= -github.com/zitadel/zitadel-go/v3 v3.0.0-next.2 h1:w0lnLvijwQwkrUEA74loenNR9udRAaq6rccjlMSA+4U= -github.com/zitadel/zitadel-go/v3 v3.0.0-next.2/go.mod h1:SY9IZuDw/766mwEobCX7JNwXawIQxVseo679JG1U0c0= -go.opentelemetry.io/otel v1.21.0 h1:hzLeKBZEL7Okw2mGzZ0cc4k/A7Fta0uoPgaJCr8fsFc= -go.opentelemetry.io/otel v1.21.0/go.mod h1:QZzNPQPm1zLX4gZK4cMi+71eaorMSGT3A4znnUvNNEo= -go.opentelemetry.io/otel/metric v1.21.0 h1:tlYWfeo+Bocx5kLEloTjbcDwBuELRrIFxwdQ36PlJu4= -go.opentelemetry.io/otel/metric v1.21.0/go.mod h1:o1p3CA8nNHW8j5yuQLdc1eeqEaPfzug24uvsyIEJRWM= -go.opentelemetry.io/otel/trace v1.21.0 h1:WD9i5gzvoUPuXIXH24ZNBudiarZDKuekPqi/E8fpfLc= -go.opentelemetry.io/otel/trace v1.21.0/go.mod h1:LGbsEB0f9LGjN+OZaQQ26sohbOmiMR+BaslueVtS/qQ= -golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= -golang.org/x/arch v0.7.0 h1:pskyeJh/3AmoQ8CPE95vxHLqp1G1GfGNXTmcl9NEKTc= -golang.org/x/arch v0.7.0/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190911031432-227b76d455e7/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30= -golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M= -golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 h1:vr/HnozRka3pE4EsMEg1lgkXJkTFJCVUX+S/ZT6wYzM= -golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842/go.mod h1:XtvwrStGgqGPLc4cjQfWqZHG1YFdYs6swckp8vpsjnc= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= -golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= -golang.org/x/oauth2 v0.19.0 h1:9+E/EZBCbTLNrbN35fHv/a/d/mOBatymz1zbtQrXpIg= -golang.org/x/oauth2 v0.19.0/go.mod h1:vYi7skDa1x015PmRRYZ7+s1cWyPgrPiSYRe4rnsexc8= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +github.com/zitadel/zitadel-go/v3 v3.3.2 h1:sVMd7LKbORONdqcT7D+O6u7AY5v1r/5O1f8Ics9H76s= +github.com/zitadel/zitadel-go/v3 v3.3.2/go.mod h1:1ogo8MBN5iRxHHfDw70Z0k1/PN4O4SDJ0gZ8pVKA6qI= +go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA= +go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A= +go.opentelemetry.io/otel v1.33.0 h1:/FerN9bax5LoK51X/sI0SVYrjSE0/yUL7DpxW4K3FWw= +go.opentelemetry.io/otel v1.33.0/go.mod h1:SUUkR6csvUQl+yjReHu5uM3EtVV7MBm5FHKRlNx4I8I= +go.opentelemetry.io/otel/metric v1.33.0 h1:r+JOocAyeRVXD8lZpjdQjzMadVZp2M4WmQ+5WtEnklQ= +go.opentelemetry.io/otel/metric v1.33.0/go.mod h1:L9+Fyctbp6HFTddIxClbQkjtubW6O9QS3Ann/M82u6M= +go.opentelemetry.io/otel/trace v1.33.0 h1:cCJuF7LRjUFso9LPnEAHJDB2pqzp+hbO8eu1qqW2d/s= +go.opentelemetry.io/otel/trace v1.33.0/go.mod h1:uIcdVUZMpTAmz0tI1z04GoVSezK37CbGV4fr1f2nBck= +golang.org/x/arch v0.12.0 h1:UsYJhbzPYGsT0HbEdmYcqtCv8UNGvnaL561NnIUvaKg= +golang.org/x/arch v0.12.0/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys= +golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U= +golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= +golang.org/x/exp v0.0.0-20241217172543-b2144cdd0a67 h1:1UoZQm6f0P/ZO0w1Ri+f+ifG/gXhegadRdwBIXEFWDo= +golang.org/x/exp v0.0.0-20241217172543-b2144cdd0a67/go.mod h1:qj5a5QZpwLU2NLQudwIN5koi3beDhSAlJwa67PuM98c= +golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= +golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= +golang.org/x/oauth2 v0.24.0 h1:KTBBxWqUa0ykRPLtV69rRto9TLXcqYkeswu48x/gvNE= +golang.org/x/oauth2 v0.24.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= -golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= -golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/protobuf v1.34.0 h1:Qo/qEd2RZPCf2nKuorzksSknv0d3ERwp1vFG38gSmH4= -google.golang.org/protobuf v1.34.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= +golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= +google.golang.org/protobuf v1.36.0 h1:mjIs9gYtt56AzC4ZaffQuh88TZurBGhIJMBZGSxNerQ= +google.golang.org/protobuf v1.36.0/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= @@ -150,4 +142,3 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= nullprogram.com/x/optparse v1.0.0/go.mod h1:KdyPE+Igbe0jQUrVfMqDMeJQIJZEuyV7pjYmp6pbG50= -rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= diff --git a/utilities/fileExists.go b/pkg/fileExists.go similarity index 89% rename from utilities/fileExists.go rename to pkg/fileExists.go index 72977ba..7f1f181 100644 --- a/utilities/fileExists.go +++ b/pkg/fileExists.go @@ -1,4 +1,4 @@ -package utilities +package pkg import ( "os" diff --git a/utilities/fileExists_test.go b/pkg/fileExists_test.go similarity index 96% rename from utilities/fileExists_test.go rename to pkg/fileExists_test.go index ee722f3..272829c 100644 --- a/utilities/fileExists_test.go +++ b/pkg/fileExists_test.go @@ -1,4 +1,4 @@ -package utilities +package pkg import ( "os" diff --git a/utilities/gin_liveness/liveness.go b/pkg/gin/healthcheck/health_check.go similarity index 97% rename from utilities/gin_liveness/liveness.go rename to pkg/gin/healthcheck/health_check.go index a8db759..1ebbe65 100644 --- a/utilities/gin_liveness/liveness.go +++ b/pkg/gin/healthcheck/health_check.go @@ -1,4 +1,4 @@ -package gin_liveness +package healthcheck import ( "net/http" diff --git a/utilities/gin_liveness/liveness_test.go b/pkg/gin/healthcheck/health_check_test.go similarity index 99% rename from utilities/gin_liveness/liveness_test.go rename to pkg/gin/healthcheck/health_check_test.go index 826d560..92dd268 100644 --- a/utilities/gin_liveness/liveness_test.go +++ b/pkg/gin/healthcheck/health_check_test.go @@ -1,4 +1,4 @@ -package gin_liveness +package healthcheck import ( "net/http" diff --git a/utilities/server_setup.go b/pkg/setup_https_server.go similarity index 98% rename from utilities/server_setup.go rename to pkg/setup_https_server.go index 7107641..bcc6bf3 100644 --- a/utilities/server_setup.go +++ b/pkg/setup_https_server.go @@ -1,4 +1,4 @@ -package utilities +package pkg import ( "errors" diff --git a/utilities/logger_setup.go b/pkg/setup_logger.go similarity index 97% rename from utilities/logger_setup.go rename to pkg/setup_logger.go index 9d7320d..f0a9ce4 100644 --- a/utilities/logger_setup.go +++ b/pkg/setup_logger.go @@ -1,4 +1,4 @@ -package utilities +package pkg import ( "fmt" diff --git a/utilities/go.mod b/utilities/go.mod deleted file mode 100644 index d577430..0000000 --- a/utilities/go.mod +++ /dev/null @@ -1,32 +0,0 @@ -module github.com/vcscsvcscs/GenerationsHeritage/utilities - -go 1.22.2 - -require github.com/gin-gonic/gin v1.9.1 - -require ( - github.com/bytedance/sonic v1.9.1 // indirect - github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect - github.com/gabriel-vasile/mimetype v1.4.2 // indirect - github.com/gin-contrib/sse v0.1.0 // indirect - github.com/go-playground/locales v0.14.1 // indirect - github.com/go-playground/universal-translator v0.18.1 // indirect - github.com/go-playground/validator/v10 v10.14.0 // indirect - github.com/goccy/go-json v0.10.2 // indirect - github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/cpuid/v2 v2.2.4 // indirect - github.com/leodido/go-urn v1.2.4 // indirect - github.com/mattn/go-isatty v0.0.19 // indirect - github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect - github.com/modern-go/reflect2 v1.0.2 // indirect - github.com/pelletier/go-toml/v2 v2.0.8 // indirect - github.com/twitchyliquid64/golang-asm v0.15.1 // indirect - github.com/ugorji/go/codec v1.2.11 // indirect - golang.org/x/arch v0.3.0 // indirect - golang.org/x/crypto v0.9.0 // indirect - golang.org/x/net v0.10.0 // indirect - golang.org/x/sys v0.8.0 // indirect - golang.org/x/text v0.9.0 // indirect - google.golang.org/protobuf v1.30.0 // indirect - gopkg.in/yaml.v3 v3.0.1 // indirect -) diff --git a/utilities/go.sum b/utilities/go.sum deleted file mode 100644 index 1a77fa1..0000000 --- a/utilities/go.sum +++ /dev/null @@ -1,86 +0,0 @@ -github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM= -github.com/bytedance/sonic v1.9.1 h1:6iJ6NqdoxCDr6mbY8h18oSO+cShGSMRGCEo7F2h0x8s= -github.com/bytedance/sonic v1.9.1/go.mod h1:i736AoUSYt75HyZLoJW9ERYxcy6eaN6h4BZXU064P/U= -github.com/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06/go.mod h1:DH46F32mSOjUmXrMHnKwZdA8wcEefY7UVqBKYGjpdQY= -github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 h1:qSGYFH7+jGhDF8vLC+iwCD4WpbV1EBDSzWkJODFLams= -github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311/go.mod h1:b583jCggY9gE99b6G5LEC39OIiVsWj+R97kbl5odCEk= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/gabriel-vasile/mimetype v1.4.2 h1:w5qFW6JKBz9Y393Y4q372O9A7cUSequkh1Q7OhCmWKU= -github.com/gabriel-vasile/mimetype v1.4.2/go.mod h1:zApsH/mKG4w07erKIaJPFiX0Tsq9BFQgN3qGY5GnNgA= -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= -github.com/gin-gonic/gin v1.9.1/go.mod h1:hPrL7YrpYKXt5YId3A/Tnip5kqbEAP+KLuI3SUcPTeU= -github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s= -github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= -github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= -github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= -github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= -github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= -github.com/go-playground/validator/v10 v10.14.0 h1:vgvQWe3XCz3gIeFDm/HnTIbj6UGmg/+t63MyGU2n5js= -github.com/go-playground/validator/v10 v10.14.0/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU= -github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= -github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= -github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= -github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= -github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= -github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= -github.com/klauspost/cpuid/v2 v2.2.4 h1:acbojRNwl3o09bUq+yDCtZFc1aiwaAAxtcn8YkZXnvk= -github.com/klauspost/cpuid/v2 v2.2.4/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY= -github.com/leodido/go-urn v1.2.4 h1:XlAE/cm/ms7TE/VMVoduSpNBoyc2dOxHs5MZSwAN63Q= -github.com/leodido/go-urn v1.2.4/go.mod h1:7ZrI8mTSeBSHl/UaRyKQW1qZeMgak41ANeCNaVckg+4= -github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= -github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= -github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= -github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/pelletier/go-toml/v2 v2.0.8 h1:0ctb6s9mE31h0/lhu+J6OPmVeDxJn+kYnJc2jZR9tGQ= -github.com/pelletier/go-toml/v2 v2.0.8/go.mod h1:vuYfssBdrU2XDZ9bYydBu6t+6a6PYNcZljzZR9VXg+4= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.3 h1:RP3t2pwF7cMEbC1dqtB6poj3niw/9gnV4Cjg5oW5gtY= -github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= -github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= -github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU= -github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= -golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= -golang.org/x/arch v0.3.0 h1:02VY4/ZcO/gBOH6PUaoiptASxtXU10jazRCP865E97k= -golang.org/x/arch v0.3.0/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= -golang.org/x/crypto v0.9.0 h1:LF6fAI+IutBocDJ2OT0Q1g8plpYljMZ4+lty+dsqw3g= -golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0= -golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= -golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= -golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= -golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= -golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= -google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= -gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= From 5658c10b561e43c29ffd106594cd593c889ad256 Mon Sep 17 00:00:00 2001 From: Vargha Csongor Date: Sun, 22 Dec 2024 21:39:36 +0100 Subject: [PATCH 02/11] move backend to new structure --- .github/workflows/backend-cd.yml | 5 +- .github/workflows/backend-ci.yml | 9 +- backend/auth.go | 23 --- backend/dockerfile | 16 -- backend/go.mod | 50 ------ backend/go.sum | 158 ------------------ backend/main.go | 107 ------------ .../backend}/handlers/createPerson.go | 2 +- .../backend}/handlers/createRelationship.go | 2 +- .../create_relationship_and_person.go | 2 +- .../backend}/handlers/deletePerson.go | 2 +- .../backend}/handlers/deleteRelationship.go | 2 +- .../backend}/handlers/updatePerson.go | 2 +- .../backend}/handlers/verifyRelationship.go | 2 +- .../backend}/handlers/viewFamilyTree.go | 0 .../backend}/handlers/viewPerson.go | 0 {backend => pkg}/memgraph/create_person.go | 0 .../memgraph/create_relationship.go | 0 .../create_relationship_and_person.go | 0 {backend => pkg}/memgraph/create_schema.go | 0 .../memgraph/cypher_verify_string.go | 0 {backend => pkg}/memgraph/delete_person.go | 0 .../memgraph/delete_relationship.go | 0 {backend => pkg}/memgraph/init_database.go | 0 {backend => pkg}/memgraph/model.go | 0 {backend => pkg}/memgraph/model_test.go | 0 {backend => pkg}/memgraph/update_person.go | 0 .../memgraph/verify_relationship.go | 0 28 files changed, 15 insertions(+), 367 deletions(-) delete mode 100644 backend/auth.go delete mode 100644 backend/dockerfile delete mode 100644 backend/go.mod delete mode 100644 backend/go.sum delete mode 100644 backend/main.go rename {backend => cmd/backend}/handlers/createPerson.go (95%) rename {backend => cmd/backend}/handlers/createRelationship.go (92%) rename {backend => cmd/backend}/handlers/create_relationship_and_person.go (92%) rename {backend => cmd/backend}/handlers/deletePerson.go (95%) rename {backend => cmd/backend}/handlers/deleteRelationship.go (92%) rename {backend => cmd/backend}/handlers/updatePerson.go (95%) rename {backend => cmd/backend}/handlers/verifyRelationship.go (92%) rename {backend => cmd/backend}/handlers/viewFamilyTree.go (100%) rename {backend => cmd/backend}/handlers/viewPerson.go (100%) rename {backend => pkg}/memgraph/create_person.go (100%) rename {backend => pkg}/memgraph/create_relationship.go (100%) rename {backend => pkg}/memgraph/create_relationship_and_person.go (100%) rename {backend => pkg}/memgraph/create_schema.go (100%) rename {backend => pkg}/memgraph/cypher_verify_string.go (100%) rename {backend => pkg}/memgraph/delete_person.go (100%) rename {backend => pkg}/memgraph/delete_relationship.go (100%) rename {backend => pkg}/memgraph/init_database.go (100%) rename {backend => pkg}/memgraph/model.go (100%) rename {backend => pkg}/memgraph/model_test.go (100%) rename {backend => pkg}/memgraph/update_person.go (100%) rename {backend => pkg}/memgraph/verify_relationship.go (100%) diff --git a/.github/workflows/backend-cd.yml b/.github/workflows/backend-cd.yml index e2bfce7..6adff74 100644 --- a/.github/workflows/backend-cd.yml +++ b/.github/workflows/backend-cd.yml @@ -3,7 +3,8 @@ name: Release Backend service to Docker Hub and Deploy to Kubernetes on: push: paths: - - "backend/**" + - "cmd/backend/**" + - "pkg/**" - "deployment/backend/**" - ".github/workflows/backend-cd.yml" @@ -46,6 +47,6 @@ jobs: uses: docker/build-push-action@v5 with: push: true - context: "{{defaultContext}}:backend" + context: "{{defaultContext}}:cmd/backend" tags: vcscsvcscs/gheritage-backend-service:${{steps.create_image_tag.outputs.result}} platforms: linux/arm64 diff --git a/.github/workflows/backend-ci.yml b/.github/workflows/backend-ci.yml index ebee273..25ab1d4 100644 --- a/.github/workflows/backend-ci.yml +++ b/.github/workflows/backend-ci.yml @@ -2,19 +2,20 @@ name: Backend Continuous Integration on: push: paths: - - "backend/**" + - "cmd/backend/**" + - "pkg/**" jobs: lint: uses: ./.github/workflows/go_lint.yml with: - working-directory: 'backend' + working-directory: 'cmd/backend' build: needs: lint uses: ./.github/workflows/go_build.yml with: - working-directory: 'backend' + working-directory: 'cmd/backend' test: needs: build uses: ./.github/workflows/go_test.yml with: - working-directory: 'backend' \ No newline at end of file + working-directory: 'cmd/backend' \ No newline at end of file diff --git a/backend/auth.go b/backend/auth.go deleted file mode 100644 index 0246199..0000000 --- a/backend/auth.go +++ /dev/null @@ -1,23 +0,0 @@ -package main - -import ( - "net/http" - - "github.com/gin-gonic/gin" - "github.com/zitadel/zitadel-go/v3/pkg/authorization/oauth" - "github.com/zitadel/zitadel-go/v3/pkg/http/middleware" -) - -func auth(mw *middleware.Interceptor[*oauth.IntrospectionContext]) gin.HandlerFunc { - return func(c *gin.Context) { - mw.RequireAuthorization()(http.HandlerFunc(authHTTPHandler(mw, c))).ServeHTTP(c.Writer, c.Request) - } -} - -func authHTTPHandler(mw *middleware.Interceptor[*oauth.IntrospectionContext], c *gin.Context) func(w http.ResponseWriter, r *http.Request) { - return func(w http.ResponseWriter, r *http.Request) { - authCtx := mw.Context(r.Context()) - c.Set("id", authCtx.UserID()) - c.Next() - } -} diff --git a/backend/dockerfile b/backend/dockerfile deleted file mode 100644 index d1ff741..0000000 --- a/backend/dockerfile +++ /dev/null @@ -1,16 +0,0 @@ -FROM arm64v8/golang:1.22.2-alpine as build - -WORKDIR /app - -COPY . . - -RUN GOOS=linux GOARCH=arm64 go build -o backend - -RUN apk update && apk add ca-certificates && update-ca-certificates - -FROM arm64v8/busybox:1.36.1 - -COPY --from=build /etc/ssl/certs /etc/ssl/certs -COPY --from=build /app/backend /app/ - -CMD [ "/app/backend" ] \ No newline at end of file diff --git a/backend/go.mod b/backend/go.mod deleted file mode 100644 index ec0493c..0000000 --- a/backend/go.mod +++ /dev/null @@ -1,50 +0,0 @@ -module github.com/vcscsvcscs/GenerationsHeritage/backend - -go 1.22.2 - -require ( - github.com/gin-contrib/cors v1.7.1 - github.com/gin-gonic/gin v1.9.1 - github.com/google/uuid v1.6.0 - github.com/neo4j/neo4j-go-driver/v5 v5.19.0 - github.com/vcscsvcscs/GenerationsHeritage/utilities v0.0.0-20240414091827-ffde94d457cb - github.com/zitadel/zitadel-go/v3 v3.0.0-next.2 - golang.org/x/net v0.23.0 -) - -require ( - github.com/bytedance/sonic v1.11.3 // indirect - github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d // indirect - github.com/chenzhuoyu/iasm v0.9.1 // indirect - github.com/gabriel-vasile/mimetype v1.4.3 // indirect - github.com/gin-contrib/sse v0.1.0 // indirect - github.com/go-jose/go-jose/v3 v3.0.1 // indirect - github.com/go-playground/locales v0.14.1 // indirect - github.com/go-playground/universal-translator v0.18.1 // indirect - github.com/go-playground/validator/v10 v10.19.0 // indirect - github.com/goccy/go-json v0.10.2 // indirect - github.com/gorilla/securecookie v1.1.2 // indirect - github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/cpuid/v2 v2.2.7 // indirect - github.com/kr/text v0.2.0 // indirect - github.com/leodido/go-urn v1.4.0 // indirect - github.com/mattn/go-isatty v0.0.20 // indirect - github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect - github.com/modern-go/reflect2 v1.0.2 // indirect - github.com/muhlemmer/gu v0.3.1 // indirect - github.com/pelletier/go-toml/v2 v2.2.0 // indirect - github.com/sirupsen/logrus v1.9.3 // indirect - github.com/twitchyliquid64/golang-asm v0.15.1 // indirect - github.com/ugorji/go/codec v1.2.12 // indirect - github.com/zitadel/logging v0.5.0 // indirect - github.com/zitadel/oidc/v3 v3.5.1 // indirect - github.com/zitadel/schema v1.3.0 // indirect - golang.org/x/arch v0.7.0 // indirect - golang.org/x/crypto v0.21.0 // indirect - golang.org/x/exp v0.0.0-20231219180239-dc181d75b848 // indirect - golang.org/x/oauth2 v0.19.0 // indirect - golang.org/x/sys v0.18.0 // indirect - golang.org/x/text v0.14.0 // indirect - google.golang.org/protobuf v1.33.0 // indirect - gopkg.in/yaml.v3 v3.0.1 // indirect -) diff --git a/backend/go.sum b/backend/go.sum deleted file mode 100644 index 05c39e7..0000000 --- a/backend/go.sum +++ /dev/null @@ -1,158 +0,0 @@ -github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM= -github.com/bytedance/sonic v1.10.0-rc/go.mod h1:ElCzW+ufi8qKqNW0FY314xriJhyJhuoJ3gFZdAHF7NM= -github.com/bytedance/sonic v1.11.3 h1:jRN+yEjakWh8aK5FzrciUHG8OFXK+4/KrAX/ysEtHAA= -github.com/bytedance/sonic v1.11.3/go.mod h1:iZcSUejdk5aukTND/Eu/ivjQuEL0Cu9/rf50Hi0u/g4= -github.com/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06/go.mod h1:DH46F32mSOjUmXrMHnKwZdA8wcEefY7UVqBKYGjpdQY= -github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311/go.mod h1:b583jCggY9gE99b6G5LEC39OIiVsWj+R97kbl5odCEk= -github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d h1:77cEq6EriyTZ0g/qfRdp61a3Uu/AWrgIq2s0ClJV1g0= -github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d/go.mod h1:8EPpVsBuRksnlj1mLy4AWzRNQYxauNi62uWcE3to6eA= -github.com/chenzhuoyu/iasm v0.9.0/go.mod h1:Xjy2NpN3h7aUqeqM+woSuuvxmIe6+DDsiNLIrkAmYog= -github.com/chenzhuoyu/iasm v0.9.1 h1:tUHQJXo3NhBqw6s33wkGn9SP3bvrWLdlVIJ3hQBL7P0= -github.com/chenzhuoyu/iasm v0.9.1/go.mod h1:Xjy2NpN3h7aUqeqM+woSuuvxmIe6+DDsiNLIrkAmYog= -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -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/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= -github.com/gin-gonic/gin v1.9.1/go.mod h1:hPrL7YrpYKXt5YId3A/Tnip5kqbEAP+KLuI3SUcPTeU= -github.com/go-chi/chi/v5 v5.0.10 h1:rLz5avzKpjqxrYwXNfmjkrYYXOyLJd37pz53UFHC6vk= -github.com/go-chi/chi/v5 v5.0.10/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8= -github.com/go-jose/go-jose/v3 v3.0.1 h1:pWmKFVtt+Jl0vBZTIpz/eAKwsm6LkIxDVVbFHKkchhA= -github.com/go-jose/go-jose/v3 v3.0.1/go.mod h1:RNkWWRld676jZEYoV3+XK8L2ZnNSvIsxFMht0mSX+u8= -github.com/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY= -github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= -github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= -github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= -github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s= -github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= -github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= -github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= -github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= -github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= -github.com/go-playground/validator/v10 v10.19.0 h1:ol+5Fu+cSq9JD7SoSqe04GMI92cbn0+wvQ3bZ8b/AU4= -github.com/go-playground/validator/v10 v10.19.0/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM= -github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= -github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= -github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= -github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= -github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= -github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/gorilla/securecookie v1.1.2 h1:YCIWL56dvtr73r6715mJs5ZvhtnY73hBvEF8kXD8ePA= -github.com/gorilla/securecookie v1.1.2/go.mod h1:NfCASbcHqRSY+3a8tlWJwsQap2VX5pwzwo4h3eOamfo= -github.com/jeremija/gosubmit v0.2.7 h1:At0OhGCFGPXyjPYAsCchoBUhE099pcBXmsb4iZqROIc= -github.com/jeremija/gosubmit v0.2.7/go.mod h1:Ui+HS073lCFREXBbdfrJzMB57OI/bdxTiLtrDHHhFPI= -github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= -github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= -github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= -github.com/klauspost/cpuid/v2 v2.2.7 h1:ZWSB3igEs+d0qvnxR/ZBzXVmxkgt8DdzP6m9pfuVLDM= -github.com/klauspost/cpuid/v2 v2.2.7/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= -github.com/knz/go-libedit v1.10.1/go.mod h1:MZTVkCWyz0oBc7JOWP3wNAzd002ZbM/5hgShxwh4x8M= -github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= -github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= -github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ= -github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI= -github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= -github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= -github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= -github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/muhlemmer/gu v0.3.1 h1:7EAqmFrW7n3hETvuAdmFmn4hS8W+z3LgKtrnow+YzNM= -github.com/muhlemmer/gu v0.3.1/go.mod h1:YHtHR+gxM+bKEIIs7Hmi9sPT3ZDUvTN/i88wQpZkrdM= -github.com/muhlemmer/httpforwarded v0.1.0 h1:x4DLrzXdliq8mprgUMR0olDvHGkou5BJsK/vWUetyzY= -github.com/muhlemmer/httpforwarded v0.1.0/go.mod h1:yo9czKedo2pdZhoXe+yDkGVbU0TJ0q9oQ90BVoDEtw0= -github.com/neo4j/neo4j-go-driver/v5 v5.19.0 h1:v2cB19fZQYz1xmj6EZXofFHD/+Tj16hH/OOp39uNN1I= -github.com/neo4j/neo4j-go-driver/v5 v5.19.0/go.mod h1:Vff8OwT7QpLm7L2yYr85XNWe9Rbqlbeb9asNXJTHO4k= -github.com/pelletier/go-toml/v2 v2.2.0 h1:QLgLl2yMN7N+ruc31VynXs1vhMZa7CeHHejIeBAsoHo= -github.com/pelletier/go-toml/v2 v2.2.0/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -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.10.1 h1:L0uuZVXIKlI1SShY2nhFfo44TYvDPQ1w4oFkUJNfhyo= -github.com/rs/cors v1.10.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= -github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= -github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= -github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= -github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= -github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= -github.com/ugorji/go/codec v1.2.12 h1:9LC83zGrHhuUA9l16C9AHXAqEV/2wBQ4nkvumAE65EE= -github.com/ugorji/go/codec v1.2.12/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= -github.com/vcscsvcscs/GenerationsHeritage/utilities v0.0.0-20240414091827-ffde94d457cb h1:fU736we2gQQRMOWP/su7sCiUFmrXTKBN0s8LG5k7bOE= -github.com/vcscsvcscs/GenerationsHeritage/utilities v0.0.0-20240414091827-ffde94d457cb/go.mod h1:aQlmG6BiGFmOFxzAkWTJDzm1EzdCJ4OEETXTUkWJaLk= -github.com/zitadel/logging v0.5.0 h1:Kunouvqse/efXy4UDvFw5s3vP+Z4AlHo3y8wF7stXHA= -github.com/zitadel/logging v0.5.0/go.mod h1:IzP5fzwFhzzyxHkSmfF8dsyqFsQRJLLcQmwhIBzlGsE= -github.com/zitadel/oidc/v3 v3.5.1 h1:7gyrxRNqX5eZYai2KhzPj8MhBZ7I3YpviQeX1Lp4j4U= -github.com/zitadel/oidc/v3 v3.5.1/go.mod h1:R8sF5DPR98QQnOoyySsaNqI4NcF/VFMkf/XoYiBUuXQ= -github.com/zitadel/schema v1.3.0 h1:kQ9W9tvIwZICCKWcMvCEweXET1OcOyGEuFbHs4o5kg0= -github.com/zitadel/schema v1.3.0/go.mod h1:NptN6mkBDFvERUCvZHlvWmmME+gmZ44xzwRXwhzsbtc= -github.com/zitadel/zitadel-go/v3 v3.0.0-next.2 h1:w0lnLvijwQwkrUEA74loenNR9udRAaq6rccjlMSA+4U= -github.com/zitadel/zitadel-go/v3 v3.0.0-next.2/go.mod h1:SY9IZuDw/766mwEobCX7JNwXawIQxVseo679JG1U0c0= -go.opentelemetry.io/otel v1.21.0 h1:hzLeKBZEL7Okw2mGzZ0cc4k/A7Fta0uoPgaJCr8fsFc= -go.opentelemetry.io/otel v1.21.0/go.mod h1:QZzNPQPm1zLX4gZK4cMi+71eaorMSGT3A4znnUvNNEo= -go.opentelemetry.io/otel/metric v1.21.0 h1:tlYWfeo+Bocx5kLEloTjbcDwBuELRrIFxwdQ36PlJu4= -go.opentelemetry.io/otel/metric v1.21.0/go.mod h1:o1p3CA8nNHW8j5yuQLdc1eeqEaPfzug24uvsyIEJRWM= -go.opentelemetry.io/otel/trace v1.21.0 h1:WD9i5gzvoUPuXIXH24ZNBudiarZDKuekPqi/E8fpfLc= -go.opentelemetry.io/otel/trace v1.21.0/go.mod h1:LGbsEB0f9LGjN+OZaQQ26sohbOmiMR+BaslueVtS/qQ= -golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= -golang.org/x/arch v0.7.0 h1:pskyeJh/3AmoQ8CPE95vxHLqp1G1GfGNXTmcl9NEKTc= -golang.org/x/arch v0.7.0/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190911031432-227b76d455e7/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= -golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= -golang.org/x/exp v0.0.0-20231219180239-dc181d75b848 h1:+iq7lrkxmFNBM7xx+Rae2W6uyPfhPeDWD+n+JgppptE= -golang.org/x/exp v0.0.0-20231219180239-dc181d75b848/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs= -golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= -golang.org/x/oauth2 v0.19.0 h1:9+E/EZBCbTLNrbN35fHv/a/d/mOBatymz1zbtQrXpIg= -golang.org/x/oauth2 v0.19.0/go.mod h1:vYi7skDa1x015PmRRYZ7+s1cWyPgrPiSYRe4rnsexc8= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= -golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= -golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= -google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= -gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= -gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= -gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -nullprogram.com/x/optparse v1.0.0/go.mod h1:KdyPE+Igbe0jQUrVfMqDMeJQIJZEuyV7pjYmp6pbG50= -rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= diff --git a/backend/main.go b/backend/main.go deleted file mode 100644 index bec874e..0000000 --- a/backend/main.go +++ /dev/null @@ -1,107 +0,0 @@ -package main - -import ( - "context" - "flag" - "log" - "os" - "os/signal" - "syscall" - "time" - - "github.com/gin-contrib/cors" - "github.com/gin-gonic/gin" - "github.com/vcscsvcscs/GenerationsHeritage/backend/handlers" - "github.com/vcscsvcscs/GenerationsHeritage/backend/memgraph" - "github.com/vcscsvcscs/GenerationsHeritage/utilities" - "github.com/vcscsvcscs/GenerationsHeritage/utilities/gin_liveness" - "github.com/zitadel/zitadel-go/v3/pkg/authorization" - "github.com/zitadel/zitadel-go/v3/pkg/authorization/oauth" - "github.com/zitadel/zitadel-go/v3/pkg/http/middleware" - "github.com/zitadel/zitadel-go/v3/pkg/zitadel" -) - -var ( - cert = flag.String("cert", "/etc/gh-backend/ssl/tls.crt", "Specify the path of TLS cert") - key = flag.String("key", "/etc/gh-backend/ssl/tls.key", "Specify the path of TLS key") - httpsPort = flag.String("https", ":443", "Specify port for http secure hosting(example for format :443)") - httpPort = flag.String("http", ":80", "Specify port for http hosting(example for format :80)") - zitadelAccessKey = flag.String("zitadel-access-key", "/etc/gh-backend/zitadel/api-key.json", "Specify the path of Zitadel access key") - zitadelURI = flag.String("zitadel-uri", "zitadel.varghacsongor.hu", "Specify the Zitadel URI") - memgraphURI = flag.String("memgraph", "bolt+ssc://memgraph:7687", "Specify the Memgraph database URI") - memgraphUser = flag.String("memgraph-user", "", "Specify the Memgraph database user") - memgraphPass = flag.String("memgraph-pass", "", "Specify the Memgraph database password") - release = flag.Bool("release", false, "Set true to release build") - logToFile = flag.Bool("log-to-file", false, "Set true to log to file") - logToFileAndStd = flag.Bool("log-to-file-and-std", false, "Set true to log to file and std") - requestTimeout = time.Duration(*flag.Int("request-timeout", 20, "Set request timeout in seconds")) -) - -func main() { - flag.Parse() - if *release { - gin.SetMode(gin.ReleaseMode) - } - - utilities.SetupLogger(*logToFileAndStd, *logToFile) - - hc := gin_liveness.New() - - memgraphDriver := memgraph.InitDatabase(*memgraphURI, *memgraphUser, *memgraphPass) - - router := gin.Default() - router.Use(cors.New(cors.Config{ - AllowOrigins: []string{"http://localhost:5173", "http://localhost", "https://heritagebackend.varghacsongor.hu", "https://feature-add-frontend.generationsheritage.pages.dev/", "https://csalad.varghacsongor.hu/"}, - AllowCredentials: true, - AllowHeaders: []string{"Authorization", "id", "Content-Type"}, - MaxAge: 12 * time.Hour, - })) - router.Use(gin.Recovery()) - - ctx := context.Background() - - // Initiate the authorization by providing a zitadel configuration and a verifier. - // This example will use OAuth2 Introspection for this, therefore you will also need to provide the downloaded api key.json - authZ, err := authorization.New(ctx, zitadel.New(*zitadelURI), oauth.DefaultAuthorization(*zitadelAccessKey)) - if err != nil { - log.Println("zitadel sdk could not initialize", "error", err) - os.Exit(1) - } - - // Initialize the HTTP middleware by providing the authorization - mw := middleware.New(authZ) - - router.Use(auth(mw)) - router.GET("/health", hc.HealthCheckHandler()) - router.GET("/person", handlers.ViewPerson(memgraphDriver)) - router.POST("/person", handlers.CreatePerson(memgraphDriver)) - router.DELETE("/person", handlers.DeletePerson(memgraphDriver)) - router.PUT("/person", handlers.UpdatePerson(memgraphDriver)) - router.POST("/relationship", handlers.CreateRelationship(memgraphDriver)) - router.DELETE("/relationship", handlers.DeleteRelationship(memgraphDriver)) - router.PUT("/relationship", handlers.VerifyRelationship(memgraphDriver)) - router.POST("/createRelationshipAndPerson", handlers.CreateRelationshipAndPerson(memgraphDriver)) - router.GET("/familyTree", handlers.ViewFamiliyTree(memgraphDriver)) - - server := utilities.SetupHttpsServer(router, *cert, *key, *httpsPort, *httpPort, requestTimeout) - - // Wait for interrupt signal to gracefully shutdown the server with some time to finish requests. - quit := make(chan os.Signal, 1) - // kill (no param) default send syscall.SIGTERM - // kill -2 is syscall.SIGINT - // kill -9 is syscall.SIGKILL but can't be caught, so don't need to add it - signal.Notify(quit, syscall.SIGINT, syscall.SIGTERM, os.Interrupt) - <-quit - log.Println("Shutting down server...") - - // The context is used to inform the server it has some seconds to finish - // the request it is currently handling - ctx, cancel := context.WithTimeout(context.Background(), requestTimeout*time.Second) - defer cancel() - - if err := server.Shutdown(ctx); err != nil { - log.Fatal("Server forced to shutdown:", err) - } - - log.Println("Server exiting") -} diff --git a/backend/handlers/createPerson.go b/cmd/backend/handlers/createPerson.go similarity index 95% rename from backend/handlers/createPerson.go rename to cmd/backend/handlers/createPerson.go index 579564f..9481b9b 100644 --- a/backend/handlers/createPerson.go +++ b/cmd/backend/handlers/createPerson.go @@ -7,7 +7,7 @@ import ( "github.com/gin-gonic/gin" "github.com/neo4j/neo4j-go-driver/v5/neo4j" - "github.com/vcscsvcscs/GenerationsHeritage/backend/memgraph" + "github.com/vcscsvcscs/GenerationsHeritage/pkg/memgraph" ) func CreatePerson(driver neo4j.DriverWithContext) gin.HandlerFunc { diff --git a/backend/handlers/createRelationship.go b/cmd/backend/handlers/createRelationship.go similarity index 92% rename from backend/handlers/createRelationship.go rename to cmd/backend/handlers/createRelationship.go index 71b28eb..c80c783 100644 --- a/backend/handlers/createRelationship.go +++ b/cmd/backend/handlers/createRelationship.go @@ -6,7 +6,7 @@ import ( "github.com/gin-gonic/gin" "github.com/neo4j/neo4j-go-driver/v5/neo4j" - "github.com/vcscsvcscs/GenerationsHeritage/backend/memgraph" + "github.com/vcscsvcscs/GenerationsHeritage/pkg/memgraph" ) func CreateRelationship(driver neo4j.DriverWithContext) gin.HandlerFunc { diff --git a/backend/handlers/create_relationship_and_person.go b/cmd/backend/handlers/create_relationship_and_person.go similarity index 92% rename from backend/handlers/create_relationship_and_person.go rename to cmd/backend/handlers/create_relationship_and_person.go index 7747ee3..fbc570c 100644 --- a/backend/handlers/create_relationship_and_person.go +++ b/cmd/backend/handlers/create_relationship_and_person.go @@ -6,7 +6,7 @@ import ( "github.com/gin-gonic/gin" "github.com/neo4j/neo4j-go-driver/v5/neo4j" - "github.com/vcscsvcscs/GenerationsHeritage/backend/memgraph" + "github.com/vcscsvcscs/GenerationsHeritage/pkg/memgraph" ) func CreateRelationshipAndPerson(driver neo4j.DriverWithContext) gin.HandlerFunc { diff --git a/backend/handlers/deletePerson.go b/cmd/backend/handlers/deletePerson.go similarity index 95% rename from backend/handlers/deletePerson.go rename to cmd/backend/handlers/deletePerson.go index 48becd0..df9ef99 100644 --- a/backend/handlers/deletePerson.go +++ b/cmd/backend/handlers/deletePerson.go @@ -7,7 +7,7 @@ import ( "github.com/gin-gonic/gin" "github.com/neo4j/neo4j-go-driver/v5/neo4j" - "github.com/vcscsvcscs/GenerationsHeritage/backend/memgraph" + "github.com/vcscsvcscs/GenerationsHeritage/pkg/memgraph" ) func DeletePerson(driver neo4j.DriverWithContext) gin.HandlerFunc { diff --git a/backend/handlers/deleteRelationship.go b/cmd/backend/handlers/deleteRelationship.go similarity index 92% rename from backend/handlers/deleteRelationship.go rename to cmd/backend/handlers/deleteRelationship.go index 160019a..e1cf576 100644 --- a/backend/handlers/deleteRelationship.go +++ b/cmd/backend/handlers/deleteRelationship.go @@ -6,7 +6,7 @@ import ( "github.com/gin-gonic/gin" "github.com/neo4j/neo4j-go-driver/v5/neo4j" - "github.com/vcscsvcscs/GenerationsHeritage/backend/memgraph" + "github.com/vcscsvcscs/GenerationsHeritage/pkg/memgraph" ) func DeleteRelationship(driver neo4j.DriverWithContext) gin.HandlerFunc { diff --git a/backend/handlers/updatePerson.go b/cmd/backend/handlers/updatePerson.go similarity index 95% rename from backend/handlers/updatePerson.go rename to cmd/backend/handlers/updatePerson.go index ce094cb..f413643 100644 --- a/backend/handlers/updatePerson.go +++ b/cmd/backend/handlers/updatePerson.go @@ -7,7 +7,7 @@ import ( "github.com/gin-gonic/gin" "github.com/neo4j/neo4j-go-driver/v5/neo4j" - "github.com/vcscsvcscs/GenerationsHeritage/backend/memgraph" + "github.com/vcscsvcscs/GenerationsHeritage/pkg/memgraph" ) func UpdatePerson(driver neo4j.DriverWithContext) gin.HandlerFunc { diff --git a/backend/handlers/verifyRelationship.go b/cmd/backend/handlers/verifyRelationship.go similarity index 92% rename from backend/handlers/verifyRelationship.go rename to cmd/backend/handlers/verifyRelationship.go index d347d80..5b3e9f9 100644 --- a/backend/handlers/verifyRelationship.go +++ b/cmd/backend/handlers/verifyRelationship.go @@ -6,7 +6,7 @@ import ( "github.com/gin-gonic/gin" "github.com/neo4j/neo4j-go-driver/v5/neo4j" - "github.com/vcscsvcscs/GenerationsHeritage/backend/memgraph" + "github.com/vcscsvcscs/GenerationsHeritage/pkg/memgraph" ) func VerifyRelationship(driver neo4j.DriverWithContext) gin.HandlerFunc { diff --git a/backend/handlers/viewFamilyTree.go b/cmd/backend/handlers/viewFamilyTree.go similarity index 100% rename from backend/handlers/viewFamilyTree.go rename to cmd/backend/handlers/viewFamilyTree.go diff --git a/backend/handlers/viewPerson.go b/cmd/backend/handlers/viewPerson.go similarity index 100% rename from backend/handlers/viewPerson.go rename to cmd/backend/handlers/viewPerson.go diff --git a/backend/memgraph/create_person.go b/pkg/memgraph/create_person.go similarity index 100% rename from backend/memgraph/create_person.go rename to pkg/memgraph/create_person.go diff --git a/backend/memgraph/create_relationship.go b/pkg/memgraph/create_relationship.go similarity index 100% rename from backend/memgraph/create_relationship.go rename to pkg/memgraph/create_relationship.go diff --git a/backend/memgraph/create_relationship_and_person.go b/pkg/memgraph/create_relationship_and_person.go similarity index 100% rename from backend/memgraph/create_relationship_and_person.go rename to pkg/memgraph/create_relationship_and_person.go diff --git a/backend/memgraph/create_schema.go b/pkg/memgraph/create_schema.go similarity index 100% rename from backend/memgraph/create_schema.go rename to pkg/memgraph/create_schema.go diff --git a/backend/memgraph/cypher_verify_string.go b/pkg/memgraph/cypher_verify_string.go similarity index 100% rename from backend/memgraph/cypher_verify_string.go rename to pkg/memgraph/cypher_verify_string.go diff --git a/backend/memgraph/delete_person.go b/pkg/memgraph/delete_person.go similarity index 100% rename from backend/memgraph/delete_person.go rename to pkg/memgraph/delete_person.go diff --git a/backend/memgraph/delete_relationship.go b/pkg/memgraph/delete_relationship.go similarity index 100% rename from backend/memgraph/delete_relationship.go rename to pkg/memgraph/delete_relationship.go diff --git a/backend/memgraph/init_database.go b/pkg/memgraph/init_database.go similarity index 100% rename from backend/memgraph/init_database.go rename to pkg/memgraph/init_database.go diff --git a/backend/memgraph/model.go b/pkg/memgraph/model.go similarity index 100% rename from backend/memgraph/model.go rename to pkg/memgraph/model.go diff --git a/backend/memgraph/model_test.go b/pkg/memgraph/model_test.go similarity index 100% rename from backend/memgraph/model_test.go rename to pkg/memgraph/model_test.go diff --git a/backend/memgraph/update_person.go b/pkg/memgraph/update_person.go similarity index 100% rename from backend/memgraph/update_person.go rename to pkg/memgraph/update_person.go diff --git a/backend/memgraph/verify_relationship.go b/pkg/memgraph/verify_relationship.go similarity index 100% rename from backend/memgraph/verify_relationship.go rename to pkg/memgraph/verify_relationship.go From ebd82475fd9ffbcde22b5c628cbb803258c9ec80 Mon Sep 17 00:00:00 2001 From: Vargha Csongor Date: Sun, 22 Dec 2024 21:39:54 +0100 Subject: [PATCH 03/11] update go in docker image --- cmd/auth/dockerfile | 2 +- cmd/backend/dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/auth/dockerfile b/cmd/auth/dockerfile index fffd278..9a59f75 100644 --- a/cmd/auth/dockerfile +++ b/cmd/auth/dockerfile @@ -1,4 +1,4 @@ -FROM arm64v8/golang:1.22.2-alpine as build +FROM arm64v8/golang:1.23.4-alpine as build WORKDIR /app diff --git a/cmd/backend/dockerfile b/cmd/backend/dockerfile index d1ff741..5ee8527 100644 --- a/cmd/backend/dockerfile +++ b/cmd/backend/dockerfile @@ -1,4 +1,4 @@ -FROM arm64v8/golang:1.22.2-alpine as build +FROM arm64v8/golang:1.23.4-alpine as build WORKDIR /app From 3bfc20cb21435df2588ed3846eedc0318a38b282 Mon Sep 17 00:00:00 2001 From: Vargha Csongor Date: Sun, 22 Dec 2024 21:40:21 +0100 Subject: [PATCH 04/11] move frontend to a cmd too for consistency --- .github/workflows/frontend-ci.yml | 6 +++--- {frontend => cmd/frontend}/.eslintignore | 0 {frontend => cmd/frontend}/.eslintrc.cjs | 0 {frontend => cmd/frontend}/.npmrc | 0 {frontend => cmd/frontend}/.prettierignore | 0 {frontend => cmd/frontend}/.prettierrc.cjs | 0 {frontend => cmd/frontend}/README.md | 0 {frontend => cmd/frontend}/package-lock.json | 0 {frontend => cmd/frontend}/package.json | 0 {frontend => cmd/frontend}/postcss.config.js | 0 {frontend => cmd/frontend}/src/app.html | 0 {frontend => cmd/frontend}/src/lib/auth.ts | 0 .../src/lib/family_tree/AddFamilyMember.svelte | 0 .../src/lib/family_tree/AddRelationship.svelte | 0 .../src/lib/family_tree/CreateProfile.svelte | 0 .../frontend}/src/lib/family_tree/PersonMenu.svelte | 0 .../frontend}/src/lib/family_tree/PersonNode.svelte | 0 .../src/lib/family_tree/PersonPanel.svelte | 0 .../frontend}/src/lib/family_tree/dagreLayout.ts | 0 .../frontend}/src/lib/family_tree/dataAdapter.ts | 0 .../frontend}/src/lib/family_tree/getFamilyTree.ts | 0 .../frontend}/src/lib/family_tree/getProfile.ts | 0 .../src/lib/family_tree/setFamilyTreeNodes.ts | 0 {frontend => cmd/frontend}/src/lib/index.js | 0 {frontend => cmd/frontend}/src/lib/stores.ts | 0 {frontend => cmd/frontend}/src/routes/+layout.js | 0 {frontend => cmd/frontend}/src/routes/+page.svelte | 0 .../frontend}/src/routes/callback/+page.svelte | 0 .../src/routes/siltent-refresh/+page.svelte | 0 {frontend => cmd/frontend}/static/favicon.png | Bin {frontend => cmd/frontend}/svelte.config.js | 0 {frontend => cmd/frontend}/tailwind.config.js | 0 {frontend => cmd/frontend}/tsconfig.json | 0 {frontend => cmd/frontend}/vite.config.js | 0 34 files changed, 3 insertions(+), 3 deletions(-) rename {frontend => cmd/frontend}/.eslintignore (100%) rename {frontend => cmd/frontend}/.eslintrc.cjs (100%) rename {frontend => cmd/frontend}/.npmrc (100%) rename {frontend => cmd/frontend}/.prettierignore (100%) rename {frontend => cmd/frontend}/.prettierrc.cjs (100%) rename {frontend => cmd/frontend}/README.md (100%) rename {frontend => cmd/frontend}/package-lock.json (100%) rename {frontend => cmd/frontend}/package.json (100%) rename {frontend => cmd/frontend}/postcss.config.js (100%) rename {frontend => cmd/frontend}/src/app.html (100%) rename {frontend => cmd/frontend}/src/lib/auth.ts (100%) rename {frontend => cmd/frontend}/src/lib/family_tree/AddFamilyMember.svelte (100%) rename {frontend => cmd/frontend}/src/lib/family_tree/AddRelationship.svelte (100%) rename {frontend => cmd/frontend}/src/lib/family_tree/CreateProfile.svelte (100%) rename {frontend => cmd/frontend}/src/lib/family_tree/PersonMenu.svelte (100%) rename {frontend => cmd/frontend}/src/lib/family_tree/PersonNode.svelte (100%) rename {frontend => cmd/frontend}/src/lib/family_tree/PersonPanel.svelte (100%) rename {frontend => cmd/frontend}/src/lib/family_tree/dagreLayout.ts (100%) rename {frontend => cmd/frontend}/src/lib/family_tree/dataAdapter.ts (100%) rename {frontend => cmd/frontend}/src/lib/family_tree/getFamilyTree.ts (100%) rename {frontend => cmd/frontend}/src/lib/family_tree/getProfile.ts (100%) rename {frontend => cmd/frontend}/src/lib/family_tree/setFamilyTreeNodes.ts (100%) rename {frontend => cmd/frontend}/src/lib/index.js (100%) rename {frontend => cmd/frontend}/src/lib/stores.ts (100%) rename {frontend => cmd/frontend}/src/routes/+layout.js (100%) rename {frontend => cmd/frontend}/src/routes/+page.svelte (100%) rename {frontend => cmd/frontend}/src/routes/callback/+page.svelte (100%) rename {frontend => cmd/frontend}/src/routes/siltent-refresh/+page.svelte (100%) rename {frontend => cmd/frontend}/static/favicon.png (100%) rename {frontend => cmd/frontend}/svelte.config.js (100%) rename {frontend => cmd/frontend}/tailwind.config.js (100%) rename {frontend => cmd/frontend}/tsconfig.json (100%) rename {frontend => cmd/frontend}/vite.config.js (100%) diff --git a/.github/workflows/frontend-ci.yml b/.github/workflows/frontend-ci.yml index 209ae60..0257c67 100644 --- a/.github/workflows/frontend-ci.yml +++ b/.github/workflows/frontend-ci.yml @@ -2,14 +2,14 @@ name: Frontend Continuous Integration on: push: paths: - - "frontend/**" + - "cmd/frontend/**" jobs: lint: uses: ./.github/workflows/svelte_lint.yml with: - working-directory: 'frontend' + working-directory: 'cmd/frontend' build: needs: lint uses: ./.github/workflows/svelte_build.yml with: - working-directory: 'frontend' + working-directory: 'cmd/frontend' diff --git a/frontend/.eslintignore b/cmd/frontend/.eslintignore similarity index 100% rename from frontend/.eslintignore rename to cmd/frontend/.eslintignore diff --git a/frontend/.eslintrc.cjs b/cmd/frontend/.eslintrc.cjs similarity index 100% rename from frontend/.eslintrc.cjs rename to cmd/frontend/.eslintrc.cjs diff --git a/frontend/.npmrc b/cmd/frontend/.npmrc similarity index 100% rename from frontend/.npmrc rename to cmd/frontend/.npmrc diff --git a/frontend/.prettierignore b/cmd/frontend/.prettierignore similarity index 100% rename from frontend/.prettierignore rename to cmd/frontend/.prettierignore diff --git a/frontend/.prettierrc.cjs b/cmd/frontend/.prettierrc.cjs similarity index 100% rename from frontend/.prettierrc.cjs rename to cmd/frontend/.prettierrc.cjs diff --git a/frontend/README.md b/cmd/frontend/README.md similarity index 100% rename from frontend/README.md rename to cmd/frontend/README.md diff --git a/frontend/package-lock.json b/cmd/frontend/package-lock.json similarity index 100% rename from frontend/package-lock.json rename to cmd/frontend/package-lock.json diff --git a/frontend/package.json b/cmd/frontend/package.json similarity index 100% rename from frontend/package.json rename to cmd/frontend/package.json diff --git a/frontend/postcss.config.js b/cmd/frontend/postcss.config.js similarity index 100% rename from frontend/postcss.config.js rename to cmd/frontend/postcss.config.js diff --git a/frontend/src/app.html b/cmd/frontend/src/app.html similarity index 100% rename from frontend/src/app.html rename to cmd/frontend/src/app.html diff --git a/frontend/src/lib/auth.ts b/cmd/frontend/src/lib/auth.ts similarity index 100% rename from frontend/src/lib/auth.ts rename to cmd/frontend/src/lib/auth.ts diff --git a/frontend/src/lib/family_tree/AddFamilyMember.svelte b/cmd/frontend/src/lib/family_tree/AddFamilyMember.svelte similarity index 100% rename from frontend/src/lib/family_tree/AddFamilyMember.svelte rename to cmd/frontend/src/lib/family_tree/AddFamilyMember.svelte diff --git a/frontend/src/lib/family_tree/AddRelationship.svelte b/cmd/frontend/src/lib/family_tree/AddRelationship.svelte similarity index 100% rename from frontend/src/lib/family_tree/AddRelationship.svelte rename to cmd/frontend/src/lib/family_tree/AddRelationship.svelte diff --git a/frontend/src/lib/family_tree/CreateProfile.svelte b/cmd/frontend/src/lib/family_tree/CreateProfile.svelte similarity index 100% rename from frontend/src/lib/family_tree/CreateProfile.svelte rename to cmd/frontend/src/lib/family_tree/CreateProfile.svelte diff --git a/frontend/src/lib/family_tree/PersonMenu.svelte b/cmd/frontend/src/lib/family_tree/PersonMenu.svelte similarity index 100% rename from frontend/src/lib/family_tree/PersonMenu.svelte rename to cmd/frontend/src/lib/family_tree/PersonMenu.svelte diff --git a/frontend/src/lib/family_tree/PersonNode.svelte b/cmd/frontend/src/lib/family_tree/PersonNode.svelte similarity index 100% rename from frontend/src/lib/family_tree/PersonNode.svelte rename to cmd/frontend/src/lib/family_tree/PersonNode.svelte diff --git a/frontend/src/lib/family_tree/PersonPanel.svelte b/cmd/frontend/src/lib/family_tree/PersonPanel.svelte similarity index 100% rename from frontend/src/lib/family_tree/PersonPanel.svelte rename to cmd/frontend/src/lib/family_tree/PersonPanel.svelte diff --git a/frontend/src/lib/family_tree/dagreLayout.ts b/cmd/frontend/src/lib/family_tree/dagreLayout.ts similarity index 100% rename from frontend/src/lib/family_tree/dagreLayout.ts rename to cmd/frontend/src/lib/family_tree/dagreLayout.ts diff --git a/frontend/src/lib/family_tree/dataAdapter.ts b/cmd/frontend/src/lib/family_tree/dataAdapter.ts similarity index 100% rename from frontend/src/lib/family_tree/dataAdapter.ts rename to cmd/frontend/src/lib/family_tree/dataAdapter.ts diff --git a/frontend/src/lib/family_tree/getFamilyTree.ts b/cmd/frontend/src/lib/family_tree/getFamilyTree.ts similarity index 100% rename from frontend/src/lib/family_tree/getFamilyTree.ts rename to cmd/frontend/src/lib/family_tree/getFamilyTree.ts diff --git a/frontend/src/lib/family_tree/getProfile.ts b/cmd/frontend/src/lib/family_tree/getProfile.ts similarity index 100% rename from frontend/src/lib/family_tree/getProfile.ts rename to cmd/frontend/src/lib/family_tree/getProfile.ts diff --git a/frontend/src/lib/family_tree/setFamilyTreeNodes.ts b/cmd/frontend/src/lib/family_tree/setFamilyTreeNodes.ts similarity index 100% rename from frontend/src/lib/family_tree/setFamilyTreeNodes.ts rename to cmd/frontend/src/lib/family_tree/setFamilyTreeNodes.ts diff --git a/frontend/src/lib/index.js b/cmd/frontend/src/lib/index.js similarity index 100% rename from frontend/src/lib/index.js rename to cmd/frontend/src/lib/index.js diff --git a/frontend/src/lib/stores.ts b/cmd/frontend/src/lib/stores.ts similarity index 100% rename from frontend/src/lib/stores.ts rename to cmd/frontend/src/lib/stores.ts diff --git a/frontend/src/routes/+layout.js b/cmd/frontend/src/routes/+layout.js similarity index 100% rename from frontend/src/routes/+layout.js rename to cmd/frontend/src/routes/+layout.js diff --git a/frontend/src/routes/+page.svelte b/cmd/frontend/src/routes/+page.svelte similarity index 100% rename from frontend/src/routes/+page.svelte rename to cmd/frontend/src/routes/+page.svelte diff --git a/frontend/src/routes/callback/+page.svelte b/cmd/frontend/src/routes/callback/+page.svelte similarity index 100% rename from frontend/src/routes/callback/+page.svelte rename to cmd/frontend/src/routes/callback/+page.svelte diff --git a/frontend/src/routes/siltent-refresh/+page.svelte b/cmd/frontend/src/routes/siltent-refresh/+page.svelte similarity index 100% rename from frontend/src/routes/siltent-refresh/+page.svelte rename to cmd/frontend/src/routes/siltent-refresh/+page.svelte diff --git a/frontend/static/favicon.png b/cmd/frontend/static/favicon.png similarity index 100% rename from frontend/static/favicon.png rename to cmd/frontend/static/favicon.png diff --git a/frontend/svelte.config.js b/cmd/frontend/svelte.config.js similarity index 100% rename from frontend/svelte.config.js rename to cmd/frontend/svelte.config.js diff --git a/frontend/tailwind.config.js b/cmd/frontend/tailwind.config.js similarity index 100% rename from frontend/tailwind.config.js rename to cmd/frontend/tailwind.config.js diff --git a/frontend/tsconfig.json b/cmd/frontend/tsconfig.json similarity index 100% rename from frontend/tsconfig.json rename to cmd/frontend/tsconfig.json diff --git a/frontend/vite.config.js b/cmd/frontend/vite.config.js similarity index 100% rename from frontend/vite.config.js rename to cmd/frontend/vite.config.js From fa7086cd3c4b1ff8b71d1a5b3852154a358c8589 Mon Sep 17 00:00:00 2001 From: Vargha Csongor Date: Sun, 22 Dec 2024 21:41:56 +0100 Subject: [PATCH 05/11] comment unused zitadel auths in backend --- cmd/backend/main.go | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/cmd/backend/main.go b/cmd/backend/main.go index 8c79840..a6491f8 100644 --- a/cmd/backend/main.go +++ b/cmd/backend/main.go @@ -21,19 +21,19 @@ import ( ) var ( - cert = flag.String("cert", "/etc/gh-backend/ssl/tls.crt", "Specify the path of TLS cert") - key = flag.String("key", "/etc/gh-backend/ssl/tls.key", "Specify the path of TLS key") - httpsPort = flag.String("https", ":443", "Specify port for http secure hosting(example for format :443)") - httpPort = flag.String("http", ":80", "Specify port for http hosting(example for format :80)") - zitadelAccessKey = flag.String("zitadel-access-key", "/etc/gh-backend/zitadel/api-key.json", "Specify the path of Zitadel access key") - zitadelURI = flag.String("zitadel-uri", "zitadel.varghacsongor.hu", "Specify the Zitadel URI") - memgraphURI = flag.String("memgraph", "bolt+ssc://memgraph:7687", "Specify the Memgraph database URI") - memgraphUser = flag.String("memgraph-user", "", "Specify the Memgraph database user") - memgraphPass = flag.String("memgraph-pass", "", "Specify the Memgraph database password") - release = flag.Bool("release", false, "Set true to release build") - logToFile = flag.Bool("log-to-file", false, "Set true to log to file") - logToFileAndStd = flag.Bool("log-to-file-and-std", false, "Set true to log to file and std") - requestTimeout = time.Duration(*flag.Int("request-timeout", 20, "Set request timeout in seconds")) + cert = flag.String("cert", "/etc/gh-backend/ssl/tls.crt", "Specify the path of TLS cert") + key = flag.String("key", "/etc/gh-backend/ssl/tls.key", "Specify the path of TLS key") + httpsPort = flag.String("https", ":443", "Specify port for http secure hosting(example for format :443)") + httpPort = flag.String("http", ":80", "Specify port for http hosting(example for format :80)") + // zitadelAccessKey = flag.String("zitadel-access-key", "/etc/gh-backend/zitadel/api-key.json", "Specify the path of Zitadel access key") + // zitadelURI = flag.String("zitadel-uri", "zitadel.varghacsongor.hu", "Specify the Zitadel URI") + memgraphURI = flag.String("memgraph", "bolt+ssc://memgraph:7687", "Specify the Memgraph database URI") + memgraphUser = flag.String("memgraph-user", "", "Specify the Memgraph database user") + memgraphPass = flag.String("memgraph-pass", "", "Specify the Memgraph database password") + release = flag.Bool("release", false, "Set true to release build") + logToFile = flag.Bool("log-to-file", false, "Set true to log to file") + logToFileAndStd = flag.Bool("log-to-file-and-std", false, "Set true to log to file and std") + requestTimeout = time.Duration(*flag.Int("request-timeout", 20, "Set request timeout in seconds")) ) func main() { @@ -57,7 +57,7 @@ func main() { })) router.Use(gin.Recovery()) - ctx := context.Background() + //ctx := context.Background() // Initiate the authorization by providing a zitadel configuration and a verifier. // This example will use OAuth2 Introspection for this, therefore you will also need to provide the downloaded api key.json From 677adc1e22c42ef0db944b4ef990436ed38eddac Mon Sep 17 00:00:00 2001 From: Vargha Csongor Date: Sun, 22 Dec 2024 21:58:50 +0100 Subject: [PATCH 06/11] fixup ci --- .github/workflows/auth-service-cd.yml | 2 +- .github/workflows/auth-service-ci.yml | 21 ---------------- .github/workflows/backend-cd.yml | 2 +- .github/workflows/backend-ci.yml | 21 ---------------- .github/workflows/frontend-ci.yml | 2 +- .github/workflows/go_build.yml | 27 --------------------- .github/workflows/{go_lint.yml => lint.yml} | 12 ++++----- .github/workflows/pkg-ci.yml | 15 ------------ .github/workflows/{go_test.yml => test.yml} | 10 +++----- 9 files changed, 12 insertions(+), 100 deletions(-) delete mode 100644 .github/workflows/auth-service-ci.yml delete mode 100644 .github/workflows/backend-ci.yml delete mode 100644 .github/workflows/go_build.yml rename .github/workflows/{go_lint.yml => lint.yml} (61%) delete mode 100644 .github/workflows/pkg-ci.yml rename .github/workflows/{go_test.yml => test.yml} (73%) diff --git a/.github/workflows/auth-service-cd.yml b/.github/workflows/auth-service-cd.yml index 61dfd11..ea34324 100644 --- a/.github/workflows/auth-service-cd.yml +++ b/.github/workflows/auth-service-cd.yml @@ -1,4 +1,4 @@ -name: Release Auth service to Docker Hub and Deploy to Kubernetes +name: Release Auth service to Docker Hub on: push: diff --git a/.github/workflows/auth-service-ci.yml b/.github/workflows/auth-service-ci.yml deleted file mode 100644 index d96d428..0000000 --- a/.github/workflows/auth-service-ci.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: Authentication service Continuous Integration -on: - push: - paths: - - "cmd/auth/**" - - "pkg/**" -jobs: - lint: - uses: ./.github/workflows/go_lint.yml - with: - working-directory: 'cmd/auth' - build: - needs: lint - uses: ./.github/workflows/go_build.yml - with: - working-directory: 'cmd/auth' - test: - needs: build - uses: ./.github/workflows/go_test.yml - with: - working-directory: 'cmd/auth' \ No newline at end of file diff --git a/.github/workflows/backend-cd.yml b/.github/workflows/backend-cd.yml index 6adff74..8b941e6 100644 --- a/.github/workflows/backend-cd.yml +++ b/.github/workflows/backend-cd.yml @@ -1,4 +1,4 @@ -name: Release Backend service to Docker Hub and Deploy to Kubernetes +name: Release Backend service to Docker Hub on: push: diff --git a/.github/workflows/backend-ci.yml b/.github/workflows/backend-ci.yml deleted file mode 100644 index 25ab1d4..0000000 --- a/.github/workflows/backend-ci.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: Backend Continuous Integration -on: - push: - paths: - - "cmd/backend/**" - - "pkg/**" -jobs: - lint: - uses: ./.github/workflows/go_lint.yml - with: - working-directory: 'cmd/backend' - build: - needs: lint - uses: ./.github/workflows/go_build.yml - with: - working-directory: 'cmd/backend' - test: - needs: build - uses: ./.github/workflows/go_test.yml - with: - working-directory: 'cmd/backend' \ No newline at end of file diff --git a/.github/workflows/frontend-ci.yml b/.github/workflows/frontend-ci.yml index 0257c67..27aaa3b 100644 --- a/.github/workflows/frontend-ci.yml +++ b/.github/workflows/frontend-ci.yml @@ -1,6 +1,6 @@ name: Frontend Continuous Integration on: - push: + pull_request: paths: - "cmd/frontend/**" jobs: diff --git a/.github/workflows/go_build.yml b/.github/workflows/go_build.yml deleted file mode 100644 index 1c471d6..0000000 --- a/.github/workflows/go_build.yml +++ /dev/null @@ -1,27 +0,0 @@ -on: - workflow_call: - inputs: - working-directory: - required: true - type: string - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Setup Go 1.22.x' - uses: actions/setup-go@v5 - with: - go-version: '1.22.x' - - - name: Display Go version - run: go version - - - name: Install dependencies - run: | - go get - - - name: Build - run: | - go build ${{ inputs.working-directory }} \ No newline at end of file diff --git a/.github/workflows/go_lint.yml b/.github/workflows/lint.yml similarity index 61% rename from .github/workflows/go_lint.yml rename to .github/workflows/lint.yml index 287601b..b4305db 100644 --- a/.github/workflows/go_lint.yml +++ b/.github/workflows/lint.yml @@ -1,9 +1,8 @@ on: - workflow_call: - inputs: - working-directory: - required: true - type: string + pull_request: + paths: + - "cmd/**" + - "pkg/**" jobs: golangci: @@ -13,10 +12,9 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: - go-version: '1.22' + go-version: '1.23' cache: false - name: golangci-lint uses: golangci/golangci-lint-action@v4 with: version: latest - working-directory: ${{ inputs.working-directory }} \ No newline at end of file diff --git a/.github/workflows/pkg-ci.yml b/.github/workflows/pkg-ci.yml deleted file mode 100644 index 6a5eda7..0000000 --- a/.github/workflows/pkg-ci.yml +++ /dev/null @@ -1,15 +0,0 @@ -name: Common Package Continuous Integration -on: - push: - paths: - - "pkg/**" -jobs: - lint: - uses: ./.github/workflows/go_lint.yml - with: - working-directory: 'pkg' - test: - needs: lint - uses: ./.github/workflows/go_test.yml - with: - working-directory: 'pkg' \ No newline at end of file diff --git a/.github/workflows/go_test.yml b/.github/workflows/test.yml similarity index 73% rename from .github/workflows/go_test.yml rename to .github/workflows/test.yml index 2fab8bc..dcd6d32 100644 --- a/.github/workflows/go_test.yml +++ b/.github/workflows/test.yml @@ -1,9 +1,8 @@ on: - workflow_call: - inputs: - working-directory: - required: true - type: string + pull_request: + paths: + - "cmd/**" + - "pkg/**" jobs: build: @@ -24,5 +23,4 @@ jobs: - name: Run tests run: | - cd ${{ inputs.working-directory }} go test ./... \ No newline at end of file From d0f80818b05f50783ab86162553841180f530980 Mon Sep 17 00:00:00 2001 From: Vargha Csongor Date: Sun, 22 Dec 2024 21:59:55 +0100 Subject: [PATCH 07/11] change deploy trigger to pr too --- .github/workflows/auth-service-cd.yml | 2 +- .github/workflows/backend-cd.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/auth-service-cd.yml b/.github/workflows/auth-service-cd.yml index ea34324..6b104a1 100644 --- a/.github/workflows/auth-service-cd.yml +++ b/.github/workflows/auth-service-cd.yml @@ -1,7 +1,7 @@ name: Release Auth service to Docker Hub on: - push: + pull_request: paths: - "cmd/auth/**" - "pkg/**" diff --git a/.github/workflows/backend-cd.yml b/.github/workflows/backend-cd.yml index 8b941e6..b625a72 100644 --- a/.github/workflows/backend-cd.yml +++ b/.github/workflows/backend-cd.yml @@ -1,7 +1,7 @@ name: Release Backend service to Docker Hub on: - push: + pull_request: paths: - "cmd/backend/**" - "pkg/**" From 9da42c62cd72bfebb50abfc31a49b167698ac231 Mon Sep 17 00:00:00 2001 From: Vargha Csongor Date: Sun, 22 Dec 2024 22:06:38 +0100 Subject: [PATCH 08/11] name lint and test and add go get path --- .github/workflows/lint.yml | 3 +++ .github/workflows/test.yml | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index b4305db..d1c32ed 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,3 +1,5 @@ +name: Go Lint + on: pull_request: paths: @@ -18,3 +20,4 @@ jobs: uses: golangci/golangci-lint-action@v4 with: version: latest + working-directory: . diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index dcd6d32..b3eaf3f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,3 +1,5 @@ +name: Go Test + on: pull_request: paths: @@ -19,7 +21,7 @@ jobs: - name: Install dependencies run: | - go get + go get ... - name: Run tests run: | From fa4c886300cb66a228eb015d8eb157c7193bd445 Mon Sep 17 00:00:00 2001 From: Vargha Csongor Date: Sun, 22 Dec 2024 22:17:14 +0100 Subject: [PATCH 09/11] update --- .github/workflows/lint.yml | 2 +- .github/workflows/test.yml | 2 +- cmd/auth/dockerfile | 2 +- cmd/backend/dockerfile | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index d1c32ed..c3e3925 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -20,4 +20,4 @@ jobs: uses: golangci/golangci-lint-action@v4 with: version: latest - working-directory: . + working-directory: ./... diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b3eaf3f..5c61b2e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -21,7 +21,7 @@ jobs: - name: Install dependencies run: | - go get ... + go get ./... - name: Run tests run: | diff --git a/cmd/auth/dockerfile b/cmd/auth/dockerfile index 9a59f75..90c29a6 100644 --- a/cmd/auth/dockerfile +++ b/cmd/auth/dockerfile @@ -1,4 +1,4 @@ -FROM arm64v8/golang:1.23.4-alpine as build +FROM arm64v8/golang:1.23.4-alpine AS build WORKDIR /app diff --git a/cmd/backend/dockerfile b/cmd/backend/dockerfile index 5ee8527..45bce00 100644 --- a/cmd/backend/dockerfile +++ b/cmd/backend/dockerfile @@ -1,4 +1,4 @@ -FROM arm64v8/golang:1.23.4-alpine as build +FROM arm64v8/golang:1.23.4-alpine AS build WORKDIR /app From bbddd08d247c76ff610b225ba8b98390a3e5c1b8 Mon Sep 17 00:00:00 2001 From: Vargha Csongor Date: Sun, 22 Dec 2024 22:22:05 +0100 Subject: [PATCH 10/11] fix path and add go get to docker --- .github/workflows/lint.yml | 2 +- cmd/auth/dockerfile | 2 ++ cmd/backend/dockerfile | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index c3e3925..d1c32ed 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -20,4 +20,4 @@ jobs: uses: golangci/golangci-lint-action@v4 with: version: latest - working-directory: ./... + working-directory: . diff --git a/cmd/auth/dockerfile b/cmd/auth/dockerfile index 90c29a6..4432ddb 100644 --- a/cmd/auth/dockerfile +++ b/cmd/auth/dockerfile @@ -4,6 +4,8 @@ WORKDIR /app COPY . . +RUN go get ./... + RUN GOOS=linux GOARCH=arm64 go build -o auth-service RUN apk update && apk add ca-certificates && update-ca-certificates diff --git a/cmd/backend/dockerfile b/cmd/backend/dockerfile index 45bce00..29ec584 100644 --- a/cmd/backend/dockerfile +++ b/cmd/backend/dockerfile @@ -4,6 +4,8 @@ WORKDIR /app COPY . . +RUN go get ./... + RUN GOOS=linux GOARCH=arm64 go build -o backend RUN apk update && apk add ca-certificates && update-ca-certificates From 42b88e14a7e5ca885a47fa3f84d0a2bac2b53330 Mon Sep 17 00:00:00 2001 From: Vargha Csongor Date: Sat, 28 Dec 2024 13:26:38 +0100 Subject: [PATCH 11/11] update images --- .github/workflows/auth-service-cd.yml | 2 +- .github/workflows/backend-cd.yml | 2 +- cmd/auth/dockerfile | 6 +++--- cmd/backend/dockerfile | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/auth-service-cd.yml b/.github/workflows/auth-service-cd.yml index 6b104a1..c862118 100644 --- a/.github/workflows/auth-service-cd.yml +++ b/.github/workflows/auth-service-cd.yml @@ -49,4 +49,4 @@ jobs: push: true context: "{{defaultContext}}:cmd/auth" tags: vcscsvcscs/gheritage-auth-service:${{steps.create_image_tag.outputs.result}} - platforms: linux/arm64 + platforms: linux/amd64, linux/arm64 diff --git a/.github/workflows/backend-cd.yml b/.github/workflows/backend-cd.yml index b625a72..8635e63 100644 --- a/.github/workflows/backend-cd.yml +++ b/.github/workflows/backend-cd.yml @@ -49,4 +49,4 @@ jobs: push: true context: "{{defaultContext}}:cmd/backend" tags: vcscsvcscs/gheritage-backend-service:${{steps.create_image_tag.outputs.result}} - platforms: linux/arm64 + platforms: linux/amd64, linux/arm64 diff --git a/cmd/auth/dockerfile b/cmd/auth/dockerfile index 4432ddb..9ea655f 100644 --- a/cmd/auth/dockerfile +++ b/cmd/auth/dockerfile @@ -1,4 +1,4 @@ -FROM arm64v8/golang:1.23.4-alpine AS build +FROM --platform=$BUILDPLATFORM golang:alpine AS build WORKDIR /app @@ -6,11 +6,11 @@ COPY . . RUN go get ./... -RUN GOOS=linux GOARCH=arm64 go build -o auth-service +RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -o auth-service RUN apk update && apk add ca-certificates && update-ca-certificates -FROM arm64v8/busybox:1.36.1 +FROM --platform=$TARGETPLATFORM busybox:1.36.1 COPY --from=build /etc/ssl/certs /etc/ssl/certs COPY --from=build /app/auth-service /app/ diff --git a/cmd/backend/dockerfile b/cmd/backend/dockerfile index 29ec584..a34b672 100644 --- a/cmd/backend/dockerfile +++ b/cmd/backend/dockerfile @@ -1,4 +1,4 @@ -FROM arm64v8/golang:1.23.4-alpine AS build +FROM --platform=$BUILDPLATFORM golang:alpine AS build WORKDIR /app @@ -6,11 +6,11 @@ COPY . . RUN go get ./... -RUN GOOS=linux GOARCH=arm64 go build -o backend +RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -o backend RUN apk update && apk add ca-certificates && update-ca-certificates -FROM arm64v8/busybox:1.36.1 +FROM --platform=$TARGETPLATFORM busybox:1.36.1 COPY --from=build /etc/ssl/certs /etc/ssl/certs COPY --from=build /app/backend /app/