From 440ba9f5efa11802f27d1ad39db79581101398a9 Mon Sep 17 00:00:00 2001 From: Stefan Benz <46600784+stebenz@users.noreply.github.com> Date: Tue, 11 Apr 2023 09:39:12 +0200 Subject: [PATCH] fix: update saml to v0.0.11 (#5628) * fix: update saml to v0.0.11 * chore: remove unused sum --------- Co-authored-by: adlerhurst --- cmd/start/start.go | 4 ++-- go.mod | 2 +- go.sum | 4 ++-- internal/api/oidc/op.go | 2 +- internal/api/saml/provider.go | 4 +--- 5 files changed, 7 insertions(+), 9 deletions(-) diff --git a/cmd/start/start.go b/cmd/start/start.go index f01060bef..61d35540e 100644 --- a/cmd/start/start.go +++ b/cmd/start/start.go @@ -260,12 +260,12 @@ func startAPIs( } apis.RegisterHandler(openapi.HandlerPrefix, openAPIHandler) - oidcProvider, err := oidc.NewProvider(ctx, config.OIDC, login.DefaultLoggedOutPath, config.ExternalSecure, commands, queries, authRepo, keys.OIDC, keys.OIDCKey, eventstore, dbClient, userAgentInterceptor, instanceInterceptor.Handler, accessInterceptor.Handle) + oidcProvider, err := oidc.NewProvider(config.OIDC, login.DefaultLoggedOutPath, config.ExternalSecure, commands, queries, authRepo, keys.OIDC, keys.OIDCKey, eventstore, dbClient, userAgentInterceptor, instanceInterceptor.Handler, accessInterceptor.Handle) if err != nil { return fmt.Errorf("unable to start oidc provider: %w", err) } - samlProvider, err := saml.NewProvider(ctx, config.SAML, config.ExternalSecure, commands, queries, authRepo, keys.OIDC, keys.SAML, eventstore, dbClient, instanceInterceptor.Handler, userAgentInterceptor, accessInterceptor.Handle) + samlProvider, err := saml.NewProvider(config.SAML, config.ExternalSecure, commands, queries, authRepo, keys.OIDC, keys.SAML, eventstore, dbClient, instanceInterceptor.Handler, userAgentInterceptor, accessInterceptor.Handle) if err != nil { return fmt.Errorf("unable to start saml provider: %w", err) } diff --git a/go.mod b/go.mod index 7edde0655..eb61ce26e 100644 --- a/go.mod +++ b/go.mod @@ -58,7 +58,7 @@ require ( github.com/ttacon/libphonenumber v1.2.1 github.com/zitadel/logging v0.3.4 github.com/zitadel/oidc/v2 v2.2.6 - github.com/zitadel/saml v0.0.10 + github.com/zitadel/saml v0.0.11 go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.40.0 go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.40.0 go.opentelemetry.io/otel v1.14.0 diff --git a/go.sum b/go.sum index 201147346..4efcc17bb 100644 --- a/go.sum +++ b/go.sum @@ -1132,8 +1132,8 @@ github.com/zitadel/logging v0.3.4 h1:9hZsTjMMTE3X2LUi0xcF9Q9EdLo+FAezeu52ireBbHM github.com/zitadel/logging v0.3.4/go.mod h1:aPpLQhE+v6ocNK0TWrBrd363hZ95KcI17Q1ixAQwZF0= github.com/zitadel/oidc/v2 v2.2.6 h1:L2k5q1X8Rucax5Ynp3B3lz7JQDJxUwfWCOmgc9Bh0BM= github.com/zitadel/oidc/v2 v2.2.6/go.mod h1:tGkj9lQk6KVj5hsM89XPadvi6I06666sMy3KtykvSFM= -github.com/zitadel/saml v0.0.10 h1:cyKd78Vat9vz55S74lggJrXMSqbAPsnJDrPFTPScNYY= -github.com/zitadel/saml v0.0.10/go.mod h1:Hze1/zRN9j1uh7U+89vweP/OwLNO8BLHg3zU1Jtycdg= +github.com/zitadel/saml v0.0.11 h1:kObucnBrcu1PHCO7RGT0iVeuJL/5I50gUgr40S41nMs= +github.com/zitadel/saml v0.0.11/go.mod h1:YGWAvPZRv4DbEZ78Ht/2P0AWzGn+6WGhFf90PMXl0Po= github.com/ziutek/mymysql v1.5.4/go.mod h1:LMSpPZ6DbqWFxNCHW77HeMg9I646SAhApZ/wKdgO/C0= github.com/zmap/rc2 v0.0.0-20131011165748-24b9757f5521/go.mod h1:3YZ9o3WnatTIZhuOtot4IcUfzoKVjUHqu6WALIyI0nE= github.com/zmap/zcertificate v0.0.0-20180516150559-0e3d58b1bac4/go.mod h1:5iU54tB79AMBcySS0R2XIyZBAVmeHranShAFELYx7is= diff --git a/internal/api/oidc/op.go b/internal/api/oidc/op.go index c8d72a12e..48167f402 100644 --- a/internal/api/oidc/op.go +++ b/internal/api/oidc/op.go @@ -73,7 +73,7 @@ type OPStorage struct { assetAPIPrefix func(ctx context.Context) string } -func NewProvider(ctx context.Context, config Config, defaultLogoutRedirectURI string, externalSecure bool, command *command.Commands, query *query.Queries, repo repository.Repository, encryptionAlg crypto.EncryptionAlgorithm, cryptoKey []byte, es *eventstore.Eventstore, projections *database.DB, userAgentCookie, instanceHandler, accessHandler func(http.Handler) http.Handler) (op.OpenIDProvider, error) { +func NewProvider(config Config, defaultLogoutRedirectURI string, externalSecure bool, command *command.Commands, query *query.Queries, repo repository.Repository, encryptionAlg crypto.EncryptionAlgorithm, cryptoKey []byte, es *eventstore.Eventstore, projections *database.DB, userAgentCookie, instanceHandler, accessHandler func(http.Handler) http.Handler) (op.OpenIDProvider, error) { opConfig, err := createOPConfig(config, defaultLogoutRedirectURI, cryptoKey) if err != nil { return nil, caos_errs.ThrowInternal(err, "OIDC-EGrqd", "cannot create op config: %w") diff --git a/internal/api/saml/provider.go b/internal/api/saml/provider.go index 815884621..f46802f6a 100644 --- a/internal/api/saml/provider.go +++ b/internal/api/saml/provider.go @@ -1,7 +1,6 @@ package saml import ( - "context" "fmt" "net/http" @@ -29,7 +28,6 @@ type Config struct { } func NewProvider( - ctx context.Context, conf Config, externalSecure bool, command *command.Commands, @@ -68,13 +66,13 @@ func NewProvider( accessHandler, http_utils.CopyHeadersToContext, ), + provider.WithCustomTimeFormat("2006-01-02T15:04:05.999Z"), } if !externalSecure { options = append(options, provider.WithAllowInsecure()) } return provider.NewProvider( - ctx, provStorage, HandlerPrefix, conf.ProviderConfig,