Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,19 @@ var (

func main() {
loggerConfiguration := logging.LoggerConfiguration{}
serverConfiguration := server.HTTPServerConfiguration{}
oidcClientConfiguration := configurations.OIDCClientConfiguration{}
oidcServiceConfiguration := configurations.OIDCServiceConfiguration{}
cookieCredentialsHandlerConfiguration := configurations.CookieCredentialsHandlerConfiguration{}
restConfiguration := configurations.RESTControllerConfiguration{}
serverConfiguration := server.HTTPServerConfiguration{}

if err := config.InitConfigurationVariables([]config.ConfigurationVariables{
&loggerConfiguration,
&serverConfiguration,
&oidcClientConfiguration,
&oidcServiceConfiguration,
&cookieCredentialsHandlerConfiguration,
&restConfiguration,
&serverConfiguration,
}); err != nil {
fmt.Println(fmt.Errorf("[✖️] Could not set configuration variables. Err: %v", err))
os.Exit(1)
Expand All @@ -52,11 +54,11 @@ func main() {

// Gathering the Credentials Handler.
headerCredentials := handlers.NewHeaderCredentialsHandler(logger)
cookieCredentials := handlers.NewCookieCredentialsHandler(logger)
cookieCredentials := handlers.NewCookieCredentialsHandler(logger, cookieCredentialsHandlerConfiguration)
// preference is chosen here.
credentials := []handlers.CredentialsHandler{
headerCredentials,
cookieCredentials,
credentials := map[string]handlers.CredentialsHandler{
"header": headerCredentials,
"cookie": cookieCredentials,
}

restController := controllers.NewRESTController(logger, restConfiguration, oidcService, credentials)
Expand Down
48 changes: 3 additions & 45 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,78 +4,36 @@ go 1.17

require (
github.com/coreos/go-oidc/v3 v3.1.0
github.com/gin-gonic/gin v1.7.4
github.com/gin-gonic/gin v1.7.7
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.7.3
github.com/ydataai/go-core v0.9.0
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8
)

require (
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
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