Skip to content

Commit

Permalink
feat: encryption keys
Browse files Browse the repository at this point in the history
  • Loading branch information
gllm-dev committed Apr 4, 2024
1 parent e946e08 commit ffcbd73
Show file tree
Hide file tree
Showing 67 changed files with 1,151 additions and 964 deletions.
4 changes: 3 additions & 1 deletion cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@ import (
"log/slog"
"os"

"go.openfort.xyz/shield/pkg/logger"

"go.openfort.xyz/shield/cmd/cli"
)

func main() {
slog.Info("Starting OpenFort Shield")
rootCmd := cli.NewCmdRoot()
if err := rootCmd.Execute(); err != nil {
slog.Info("Error executing command", slog.String("error", err.Error()))
slog.Info("Error executing command", logger.Error(err))
os.Exit(1)
}
}
17 changes: 9 additions & 8 deletions di/wire.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ package di
import (
"github.com/google/wire"
"go.openfort.xyz/shield/internal/applications/projectapp"
"go.openfort.xyz/shield/internal/applications/userapp"
"go.openfort.xyz/shield/internal/applications/shareapp"
"go.openfort.xyz/shield/internal/core/ports/repositories"
"go.openfort.xyz/shield/internal/core/ports/services"
"go.openfort.xyz/shield/internal/core/services/projectsvc"
Expand Down Expand Up @@ -114,14 +114,12 @@ func ProvideProviderManager() (pm *providersmgr.Manager, err error) {
return
}

func ProvideUserApplication() (a *userapp.UserApplication, err error) {
func ProvideShareApplication() (a *shareapp.ShareApplication, err error) {
wire.Build(
userapp.New,
ProvideUserService,
shareapp.New,
ProvideShareService,
ProvideProjectService,
ProvideProviderService,
ProvideProviderManager,
ProvideSQLShareRepository,
ProvideSQLProjectRepository,
)

return
Expand All @@ -131,7 +129,10 @@ func ProvideProjectApplication() (a *projectapp.ProjectApplication, err error) {
wire.Build(
projectapp.New,
ProvideProjectService,
ProvideSQLProjectRepository,
ProvideProviderService,
ProvideSQLProviderRepository,
ProvideSQLShareRepository,
)

return
Expand All @@ -152,7 +153,7 @@ func ProvideRESTServer() (s *rest.Server, err error) {
wire.Build(
rest.New,
rest.GetConfigFromEnv,
ProvideUserApplication,
ProvideShareApplication,
ProvideProjectApplication,
ProvideAuthenticationManager,
)
Expand Down
36 changes: 20 additions & 16 deletions di/wire_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ require (
require (
filippo.io/edwards25519 v1.1.0 // indirect
github.com/MicahParks/jwkset v0.5.15 // indirect
github.com/benbjohnson/clock v1.3.5 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/go-sql-driver/mysql v1.8.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
Expand All @@ -38,6 +39,7 @@ require (
github.com/rogpeppe/go-internal v1.12.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/stretchr/objx v0.5.0 // indirect
go.uber.org/ratelimit v0.3.1 // indirect
golang.org/x/sync v0.6.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/time v0.5.0 // indirect
Expand Down
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ github.com/MicahParks/jwkset v0.5.15 h1:ACJY045Zuvo2TVWikeFLnKTIsEDQQHUHrNYiMW+g
github.com/MicahParks/jwkset v0.5.15/go.mod h1:q8ptTGn/Z9c4MwbcfeCDssADeVQb3Pk7PnVxrvi+2QY=
github.com/MicahParks/keyfunc/v3 v3.2.9 h1:juKYzZvb5q4mWnox3439WNq6cusvSdt2fJ5nj+osgCk=
github.com/MicahParks/keyfunc/v3 v3.2.9/go.mod h1:Yx3jN/pn7ZMCxwFsyIrsmSqRfp0HGHAcyezBlhYi1Ew=
github.com/benbjohnson/clock v1.3.5 h1:VvXlSJBzZpA/zum6Sj74hxwYI2DIxRWuNIoXAzHZz5o=
github.com/benbjohnson/clock v1.3.5/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA=
github.com/caarlos0/env/v10 v10.0.0 h1:yIHUBZGsyqCnpTkbjk8asUlx6RFhhEs+h7TOBdgdzXA=
github.com/caarlos0/env/v10 v10.0.0/go.mod h1:ZfulV76NvVPw3tm591U4SwL3Xx9ldzBP9aGxzeN7G18=
github.com/codahale/sss v0.0.0-20160501174526-0cb9f6d3f7f1 h1:PJJtqFbZH8ZW9PtsfB+ALZKVPRiRwNbPrNe+gliLpGo=
Expand Down Expand Up @@ -70,6 +72,8 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
go.uber.org/ratelimit v0.3.1 h1:K4qVE+byfv/B3tC+4nYWP7v/6SimcO7HzHekoMNBma0=
go.uber.org/ratelimit v0.3.1/go.mod h1:6euWsTB6U/Nb3X++xEUXA8ciPJvr19Q/0h1+oDcJhRk=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc=
Expand Down
Loading

0 comments on commit ffcbd73

Please sign in to comment.