Skip to content

Commit

Permalink
feat(redis): add message queue with User Info (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
wsalles authored Jan 13, 2022
1 parent 8aba2d0 commit bb728fb
Show file tree
Hide file tree
Showing 8 changed files with 189 additions and 32 deletions.
8 changes: 7 additions & 1 deletion cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import (
"github.com/ydataai/authentication-service/internal/handlers"
"github.com/ydataai/authentication-service/internal/services"
"github.com/ydataai/authentication-service/internal/storages"

coreClients "github.com/ydataai/go-core/pkg/common/clients"
"github.com/ydataai/go-core/pkg/common/config"
"github.com/ydataai/go-core/pkg/common/logging"
"github.com/ydataai/go-core/pkg/common/server"
Expand All @@ -26,13 +28,15 @@ func main() {
oidcClientConfiguration := configurations.OIDCClientConfiguration{}
oidcServiceConfiguration := configurations.OIDCServiceConfiguration{}
restConfiguration := configurations.RESTControllerConfiguration{}
redisConfiguration := coreClients.RedisConfiguration{}

if err := config.InitConfigurationVariables([]config.ConfigurationVariables{
&loggerConfiguration,
&serverConfiguration,
&oidcClientConfiguration,
&oidcServiceConfiguration,
&restConfiguration,
&redisConfiguration,
}); err != nil {
fmt.Println(fmt.Errorf("[✖️] Could not set configuration variables. Err: %v", err))
os.Exit(1)
Expand All @@ -47,7 +51,9 @@ func main() {
// Initializes a storage to save temporary sessions configured with TTL.
sessionStorage := storages.NewSessionStorage()

oidcService := services.NewOAuth2OIDCService(logger, oidcServiceConfiguration, oidcClient, sessionStorage)
redisClient := coreClients.NewRedisClient(redisConfiguration, logger)

oidcService := services.NewOAuth2OIDCService(logger, oidcServiceConfiguration, oidcClient, sessionStorage, redisClient)

// Gathering the Credentials Handler.
headerCredentials := handlers.NewHeaderCredentialsHandler(logger)
Expand Down
49 changes: 47 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,82 @@ module github.com/ydataai/authentication-service
go 1.17

require (
github.com/alicebob/miniredis/v2 v2.17.0
github.com/coreos/go-oidc/v3 v3.1.0
github.com/gin-gonic/gin v1.7.4
github.com/golang-jwt/jwt/v4 v4.2.0
github.com/kelseyhightower/envconfig v1.4.0
github.com/stretchr/testify v1.7.0
github.com/ydataai/go-core v0.4.0
github.com/ydataai/go-core v0.5.0
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8
)

require (
github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a // indirect
github.com/armon/go-metrics v0.3.9 // indirect
github.com/armon/go-radix v1.0.0 // indirect
github.com/cenkalti/backoff/v3 v3.0.0 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
github.com/fatih/color v1.7.0 // indirect
github.com/gin-contrib/sse v0.1.0 // indirect
github.com/go-playground/locales v0.13.0 // indirect
github.com/go-playground/universal-translator v0.17.0 // indirect
github.com/go-playground/validator/v10 v10.4.1 // indirect
github.com/go-redis/redis/v8 v8.11.4 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/uuid v1.1.2 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-cleanhttp v0.5.1 // indirect
github.com/hashicorp/go-hclog v0.16.2 // indirect
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/go-plugin v1.4.3 // indirect
github.com/hashicorp/go-retryablehttp v0.6.6 // indirect
github.com/hashicorp/go-rootcerts v1.0.2 // indirect
github.com/hashicorp/go-secure-stdlib/mlock v0.1.1 // indirect
github.com/hashicorp/go-secure-stdlib/parseutil v0.1.1 // indirect
github.com/hashicorp/go-secure-stdlib/strutil v0.1.1 // indirect
github.com/hashicorp/go-sockaddr v1.0.2 // indirect
github.com/hashicorp/go-uuid v1.0.2 // indirect
github.com/hashicorp/go-version v1.2.0 // indirect
github.com/hashicorp/golang-lru v0.5.4 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/hashicorp/vault/api v1.3.0 // indirect
github.com/hashicorp/vault/sdk v0.3.0 // indirect
github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb // indirect
github.com/json-iterator/go v1.1.11 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/leodido/go-urn v1.2.0 // indirect
github.com/mattn/go-colorable v0.1.6 // indirect
github.com/mattn/go-isatty v0.0.12 // indirect
github.com/mitchellh/copystructure v1.0.0 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/go-testing-interface v1.0.0 // indirect
github.com/mitchellh/mapstructure v1.4.2 // indirect
github.com/mitchellh/reflectwalk v1.0.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.1 // indirect
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect
github.com/oklog/run v1.0.0 // indirect
github.com/pierrec/lz4 v2.5.2+incompatible // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_golang v1.11.0 // indirect
github.com/prometheus/common v0.26.0 // indirect
github.com/ryanuber/go-glob v1.0.0 // indirect
github.com/sirupsen/logrus v1.8.1 // indirect
github.com/ugorji/go/codec v1.1.7 // indirect
github.com/yuin/gopher-lua v0.0.0-20200816102855-ee81675732da // indirect
go.uber.org/atomic v1.9.0 // indirect
golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97 // indirect
golang.org/x/net v0.0.0-20210520170846-37e1c6afe023 // indirect
golang.org/x/sys v0.0.0-20210817190340-bfb29a6856f2 // indirect
golang.org/x/text v0.3.6 // indirect
golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c // indirect
google.golang.org/grpc v1.41.0 // indirect
google.golang.org/protobuf v1.27.1 // indirect
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect
gopkg.in/square/go-jose.v2 v2.5.1 // indirect
Expand Down
Loading

0 comments on commit bb728fb

Please sign in to comment.