From 70da13bb5ddee851347ce5b55f9c6699056b3479 Mon Sep 17 00:00:00 2001 From: Newman Chow Date: Wed, 28 Feb 2024 16:31:58 +0800 Subject: [PATCH] Redirect settings action to consent and update settings action response type #3813 --- .../webapp/settings_change_password.go | 11 +- pkg/auth/webapp/redirect.go | 41 +- pkg/auth/webapp/service2.go | 111 +- pkg/auth/wire_gen.go | 5302 ++++++----------- .../interaction/nodes/do_ensure_session.go | 16 - .../interaction/nodes/settings_action_end.go | 10 +- pkg/lib/oauth/handler/handler_authz.go | 89 +- .../oauth/handler/handler_authz_mock_test.go | 8 +- pkg/lib/oauth/metadata.go | 2 +- pkg/lib/oauth/oidc/ui.go | 6 + 10 files changed, 2047 insertions(+), 3549 deletions(-) diff --git a/pkg/auth/handler/webapp/settings_change_password.go b/pkg/auth/handler/webapp/settings_change_password.go index 83d6c75784a..99773365c65 100644 --- a/pkg/auth/handler/webapp/settings_change_password.go +++ b/pkg/auth/handler/webapp/settings_change_password.go @@ -30,11 +30,10 @@ func ConfigureSettingsChangePasswordRoute(route httproute.Route) httproute.Route } type SettingsChangePasswordHandler struct { - ControllerFactory ControllerFactory - BaseViewModel *viewmodels.BaseViewModeler - Renderer Renderer - PasswordPolicy PasswordPolicy - OAuthClientResolver WebappOAuthClientResolver + ControllerFactory ControllerFactory + BaseViewModel *viewmodels.BaseViewModeler + Renderer Renderer + PasswordPolicy PasswordPolicy } func (h *SettingsChangePasswordHandler) GetData(r *http.Request, rw http.ResponseWriter) (map[string]interface{}, error) { @@ -76,7 +75,7 @@ func (h *SettingsChangePasswordHandler) ServeHTTP(w http.ResponseWriter, r *http ctrl.PostAction("", func() error { userID := ctrl.RequireUserID() opts := webapp.SessionOptions{ - RedirectURI: webapp.DeriveSettingsRedirectURIFromRequest(r, h.OAuthClientResolver, "/settings"), + RedirectURI: ctrl.RedirectURI(), } intent := intents.NewIntentChangePrimaryPassword(userID) result, err := ctrl.EntryPointPost(opts, intent, func() (input interface{}, err error) { diff --git a/pkg/auth/webapp/redirect.go b/pkg/auth/webapp/redirect.go index 06c869ea398..d0a4dcd39ce 100644 --- a/pkg/auth/webapp/redirect.go +++ b/pkg/auth/webapp/redirect.go @@ -19,43 +19,6 @@ type OAuthClientResolver interface { ResolveClient(clientID string) *config.OAuthClientConfig } -func DeriveSettingsRedirectURIFromRequest(r *http.Request, clientResolver OAuthClientResolver, defaultURI string) string { - // 1. Redirect URL in query param (must be whitelisted) - // 2. Default redirect URL - // 3. `/settings` - redirectURIFromQuery := func() string { - clientID := r.URL.Query().Get("client_id") - redirectURI := r.URL.Query().Get("redirect_uri") - if clientID == "" { - return "" - } - client := clientResolver.ResolveClient(clientID) - if client == nil { - return "" - } - - allowed := true - // 1. Redirect URL in query param (must be whitelisted) - if allowed && redirectURI != "" { - return redirectURI - } - - return "" - }() - - if redirectURIFromQuery != "" { - return redirectURIFromQuery - } - - // 2. Default redirect URL - if defaultURI != "" { - return defaultURI - } - - // 3. `/settings` - return "/settings" -} - func DerivePostLoginRedirectURIFromRequest(r *http.Request, clientResolver OAuthClientResolver, uiConfig *config.UIConfig) string { // 1. Redirect URL in query param (must be whitelisted) // 2. Default redirect URL of the client @@ -72,8 +35,10 @@ func DerivePostLoginRedirectURIFromRequest(r *http.Request, clientResolver OAuth return "" } + allowedURIs := client.RedirectURIs allowed := false - for _, u := range client.RedirectURIs { + + for _, u := range allowedURIs { if u == redirectURI { allowed = true break diff --git a/pkg/auth/webapp/service2.go b/pkg/auth/webapp/service2.go index 3efe7c84788..2492e5a429e 100644 --- a/pkg/auth/webapp/service2.go +++ b/pkg/auth/webapp/service2.go @@ -15,22 +15,12 @@ import ( "github.com/authgear/authgear-server/pkg/lib/interaction" "github.com/authgear/authgear-server/pkg/lib/interaction/intents" "github.com/authgear/authgear-server/pkg/lib/interaction/nodes" - "github.com/authgear/authgear-server/pkg/lib/oauth" - "github.com/authgear/authgear-server/pkg/lib/oauth/handler" - "github.com/authgear/authgear-server/pkg/lib/oauth/oauthsession" - "github.com/authgear/authgear-server/pkg/lib/oauth/oidc" - "github.com/authgear/authgear-server/pkg/lib/oauth/protocol" - "github.com/authgear/authgear-server/pkg/lib/session" "github.com/authgear/authgear-server/pkg/util/log" "github.com/authgear/authgear-server/pkg/util/setutil" ) type UIInfoResolver interface { SetAuthenticationInfoInQuery(redirectURI string, e *authenticationinfo.Entry) string - ResolveForAuthorizationEndpoint( - client *config.OAuthClientConfig, - req protocol.AuthorizationRequest, - ) (*oidc.UIInfo, *oidc.UIInfoByProduct, error) } type SessionStore interface { @@ -59,22 +49,19 @@ func NewServiceLogger(lf *log.Factory) ServiceLogger { } type Service2 struct { - Logger ServiceLogger - Request *http.Request - Sessions SessionStore - SessionCookie SessionCookieDef - SignedUpCookie SignedUpCookieDef - MFADeviceTokenCookie mfa.CookieDef - ErrorCookie *ErrorCookie - Cookies CookieManager - OAuthConfig *config.OAuthConfig - UIConfig *config.UIConfig - TrustProxy config.TrustProxy - UIInfoResolver UIInfoResolver - OAuthClientResolver OAuthClientResolver - OAuthSessions oauthsession.StoreRedis - SettingsActionGrantService handler.SettingsActionGrantService - Authorizations handler.AuthorizationService + Logger ServiceLogger + Request *http.Request + Sessions SessionStore + SessionCookie SessionCookieDef + SignedUpCookie SignedUpCookieDef + MFADeviceTokenCookie mfa.CookieDef + ErrorCookie *ErrorCookie + Cookies CookieManager + OAuthConfig *config.OAuthConfig + UIConfig *config.UIConfig + TrustProxy config.TrustProxy + UIInfoResolver UIInfoResolver + OAuthClientResolver OAuthClientResolver Graph GraphService } @@ -551,16 +538,6 @@ func (s *Service2) afterPost( func (s *Service2) deriveFinishRedirectURI(session *Session, graph *interaction.Graph) (redirectURI string) { defer func() { if e, ok := graph.GetAuthenticationInfoEntry(); ok { - code, err := s.generateSettingsActionGrant(redirectURI, e) - if err != nil { - panic(err) - } - - if code != "" { - e = &authenticationinfo.Entry{ - ID: code, - } - } redirectURI = s.UIInfoResolver.SetAuthenticationInfoInQuery(redirectURI, e) } }() @@ -587,68 +564,6 @@ func (s *Service2) deriveFinishRedirectURI(session *Session, graph *interaction. return } -func (s *Service2) generateSettingsActionGrant(redirectURI string, e *authenticationinfo.Entry) (string, error) { - entry, err := s.OAuthSessions.Get(e.OAuthSessionID) - if err != nil { - return "", err - } - - req := entry.T.AuthorizationRequest - if req.ResponseType() != "settings_action" { - return "", nil - } - - result := entry.T.SettingsActionResult - if result == nil { - return "", nil - } - - client := s.OAuthClientResolver.ResolveClient(entry.T.AuthorizationRequest.ClientID()) - - // Assume prompt=none for settings action - _, uiInfoByProduct, err := s.UIInfoResolver.ResolveForAuthorizationEndpoint(client, req) - if err != nil { - return "", err - } - idTokenHintSID := uiInfoByProduct.IDTokenHintSID - - authenticationInfo := e.T - autoGrantAuthz := client.IsFirstParty() - var authz *oauth.Authorization - r := entry.T.AuthorizationRequest - if autoGrantAuthz { - authz, err = s.Authorizations.CheckAndGrant( - r.ClientID(), - authenticationInfo.UserID, - r.Scope(), - ) - } else { - authz, err = s.Authorizations.Check( - r.ClientID(), - authenticationInfo.UserID, - r.Scope(), - ) - } - if err != nil { - return "", err - } - - ss := session.GetSession(s.Request.Context()) - code, _, err := s.SettingsActionGrantService.CreateSettingsActionGrant(&handler.CreateSettingsActionGrantOptions{ - Authorization: authz, - IDPSessionID: ss.SessionID(), - AuthenticationInfo: authenticationInfo, - IDTokenHintSID: idTokenHintSID, - RedirectURI: req.RedirectURI(), - AuthorizationRequest: req, - }) - if err != nil { - return "", err - } - - return code, nil -} - func deriveSessionStepKind(graph *interaction.Graph) SessionStepKind { switch currentNode := graph.CurrentNode().(type) { case *nodes.NodeUseIdentityOAuthProvider: diff --git a/pkg/auth/wire_gen.go b/pkg/auth/wire_gen.go index 390df889923..215331c9660 100644 --- a/pkg/auth/wire_gen.go +++ b/pkg/auth/wire_gen.go @@ -7011,39 +7011,6 @@ func newWebAppLoginHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, ClientResolver: oauthclientResolver, } - oauthsessionStoreRedis := oauthsession.StoreRedis{ - Context: contextContext, - Redis: appredisHandle, - AppID: appID, - } - tokenGenerator := _wireTokenGeneratorValue - settingsActionGrantService := handler.SettingsActionGrantService{ - AppID: appID, - CodeGenerator: tokenGenerator, - Clock: clockClock, - SettingsActionGrants: redisStore, - } - authorizationStore := &pq.AuthorizationStore{ - SQLBuilder: sqlBuilderApp, - SQLExecutor: sqlExecutor, - } - offlineGrantService := oauth2.OfflineGrantService{ - OAuthConfig: oAuthConfig, - Clock: clockClock, - IDPSessions: idpsessionProvider, - ClientResolver: oauthclientResolver, - } - sessionManager := &oauth2.SessionManager{ - Store: redisStore, - Config: oAuthConfig, - Service: offlineGrantService, - } - authorizationService := &oauth2.AuthorizationService{ - AppID: appID, - Store: authorizationStore, - Clock: clockClock, - OAuthSessionManager: sessionManager, - } interactionLogger := interaction.NewLogger(factory) eventLogger := event.NewLogger(factory) sqlBuilder := appdb.NewSQLBuilder(databaseCredentials) @@ -7162,6 +7129,10 @@ func newWebAppLoginHandler(p *deps.RequestProvider) http.Handler { UserStore: store, Events: eventService, } + authorizationStore := &pq.AuthorizationStore{ + SQLBuilder: sqlBuilderApp, + SQLExecutor: sqlExecutor, + } cookieDef2 := session.NewSessionCookieDef(sessionConfig) idpsessionManager := &idpsession.Manager{ Store: idpsessionStoreRedis, @@ -7169,6 +7140,17 @@ func newWebAppLoginHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, CookieDef: cookieDef2, } + offlineGrantService := oauth2.OfflineGrantService{ + OAuthConfig: oAuthConfig, + Clock: clockClock, + IDPSessions: idpsessionProvider, + ClientResolver: oauthclientResolver, + } + sessionManager := &oauth2.SessionManager{ + Store: redisStore, + Config: oAuthConfig, + Service: offlineGrantService, + } accountDeletionConfig := appConfig.AccountDeletion accountAnonymizationConfig := appConfig.AccountAnonymization coordinator := &facade.Coordinator{ @@ -7307,7 +7289,7 @@ func newWebAppLoginHandler(p *deps.RequestProvider) http.Handler { AccessTokenSessions: sessionManager, Events: eventService, } - storeRedis2 := &oauthsession.StoreRedis{ + oauthsessionStoreRedis := &oauthsession.StoreRedis{ Context: contextContext, Redis: appredisHandle, AppID: appID, @@ -7346,7 +7328,7 @@ func newWebAppLoginHandler(p *deps.RequestProvider) http.Handler { Sessions: idpsessionProvider, SessionManager: manager2, SessionCookie: cookieDef2, - OAuthSessions: storeRedis2, + OAuthSessions: oauthsessionStoreRedis, MFADeviceTokenCookie: cookieDef, } interactionStoreRedis := &interaction.StoreRedis{ @@ -7359,23 +7341,20 @@ func newWebAppLoginHandler(p *deps.RequestProvider) http.Handler { Store: interactionStoreRedis, } webappService2 := &webapp2.Service2{ - Logger: serviceLogger, - Request: request, - Sessions: sessionStoreRedis, - SessionCookie: sessionCookieDef, - SignedUpCookie: signedUpCookieDef, - MFADeviceTokenCookie: cookieDef, - ErrorCookie: errorCookie, - Cookies: cookieManager, - OAuthConfig: oAuthConfig, - UIConfig: uiConfig, - TrustProxy: trustProxy, - UIInfoResolver: uiInfoResolver, - OAuthClientResolver: oauthclientResolver, - OAuthSessions: oauthsessionStoreRedis, - SettingsActionGrantService: settingsActionGrantService, - Authorizations: authorizationService, - Graph: interactionService, + Logger: serviceLogger, + Request: request, + Sessions: sessionStoreRedis, + SessionCookie: sessionCookieDef, + SignedUpCookie: signedUpCookieDef, + MFADeviceTokenCookie: cookieDef, + ErrorCookie: errorCookie, + Cookies: cookieManager, + OAuthConfig: oAuthConfig, + UIConfig: uiConfig, + TrustProxy: trustProxy, + UIInfoResolver: uiInfoResolver, + OAuthClientResolver: oauthclientResolver, + Graph: interactionService, } uiFeatureConfig := featureConfig.UI forgotPasswordConfig := appConfig.ForgotPassword @@ -7906,39 +7885,6 @@ func newWebAppSignupHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, ClientResolver: oauthclientResolver, } - oauthsessionStoreRedis := oauthsession.StoreRedis{ - Context: contextContext, - Redis: appredisHandle, - AppID: appID, - } - tokenGenerator := _wireTokenGeneratorValue - settingsActionGrantService := handler.SettingsActionGrantService{ - AppID: appID, - CodeGenerator: tokenGenerator, - Clock: clockClock, - SettingsActionGrants: redisStore, - } - authorizationStore := &pq.AuthorizationStore{ - SQLBuilder: sqlBuilderApp, - SQLExecutor: sqlExecutor, - } - offlineGrantService := oauth2.OfflineGrantService{ - OAuthConfig: oAuthConfig, - Clock: clockClock, - IDPSessions: idpsessionProvider, - ClientResolver: oauthclientResolver, - } - sessionManager := &oauth2.SessionManager{ - Store: redisStore, - Config: oAuthConfig, - Service: offlineGrantService, - } - authorizationService := &oauth2.AuthorizationService{ - AppID: appID, - Store: authorizationStore, - Clock: clockClock, - OAuthSessionManager: sessionManager, - } interactionLogger := interaction.NewLogger(factory) eventLogger := event.NewLogger(factory) sqlBuilder := appdb.NewSQLBuilder(databaseCredentials) @@ -8057,6 +8003,10 @@ func newWebAppSignupHandler(p *deps.RequestProvider) http.Handler { UserStore: store, Events: eventService, } + authorizationStore := &pq.AuthorizationStore{ + SQLBuilder: sqlBuilderApp, + SQLExecutor: sqlExecutor, + } cookieDef2 := session.NewSessionCookieDef(sessionConfig) idpsessionManager := &idpsession.Manager{ Store: idpsessionStoreRedis, @@ -8064,6 +8014,17 @@ func newWebAppSignupHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, CookieDef: cookieDef2, } + offlineGrantService := oauth2.OfflineGrantService{ + OAuthConfig: oAuthConfig, + Clock: clockClock, + IDPSessions: idpsessionProvider, + ClientResolver: oauthclientResolver, + } + sessionManager := &oauth2.SessionManager{ + Store: redisStore, + Config: oAuthConfig, + Service: offlineGrantService, + } accountDeletionConfig := appConfig.AccountDeletion accountAnonymizationConfig := appConfig.AccountAnonymization coordinator := &facade.Coordinator{ @@ -8202,7 +8163,7 @@ func newWebAppSignupHandler(p *deps.RequestProvider) http.Handler { AccessTokenSessions: sessionManager, Events: eventService, } - storeRedis2 := &oauthsession.StoreRedis{ + oauthsessionStoreRedis := &oauthsession.StoreRedis{ Context: contextContext, Redis: appredisHandle, AppID: appID, @@ -8241,7 +8202,7 @@ func newWebAppSignupHandler(p *deps.RequestProvider) http.Handler { Sessions: idpsessionProvider, SessionManager: manager2, SessionCookie: cookieDef2, - OAuthSessions: storeRedis2, + OAuthSessions: oauthsessionStoreRedis, MFADeviceTokenCookie: cookieDef, } interactionStoreRedis := &interaction.StoreRedis{ @@ -8254,23 +8215,20 @@ func newWebAppSignupHandler(p *deps.RequestProvider) http.Handler { Store: interactionStoreRedis, } webappService2 := &webapp2.Service2{ - Logger: serviceLogger, - Request: request, - Sessions: sessionStoreRedis, - SessionCookie: sessionCookieDef, - SignedUpCookie: signedUpCookieDef, - MFADeviceTokenCookie: cookieDef, - ErrorCookie: errorCookie, - Cookies: cookieManager, - OAuthConfig: oAuthConfig, - UIConfig: uiConfig, - TrustProxy: trustProxy, - UIInfoResolver: uiInfoResolver, - OAuthClientResolver: oauthclientResolver, - OAuthSessions: oauthsessionStoreRedis, - SettingsActionGrantService: settingsActionGrantService, - Authorizations: authorizationService, - Graph: interactionService, + Logger: serviceLogger, + Request: request, + Sessions: sessionStoreRedis, + SessionCookie: sessionCookieDef, + SignedUpCookie: signedUpCookieDef, + MFADeviceTokenCookie: cookieDef, + ErrorCookie: errorCookie, + Cookies: cookieManager, + OAuthConfig: oAuthConfig, + UIConfig: uiConfig, + TrustProxy: trustProxy, + UIInfoResolver: uiInfoResolver, + OAuthClientResolver: oauthclientResolver, + Graph: interactionService, } uiFeatureConfig := featureConfig.UI forgotPasswordConfig := appConfig.ForgotPassword @@ -8800,39 +8758,6 @@ func newWebAppPromoteHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, ClientResolver: oauthclientResolver, } - oauthsessionStoreRedis := oauthsession.StoreRedis{ - Context: contextContext, - Redis: appredisHandle, - AppID: appID, - } - tokenGenerator := _wireTokenGeneratorValue - settingsActionGrantService := handler.SettingsActionGrantService{ - AppID: appID, - CodeGenerator: tokenGenerator, - Clock: clockClock, - SettingsActionGrants: redisStore, - } - authorizationStore := &pq.AuthorizationStore{ - SQLBuilder: sqlBuilderApp, - SQLExecutor: sqlExecutor, - } - offlineGrantService := oauth2.OfflineGrantService{ - OAuthConfig: oAuthConfig, - Clock: clockClock, - IDPSessions: idpsessionProvider, - ClientResolver: oauthclientResolver, - } - sessionManager := &oauth2.SessionManager{ - Store: redisStore, - Config: oAuthConfig, - Service: offlineGrantService, - } - authorizationService := &oauth2.AuthorizationService{ - AppID: appID, - Store: authorizationStore, - Clock: clockClock, - OAuthSessionManager: sessionManager, - } interactionLogger := interaction.NewLogger(factory) eventLogger := event.NewLogger(factory) sqlBuilder := appdb.NewSQLBuilder(databaseCredentials) @@ -8951,6 +8876,10 @@ func newWebAppPromoteHandler(p *deps.RequestProvider) http.Handler { UserStore: store, Events: eventService, } + authorizationStore := &pq.AuthorizationStore{ + SQLBuilder: sqlBuilderApp, + SQLExecutor: sqlExecutor, + } cookieDef2 := session.NewSessionCookieDef(sessionConfig) idpsessionManager := &idpsession.Manager{ Store: idpsessionStoreRedis, @@ -8958,6 +8887,17 @@ func newWebAppPromoteHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, CookieDef: cookieDef2, } + offlineGrantService := oauth2.OfflineGrantService{ + OAuthConfig: oAuthConfig, + Clock: clockClock, + IDPSessions: idpsessionProvider, + ClientResolver: oauthclientResolver, + } + sessionManager := &oauth2.SessionManager{ + Store: redisStore, + Config: oAuthConfig, + Service: offlineGrantService, + } accountDeletionConfig := appConfig.AccountDeletion accountAnonymizationConfig := appConfig.AccountAnonymization coordinator := &facade.Coordinator{ @@ -9096,7 +9036,7 @@ func newWebAppPromoteHandler(p *deps.RequestProvider) http.Handler { AccessTokenSessions: sessionManager, Events: eventService, } - storeRedis2 := &oauthsession.StoreRedis{ + oauthsessionStoreRedis := &oauthsession.StoreRedis{ Context: contextContext, Redis: appredisHandle, AppID: appID, @@ -9135,7 +9075,7 @@ func newWebAppPromoteHandler(p *deps.RequestProvider) http.Handler { Sessions: idpsessionProvider, SessionManager: manager2, SessionCookie: cookieDef2, - OAuthSessions: storeRedis2, + OAuthSessions: oauthsessionStoreRedis, MFADeviceTokenCookie: cookieDef, } interactionStoreRedis := &interaction.StoreRedis{ @@ -9148,23 +9088,20 @@ func newWebAppPromoteHandler(p *deps.RequestProvider) http.Handler { Store: interactionStoreRedis, } webappService2 := &webapp2.Service2{ - Logger: serviceLogger, - Request: request, - Sessions: sessionStoreRedis, - SessionCookie: sessionCookieDef, - SignedUpCookie: signedUpCookieDef, - MFADeviceTokenCookie: cookieDef, - ErrorCookie: errorCookie, - Cookies: cookieManager, - OAuthConfig: oAuthConfig, - UIConfig: uiConfig, - TrustProxy: trustProxy, - UIInfoResolver: uiInfoResolver, - OAuthClientResolver: oauthclientResolver, - OAuthSessions: oauthsessionStoreRedis, - SettingsActionGrantService: settingsActionGrantService, - Authorizations: authorizationService, - Graph: interactionService, + Logger: serviceLogger, + Request: request, + Sessions: sessionStoreRedis, + SessionCookie: sessionCookieDef, + SignedUpCookie: signedUpCookieDef, + MFADeviceTokenCookie: cookieDef, + ErrorCookie: errorCookie, + Cookies: cookieManager, + OAuthConfig: oAuthConfig, + UIConfig: uiConfig, + TrustProxy: trustProxy, + UIInfoResolver: uiInfoResolver, + OAuthClientResolver: oauthclientResolver, + Graph: interactionService, } uiFeatureConfig := featureConfig.UI forgotPasswordConfig := appConfig.ForgotPassword @@ -9682,39 +9619,6 @@ func newWebAppSelectAccountHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, ClientResolver: oauthclientResolver, } - oauthsessionStoreRedis := oauthsession.StoreRedis{ - Context: contextContext, - Redis: appredisHandle, - AppID: appID, - } - tokenGenerator := _wireTokenGeneratorValue - settingsActionGrantService := handler.SettingsActionGrantService{ - AppID: appID, - CodeGenerator: tokenGenerator, - Clock: clockClock, - SettingsActionGrants: redisStore, - } - authorizationStore := &pq.AuthorizationStore{ - SQLBuilder: sqlBuilderApp, - SQLExecutor: sqlExecutor, - } - offlineGrantService := oauth2.OfflineGrantService{ - OAuthConfig: oAuthConfig, - Clock: clockClock, - IDPSessions: idpsessionProvider, - ClientResolver: oauthclientResolver, - } - sessionManager := &oauth2.SessionManager{ - Store: redisStore, - Config: oAuthConfig, - Service: offlineGrantService, - } - authorizationService := &oauth2.AuthorizationService{ - AppID: appID, - Store: authorizationStore, - Clock: clockClock, - OAuthSessionManager: sessionManager, - } interactionLogger := interaction.NewLogger(factory) eventLogger := event.NewLogger(factory) sqlBuilder := appdb.NewSQLBuilder(databaseCredentials) @@ -9833,6 +9737,10 @@ func newWebAppSelectAccountHandler(p *deps.RequestProvider) http.Handler { UserStore: store, Events: eventService, } + authorizationStore := &pq.AuthorizationStore{ + SQLBuilder: sqlBuilderApp, + SQLExecutor: sqlExecutor, + } cookieDef2 := session.NewSessionCookieDef(sessionConfig) idpsessionManager := &idpsession.Manager{ Store: idpsessionStoreRedis, @@ -9840,6 +9748,17 @@ func newWebAppSelectAccountHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, CookieDef: cookieDef2, } + offlineGrantService := oauth2.OfflineGrantService{ + OAuthConfig: oAuthConfig, + Clock: clockClock, + IDPSessions: idpsessionProvider, + ClientResolver: oauthclientResolver, + } + sessionManager := &oauth2.SessionManager{ + Store: redisStore, + Config: oAuthConfig, + Service: offlineGrantService, + } accountDeletionConfig := appConfig.AccountDeletion accountAnonymizationConfig := appConfig.AccountAnonymization coordinator := &facade.Coordinator{ @@ -9978,7 +9897,7 @@ func newWebAppSelectAccountHandler(p *deps.RequestProvider) http.Handler { AccessTokenSessions: sessionManager, Events: eventService, } - storeRedis2 := &oauthsession.StoreRedis{ + oauthsessionStoreRedis := &oauthsession.StoreRedis{ Context: contextContext, Redis: appredisHandle, AppID: appID, @@ -10017,7 +9936,7 @@ func newWebAppSelectAccountHandler(p *deps.RequestProvider) http.Handler { Sessions: idpsessionProvider, SessionManager: manager2, SessionCookie: cookieDef2, - OAuthSessions: storeRedis2, + OAuthSessions: oauthsessionStoreRedis, MFADeviceTokenCookie: cookieDef, } interactionStoreRedis := &interaction.StoreRedis{ @@ -10030,23 +9949,20 @@ func newWebAppSelectAccountHandler(p *deps.RequestProvider) http.Handler { Store: interactionStoreRedis, } webappService2 := &webapp2.Service2{ - Logger: serviceLogger, - Request: request, - Sessions: sessionStoreRedis, - SessionCookie: sessionCookieDef, - SignedUpCookie: signedUpCookieDef, - MFADeviceTokenCookie: cookieDef, - ErrorCookie: errorCookie, - Cookies: cookieManager, - OAuthConfig: oAuthConfig, - UIConfig: uiConfig, - TrustProxy: trustProxy, - UIInfoResolver: uiInfoResolver, - OAuthClientResolver: oauthclientResolver, - OAuthSessions: oauthsessionStoreRedis, - SettingsActionGrantService: settingsActionGrantService, - Authorizations: authorizationService, - Graph: interactionService, + Logger: serviceLogger, + Request: request, + Sessions: sessionStoreRedis, + SessionCookie: sessionCookieDef, + SignedUpCookie: signedUpCookieDef, + MFADeviceTokenCookie: cookieDef, + ErrorCookie: errorCookie, + Cookies: cookieManager, + OAuthConfig: oAuthConfig, + UIConfig: uiConfig, + TrustProxy: trustProxy, + UIInfoResolver: uiInfoResolver, + OAuthClientResolver: oauthclientResolver, + Graph: interactionService, } uiFeatureConfig := featureConfig.UI forgotPasswordConfig := appConfig.ForgotPassword @@ -10559,39 +10475,6 @@ func newWebAppAuthflowV2SelectAccountHandler(p *deps.RequestProvider) http.Handl Cookies: cookieManager, ClientResolver: oauthclientResolver, } - oauthsessionStoreRedis := oauthsession.StoreRedis{ - Context: contextContext, - Redis: appredisHandle, - AppID: appID, - } - tokenGenerator := _wireTokenGeneratorValue - settingsActionGrantService := handler.SettingsActionGrantService{ - AppID: appID, - CodeGenerator: tokenGenerator, - Clock: clockClock, - SettingsActionGrants: redisStore, - } - authorizationStore := &pq.AuthorizationStore{ - SQLBuilder: sqlBuilderApp, - SQLExecutor: sqlExecutor, - } - offlineGrantService := oauth2.OfflineGrantService{ - OAuthConfig: oAuthConfig, - Clock: clockClock, - IDPSessions: idpsessionProvider, - ClientResolver: oauthclientResolver, - } - sessionManager := &oauth2.SessionManager{ - Store: redisStore, - Config: oAuthConfig, - Service: offlineGrantService, - } - authorizationService := &oauth2.AuthorizationService{ - AppID: appID, - Store: authorizationStore, - Clock: clockClock, - OAuthSessionManager: sessionManager, - } interactionLogger := interaction.NewLogger(factory) eventLogger := event.NewLogger(factory) sqlBuilder := appdb.NewSQLBuilder(databaseCredentials) @@ -10710,6 +10593,10 @@ func newWebAppAuthflowV2SelectAccountHandler(p *deps.RequestProvider) http.Handl UserStore: store, Events: eventService, } + authorizationStore := &pq.AuthorizationStore{ + SQLBuilder: sqlBuilderApp, + SQLExecutor: sqlExecutor, + } cookieDef2 := session.NewSessionCookieDef(sessionConfig) idpsessionManager := &idpsession.Manager{ Store: idpsessionStoreRedis, @@ -10717,6 +10604,17 @@ func newWebAppAuthflowV2SelectAccountHandler(p *deps.RequestProvider) http.Handl Cookies: cookieManager, CookieDef: cookieDef2, } + offlineGrantService := oauth2.OfflineGrantService{ + OAuthConfig: oAuthConfig, + Clock: clockClock, + IDPSessions: idpsessionProvider, + ClientResolver: oauthclientResolver, + } + sessionManager := &oauth2.SessionManager{ + Store: redisStore, + Config: oAuthConfig, + Service: offlineGrantService, + } accountDeletionConfig := appConfig.AccountDeletion accountAnonymizationConfig := appConfig.AccountAnonymization coordinator := &facade.Coordinator{ @@ -10855,7 +10753,7 @@ func newWebAppAuthflowV2SelectAccountHandler(p *deps.RequestProvider) http.Handl AccessTokenSessions: sessionManager, Events: eventService, } - storeRedis2 := &oauthsession.StoreRedis{ + oauthsessionStoreRedis := &oauthsession.StoreRedis{ Context: contextContext, Redis: appredisHandle, AppID: appID, @@ -10894,7 +10792,7 @@ func newWebAppAuthflowV2SelectAccountHandler(p *deps.RequestProvider) http.Handl Sessions: idpsessionProvider, SessionManager: manager2, SessionCookie: cookieDef2, - OAuthSessions: storeRedis2, + OAuthSessions: oauthsessionStoreRedis, MFADeviceTokenCookie: cookieDef, } interactionStoreRedis := &interaction.StoreRedis{ @@ -10907,23 +10805,20 @@ func newWebAppAuthflowV2SelectAccountHandler(p *deps.RequestProvider) http.Handl Store: interactionStoreRedis, } webappService2 := &webapp2.Service2{ - Logger: serviceLogger, - Request: request, - Sessions: sessionStoreRedis, - SessionCookie: sessionCookieDef, - SignedUpCookie: signedUpCookieDef, - MFADeviceTokenCookie: cookieDef, - ErrorCookie: errorCookie, - Cookies: cookieManager, - OAuthConfig: oAuthConfig, - UIConfig: uiConfig, - TrustProxy: trustProxy, - UIInfoResolver: uiInfoResolver, - OAuthClientResolver: oauthclientResolver, - OAuthSessions: oauthsessionStoreRedis, - SettingsActionGrantService: settingsActionGrantService, - Authorizations: authorizationService, - Graph: interactionService, + Logger: serviceLogger, + Request: request, + Sessions: sessionStoreRedis, + SessionCookie: sessionCookieDef, + SignedUpCookie: signedUpCookieDef, + MFADeviceTokenCookie: cookieDef, + ErrorCookie: errorCookie, + Cookies: cookieManager, + OAuthConfig: oAuthConfig, + UIConfig: uiConfig, + TrustProxy: trustProxy, + UIInfoResolver: uiInfoResolver, + OAuthClientResolver: oauthclientResolver, + Graph: interactionService, } uiFeatureConfig := featureConfig.UI forgotPasswordConfig := appConfig.ForgotPassword @@ -11840,24 +11735,6 @@ func newWebAppSSOCallbackHandler(p *deps.RequestProvider) http.Handler { Navigator: authflowNavigator, } webappServiceLogger := webapp2.NewServiceLogger(factory) - storeRedis2 := oauthsession.StoreRedis{ - Context: contextContext, - Redis: handle, - AppID: appID, - } - tokenGenerator := _wireTokenGeneratorValue - settingsActionGrantService := handler.SettingsActionGrantService{ - AppID: appID, - CodeGenerator: tokenGenerator, - Clock: clockClock, - SettingsActionGrants: redisStore, - } - authorizationService := &oauth2.AuthorizationService{ - AppID: appID, - Store: authorizationStore, - Clock: clockClock, - OAuthSessionManager: sessionManager, - } interactionLogger := interaction.NewLogger(factory) responseWriter := p.ResponseWriter nonceService := &nonce.Service{ @@ -11912,23 +11789,20 @@ func newWebAppSSOCallbackHandler(p *deps.RequestProvider) http.Handler { Store: interactionStoreRedis, } webappService2 := &webapp2.Service2{ - Logger: webappServiceLogger, - Request: request, - Sessions: sessionStoreRedis, - SessionCookie: sessionCookieDef, - SignedUpCookie: signedUpCookieDef, - MFADeviceTokenCookie: mfaCookieDef, - ErrorCookie: errorCookie, - Cookies: cookieManager, - OAuthConfig: oAuthConfig, - UIConfig: uiConfig, - TrustProxy: trustProxy, - UIInfoResolver: uiInfoResolver, - OAuthClientResolver: oauthclientResolver, - OAuthSessions: storeRedis2, - SettingsActionGrantService: settingsActionGrantService, - Authorizations: authorizationService, - Graph: interactionService, + Logger: webappServiceLogger, + Request: request, + Sessions: sessionStoreRedis, + SessionCookie: sessionCookieDef, + SignedUpCookie: signedUpCookieDef, + MFADeviceTokenCookie: mfaCookieDef, + ErrorCookie: errorCookie, + Cookies: cookieManager, + OAuthConfig: oAuthConfig, + UIConfig: uiConfig, + TrustProxy: trustProxy, + UIInfoResolver: uiInfoResolver, + OAuthClientResolver: oauthclientResolver, + Graph: interactionService, } uiFeatureConfig := featureConfig.UI forgotPasswordConfig := appConfig.ForgotPassword @@ -12430,39 +12304,6 @@ func newWechatAuthHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, ClientResolver: oauthclientResolver, } - oauthsessionStoreRedis := oauthsession.StoreRedis{ - Context: contextContext, - Redis: appredisHandle, - AppID: appID, - } - tokenGenerator := _wireTokenGeneratorValue - settingsActionGrantService := handler.SettingsActionGrantService{ - AppID: appID, - CodeGenerator: tokenGenerator, - Clock: clockClock, - SettingsActionGrants: redisStore, - } - authorizationStore := &pq.AuthorizationStore{ - SQLBuilder: sqlBuilderApp, - SQLExecutor: sqlExecutor, - } - offlineGrantService := oauth2.OfflineGrantService{ - OAuthConfig: oAuthConfig, - Clock: clockClock, - IDPSessions: idpsessionProvider, - ClientResolver: oauthclientResolver, - } - sessionManager := &oauth2.SessionManager{ - Store: redisStore, - Config: oAuthConfig, - Service: offlineGrantService, - } - authorizationService := &oauth2.AuthorizationService{ - AppID: appID, - Store: authorizationStore, - Clock: clockClock, - OAuthSessionManager: sessionManager, - } interactionLogger := interaction.NewLogger(factory) eventLogger := event.NewLogger(factory) sqlBuilder := appdb.NewSQLBuilder(databaseCredentials) @@ -12581,6 +12422,10 @@ func newWechatAuthHandler(p *deps.RequestProvider) http.Handler { UserStore: store, Events: eventService, } + authorizationStore := &pq.AuthorizationStore{ + SQLBuilder: sqlBuilderApp, + SQLExecutor: sqlExecutor, + } cookieDef2 := session.NewSessionCookieDef(sessionConfig) idpsessionManager := &idpsession.Manager{ Store: idpsessionStoreRedis, @@ -12588,6 +12433,17 @@ func newWechatAuthHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, CookieDef: cookieDef2, } + offlineGrantService := oauth2.OfflineGrantService{ + OAuthConfig: oAuthConfig, + Clock: clockClock, + IDPSessions: idpsessionProvider, + ClientResolver: oauthclientResolver, + } + sessionManager := &oauth2.SessionManager{ + Store: redisStore, + Config: oAuthConfig, + Service: offlineGrantService, + } accountDeletionConfig := appConfig.AccountDeletion accountAnonymizationConfig := appConfig.AccountAnonymization coordinator := &facade.Coordinator{ @@ -12726,7 +12582,7 @@ func newWechatAuthHandler(p *deps.RequestProvider) http.Handler { AccessTokenSessions: sessionManager, Events: eventService, } - storeRedis2 := &oauthsession.StoreRedis{ + oauthsessionStoreRedis := &oauthsession.StoreRedis{ Context: contextContext, Redis: appredisHandle, AppID: appID, @@ -12765,7 +12621,7 @@ func newWechatAuthHandler(p *deps.RequestProvider) http.Handler { Sessions: idpsessionProvider, SessionManager: manager2, SessionCookie: cookieDef2, - OAuthSessions: storeRedis2, + OAuthSessions: oauthsessionStoreRedis, MFADeviceTokenCookie: cookieDef, } interactionStoreRedis := &interaction.StoreRedis{ @@ -12778,23 +12634,20 @@ func newWechatAuthHandler(p *deps.RequestProvider) http.Handler { Store: interactionStoreRedis, } webappService2 := &webapp2.Service2{ - Logger: serviceLogger, - Request: request, - Sessions: sessionStoreRedis, - SessionCookie: sessionCookieDef, - SignedUpCookie: signedUpCookieDef, - MFADeviceTokenCookie: cookieDef, - ErrorCookie: errorCookie, - Cookies: cookieManager, - OAuthConfig: oAuthConfig, - UIConfig: uiConfig, - TrustProxy: trustProxy, - UIInfoResolver: uiInfoResolver, - OAuthClientResolver: oauthclientResolver, - OAuthSessions: oauthsessionStoreRedis, - SettingsActionGrantService: settingsActionGrantService, - Authorizations: authorizationService, - Graph: interactionService, + Logger: serviceLogger, + Request: request, + Sessions: sessionStoreRedis, + SessionCookie: sessionCookieDef, + SignedUpCookie: signedUpCookieDef, + MFADeviceTokenCookie: cookieDef, + ErrorCookie: errorCookie, + Cookies: cookieManager, + OAuthConfig: oAuthConfig, + UIConfig: uiConfig, + TrustProxy: trustProxy, + UIInfoResolver: uiInfoResolver, + OAuthClientResolver: oauthclientResolver, + Graph: interactionService, } uiFeatureConfig := featureConfig.UI forgotPasswordConfig := appConfig.ForgotPassword @@ -13297,39 +13150,6 @@ func newWechatCallbackHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, ClientResolver: oauthclientResolver, } - oauthsessionStoreRedis := oauthsession.StoreRedis{ - Context: contextContext, - Redis: appredisHandle, - AppID: appID, - } - tokenGenerator := _wireTokenGeneratorValue - settingsActionGrantService := handler.SettingsActionGrantService{ - AppID: appID, - CodeGenerator: tokenGenerator, - Clock: clockClock, - SettingsActionGrants: redisStore, - } - authorizationStore := &pq.AuthorizationStore{ - SQLBuilder: sqlBuilderApp, - SQLExecutor: sqlExecutor, - } - offlineGrantService := oauth2.OfflineGrantService{ - OAuthConfig: oAuthConfig, - Clock: clockClock, - IDPSessions: idpsessionProvider, - ClientResolver: oauthclientResolver, - } - sessionManager := &oauth2.SessionManager{ - Store: redisStore, - Config: oAuthConfig, - Service: offlineGrantService, - } - authorizationService := &oauth2.AuthorizationService{ - AppID: appID, - Store: authorizationStore, - Clock: clockClock, - OAuthSessionManager: sessionManager, - } interactionLogger := interaction.NewLogger(factory) eventLogger := event.NewLogger(factory) sqlBuilder := appdb.NewSQLBuilder(databaseCredentials) @@ -13448,6 +13268,10 @@ func newWechatCallbackHandler(p *deps.RequestProvider) http.Handler { UserStore: store, Events: eventService, } + authorizationStore := &pq.AuthorizationStore{ + SQLBuilder: sqlBuilderApp, + SQLExecutor: sqlExecutor, + } cookieDef2 := session.NewSessionCookieDef(sessionConfig) idpsessionManager := &idpsession.Manager{ Store: idpsessionStoreRedis, @@ -13455,6 +13279,17 @@ func newWechatCallbackHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, CookieDef: cookieDef2, } + offlineGrantService := oauth2.OfflineGrantService{ + OAuthConfig: oAuthConfig, + Clock: clockClock, + IDPSessions: idpsessionProvider, + ClientResolver: oauthclientResolver, + } + sessionManager := &oauth2.SessionManager{ + Store: redisStore, + Config: oAuthConfig, + Service: offlineGrantService, + } accountDeletionConfig := appConfig.AccountDeletion accountAnonymizationConfig := appConfig.AccountAnonymization coordinator := &facade.Coordinator{ @@ -13593,7 +13428,7 @@ func newWechatCallbackHandler(p *deps.RequestProvider) http.Handler { AccessTokenSessions: sessionManager, Events: eventService, } - storeRedis2 := &oauthsession.StoreRedis{ + oauthsessionStoreRedis := &oauthsession.StoreRedis{ Context: contextContext, Redis: appredisHandle, AppID: appID, @@ -13632,7 +13467,7 @@ func newWechatCallbackHandler(p *deps.RequestProvider) http.Handler { Sessions: idpsessionProvider, SessionManager: manager2, SessionCookie: cookieDef2, - OAuthSessions: storeRedis2, + OAuthSessions: oauthsessionStoreRedis, MFADeviceTokenCookie: cookieDef, } interactionStoreRedis := &interaction.StoreRedis{ @@ -13645,23 +13480,20 @@ func newWechatCallbackHandler(p *deps.RequestProvider) http.Handler { Store: interactionStoreRedis, } webappService2 := &webapp2.Service2{ - Logger: serviceLogger, - Request: request, - Sessions: sessionStoreRedis, - SessionCookie: sessionCookieDef, - SignedUpCookie: signedUpCookieDef, - MFADeviceTokenCookie: cookieDef, - ErrorCookie: errorCookie, - Cookies: cookieManager, - OAuthConfig: oAuthConfig, - UIConfig: uiConfig, - TrustProxy: trustProxy, - UIInfoResolver: uiInfoResolver, - OAuthClientResolver: oauthclientResolver, - OAuthSessions: oauthsessionStoreRedis, - SettingsActionGrantService: settingsActionGrantService, - Authorizations: authorizationService, - Graph: interactionService, + Logger: serviceLogger, + Request: request, + Sessions: sessionStoreRedis, + SessionCookie: sessionCookieDef, + SignedUpCookie: signedUpCookieDef, + MFADeviceTokenCookie: cookieDef, + ErrorCookie: errorCookie, + Cookies: cookieManager, + OAuthConfig: oAuthConfig, + UIConfig: uiConfig, + TrustProxy: trustProxy, + UIInfoResolver: uiInfoResolver, + OAuthClientResolver: oauthclientResolver, + Graph: interactionService, } uiFeatureConfig := featureConfig.UI forgotPasswordConfig := appConfig.ForgotPassword @@ -14168,39 +14000,6 @@ func newWebAppEnterLoginIDHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, ClientResolver: oauthclientResolver, } - oauthsessionStoreRedis := oauthsession.StoreRedis{ - Context: contextContext, - Redis: appredisHandle, - AppID: appID, - } - tokenGenerator := _wireTokenGeneratorValue - settingsActionGrantService := handler.SettingsActionGrantService{ - AppID: appID, - CodeGenerator: tokenGenerator, - Clock: clockClock, - SettingsActionGrants: redisStore, - } - authorizationStore := &pq.AuthorizationStore{ - SQLBuilder: sqlBuilderApp, - SQLExecutor: sqlExecutor, - } - offlineGrantService := oauth2.OfflineGrantService{ - OAuthConfig: oAuthConfig, - Clock: clockClock, - IDPSessions: idpsessionProvider, - ClientResolver: oauthclientResolver, - } - sessionManager := &oauth2.SessionManager{ - Store: redisStore, - Config: oAuthConfig, - Service: offlineGrantService, - } - authorizationService := &oauth2.AuthorizationService{ - AppID: appID, - Store: authorizationStore, - Clock: clockClock, - OAuthSessionManager: sessionManager, - } interactionLogger := interaction.NewLogger(factory) eventLogger := event.NewLogger(factory) sqlBuilder := appdb.NewSQLBuilder(databaseCredentials) @@ -14319,6 +14118,10 @@ func newWebAppEnterLoginIDHandler(p *deps.RequestProvider) http.Handler { UserStore: store, Events: eventService, } + authorizationStore := &pq.AuthorizationStore{ + SQLBuilder: sqlBuilderApp, + SQLExecutor: sqlExecutor, + } cookieDef2 := session.NewSessionCookieDef(sessionConfig) idpsessionManager := &idpsession.Manager{ Store: idpsessionStoreRedis, @@ -14326,6 +14129,17 @@ func newWebAppEnterLoginIDHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, CookieDef: cookieDef2, } + offlineGrantService := oauth2.OfflineGrantService{ + OAuthConfig: oAuthConfig, + Clock: clockClock, + IDPSessions: idpsessionProvider, + ClientResolver: oauthclientResolver, + } + sessionManager := &oauth2.SessionManager{ + Store: redisStore, + Config: oAuthConfig, + Service: offlineGrantService, + } accountDeletionConfig := appConfig.AccountDeletion accountAnonymizationConfig := appConfig.AccountAnonymization coordinator := &facade.Coordinator{ @@ -14464,7 +14278,7 @@ func newWebAppEnterLoginIDHandler(p *deps.RequestProvider) http.Handler { AccessTokenSessions: sessionManager, Events: eventService, } - storeRedis2 := &oauthsession.StoreRedis{ + oauthsessionStoreRedis := &oauthsession.StoreRedis{ Context: contextContext, Redis: appredisHandle, AppID: appID, @@ -14503,7 +14317,7 @@ func newWebAppEnterLoginIDHandler(p *deps.RequestProvider) http.Handler { Sessions: idpsessionProvider, SessionManager: manager2, SessionCookie: cookieDef2, - OAuthSessions: storeRedis2, + OAuthSessions: oauthsessionStoreRedis, MFADeviceTokenCookie: cookieDef, } interactionStoreRedis := &interaction.StoreRedis{ @@ -14516,23 +14330,20 @@ func newWebAppEnterLoginIDHandler(p *deps.RequestProvider) http.Handler { Store: interactionStoreRedis, } webappService2 := &webapp2.Service2{ - Logger: serviceLogger, - Request: request, - Sessions: sessionStoreRedis, - SessionCookie: sessionCookieDef, - SignedUpCookie: signedUpCookieDef, - MFADeviceTokenCookie: cookieDef, - ErrorCookie: errorCookie, - Cookies: cookieManager, - OAuthConfig: oAuthConfig, - UIConfig: uiConfig, - TrustProxy: trustProxy, - UIInfoResolver: uiInfoResolver, - OAuthClientResolver: oauthclientResolver, - OAuthSessions: oauthsessionStoreRedis, - SettingsActionGrantService: settingsActionGrantService, - Authorizations: authorizationService, - Graph: interactionService, + Logger: serviceLogger, + Request: request, + Sessions: sessionStoreRedis, + SessionCookie: sessionCookieDef, + SignedUpCookie: signedUpCookieDef, + MFADeviceTokenCookie: cookieDef, + ErrorCookie: errorCookie, + Cookies: cookieManager, + OAuthConfig: oAuthConfig, + UIConfig: uiConfig, + TrustProxy: trustProxy, + UIInfoResolver: uiInfoResolver, + OAuthClientResolver: oauthclientResolver, + Graph: interactionService, } uiFeatureConfig := featureConfig.UI forgotPasswordConfig := appConfig.ForgotPassword @@ -15041,39 +14852,6 @@ func newWebAppEnterPasswordHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, ClientResolver: oauthclientResolver, } - oauthsessionStoreRedis := oauthsession.StoreRedis{ - Context: contextContext, - Redis: appredisHandle, - AppID: appID, - } - tokenGenerator := _wireTokenGeneratorValue - settingsActionGrantService := handler.SettingsActionGrantService{ - AppID: appID, - CodeGenerator: tokenGenerator, - Clock: clockClock, - SettingsActionGrants: redisStore, - } - authorizationStore := &pq.AuthorizationStore{ - SQLBuilder: sqlBuilderApp, - SQLExecutor: sqlExecutor, - } - offlineGrantService := oauth2.OfflineGrantService{ - OAuthConfig: oAuthConfig, - Clock: clockClock, - IDPSessions: idpsessionProvider, - ClientResolver: oauthclientResolver, - } - sessionManager := &oauth2.SessionManager{ - Store: redisStore, - Config: oAuthConfig, - Service: offlineGrantService, - } - authorizationService := &oauth2.AuthorizationService{ - AppID: appID, - Store: authorizationStore, - Clock: clockClock, - OAuthSessionManager: sessionManager, - } interactionLogger := interaction.NewLogger(factory) eventLogger := event.NewLogger(factory) sqlBuilder := appdb.NewSQLBuilder(databaseCredentials) @@ -15192,6 +14970,10 @@ func newWebAppEnterPasswordHandler(p *deps.RequestProvider) http.Handler { UserStore: store, Events: eventService, } + authorizationStore := &pq.AuthorizationStore{ + SQLBuilder: sqlBuilderApp, + SQLExecutor: sqlExecutor, + } cookieDef2 := session.NewSessionCookieDef(sessionConfig) idpsessionManager := &idpsession.Manager{ Store: idpsessionStoreRedis, @@ -15199,6 +14981,17 @@ func newWebAppEnterPasswordHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, CookieDef: cookieDef2, } + offlineGrantService := oauth2.OfflineGrantService{ + OAuthConfig: oAuthConfig, + Clock: clockClock, + IDPSessions: idpsessionProvider, + ClientResolver: oauthclientResolver, + } + sessionManager := &oauth2.SessionManager{ + Store: redisStore, + Config: oAuthConfig, + Service: offlineGrantService, + } accountDeletionConfig := appConfig.AccountDeletion accountAnonymizationConfig := appConfig.AccountAnonymization coordinator := &facade.Coordinator{ @@ -15337,7 +15130,7 @@ func newWebAppEnterPasswordHandler(p *deps.RequestProvider) http.Handler { AccessTokenSessions: sessionManager, Events: eventService, } - storeRedis2 := &oauthsession.StoreRedis{ + oauthsessionStoreRedis := &oauthsession.StoreRedis{ Context: contextContext, Redis: appredisHandle, AppID: appID, @@ -15376,7 +15169,7 @@ func newWebAppEnterPasswordHandler(p *deps.RequestProvider) http.Handler { Sessions: idpsessionProvider, SessionManager: manager2, SessionCookie: cookieDef2, - OAuthSessions: storeRedis2, + OAuthSessions: oauthsessionStoreRedis, MFADeviceTokenCookie: cookieDef, } interactionStoreRedis := &interaction.StoreRedis{ @@ -15389,23 +15182,20 @@ func newWebAppEnterPasswordHandler(p *deps.RequestProvider) http.Handler { Store: interactionStoreRedis, } webappService2 := &webapp2.Service2{ - Logger: serviceLogger, - Request: request, - Sessions: sessionStoreRedis, - SessionCookie: sessionCookieDef, - SignedUpCookie: signedUpCookieDef, - MFADeviceTokenCookie: cookieDef, - ErrorCookie: errorCookie, - Cookies: cookieManager, - OAuthConfig: oAuthConfig, - UIConfig: uiConfig, - TrustProxy: trustProxy, - UIInfoResolver: uiInfoResolver, - OAuthClientResolver: oauthclientResolver, - OAuthSessions: oauthsessionStoreRedis, - SettingsActionGrantService: settingsActionGrantService, - Authorizations: authorizationService, - Graph: interactionService, + Logger: serviceLogger, + Request: request, + Sessions: sessionStoreRedis, + SessionCookie: sessionCookieDef, + SignedUpCookie: signedUpCookieDef, + MFADeviceTokenCookie: cookieDef, + ErrorCookie: errorCookie, + Cookies: cookieManager, + OAuthConfig: oAuthConfig, + UIConfig: uiConfig, + TrustProxy: trustProxy, + UIInfoResolver: uiInfoResolver, + OAuthClientResolver: oauthclientResolver, + Graph: interactionService, } uiFeatureConfig := featureConfig.UI forgotPasswordConfig := appConfig.ForgotPassword @@ -15912,39 +15702,6 @@ func newWebConfirmTerminateOtherSessionsHandler(p *deps.RequestProvider) http.Ha Cookies: cookieManager, ClientResolver: oauthclientResolver, } - oauthsessionStoreRedis := oauthsession.StoreRedis{ - Context: contextContext, - Redis: appredisHandle, - AppID: appID, - } - tokenGenerator := _wireTokenGeneratorValue - settingsActionGrantService := handler.SettingsActionGrantService{ - AppID: appID, - CodeGenerator: tokenGenerator, - Clock: clockClock, - SettingsActionGrants: redisStore, - } - authorizationStore := &pq.AuthorizationStore{ - SQLBuilder: sqlBuilderApp, - SQLExecutor: sqlExecutor, - } - offlineGrantService := oauth2.OfflineGrantService{ - OAuthConfig: oAuthConfig, - Clock: clockClock, - IDPSessions: idpsessionProvider, - ClientResolver: oauthclientResolver, - } - sessionManager := &oauth2.SessionManager{ - Store: redisStore, - Config: oAuthConfig, - Service: offlineGrantService, - } - authorizationService := &oauth2.AuthorizationService{ - AppID: appID, - Store: authorizationStore, - Clock: clockClock, - OAuthSessionManager: sessionManager, - } interactionLogger := interaction.NewLogger(factory) eventLogger := event.NewLogger(factory) sqlBuilder := appdb.NewSQLBuilder(databaseCredentials) @@ -16063,6 +15820,10 @@ func newWebConfirmTerminateOtherSessionsHandler(p *deps.RequestProvider) http.Ha UserStore: store, Events: eventService, } + authorizationStore := &pq.AuthorizationStore{ + SQLBuilder: sqlBuilderApp, + SQLExecutor: sqlExecutor, + } cookieDef2 := session.NewSessionCookieDef(sessionConfig) idpsessionManager := &idpsession.Manager{ Store: idpsessionStoreRedis, @@ -16070,6 +15831,17 @@ func newWebConfirmTerminateOtherSessionsHandler(p *deps.RequestProvider) http.Ha Cookies: cookieManager, CookieDef: cookieDef2, } + offlineGrantService := oauth2.OfflineGrantService{ + OAuthConfig: oAuthConfig, + Clock: clockClock, + IDPSessions: idpsessionProvider, + ClientResolver: oauthclientResolver, + } + sessionManager := &oauth2.SessionManager{ + Store: redisStore, + Config: oAuthConfig, + Service: offlineGrantService, + } accountDeletionConfig := appConfig.AccountDeletion accountAnonymizationConfig := appConfig.AccountAnonymization coordinator := &facade.Coordinator{ @@ -16208,7 +15980,7 @@ func newWebConfirmTerminateOtherSessionsHandler(p *deps.RequestProvider) http.Ha AccessTokenSessions: sessionManager, Events: eventService, } - storeRedis2 := &oauthsession.StoreRedis{ + oauthsessionStoreRedis := &oauthsession.StoreRedis{ Context: contextContext, Redis: appredisHandle, AppID: appID, @@ -16247,7 +16019,7 @@ func newWebConfirmTerminateOtherSessionsHandler(p *deps.RequestProvider) http.Ha Sessions: idpsessionProvider, SessionManager: manager2, SessionCookie: cookieDef2, - OAuthSessions: storeRedis2, + OAuthSessions: oauthsessionStoreRedis, MFADeviceTokenCookie: cookieDef, } interactionStoreRedis := &interaction.StoreRedis{ @@ -16260,23 +16032,20 @@ func newWebConfirmTerminateOtherSessionsHandler(p *deps.RequestProvider) http.Ha Store: interactionStoreRedis, } webappService2 := &webapp2.Service2{ - Logger: serviceLogger, - Request: request, - Sessions: sessionStoreRedis, - SessionCookie: sessionCookieDef, - SignedUpCookie: signedUpCookieDef, - MFADeviceTokenCookie: cookieDef, - ErrorCookie: errorCookie, - Cookies: cookieManager, - OAuthConfig: oAuthConfig, - UIConfig: uiConfig, - TrustProxy: trustProxy, - UIInfoResolver: uiInfoResolver, - OAuthClientResolver: oauthclientResolver, - OAuthSessions: oauthsessionStoreRedis, - SettingsActionGrantService: settingsActionGrantService, - Authorizations: authorizationService, - Graph: interactionService, + Logger: serviceLogger, + Request: request, + Sessions: sessionStoreRedis, + SessionCookie: sessionCookieDef, + SignedUpCookie: signedUpCookieDef, + MFADeviceTokenCookie: cookieDef, + ErrorCookie: errorCookie, + Cookies: cookieManager, + OAuthConfig: oAuthConfig, + UIConfig: uiConfig, + TrustProxy: trustProxy, + UIInfoResolver: uiInfoResolver, + OAuthClientResolver: oauthclientResolver, + Graph: interactionService, } uiFeatureConfig := featureConfig.UI forgotPasswordConfig := appConfig.ForgotPassword @@ -16781,39 +16550,6 @@ func newWebAppUsePasskeyHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, ClientResolver: oauthclientResolver, } - oauthsessionStoreRedis := oauthsession.StoreRedis{ - Context: contextContext, - Redis: appredisHandle, - AppID: appID, - } - tokenGenerator := _wireTokenGeneratorValue - settingsActionGrantService := handler.SettingsActionGrantService{ - AppID: appID, - CodeGenerator: tokenGenerator, - Clock: clockClock, - SettingsActionGrants: redisStore, - } - authorizationStore := &pq.AuthorizationStore{ - SQLBuilder: sqlBuilderApp, - SQLExecutor: sqlExecutor, - } - offlineGrantService := oauth2.OfflineGrantService{ - OAuthConfig: oAuthConfig, - Clock: clockClock, - IDPSessions: idpsessionProvider, - ClientResolver: oauthclientResolver, - } - sessionManager := &oauth2.SessionManager{ - Store: redisStore, - Config: oAuthConfig, - Service: offlineGrantService, - } - authorizationService := &oauth2.AuthorizationService{ - AppID: appID, - Store: authorizationStore, - Clock: clockClock, - OAuthSessionManager: sessionManager, - } interactionLogger := interaction.NewLogger(factory) eventLogger := event.NewLogger(factory) sqlBuilder := appdb.NewSQLBuilder(databaseCredentials) @@ -16932,6 +16668,10 @@ func newWebAppUsePasskeyHandler(p *deps.RequestProvider) http.Handler { UserStore: store, Events: eventService, } + authorizationStore := &pq.AuthorizationStore{ + SQLBuilder: sqlBuilderApp, + SQLExecutor: sqlExecutor, + } cookieDef2 := session.NewSessionCookieDef(sessionConfig) idpsessionManager := &idpsession.Manager{ Store: idpsessionStoreRedis, @@ -16939,6 +16679,17 @@ func newWebAppUsePasskeyHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, CookieDef: cookieDef2, } + offlineGrantService := oauth2.OfflineGrantService{ + OAuthConfig: oAuthConfig, + Clock: clockClock, + IDPSessions: idpsessionProvider, + ClientResolver: oauthclientResolver, + } + sessionManager := &oauth2.SessionManager{ + Store: redisStore, + Config: oAuthConfig, + Service: offlineGrantService, + } accountDeletionConfig := appConfig.AccountDeletion accountAnonymizationConfig := appConfig.AccountAnonymization coordinator := &facade.Coordinator{ @@ -17077,7 +16828,7 @@ func newWebAppUsePasskeyHandler(p *deps.RequestProvider) http.Handler { AccessTokenSessions: sessionManager, Events: eventService, } - storeRedis2 := &oauthsession.StoreRedis{ + oauthsessionStoreRedis := &oauthsession.StoreRedis{ Context: contextContext, Redis: appredisHandle, AppID: appID, @@ -17116,7 +16867,7 @@ func newWebAppUsePasskeyHandler(p *deps.RequestProvider) http.Handler { Sessions: idpsessionProvider, SessionManager: manager2, SessionCookie: cookieDef2, - OAuthSessions: storeRedis2, + OAuthSessions: oauthsessionStoreRedis, MFADeviceTokenCookie: cookieDef, } interactionStoreRedis := &interaction.StoreRedis{ @@ -17129,23 +16880,20 @@ func newWebAppUsePasskeyHandler(p *deps.RequestProvider) http.Handler { Store: interactionStoreRedis, } webappService2 := &webapp2.Service2{ - Logger: serviceLogger, - Request: request, - Sessions: sessionStoreRedis, - SessionCookie: sessionCookieDef, - SignedUpCookie: signedUpCookieDef, - MFADeviceTokenCookie: cookieDef, - ErrorCookie: errorCookie, - Cookies: cookieManager, - OAuthConfig: oAuthConfig, - UIConfig: uiConfig, - TrustProxy: trustProxy, - UIInfoResolver: uiInfoResolver, - OAuthClientResolver: oauthclientResolver, - OAuthSessions: oauthsessionStoreRedis, - SettingsActionGrantService: settingsActionGrantService, - Authorizations: authorizationService, - Graph: interactionService, + Logger: serviceLogger, + Request: request, + Sessions: sessionStoreRedis, + SessionCookie: sessionCookieDef, + SignedUpCookie: signedUpCookieDef, + MFADeviceTokenCookie: cookieDef, + ErrorCookie: errorCookie, + Cookies: cookieManager, + OAuthConfig: oAuthConfig, + UIConfig: uiConfig, + TrustProxy: trustProxy, + UIInfoResolver: uiInfoResolver, + OAuthClientResolver: oauthclientResolver, + Graph: interactionService, } uiFeatureConfig := featureConfig.UI forgotPasswordConfig := appConfig.ForgotPassword @@ -17652,39 +17400,6 @@ func newWebAppCreatePasswordHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, ClientResolver: oauthclientResolver, } - oauthsessionStoreRedis := oauthsession.StoreRedis{ - Context: contextContext, - Redis: appredisHandle, - AppID: appID, - } - tokenGenerator := _wireTokenGeneratorValue - settingsActionGrantService := handler.SettingsActionGrantService{ - AppID: appID, - CodeGenerator: tokenGenerator, - Clock: clockClock, - SettingsActionGrants: redisStore, - } - authorizationStore := &pq.AuthorizationStore{ - SQLBuilder: sqlBuilderApp, - SQLExecutor: sqlExecutor, - } - offlineGrantService := oauth2.OfflineGrantService{ - OAuthConfig: oAuthConfig, - Clock: clockClock, - IDPSessions: idpsessionProvider, - ClientResolver: oauthclientResolver, - } - sessionManager := &oauth2.SessionManager{ - Store: redisStore, - Config: oAuthConfig, - Service: offlineGrantService, - } - authorizationService := &oauth2.AuthorizationService{ - AppID: appID, - Store: authorizationStore, - Clock: clockClock, - OAuthSessionManager: sessionManager, - } interactionLogger := interaction.NewLogger(factory) eventLogger := event.NewLogger(factory) sqlBuilder := appdb.NewSQLBuilder(databaseCredentials) @@ -17803,6 +17518,10 @@ func newWebAppCreatePasswordHandler(p *deps.RequestProvider) http.Handler { UserStore: store, Events: eventService, } + authorizationStore := &pq.AuthorizationStore{ + SQLBuilder: sqlBuilderApp, + SQLExecutor: sqlExecutor, + } cookieDef2 := session.NewSessionCookieDef(sessionConfig) idpsessionManager := &idpsession.Manager{ Store: idpsessionStoreRedis, @@ -17810,6 +17529,17 @@ func newWebAppCreatePasswordHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, CookieDef: cookieDef2, } + offlineGrantService := oauth2.OfflineGrantService{ + OAuthConfig: oAuthConfig, + Clock: clockClock, + IDPSessions: idpsessionProvider, + ClientResolver: oauthclientResolver, + } + sessionManager := &oauth2.SessionManager{ + Store: redisStore, + Config: oAuthConfig, + Service: offlineGrantService, + } accountDeletionConfig := appConfig.AccountDeletion accountAnonymizationConfig := appConfig.AccountAnonymization coordinator := &facade.Coordinator{ @@ -17948,7 +17678,7 @@ func newWebAppCreatePasswordHandler(p *deps.RequestProvider) http.Handler { AccessTokenSessions: sessionManager, Events: eventService, } - storeRedis2 := &oauthsession.StoreRedis{ + oauthsessionStoreRedis := &oauthsession.StoreRedis{ Context: contextContext, Redis: appredisHandle, AppID: appID, @@ -17987,7 +17717,7 @@ func newWebAppCreatePasswordHandler(p *deps.RequestProvider) http.Handler { Sessions: idpsessionProvider, SessionManager: manager2, SessionCookie: cookieDef2, - OAuthSessions: storeRedis2, + OAuthSessions: oauthsessionStoreRedis, MFADeviceTokenCookie: cookieDef, } interactionStoreRedis := &interaction.StoreRedis{ @@ -18000,23 +17730,20 @@ func newWebAppCreatePasswordHandler(p *deps.RequestProvider) http.Handler { Store: interactionStoreRedis, } webappService2 := &webapp2.Service2{ - Logger: serviceLogger, - Request: request, - Sessions: sessionStoreRedis, - SessionCookie: sessionCookieDef, - SignedUpCookie: signedUpCookieDef, - MFADeviceTokenCookie: cookieDef, - ErrorCookie: errorCookie, - Cookies: cookieManager, - OAuthConfig: oAuthConfig, - UIConfig: uiConfig, - TrustProxy: trustProxy, - UIInfoResolver: uiInfoResolver, - OAuthClientResolver: oauthclientResolver, - OAuthSessions: oauthsessionStoreRedis, - SettingsActionGrantService: settingsActionGrantService, - Authorizations: authorizationService, - Graph: interactionService, + Logger: serviceLogger, + Request: request, + Sessions: sessionStoreRedis, + SessionCookie: sessionCookieDef, + SignedUpCookie: signedUpCookieDef, + MFADeviceTokenCookie: cookieDef, + ErrorCookie: errorCookie, + Cookies: cookieManager, + OAuthConfig: oAuthConfig, + UIConfig: uiConfig, + TrustProxy: trustProxy, + UIInfoResolver: uiInfoResolver, + OAuthClientResolver: oauthclientResolver, + Graph: interactionService, } uiFeatureConfig := featureConfig.UI forgotPasswordConfig := appConfig.ForgotPassword @@ -18524,39 +18251,6 @@ func newWebAppCreatePasskeyHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, ClientResolver: oauthclientResolver, } - oauthsessionStoreRedis := oauthsession.StoreRedis{ - Context: contextContext, - Redis: appredisHandle, - AppID: appID, - } - tokenGenerator := _wireTokenGeneratorValue - settingsActionGrantService := handler.SettingsActionGrantService{ - AppID: appID, - CodeGenerator: tokenGenerator, - Clock: clockClock, - SettingsActionGrants: redisStore, - } - authorizationStore := &pq.AuthorizationStore{ - SQLBuilder: sqlBuilderApp, - SQLExecutor: sqlExecutor, - } - offlineGrantService := oauth2.OfflineGrantService{ - OAuthConfig: oAuthConfig, - Clock: clockClock, - IDPSessions: idpsessionProvider, - ClientResolver: oauthclientResolver, - } - sessionManager := &oauth2.SessionManager{ - Store: redisStore, - Config: oAuthConfig, - Service: offlineGrantService, - } - authorizationService := &oauth2.AuthorizationService{ - AppID: appID, - Store: authorizationStore, - Clock: clockClock, - OAuthSessionManager: sessionManager, - } interactionLogger := interaction.NewLogger(factory) eventLogger := event.NewLogger(factory) sqlBuilder := appdb.NewSQLBuilder(databaseCredentials) @@ -18675,6 +18369,10 @@ func newWebAppCreatePasskeyHandler(p *deps.RequestProvider) http.Handler { UserStore: store, Events: eventService, } + authorizationStore := &pq.AuthorizationStore{ + SQLBuilder: sqlBuilderApp, + SQLExecutor: sqlExecutor, + } cookieDef2 := session.NewSessionCookieDef(sessionConfig) idpsessionManager := &idpsession.Manager{ Store: idpsessionStoreRedis, @@ -18682,6 +18380,17 @@ func newWebAppCreatePasskeyHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, CookieDef: cookieDef2, } + offlineGrantService := oauth2.OfflineGrantService{ + OAuthConfig: oAuthConfig, + Clock: clockClock, + IDPSessions: idpsessionProvider, + ClientResolver: oauthclientResolver, + } + sessionManager := &oauth2.SessionManager{ + Store: redisStore, + Config: oAuthConfig, + Service: offlineGrantService, + } accountDeletionConfig := appConfig.AccountDeletion accountAnonymizationConfig := appConfig.AccountAnonymization coordinator := &facade.Coordinator{ @@ -18820,7 +18529,7 @@ func newWebAppCreatePasskeyHandler(p *deps.RequestProvider) http.Handler { AccessTokenSessions: sessionManager, Events: eventService, } - storeRedis2 := &oauthsession.StoreRedis{ + oauthsessionStoreRedis := &oauthsession.StoreRedis{ Context: contextContext, Redis: appredisHandle, AppID: appID, @@ -18859,7 +18568,7 @@ func newWebAppCreatePasskeyHandler(p *deps.RequestProvider) http.Handler { Sessions: idpsessionProvider, SessionManager: manager2, SessionCookie: cookieDef2, - OAuthSessions: storeRedis2, + OAuthSessions: oauthsessionStoreRedis, MFADeviceTokenCookie: cookieDef, } interactionStoreRedis := &interaction.StoreRedis{ @@ -18872,23 +18581,20 @@ func newWebAppCreatePasskeyHandler(p *deps.RequestProvider) http.Handler { Store: interactionStoreRedis, } webappService2 := &webapp2.Service2{ - Logger: serviceLogger, - Request: request, - Sessions: sessionStoreRedis, - SessionCookie: sessionCookieDef, - SignedUpCookie: signedUpCookieDef, - MFADeviceTokenCookie: cookieDef, - ErrorCookie: errorCookie, - Cookies: cookieManager, - OAuthConfig: oAuthConfig, - UIConfig: uiConfig, - TrustProxy: trustProxy, - UIInfoResolver: uiInfoResolver, - OAuthClientResolver: oauthclientResolver, - OAuthSessions: oauthsessionStoreRedis, - SettingsActionGrantService: settingsActionGrantService, - Authorizations: authorizationService, - Graph: interactionService, + Logger: serviceLogger, + Request: request, + Sessions: sessionStoreRedis, + SessionCookie: sessionCookieDef, + SignedUpCookie: signedUpCookieDef, + MFADeviceTokenCookie: cookieDef, + ErrorCookie: errorCookie, + Cookies: cookieManager, + OAuthConfig: oAuthConfig, + UIConfig: uiConfig, + TrustProxy: trustProxy, + UIInfoResolver: uiInfoResolver, + OAuthClientResolver: oauthclientResolver, + Graph: interactionService, } uiFeatureConfig := featureConfig.UI forgotPasswordConfig := appConfig.ForgotPassword @@ -19395,39 +19101,6 @@ func newWebAppPromptCreatePasskeyHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, ClientResolver: oauthclientResolver, } - oauthsessionStoreRedis := oauthsession.StoreRedis{ - Context: contextContext, - Redis: appredisHandle, - AppID: appID, - } - tokenGenerator := _wireTokenGeneratorValue - settingsActionGrantService := handler.SettingsActionGrantService{ - AppID: appID, - CodeGenerator: tokenGenerator, - Clock: clockClock, - SettingsActionGrants: redisStore, - } - authorizationStore := &pq.AuthorizationStore{ - SQLBuilder: sqlBuilderApp, - SQLExecutor: sqlExecutor, - } - offlineGrantService := oauth2.OfflineGrantService{ - OAuthConfig: oAuthConfig, - Clock: clockClock, - IDPSessions: idpsessionProvider, - ClientResolver: oauthclientResolver, - } - sessionManager := &oauth2.SessionManager{ - Store: redisStore, - Config: oAuthConfig, - Service: offlineGrantService, - } - authorizationService := &oauth2.AuthorizationService{ - AppID: appID, - Store: authorizationStore, - Clock: clockClock, - OAuthSessionManager: sessionManager, - } interactionLogger := interaction.NewLogger(factory) eventLogger := event.NewLogger(factory) sqlBuilder := appdb.NewSQLBuilder(databaseCredentials) @@ -19546,6 +19219,10 @@ func newWebAppPromptCreatePasskeyHandler(p *deps.RequestProvider) http.Handler { UserStore: store, Events: eventService, } + authorizationStore := &pq.AuthorizationStore{ + SQLBuilder: sqlBuilderApp, + SQLExecutor: sqlExecutor, + } cookieDef2 := session.NewSessionCookieDef(sessionConfig) idpsessionManager := &idpsession.Manager{ Store: idpsessionStoreRedis, @@ -19553,6 +19230,17 @@ func newWebAppPromptCreatePasskeyHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, CookieDef: cookieDef2, } + offlineGrantService := oauth2.OfflineGrantService{ + OAuthConfig: oAuthConfig, + Clock: clockClock, + IDPSessions: idpsessionProvider, + ClientResolver: oauthclientResolver, + } + sessionManager := &oauth2.SessionManager{ + Store: redisStore, + Config: oAuthConfig, + Service: offlineGrantService, + } accountDeletionConfig := appConfig.AccountDeletion accountAnonymizationConfig := appConfig.AccountAnonymization coordinator := &facade.Coordinator{ @@ -19691,7 +19379,7 @@ func newWebAppPromptCreatePasskeyHandler(p *deps.RequestProvider) http.Handler { AccessTokenSessions: sessionManager, Events: eventService, } - storeRedis2 := &oauthsession.StoreRedis{ + oauthsessionStoreRedis := &oauthsession.StoreRedis{ Context: contextContext, Redis: appredisHandle, AppID: appID, @@ -19730,7 +19418,7 @@ func newWebAppPromptCreatePasskeyHandler(p *deps.RequestProvider) http.Handler { Sessions: idpsessionProvider, SessionManager: manager2, SessionCookie: cookieDef2, - OAuthSessions: storeRedis2, + OAuthSessions: oauthsessionStoreRedis, MFADeviceTokenCookie: cookieDef, } interactionStoreRedis := &interaction.StoreRedis{ @@ -19743,23 +19431,20 @@ func newWebAppPromptCreatePasskeyHandler(p *deps.RequestProvider) http.Handler { Store: interactionStoreRedis, } webappService2 := &webapp2.Service2{ - Logger: serviceLogger, - Request: request, - Sessions: sessionStoreRedis, - SessionCookie: sessionCookieDef, - SignedUpCookie: signedUpCookieDef, - MFADeviceTokenCookie: cookieDef, - ErrorCookie: errorCookie, - Cookies: cookieManager, - OAuthConfig: oAuthConfig, - UIConfig: uiConfig, - TrustProxy: trustProxy, - UIInfoResolver: uiInfoResolver, - OAuthClientResolver: oauthclientResolver, - OAuthSessions: oauthsessionStoreRedis, - SettingsActionGrantService: settingsActionGrantService, - Authorizations: authorizationService, - Graph: interactionService, + Logger: serviceLogger, + Request: request, + Sessions: sessionStoreRedis, + SessionCookie: sessionCookieDef, + SignedUpCookie: signedUpCookieDef, + MFADeviceTokenCookie: cookieDef, + ErrorCookie: errorCookie, + Cookies: cookieManager, + OAuthConfig: oAuthConfig, + UIConfig: uiConfig, + TrustProxy: trustProxy, + UIInfoResolver: uiInfoResolver, + OAuthClientResolver: oauthclientResolver, + Graph: interactionService, } uiFeatureConfig := featureConfig.UI forgotPasswordConfig := appConfig.ForgotPassword @@ -20266,39 +19951,6 @@ func newWebAppSetupTOTPHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, ClientResolver: oauthclientResolver, } - oauthsessionStoreRedis := oauthsession.StoreRedis{ - Context: contextContext, - Redis: appredisHandle, - AppID: appID, - } - tokenGenerator := _wireTokenGeneratorValue - settingsActionGrantService := handler.SettingsActionGrantService{ - AppID: appID, - CodeGenerator: tokenGenerator, - Clock: clockClock, - SettingsActionGrants: redisStore, - } - authorizationStore := &pq.AuthorizationStore{ - SQLBuilder: sqlBuilderApp, - SQLExecutor: sqlExecutor, - } - offlineGrantService := oauth2.OfflineGrantService{ - OAuthConfig: oAuthConfig, - Clock: clockClock, - IDPSessions: idpsessionProvider, - ClientResolver: oauthclientResolver, - } - sessionManager := &oauth2.SessionManager{ - Store: redisStore, - Config: oAuthConfig, - Service: offlineGrantService, - } - authorizationService := &oauth2.AuthorizationService{ - AppID: appID, - Store: authorizationStore, - Clock: clockClock, - OAuthSessionManager: sessionManager, - } interactionLogger := interaction.NewLogger(factory) eventLogger := event.NewLogger(factory) sqlBuilder := appdb.NewSQLBuilder(databaseCredentials) @@ -20417,6 +20069,10 @@ func newWebAppSetupTOTPHandler(p *deps.RequestProvider) http.Handler { UserStore: store, Events: eventService, } + authorizationStore := &pq.AuthorizationStore{ + SQLBuilder: sqlBuilderApp, + SQLExecutor: sqlExecutor, + } cookieDef2 := session.NewSessionCookieDef(sessionConfig) idpsessionManager := &idpsession.Manager{ Store: idpsessionStoreRedis, @@ -20424,6 +20080,17 @@ func newWebAppSetupTOTPHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, CookieDef: cookieDef2, } + offlineGrantService := oauth2.OfflineGrantService{ + OAuthConfig: oAuthConfig, + Clock: clockClock, + IDPSessions: idpsessionProvider, + ClientResolver: oauthclientResolver, + } + sessionManager := &oauth2.SessionManager{ + Store: redisStore, + Config: oAuthConfig, + Service: offlineGrantService, + } accountDeletionConfig := appConfig.AccountDeletion accountAnonymizationConfig := appConfig.AccountAnonymization coordinator := &facade.Coordinator{ @@ -20562,7 +20229,7 @@ func newWebAppSetupTOTPHandler(p *deps.RequestProvider) http.Handler { AccessTokenSessions: sessionManager, Events: eventService, } - storeRedis2 := &oauthsession.StoreRedis{ + oauthsessionStoreRedis := &oauthsession.StoreRedis{ Context: contextContext, Redis: appredisHandle, AppID: appID, @@ -20601,7 +20268,7 @@ func newWebAppSetupTOTPHandler(p *deps.RequestProvider) http.Handler { Sessions: idpsessionProvider, SessionManager: manager2, SessionCookie: cookieDef2, - OAuthSessions: storeRedis2, + OAuthSessions: oauthsessionStoreRedis, MFADeviceTokenCookie: cookieDef, } interactionStoreRedis := &interaction.StoreRedis{ @@ -20614,23 +20281,20 @@ func newWebAppSetupTOTPHandler(p *deps.RequestProvider) http.Handler { Store: interactionStoreRedis, } webappService2 := &webapp2.Service2{ - Logger: serviceLogger, - Request: request, - Sessions: sessionStoreRedis, - SessionCookie: sessionCookieDef, - SignedUpCookie: signedUpCookieDef, - MFADeviceTokenCookie: cookieDef, - ErrorCookie: errorCookie, - Cookies: cookieManager, - OAuthConfig: oAuthConfig, - UIConfig: uiConfig, - TrustProxy: trustProxy, - UIInfoResolver: uiInfoResolver, - OAuthClientResolver: oauthclientResolver, - OAuthSessions: oauthsessionStoreRedis, - SettingsActionGrantService: settingsActionGrantService, - Authorizations: authorizationService, - Graph: interactionService, + Logger: serviceLogger, + Request: request, + Sessions: sessionStoreRedis, + SessionCookie: sessionCookieDef, + SignedUpCookie: signedUpCookieDef, + MFADeviceTokenCookie: cookieDef, + ErrorCookie: errorCookie, + Cookies: cookieManager, + OAuthConfig: oAuthConfig, + UIConfig: uiConfig, + TrustProxy: trustProxy, + UIInfoResolver: uiInfoResolver, + OAuthClientResolver: oauthclientResolver, + Graph: interactionService, } uiFeatureConfig := featureConfig.UI forgotPasswordConfig := appConfig.ForgotPassword @@ -21139,39 +20803,6 @@ func newWebAppEnterTOTPHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, ClientResolver: oauthclientResolver, } - oauthsessionStoreRedis := oauthsession.StoreRedis{ - Context: contextContext, - Redis: appredisHandle, - AppID: appID, - } - tokenGenerator := _wireTokenGeneratorValue - settingsActionGrantService := handler.SettingsActionGrantService{ - AppID: appID, - CodeGenerator: tokenGenerator, - Clock: clockClock, - SettingsActionGrants: redisStore, - } - authorizationStore := &pq.AuthorizationStore{ - SQLBuilder: sqlBuilderApp, - SQLExecutor: sqlExecutor, - } - offlineGrantService := oauth2.OfflineGrantService{ - OAuthConfig: oAuthConfig, - Clock: clockClock, - IDPSessions: idpsessionProvider, - ClientResolver: oauthclientResolver, - } - sessionManager := &oauth2.SessionManager{ - Store: redisStore, - Config: oAuthConfig, - Service: offlineGrantService, - } - authorizationService := &oauth2.AuthorizationService{ - AppID: appID, - Store: authorizationStore, - Clock: clockClock, - OAuthSessionManager: sessionManager, - } interactionLogger := interaction.NewLogger(factory) eventLogger := event.NewLogger(factory) sqlBuilder := appdb.NewSQLBuilder(databaseCredentials) @@ -21290,6 +20921,10 @@ func newWebAppEnterTOTPHandler(p *deps.RequestProvider) http.Handler { UserStore: store, Events: eventService, } + authorizationStore := &pq.AuthorizationStore{ + SQLBuilder: sqlBuilderApp, + SQLExecutor: sqlExecutor, + } cookieDef2 := session.NewSessionCookieDef(sessionConfig) idpsessionManager := &idpsession.Manager{ Store: idpsessionStoreRedis, @@ -21297,6 +20932,17 @@ func newWebAppEnterTOTPHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, CookieDef: cookieDef2, } + offlineGrantService := oauth2.OfflineGrantService{ + OAuthConfig: oAuthConfig, + Clock: clockClock, + IDPSessions: idpsessionProvider, + ClientResolver: oauthclientResolver, + } + sessionManager := &oauth2.SessionManager{ + Store: redisStore, + Config: oAuthConfig, + Service: offlineGrantService, + } accountDeletionConfig := appConfig.AccountDeletion accountAnonymizationConfig := appConfig.AccountAnonymization coordinator := &facade.Coordinator{ @@ -21435,7 +21081,7 @@ func newWebAppEnterTOTPHandler(p *deps.RequestProvider) http.Handler { AccessTokenSessions: sessionManager, Events: eventService, } - storeRedis2 := &oauthsession.StoreRedis{ + oauthsessionStoreRedis := &oauthsession.StoreRedis{ Context: contextContext, Redis: appredisHandle, AppID: appID, @@ -21474,7 +21120,7 @@ func newWebAppEnterTOTPHandler(p *deps.RequestProvider) http.Handler { Sessions: idpsessionProvider, SessionManager: manager2, SessionCookie: cookieDef2, - OAuthSessions: storeRedis2, + OAuthSessions: oauthsessionStoreRedis, MFADeviceTokenCookie: cookieDef, } interactionStoreRedis := &interaction.StoreRedis{ @@ -21487,23 +21133,20 @@ func newWebAppEnterTOTPHandler(p *deps.RequestProvider) http.Handler { Store: interactionStoreRedis, } webappService2 := &webapp2.Service2{ - Logger: serviceLogger, - Request: request, - Sessions: sessionStoreRedis, - SessionCookie: sessionCookieDef, - SignedUpCookie: signedUpCookieDef, - MFADeviceTokenCookie: cookieDef, - ErrorCookie: errorCookie, - Cookies: cookieManager, - OAuthConfig: oAuthConfig, - UIConfig: uiConfig, - TrustProxy: trustProxy, - UIInfoResolver: uiInfoResolver, - OAuthClientResolver: oauthclientResolver, - OAuthSessions: oauthsessionStoreRedis, - SettingsActionGrantService: settingsActionGrantService, - Authorizations: authorizationService, - Graph: interactionService, + Logger: serviceLogger, + Request: request, + Sessions: sessionStoreRedis, + SessionCookie: sessionCookieDef, + SignedUpCookie: signedUpCookieDef, + MFADeviceTokenCookie: cookieDef, + ErrorCookie: errorCookie, + Cookies: cookieManager, + OAuthConfig: oAuthConfig, + UIConfig: uiConfig, + TrustProxy: trustProxy, + UIInfoResolver: uiInfoResolver, + OAuthClientResolver: oauthclientResolver, + Graph: interactionService, } uiFeatureConfig := featureConfig.UI forgotPasswordConfig := appConfig.ForgotPassword @@ -22010,39 +21653,6 @@ func newWebAppSetupOOBOTPHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, ClientResolver: oauthclientResolver, } - oauthsessionStoreRedis := oauthsession.StoreRedis{ - Context: contextContext, - Redis: appredisHandle, - AppID: appID, - } - tokenGenerator := _wireTokenGeneratorValue - settingsActionGrantService := handler.SettingsActionGrantService{ - AppID: appID, - CodeGenerator: tokenGenerator, - Clock: clockClock, - SettingsActionGrants: redisStore, - } - authorizationStore := &pq.AuthorizationStore{ - SQLBuilder: sqlBuilderApp, - SQLExecutor: sqlExecutor, - } - offlineGrantService := oauth2.OfflineGrantService{ - OAuthConfig: oAuthConfig, - Clock: clockClock, - IDPSessions: idpsessionProvider, - ClientResolver: oauthclientResolver, - } - sessionManager := &oauth2.SessionManager{ - Store: redisStore, - Config: oAuthConfig, - Service: offlineGrantService, - } - authorizationService := &oauth2.AuthorizationService{ - AppID: appID, - Store: authorizationStore, - Clock: clockClock, - OAuthSessionManager: sessionManager, - } interactionLogger := interaction.NewLogger(factory) eventLogger := event.NewLogger(factory) sqlBuilder := appdb.NewSQLBuilder(databaseCredentials) @@ -22161,6 +21771,10 @@ func newWebAppSetupOOBOTPHandler(p *deps.RequestProvider) http.Handler { UserStore: store, Events: eventService, } + authorizationStore := &pq.AuthorizationStore{ + SQLBuilder: sqlBuilderApp, + SQLExecutor: sqlExecutor, + } cookieDef2 := session.NewSessionCookieDef(sessionConfig) idpsessionManager := &idpsession.Manager{ Store: idpsessionStoreRedis, @@ -22168,6 +21782,17 @@ func newWebAppSetupOOBOTPHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, CookieDef: cookieDef2, } + offlineGrantService := oauth2.OfflineGrantService{ + OAuthConfig: oAuthConfig, + Clock: clockClock, + IDPSessions: idpsessionProvider, + ClientResolver: oauthclientResolver, + } + sessionManager := &oauth2.SessionManager{ + Store: redisStore, + Config: oAuthConfig, + Service: offlineGrantService, + } accountDeletionConfig := appConfig.AccountDeletion accountAnonymizationConfig := appConfig.AccountAnonymization coordinator := &facade.Coordinator{ @@ -22306,7 +21931,7 @@ func newWebAppSetupOOBOTPHandler(p *deps.RequestProvider) http.Handler { AccessTokenSessions: sessionManager, Events: eventService, } - storeRedis2 := &oauthsession.StoreRedis{ + oauthsessionStoreRedis := &oauthsession.StoreRedis{ Context: contextContext, Redis: appredisHandle, AppID: appID, @@ -22345,7 +21970,7 @@ func newWebAppSetupOOBOTPHandler(p *deps.RequestProvider) http.Handler { Sessions: idpsessionProvider, SessionManager: manager2, SessionCookie: cookieDef2, - OAuthSessions: storeRedis2, + OAuthSessions: oauthsessionStoreRedis, MFADeviceTokenCookie: cookieDef, } interactionStoreRedis := &interaction.StoreRedis{ @@ -22358,23 +21983,20 @@ func newWebAppSetupOOBOTPHandler(p *deps.RequestProvider) http.Handler { Store: interactionStoreRedis, } webappService2 := &webapp2.Service2{ - Logger: serviceLogger, - Request: request, - Sessions: sessionStoreRedis, - SessionCookie: sessionCookieDef, - SignedUpCookie: signedUpCookieDef, - MFADeviceTokenCookie: cookieDef, - ErrorCookie: errorCookie, - Cookies: cookieManager, - OAuthConfig: oAuthConfig, - UIConfig: uiConfig, - TrustProxy: trustProxy, - UIInfoResolver: uiInfoResolver, - OAuthClientResolver: oauthclientResolver, - OAuthSessions: oauthsessionStoreRedis, - SettingsActionGrantService: settingsActionGrantService, - Authorizations: authorizationService, - Graph: interactionService, + Logger: serviceLogger, + Request: request, + Sessions: sessionStoreRedis, + SessionCookie: sessionCookieDef, + SignedUpCookie: signedUpCookieDef, + MFADeviceTokenCookie: cookieDef, + ErrorCookie: errorCookie, + Cookies: cookieManager, + OAuthConfig: oAuthConfig, + UIConfig: uiConfig, + TrustProxy: trustProxy, + UIInfoResolver: uiInfoResolver, + OAuthClientResolver: oauthclientResolver, + Graph: interactionService, } uiFeatureConfig := featureConfig.UI forgotPasswordConfig := appConfig.ForgotPassword @@ -22881,39 +22503,6 @@ func newWebAppEnterOOBOTPHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, ClientResolver: oauthclientResolver, } - oauthsessionStoreRedis := oauthsession.StoreRedis{ - Context: contextContext, - Redis: appredisHandle, - AppID: appID, - } - tokenGenerator := _wireTokenGeneratorValue - settingsActionGrantService := handler.SettingsActionGrantService{ - AppID: appID, - CodeGenerator: tokenGenerator, - Clock: clockClock, - SettingsActionGrants: redisStore, - } - authorizationStore := &pq.AuthorizationStore{ - SQLBuilder: sqlBuilderApp, - SQLExecutor: sqlExecutor, - } - offlineGrantService := oauth2.OfflineGrantService{ - OAuthConfig: oAuthConfig, - Clock: clockClock, - IDPSessions: idpsessionProvider, - ClientResolver: oauthclientResolver, - } - sessionManager := &oauth2.SessionManager{ - Store: redisStore, - Config: oAuthConfig, - Service: offlineGrantService, - } - authorizationService := &oauth2.AuthorizationService{ - AppID: appID, - Store: authorizationStore, - Clock: clockClock, - OAuthSessionManager: sessionManager, - } interactionLogger := interaction.NewLogger(factory) eventLogger := event.NewLogger(factory) sqlBuilder := appdb.NewSQLBuilder(databaseCredentials) @@ -23032,6 +22621,10 @@ func newWebAppEnterOOBOTPHandler(p *deps.RequestProvider) http.Handler { UserStore: store, Events: eventService, } + authorizationStore := &pq.AuthorizationStore{ + SQLBuilder: sqlBuilderApp, + SQLExecutor: sqlExecutor, + } cookieDef2 := session.NewSessionCookieDef(sessionConfig) idpsessionManager := &idpsession.Manager{ Store: idpsessionStoreRedis, @@ -23039,6 +22632,17 @@ func newWebAppEnterOOBOTPHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, CookieDef: cookieDef2, } + offlineGrantService := oauth2.OfflineGrantService{ + OAuthConfig: oAuthConfig, + Clock: clockClock, + IDPSessions: idpsessionProvider, + ClientResolver: oauthclientResolver, + } + sessionManager := &oauth2.SessionManager{ + Store: redisStore, + Config: oAuthConfig, + Service: offlineGrantService, + } accountDeletionConfig := appConfig.AccountDeletion accountAnonymizationConfig := appConfig.AccountAnonymization coordinator := &facade.Coordinator{ @@ -23177,7 +22781,7 @@ func newWebAppEnterOOBOTPHandler(p *deps.RequestProvider) http.Handler { AccessTokenSessions: sessionManager, Events: eventService, } - storeRedis2 := &oauthsession.StoreRedis{ + oauthsessionStoreRedis := &oauthsession.StoreRedis{ Context: contextContext, Redis: appredisHandle, AppID: appID, @@ -23216,7 +22820,7 @@ func newWebAppEnterOOBOTPHandler(p *deps.RequestProvider) http.Handler { Sessions: idpsessionProvider, SessionManager: manager2, SessionCookie: cookieDef2, - OAuthSessions: storeRedis2, + OAuthSessions: oauthsessionStoreRedis, MFADeviceTokenCookie: cookieDef, } interactionStoreRedis := &interaction.StoreRedis{ @@ -23229,23 +22833,20 @@ func newWebAppEnterOOBOTPHandler(p *deps.RequestProvider) http.Handler { Store: interactionStoreRedis, } webappService2 := &webapp2.Service2{ - Logger: serviceLogger, - Request: request, - Sessions: sessionStoreRedis, - SessionCookie: sessionCookieDef, - SignedUpCookie: signedUpCookieDef, - MFADeviceTokenCookie: cookieDef, - ErrorCookie: errorCookie, - Cookies: cookieManager, - OAuthConfig: oAuthConfig, - UIConfig: uiConfig, - TrustProxy: trustProxy, - UIInfoResolver: uiInfoResolver, - OAuthClientResolver: oauthclientResolver, - OAuthSessions: oauthsessionStoreRedis, - SettingsActionGrantService: settingsActionGrantService, - Authorizations: authorizationService, - Graph: interactionService, + Logger: serviceLogger, + Request: request, + Sessions: sessionStoreRedis, + SessionCookie: sessionCookieDef, + SignedUpCookie: signedUpCookieDef, + MFADeviceTokenCookie: cookieDef, + ErrorCookie: errorCookie, + Cookies: cookieManager, + OAuthConfig: oAuthConfig, + UIConfig: uiConfig, + TrustProxy: trustProxy, + UIInfoResolver: uiInfoResolver, + OAuthClientResolver: oauthclientResolver, + Graph: interactionService, } uiFeatureConfig := featureConfig.UI forgotPasswordConfig := appConfig.ForgotPassword @@ -23756,39 +23357,6 @@ func newWebAppSetupWhatsappOTPHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, ClientResolver: oauthclientResolver, } - oauthsessionStoreRedis := oauthsession.StoreRedis{ - Context: contextContext, - Redis: appredisHandle, - AppID: appID, - } - tokenGenerator := _wireTokenGeneratorValue - settingsActionGrantService := handler.SettingsActionGrantService{ - AppID: appID, - CodeGenerator: tokenGenerator, - Clock: clockClock, - SettingsActionGrants: redisStore, - } - authorizationStore := &pq.AuthorizationStore{ - SQLBuilder: sqlBuilderApp, - SQLExecutor: sqlExecutor, - } - offlineGrantService := oauth2.OfflineGrantService{ - OAuthConfig: oAuthConfig, - Clock: clockClock, - IDPSessions: idpsessionProvider, - ClientResolver: oauthclientResolver, - } - sessionManager := &oauth2.SessionManager{ - Store: redisStore, - Config: oAuthConfig, - Service: offlineGrantService, - } - authorizationService := &oauth2.AuthorizationService{ - AppID: appID, - Store: authorizationStore, - Clock: clockClock, - OAuthSessionManager: sessionManager, - } interactionLogger := interaction.NewLogger(factory) eventLogger := event.NewLogger(factory) sqlBuilder := appdb.NewSQLBuilder(databaseCredentials) @@ -23907,6 +23475,10 @@ func newWebAppSetupWhatsappOTPHandler(p *deps.RequestProvider) http.Handler { UserStore: store, Events: eventService, } + authorizationStore := &pq.AuthorizationStore{ + SQLBuilder: sqlBuilderApp, + SQLExecutor: sqlExecutor, + } cookieDef2 := session.NewSessionCookieDef(sessionConfig) idpsessionManager := &idpsession.Manager{ Store: idpsessionStoreRedis, @@ -23914,6 +23486,17 @@ func newWebAppSetupWhatsappOTPHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, CookieDef: cookieDef2, } + offlineGrantService := oauth2.OfflineGrantService{ + OAuthConfig: oAuthConfig, + Clock: clockClock, + IDPSessions: idpsessionProvider, + ClientResolver: oauthclientResolver, + } + sessionManager := &oauth2.SessionManager{ + Store: redisStore, + Config: oAuthConfig, + Service: offlineGrantService, + } accountDeletionConfig := appConfig.AccountDeletion accountAnonymizationConfig := appConfig.AccountAnonymization coordinator := &facade.Coordinator{ @@ -24052,7 +23635,7 @@ func newWebAppSetupWhatsappOTPHandler(p *deps.RequestProvider) http.Handler { AccessTokenSessions: sessionManager, Events: eventService, } - storeRedis2 := &oauthsession.StoreRedis{ + oauthsessionStoreRedis := &oauthsession.StoreRedis{ Context: contextContext, Redis: appredisHandle, AppID: appID, @@ -24091,7 +23674,7 @@ func newWebAppSetupWhatsappOTPHandler(p *deps.RequestProvider) http.Handler { Sessions: idpsessionProvider, SessionManager: manager2, SessionCookie: cookieDef2, - OAuthSessions: storeRedis2, + OAuthSessions: oauthsessionStoreRedis, MFADeviceTokenCookie: cookieDef, } interactionStoreRedis := &interaction.StoreRedis{ @@ -24104,23 +23687,20 @@ func newWebAppSetupWhatsappOTPHandler(p *deps.RequestProvider) http.Handler { Store: interactionStoreRedis, } webappService2 := &webapp2.Service2{ - Logger: serviceLogger, - Request: request, - Sessions: sessionStoreRedis, - SessionCookie: sessionCookieDef, - SignedUpCookie: signedUpCookieDef, - MFADeviceTokenCookie: cookieDef, - ErrorCookie: errorCookie, - Cookies: cookieManager, - OAuthConfig: oAuthConfig, - UIConfig: uiConfig, - TrustProxy: trustProxy, - UIInfoResolver: uiInfoResolver, - OAuthClientResolver: oauthclientResolver, - OAuthSessions: oauthsessionStoreRedis, - SettingsActionGrantService: settingsActionGrantService, - Authorizations: authorizationService, - Graph: interactionService, + Logger: serviceLogger, + Request: request, + Sessions: sessionStoreRedis, + SessionCookie: sessionCookieDef, + SignedUpCookie: signedUpCookieDef, + MFADeviceTokenCookie: cookieDef, + ErrorCookie: errorCookie, + Cookies: cookieManager, + OAuthConfig: oAuthConfig, + UIConfig: uiConfig, + TrustProxy: trustProxy, + UIInfoResolver: uiInfoResolver, + OAuthClientResolver: oauthclientResolver, + Graph: interactionService, } uiFeatureConfig := featureConfig.UI forgotPasswordConfig := appConfig.ForgotPassword @@ -24627,39 +24207,6 @@ func newWebAppWhatsappOTPHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, ClientResolver: oauthclientResolver, } - oauthsessionStoreRedis := oauthsession.StoreRedis{ - Context: contextContext, - Redis: appredisHandle, - AppID: appID, - } - tokenGenerator := _wireTokenGeneratorValue - settingsActionGrantService := handler.SettingsActionGrantService{ - AppID: appID, - CodeGenerator: tokenGenerator, - Clock: clockClock, - SettingsActionGrants: redisStore, - } - authorizationStore := &pq.AuthorizationStore{ - SQLBuilder: sqlBuilderApp, - SQLExecutor: sqlExecutor, - } - offlineGrantService := oauth2.OfflineGrantService{ - OAuthConfig: oAuthConfig, - Clock: clockClock, - IDPSessions: idpsessionProvider, - ClientResolver: oauthclientResolver, - } - sessionManager := &oauth2.SessionManager{ - Store: redisStore, - Config: oAuthConfig, - Service: offlineGrantService, - } - authorizationService := &oauth2.AuthorizationService{ - AppID: appID, - Store: authorizationStore, - Clock: clockClock, - OAuthSessionManager: sessionManager, - } interactionLogger := interaction.NewLogger(factory) eventLogger := event.NewLogger(factory) sqlBuilder := appdb.NewSQLBuilder(databaseCredentials) @@ -24778,6 +24325,10 @@ func newWebAppWhatsappOTPHandler(p *deps.RequestProvider) http.Handler { UserStore: store, Events: eventService, } + authorizationStore := &pq.AuthorizationStore{ + SQLBuilder: sqlBuilderApp, + SQLExecutor: sqlExecutor, + } cookieDef2 := session.NewSessionCookieDef(sessionConfig) idpsessionManager := &idpsession.Manager{ Store: idpsessionStoreRedis, @@ -24785,6 +24336,17 @@ func newWebAppWhatsappOTPHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, CookieDef: cookieDef2, } + offlineGrantService := oauth2.OfflineGrantService{ + OAuthConfig: oAuthConfig, + Clock: clockClock, + IDPSessions: idpsessionProvider, + ClientResolver: oauthclientResolver, + } + sessionManager := &oauth2.SessionManager{ + Store: redisStore, + Config: oAuthConfig, + Service: offlineGrantService, + } accountDeletionConfig := appConfig.AccountDeletion accountAnonymizationConfig := appConfig.AccountAnonymization coordinator := &facade.Coordinator{ @@ -24923,7 +24485,7 @@ func newWebAppWhatsappOTPHandler(p *deps.RequestProvider) http.Handler { AccessTokenSessions: sessionManager, Events: eventService, } - storeRedis2 := &oauthsession.StoreRedis{ + oauthsessionStoreRedis := &oauthsession.StoreRedis{ Context: contextContext, Redis: appredisHandle, AppID: appID, @@ -24962,7 +24524,7 @@ func newWebAppWhatsappOTPHandler(p *deps.RequestProvider) http.Handler { Sessions: idpsessionProvider, SessionManager: manager2, SessionCookie: cookieDef2, - OAuthSessions: storeRedis2, + OAuthSessions: oauthsessionStoreRedis, MFADeviceTokenCookie: cookieDef, } interactionStoreRedis := &interaction.StoreRedis{ @@ -24975,23 +24537,20 @@ func newWebAppWhatsappOTPHandler(p *deps.RequestProvider) http.Handler { Store: interactionStoreRedis, } webappService2 := &webapp2.Service2{ - Logger: serviceLogger, - Request: request, - Sessions: sessionStoreRedis, - SessionCookie: sessionCookieDef, - SignedUpCookie: signedUpCookieDef, - MFADeviceTokenCookie: cookieDef, - ErrorCookie: errorCookie, - Cookies: cookieManager, - OAuthConfig: oAuthConfig, - UIConfig: uiConfig, - TrustProxy: trustProxy, - UIInfoResolver: uiInfoResolver, - OAuthClientResolver: oauthclientResolver, - OAuthSessions: oauthsessionStoreRedis, - SettingsActionGrantService: settingsActionGrantService, - Authorizations: authorizationService, - Graph: interactionService, + Logger: serviceLogger, + Request: request, + Sessions: sessionStoreRedis, + SessionCookie: sessionCookieDef, + SignedUpCookie: signedUpCookieDef, + MFADeviceTokenCookie: cookieDef, + ErrorCookie: errorCookie, + Cookies: cookieManager, + OAuthConfig: oAuthConfig, + UIConfig: uiConfig, + TrustProxy: trustProxy, + UIInfoResolver: uiInfoResolver, + OAuthClientResolver: oauthclientResolver, + Graph: interactionService, } uiFeatureConfig := featureConfig.UI forgotPasswordConfig := appConfig.ForgotPassword @@ -25502,39 +25061,6 @@ func newWebAppSetupLoginLinkOTPHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, ClientResolver: oauthclientResolver, } - oauthsessionStoreRedis := oauthsession.StoreRedis{ - Context: contextContext, - Redis: appredisHandle, - AppID: appID, - } - tokenGenerator := _wireTokenGeneratorValue - settingsActionGrantService := handler.SettingsActionGrantService{ - AppID: appID, - CodeGenerator: tokenGenerator, - Clock: clockClock, - SettingsActionGrants: redisStore, - } - authorizationStore := &pq.AuthorizationStore{ - SQLBuilder: sqlBuilderApp, - SQLExecutor: sqlExecutor, - } - offlineGrantService := oauth2.OfflineGrantService{ - OAuthConfig: oAuthConfig, - Clock: clockClock, - IDPSessions: idpsessionProvider, - ClientResolver: oauthclientResolver, - } - sessionManager := &oauth2.SessionManager{ - Store: redisStore, - Config: oAuthConfig, - Service: offlineGrantService, - } - authorizationService := &oauth2.AuthorizationService{ - AppID: appID, - Store: authorizationStore, - Clock: clockClock, - OAuthSessionManager: sessionManager, - } interactionLogger := interaction.NewLogger(factory) eventLogger := event.NewLogger(factory) sqlBuilder := appdb.NewSQLBuilder(databaseCredentials) @@ -25653,6 +25179,10 @@ func newWebAppSetupLoginLinkOTPHandler(p *deps.RequestProvider) http.Handler { UserStore: store, Events: eventService, } + authorizationStore := &pq.AuthorizationStore{ + SQLBuilder: sqlBuilderApp, + SQLExecutor: sqlExecutor, + } cookieDef2 := session.NewSessionCookieDef(sessionConfig) idpsessionManager := &idpsession.Manager{ Store: idpsessionStoreRedis, @@ -25660,6 +25190,17 @@ func newWebAppSetupLoginLinkOTPHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, CookieDef: cookieDef2, } + offlineGrantService := oauth2.OfflineGrantService{ + OAuthConfig: oAuthConfig, + Clock: clockClock, + IDPSessions: idpsessionProvider, + ClientResolver: oauthclientResolver, + } + sessionManager := &oauth2.SessionManager{ + Store: redisStore, + Config: oAuthConfig, + Service: offlineGrantService, + } accountDeletionConfig := appConfig.AccountDeletion accountAnonymizationConfig := appConfig.AccountAnonymization coordinator := &facade.Coordinator{ @@ -25798,7 +25339,7 @@ func newWebAppSetupLoginLinkOTPHandler(p *deps.RequestProvider) http.Handler { AccessTokenSessions: sessionManager, Events: eventService, } - storeRedis2 := &oauthsession.StoreRedis{ + oauthsessionStoreRedis := &oauthsession.StoreRedis{ Context: contextContext, Redis: appredisHandle, AppID: appID, @@ -25837,7 +25378,7 @@ func newWebAppSetupLoginLinkOTPHandler(p *deps.RequestProvider) http.Handler { Sessions: idpsessionProvider, SessionManager: manager2, SessionCookie: cookieDef2, - OAuthSessions: storeRedis2, + OAuthSessions: oauthsessionStoreRedis, MFADeviceTokenCookie: cookieDef, } interactionStoreRedis := &interaction.StoreRedis{ @@ -25850,23 +25391,20 @@ func newWebAppSetupLoginLinkOTPHandler(p *deps.RequestProvider) http.Handler { Store: interactionStoreRedis, } webappService2 := &webapp2.Service2{ - Logger: serviceLogger, - Request: request, - Sessions: sessionStoreRedis, - SessionCookie: sessionCookieDef, - SignedUpCookie: signedUpCookieDef, - MFADeviceTokenCookie: cookieDef, - ErrorCookie: errorCookie, - Cookies: cookieManager, - OAuthConfig: oAuthConfig, - UIConfig: uiConfig, - TrustProxy: trustProxy, - UIInfoResolver: uiInfoResolver, - OAuthClientResolver: oauthclientResolver, - OAuthSessions: oauthsessionStoreRedis, - SettingsActionGrantService: settingsActionGrantService, - Authorizations: authorizationService, - Graph: interactionService, + Logger: serviceLogger, + Request: request, + Sessions: sessionStoreRedis, + SessionCookie: sessionCookieDef, + SignedUpCookie: signedUpCookieDef, + MFADeviceTokenCookie: cookieDef, + ErrorCookie: errorCookie, + Cookies: cookieManager, + OAuthConfig: oAuthConfig, + UIConfig: uiConfig, + TrustProxy: trustProxy, + UIInfoResolver: uiInfoResolver, + OAuthClientResolver: oauthclientResolver, + Graph: interactionService, } uiFeatureConfig := featureConfig.UI forgotPasswordConfig := appConfig.ForgotPassword @@ -26373,39 +25911,6 @@ func newWebAppLoginLinkOTPHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, ClientResolver: oauthclientResolver, } - oauthsessionStoreRedis := oauthsession.StoreRedis{ - Context: contextContext, - Redis: handle, - AppID: appID, - } - tokenGenerator := _wireTokenGeneratorValue - settingsActionGrantService := handler.SettingsActionGrantService{ - AppID: appID, - CodeGenerator: tokenGenerator, - Clock: clockClock, - SettingsActionGrants: redisStore, - } - authorizationStore := &pq.AuthorizationStore{ - SQLBuilder: sqlBuilderApp, - SQLExecutor: sqlExecutor, - } - offlineGrantService := oauth2.OfflineGrantService{ - OAuthConfig: oAuthConfig, - Clock: clockClock, - IDPSessions: idpsessionProvider, - ClientResolver: oauthclientResolver, - } - sessionManager := &oauth2.SessionManager{ - Store: redisStore, - Config: oAuthConfig, - Service: offlineGrantService, - } - authorizationService := &oauth2.AuthorizationService{ - AppID: appID, - Store: authorizationStore, - Clock: clockClock, - OAuthSessionManager: sessionManager, - } interactionLogger := interaction.NewLogger(factory) eventLogger := event.NewLogger(factory) sqlBuilder := appdb.NewSQLBuilder(databaseCredentials) @@ -26524,6 +26029,10 @@ func newWebAppLoginLinkOTPHandler(p *deps.RequestProvider) http.Handler { UserStore: store, Events: eventService, } + authorizationStore := &pq.AuthorizationStore{ + SQLBuilder: sqlBuilderApp, + SQLExecutor: sqlExecutor, + } cookieDef2 := session.NewSessionCookieDef(sessionConfig) idpsessionManager := &idpsession.Manager{ Store: idpsessionStoreRedis, @@ -26531,6 +26040,17 @@ func newWebAppLoginLinkOTPHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, CookieDef: cookieDef2, } + offlineGrantService := oauth2.OfflineGrantService{ + OAuthConfig: oAuthConfig, + Clock: clockClock, + IDPSessions: idpsessionProvider, + ClientResolver: oauthclientResolver, + } + sessionManager := &oauth2.SessionManager{ + Store: redisStore, + Config: oAuthConfig, + Service: offlineGrantService, + } accountDeletionConfig := appConfig.AccountDeletion accountAnonymizationConfig := appConfig.AccountAnonymization coordinator := &facade.Coordinator{ @@ -26669,7 +26189,7 @@ func newWebAppLoginLinkOTPHandler(p *deps.RequestProvider) http.Handler { AccessTokenSessions: sessionManager, Events: eventService, } - storeRedis2 := &oauthsession.StoreRedis{ + oauthsessionStoreRedis := &oauthsession.StoreRedis{ Context: contextContext, Redis: handle, AppID: appID, @@ -26708,7 +26228,7 @@ func newWebAppLoginLinkOTPHandler(p *deps.RequestProvider) http.Handler { Sessions: idpsessionProvider, SessionManager: manager2, SessionCookie: cookieDef2, - OAuthSessions: storeRedis2, + OAuthSessions: oauthsessionStoreRedis, MFADeviceTokenCookie: cookieDef, } interactionStoreRedis := &interaction.StoreRedis{ @@ -26721,23 +26241,20 @@ func newWebAppLoginLinkOTPHandler(p *deps.RequestProvider) http.Handler { Store: interactionStoreRedis, } webappService2 := &webapp2.Service2{ - Logger: serviceLogger, - Request: request, - Sessions: sessionStoreRedis, - SessionCookie: sessionCookieDef, - SignedUpCookie: signedUpCookieDef, - MFADeviceTokenCookie: cookieDef, - ErrorCookie: errorCookie, - Cookies: cookieManager, - OAuthConfig: oAuthConfig, - UIConfig: uiConfig, - TrustProxy: trustProxy, - UIInfoResolver: uiInfoResolver, - OAuthClientResolver: oauthclientResolver, - OAuthSessions: oauthsessionStoreRedis, - SettingsActionGrantService: settingsActionGrantService, - Authorizations: authorizationService, - Graph: interactionService, + Logger: serviceLogger, + Request: request, + Sessions: sessionStoreRedis, + SessionCookie: sessionCookieDef, + SignedUpCookie: signedUpCookieDef, + MFADeviceTokenCookie: cookieDef, + ErrorCookie: errorCookie, + Cookies: cookieManager, + OAuthConfig: oAuthConfig, + UIConfig: uiConfig, + TrustProxy: trustProxy, + UIInfoResolver: uiInfoResolver, + OAuthClientResolver: oauthclientResolver, + Graph: interactionService, } uiFeatureConfig := featureConfig.UI forgotPasswordConfig := appConfig.ForgotPassword @@ -27252,39 +26769,6 @@ func newWebAppVerifyLoginLinkOTPHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, ClientResolver: oauthclientResolver, } - oauthsessionStoreRedis := oauthsession.StoreRedis{ - Context: contextContext, - Redis: handle, - AppID: appID, - } - tokenGenerator := _wireTokenGeneratorValue - settingsActionGrantService := handler.SettingsActionGrantService{ - AppID: appID, - CodeGenerator: tokenGenerator, - Clock: clockClock, - SettingsActionGrants: redisStore, - } - authorizationStore := &pq.AuthorizationStore{ - SQLBuilder: sqlBuilderApp, - SQLExecutor: sqlExecutor, - } - offlineGrantService := oauth2.OfflineGrantService{ - OAuthConfig: oAuthConfig, - Clock: clockClock, - IDPSessions: idpsessionProvider, - ClientResolver: oauthclientResolver, - } - sessionManager := &oauth2.SessionManager{ - Store: redisStore, - Config: oAuthConfig, - Service: offlineGrantService, - } - authorizationService := &oauth2.AuthorizationService{ - AppID: appID, - Store: authorizationStore, - Clock: clockClock, - OAuthSessionManager: sessionManager, - } interactionLogger := interaction.NewLogger(factory) eventLogger := event.NewLogger(factory) sqlBuilder := appdb.NewSQLBuilder(databaseCredentials) @@ -27403,6 +26887,10 @@ func newWebAppVerifyLoginLinkOTPHandler(p *deps.RequestProvider) http.Handler { UserStore: store, Events: eventService, } + authorizationStore := &pq.AuthorizationStore{ + SQLBuilder: sqlBuilderApp, + SQLExecutor: sqlExecutor, + } cookieDef2 := session.NewSessionCookieDef(sessionConfig) idpsessionManager := &idpsession.Manager{ Store: idpsessionStoreRedis, @@ -27410,6 +26898,17 @@ func newWebAppVerifyLoginLinkOTPHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, CookieDef: cookieDef2, } + offlineGrantService := oauth2.OfflineGrantService{ + OAuthConfig: oAuthConfig, + Clock: clockClock, + IDPSessions: idpsessionProvider, + ClientResolver: oauthclientResolver, + } + sessionManager := &oauth2.SessionManager{ + Store: redisStore, + Config: oAuthConfig, + Service: offlineGrantService, + } accountDeletionConfig := appConfig.AccountDeletion accountAnonymizationConfig := appConfig.AccountAnonymization coordinator := &facade.Coordinator{ @@ -27548,7 +27047,7 @@ func newWebAppVerifyLoginLinkOTPHandler(p *deps.RequestProvider) http.Handler { AccessTokenSessions: sessionManager, Events: eventService, } - storeRedis2 := &oauthsession.StoreRedis{ + oauthsessionStoreRedis := &oauthsession.StoreRedis{ Context: contextContext, Redis: handle, AppID: appID, @@ -27587,7 +27086,7 @@ func newWebAppVerifyLoginLinkOTPHandler(p *deps.RequestProvider) http.Handler { Sessions: idpsessionProvider, SessionManager: manager2, SessionCookie: cookieDef2, - OAuthSessions: storeRedis2, + OAuthSessions: oauthsessionStoreRedis, MFADeviceTokenCookie: cookieDef, } interactionStoreRedis := &interaction.StoreRedis{ @@ -27600,23 +27099,20 @@ func newWebAppVerifyLoginLinkOTPHandler(p *deps.RequestProvider) http.Handler { Store: interactionStoreRedis, } webappService2 := &webapp2.Service2{ - Logger: serviceLogger, - Request: request, - Sessions: sessionStoreRedis, - SessionCookie: sessionCookieDef, - SignedUpCookie: signedUpCookieDef, - MFADeviceTokenCookie: cookieDef, - ErrorCookie: errorCookie, - Cookies: cookieManager, - OAuthConfig: oAuthConfig, - UIConfig: uiConfig, - TrustProxy: trustProxy, - UIInfoResolver: uiInfoResolver, - OAuthClientResolver: oauthclientResolver, - OAuthSessions: oauthsessionStoreRedis, - SettingsActionGrantService: settingsActionGrantService, - Authorizations: authorizationService, - Graph: interactionService, + Logger: serviceLogger, + Request: request, + Sessions: sessionStoreRedis, + SessionCookie: sessionCookieDef, + SignedUpCookie: signedUpCookieDef, + MFADeviceTokenCookie: cookieDef, + ErrorCookie: errorCookie, + Cookies: cookieManager, + OAuthConfig: oAuthConfig, + UIConfig: uiConfig, + TrustProxy: trustProxy, + UIInfoResolver: uiInfoResolver, + OAuthClientResolver: oauthclientResolver, + Graph: interactionService, } uiFeatureConfig := featureConfig.UI forgotPasswordConfig := appConfig.ForgotPassword @@ -28145,39 +27641,6 @@ func newWebAppAuthflowV2VerifyLoginLinkOTPHandler(p *deps.RequestProvider) http. Cookies: cookieManager, ClientResolver: oauthclientResolver, } - oauthsessionStoreRedis := oauthsession.StoreRedis{ - Context: contextContext, - Redis: handle, - AppID: appID, - } - tokenGenerator := _wireTokenGeneratorValue - settingsActionGrantService := handler.SettingsActionGrantService{ - AppID: appID, - CodeGenerator: tokenGenerator, - Clock: clockClock, - SettingsActionGrants: redisStore, - } - authorizationStore := &pq.AuthorizationStore{ - SQLBuilder: sqlBuilderApp, - SQLExecutor: sqlExecutor, - } - offlineGrantService := oauth2.OfflineGrantService{ - OAuthConfig: oAuthConfig, - Clock: clockClock, - IDPSessions: idpsessionProvider, - ClientResolver: oauthclientResolver, - } - sessionManager := &oauth2.SessionManager{ - Store: redisStore, - Config: oAuthConfig, - Service: offlineGrantService, - } - authorizationService := &oauth2.AuthorizationService{ - AppID: appID, - Store: authorizationStore, - Clock: clockClock, - OAuthSessionManager: sessionManager, - } interactionLogger := interaction.NewLogger(factory) eventLogger := event.NewLogger(factory) sqlBuilder := appdb.NewSQLBuilder(databaseCredentials) @@ -28296,6 +27759,10 @@ func newWebAppAuthflowV2VerifyLoginLinkOTPHandler(p *deps.RequestProvider) http. UserStore: store, Events: eventService, } + authorizationStore := &pq.AuthorizationStore{ + SQLBuilder: sqlBuilderApp, + SQLExecutor: sqlExecutor, + } cookieDef2 := session.NewSessionCookieDef(sessionConfig) idpsessionManager := &idpsession.Manager{ Store: idpsessionStoreRedis, @@ -28303,6 +27770,17 @@ func newWebAppAuthflowV2VerifyLoginLinkOTPHandler(p *deps.RequestProvider) http. Cookies: cookieManager, CookieDef: cookieDef2, } + offlineGrantService := oauth2.OfflineGrantService{ + OAuthConfig: oAuthConfig, + Clock: clockClock, + IDPSessions: idpsessionProvider, + ClientResolver: oauthclientResolver, + } + sessionManager := &oauth2.SessionManager{ + Store: redisStore, + Config: oAuthConfig, + Service: offlineGrantService, + } accountDeletionConfig := appConfig.AccountDeletion accountAnonymizationConfig := appConfig.AccountAnonymization coordinator := &facade.Coordinator{ @@ -28441,7 +27919,7 @@ func newWebAppAuthflowV2VerifyLoginLinkOTPHandler(p *deps.RequestProvider) http. AccessTokenSessions: sessionManager, Events: eventService, } - storeRedis2 := &oauthsession.StoreRedis{ + oauthsessionStoreRedis := &oauthsession.StoreRedis{ Context: contextContext, Redis: handle, AppID: appID, @@ -28480,7 +27958,7 @@ func newWebAppAuthflowV2VerifyLoginLinkOTPHandler(p *deps.RequestProvider) http. Sessions: idpsessionProvider, SessionManager: manager2, SessionCookie: cookieDef2, - OAuthSessions: storeRedis2, + OAuthSessions: oauthsessionStoreRedis, MFADeviceTokenCookie: cookieDef, } interactionStoreRedis := &interaction.StoreRedis{ @@ -28493,23 +27971,20 @@ func newWebAppAuthflowV2VerifyLoginLinkOTPHandler(p *deps.RequestProvider) http. Store: interactionStoreRedis, } webappService2 := &webapp2.Service2{ - Logger: serviceLogger, - Request: request, - Sessions: sessionStoreRedis, - SessionCookie: sessionCookieDef, - SignedUpCookie: signedUpCookieDef, - MFADeviceTokenCookie: cookieDef, - ErrorCookie: errorCookie, - Cookies: cookieManager, - OAuthConfig: oAuthConfig, - UIConfig: uiConfig, - TrustProxy: trustProxy, - UIInfoResolver: uiInfoResolver, - OAuthClientResolver: oauthclientResolver, - OAuthSessions: oauthsessionStoreRedis, - SettingsActionGrantService: settingsActionGrantService, - Authorizations: authorizationService, - Graph: interactionService, + Logger: serviceLogger, + Request: request, + Sessions: sessionStoreRedis, + SessionCookie: sessionCookieDef, + SignedUpCookie: signedUpCookieDef, + MFADeviceTokenCookie: cookieDef, + ErrorCookie: errorCookie, + Cookies: cookieManager, + OAuthConfig: oAuthConfig, + UIConfig: uiConfig, + TrustProxy: trustProxy, + UIInfoResolver: uiInfoResolver, + OAuthClientResolver: oauthclientResolver, + Graph: interactionService, } uiFeatureConfig := featureConfig.UI forgotPasswordConfig := appConfig.ForgotPassword @@ -29027,39 +28502,6 @@ func newWebAppEnterRecoveryCodeHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, ClientResolver: oauthclientResolver, } - oauthsessionStoreRedis := oauthsession.StoreRedis{ - Context: contextContext, - Redis: appredisHandle, - AppID: appID, - } - tokenGenerator := _wireTokenGeneratorValue - settingsActionGrantService := handler.SettingsActionGrantService{ - AppID: appID, - CodeGenerator: tokenGenerator, - Clock: clockClock, - SettingsActionGrants: redisStore, - } - authorizationStore := &pq.AuthorizationStore{ - SQLBuilder: sqlBuilderApp, - SQLExecutor: sqlExecutor, - } - offlineGrantService := oauth2.OfflineGrantService{ - OAuthConfig: oAuthConfig, - Clock: clockClock, - IDPSessions: idpsessionProvider, - ClientResolver: oauthclientResolver, - } - sessionManager := &oauth2.SessionManager{ - Store: redisStore, - Config: oAuthConfig, - Service: offlineGrantService, - } - authorizationService := &oauth2.AuthorizationService{ - AppID: appID, - Store: authorizationStore, - Clock: clockClock, - OAuthSessionManager: sessionManager, - } interactionLogger := interaction.NewLogger(factory) eventLogger := event.NewLogger(factory) sqlBuilder := appdb.NewSQLBuilder(databaseCredentials) @@ -29178,6 +28620,10 @@ func newWebAppEnterRecoveryCodeHandler(p *deps.RequestProvider) http.Handler { UserStore: store, Events: eventService, } + authorizationStore := &pq.AuthorizationStore{ + SQLBuilder: sqlBuilderApp, + SQLExecutor: sqlExecutor, + } cookieDef2 := session.NewSessionCookieDef(sessionConfig) idpsessionManager := &idpsession.Manager{ Store: idpsessionStoreRedis, @@ -29185,6 +28631,17 @@ func newWebAppEnterRecoveryCodeHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, CookieDef: cookieDef2, } + offlineGrantService := oauth2.OfflineGrantService{ + OAuthConfig: oAuthConfig, + Clock: clockClock, + IDPSessions: idpsessionProvider, + ClientResolver: oauthclientResolver, + } + sessionManager := &oauth2.SessionManager{ + Store: redisStore, + Config: oAuthConfig, + Service: offlineGrantService, + } accountDeletionConfig := appConfig.AccountDeletion accountAnonymizationConfig := appConfig.AccountAnonymization coordinator := &facade.Coordinator{ @@ -29323,7 +28780,7 @@ func newWebAppEnterRecoveryCodeHandler(p *deps.RequestProvider) http.Handler { AccessTokenSessions: sessionManager, Events: eventService, } - storeRedis2 := &oauthsession.StoreRedis{ + oauthsessionStoreRedis := &oauthsession.StoreRedis{ Context: contextContext, Redis: appredisHandle, AppID: appID, @@ -29362,7 +28819,7 @@ func newWebAppEnterRecoveryCodeHandler(p *deps.RequestProvider) http.Handler { Sessions: idpsessionProvider, SessionManager: manager2, SessionCookie: cookieDef2, - OAuthSessions: storeRedis2, + OAuthSessions: oauthsessionStoreRedis, MFADeviceTokenCookie: cookieDef, } interactionStoreRedis := &interaction.StoreRedis{ @@ -29375,23 +28832,20 @@ func newWebAppEnterRecoveryCodeHandler(p *deps.RequestProvider) http.Handler { Store: interactionStoreRedis, } webappService2 := &webapp2.Service2{ - Logger: serviceLogger, - Request: request, - Sessions: sessionStoreRedis, - SessionCookie: sessionCookieDef, - SignedUpCookie: signedUpCookieDef, - MFADeviceTokenCookie: cookieDef, - ErrorCookie: errorCookie, - Cookies: cookieManager, - OAuthConfig: oAuthConfig, - UIConfig: uiConfig, - TrustProxy: trustProxy, - UIInfoResolver: uiInfoResolver, - OAuthClientResolver: oauthclientResolver, - OAuthSessions: oauthsessionStoreRedis, - SettingsActionGrantService: settingsActionGrantService, - Authorizations: authorizationService, - Graph: interactionService, + Logger: serviceLogger, + Request: request, + Sessions: sessionStoreRedis, + SessionCookie: sessionCookieDef, + SignedUpCookie: signedUpCookieDef, + MFADeviceTokenCookie: cookieDef, + ErrorCookie: errorCookie, + Cookies: cookieManager, + OAuthConfig: oAuthConfig, + UIConfig: uiConfig, + TrustProxy: trustProxy, + UIInfoResolver: uiInfoResolver, + OAuthClientResolver: oauthclientResolver, + Graph: interactionService, } uiFeatureConfig := featureConfig.UI forgotPasswordConfig := appConfig.ForgotPassword @@ -29898,39 +29352,6 @@ func newWebAppSetupRecoveryCodeHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, ClientResolver: oauthclientResolver, } - oauthsessionStoreRedis := oauthsession.StoreRedis{ - Context: contextContext, - Redis: appredisHandle, - AppID: appID, - } - tokenGenerator := _wireTokenGeneratorValue - settingsActionGrantService := handler.SettingsActionGrantService{ - AppID: appID, - CodeGenerator: tokenGenerator, - Clock: clockClock, - SettingsActionGrants: redisStore, - } - authorizationStore := &pq.AuthorizationStore{ - SQLBuilder: sqlBuilderApp, - SQLExecutor: sqlExecutor, - } - offlineGrantService := oauth2.OfflineGrantService{ - OAuthConfig: oAuthConfig, - Clock: clockClock, - IDPSessions: idpsessionProvider, - ClientResolver: oauthclientResolver, - } - sessionManager := &oauth2.SessionManager{ - Store: redisStore, - Config: oAuthConfig, - Service: offlineGrantService, - } - authorizationService := &oauth2.AuthorizationService{ - AppID: appID, - Store: authorizationStore, - Clock: clockClock, - OAuthSessionManager: sessionManager, - } interactionLogger := interaction.NewLogger(factory) eventLogger := event.NewLogger(factory) sqlBuilder := appdb.NewSQLBuilder(databaseCredentials) @@ -30049,6 +29470,10 @@ func newWebAppSetupRecoveryCodeHandler(p *deps.RequestProvider) http.Handler { UserStore: store, Events: eventService, } + authorizationStore := &pq.AuthorizationStore{ + SQLBuilder: sqlBuilderApp, + SQLExecutor: sqlExecutor, + } cookieDef2 := session.NewSessionCookieDef(sessionConfig) idpsessionManager := &idpsession.Manager{ Store: idpsessionStoreRedis, @@ -30056,6 +29481,17 @@ func newWebAppSetupRecoveryCodeHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, CookieDef: cookieDef2, } + offlineGrantService := oauth2.OfflineGrantService{ + OAuthConfig: oAuthConfig, + Clock: clockClock, + IDPSessions: idpsessionProvider, + ClientResolver: oauthclientResolver, + } + sessionManager := &oauth2.SessionManager{ + Store: redisStore, + Config: oAuthConfig, + Service: offlineGrantService, + } accountDeletionConfig := appConfig.AccountDeletion accountAnonymizationConfig := appConfig.AccountAnonymization coordinator := &facade.Coordinator{ @@ -30194,7 +29630,7 @@ func newWebAppSetupRecoveryCodeHandler(p *deps.RequestProvider) http.Handler { AccessTokenSessions: sessionManager, Events: eventService, } - storeRedis2 := &oauthsession.StoreRedis{ + oauthsessionStoreRedis := &oauthsession.StoreRedis{ Context: contextContext, Redis: appredisHandle, AppID: appID, @@ -30233,7 +29669,7 @@ func newWebAppSetupRecoveryCodeHandler(p *deps.RequestProvider) http.Handler { Sessions: idpsessionProvider, SessionManager: manager2, SessionCookie: cookieDef2, - OAuthSessions: storeRedis2, + OAuthSessions: oauthsessionStoreRedis, MFADeviceTokenCookie: cookieDef, } interactionStoreRedis := &interaction.StoreRedis{ @@ -30246,23 +29682,20 @@ func newWebAppSetupRecoveryCodeHandler(p *deps.RequestProvider) http.Handler { Store: interactionStoreRedis, } webappService2 := &webapp2.Service2{ - Logger: serviceLogger, - Request: request, - Sessions: sessionStoreRedis, - SessionCookie: sessionCookieDef, - SignedUpCookie: signedUpCookieDef, - MFADeviceTokenCookie: cookieDef, - ErrorCookie: errorCookie, - Cookies: cookieManager, - OAuthConfig: oAuthConfig, - UIConfig: uiConfig, - TrustProxy: trustProxy, - UIInfoResolver: uiInfoResolver, - OAuthClientResolver: oauthclientResolver, - OAuthSessions: oauthsessionStoreRedis, - SettingsActionGrantService: settingsActionGrantService, - Authorizations: authorizationService, - Graph: interactionService, + Logger: serviceLogger, + Request: request, + Sessions: sessionStoreRedis, + SessionCookie: sessionCookieDef, + SignedUpCookie: signedUpCookieDef, + MFADeviceTokenCookie: cookieDef, + ErrorCookie: errorCookie, + Cookies: cookieManager, + OAuthConfig: oAuthConfig, + UIConfig: uiConfig, + TrustProxy: trustProxy, + UIInfoResolver: uiInfoResolver, + OAuthClientResolver: oauthclientResolver, + Graph: interactionService, } uiFeatureConfig := featureConfig.UI forgotPasswordConfig := appConfig.ForgotPassword @@ -30765,39 +30198,6 @@ func newWebAppVerifyIdentityHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, ClientResolver: oauthclientResolver, } - oauthsessionStoreRedis := oauthsession.StoreRedis{ - Context: contextContext, - Redis: appredisHandle, - AppID: appID, - } - tokenGenerator := _wireTokenGeneratorValue - settingsActionGrantService := handler.SettingsActionGrantService{ - AppID: appID, - CodeGenerator: tokenGenerator, - Clock: clockClock, - SettingsActionGrants: redisStore, - } - authorizationStore := &pq.AuthorizationStore{ - SQLBuilder: sqlBuilderApp, - SQLExecutor: sqlExecutor, - } - offlineGrantService := oauth2.OfflineGrantService{ - OAuthConfig: oAuthConfig, - Clock: clockClock, - IDPSessions: idpsessionProvider, - ClientResolver: oauthclientResolver, - } - sessionManager := &oauth2.SessionManager{ - Store: redisStore, - Config: oAuthConfig, - Service: offlineGrantService, - } - authorizationService := &oauth2.AuthorizationService{ - AppID: appID, - Store: authorizationStore, - Clock: clockClock, - OAuthSessionManager: sessionManager, - } interactionLogger := interaction.NewLogger(factory) eventLogger := event.NewLogger(factory) sqlBuilder := appdb.NewSQLBuilder(databaseCredentials) @@ -30916,6 +30316,10 @@ func newWebAppVerifyIdentityHandler(p *deps.RequestProvider) http.Handler { UserStore: store, Events: eventService, } + authorizationStore := &pq.AuthorizationStore{ + SQLBuilder: sqlBuilderApp, + SQLExecutor: sqlExecutor, + } cookieDef2 := session.NewSessionCookieDef(sessionConfig) idpsessionManager := &idpsession.Manager{ Store: idpsessionStoreRedis, @@ -30923,6 +30327,17 @@ func newWebAppVerifyIdentityHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, CookieDef: cookieDef2, } + offlineGrantService := oauth2.OfflineGrantService{ + OAuthConfig: oAuthConfig, + Clock: clockClock, + IDPSessions: idpsessionProvider, + ClientResolver: oauthclientResolver, + } + sessionManager := &oauth2.SessionManager{ + Store: redisStore, + Config: oAuthConfig, + Service: offlineGrantService, + } accountDeletionConfig := appConfig.AccountDeletion accountAnonymizationConfig := appConfig.AccountAnonymization coordinator := &facade.Coordinator{ @@ -31061,7 +30476,7 @@ func newWebAppVerifyIdentityHandler(p *deps.RequestProvider) http.Handler { AccessTokenSessions: sessionManager, Events: eventService, } - storeRedis2 := &oauthsession.StoreRedis{ + oauthsessionStoreRedis := &oauthsession.StoreRedis{ Context: contextContext, Redis: appredisHandle, AppID: appID, @@ -31100,7 +30515,7 @@ func newWebAppVerifyIdentityHandler(p *deps.RequestProvider) http.Handler { Sessions: idpsessionProvider, SessionManager: manager2, SessionCookie: cookieDef2, - OAuthSessions: storeRedis2, + OAuthSessions: oauthsessionStoreRedis, MFADeviceTokenCookie: cookieDef, } interactionStoreRedis := &interaction.StoreRedis{ @@ -31113,23 +30528,20 @@ func newWebAppVerifyIdentityHandler(p *deps.RequestProvider) http.Handler { Store: interactionStoreRedis, } webappService2 := &webapp2.Service2{ - Logger: serviceLogger, - Request: request, - Sessions: sessionStoreRedis, - SessionCookie: sessionCookieDef, - SignedUpCookie: signedUpCookieDef, - MFADeviceTokenCookie: cookieDef, - ErrorCookie: errorCookie, - Cookies: cookieManager, - OAuthConfig: oAuthConfig, - UIConfig: uiConfig, - TrustProxy: trustProxy, - UIInfoResolver: uiInfoResolver, - OAuthClientResolver: oauthclientResolver, - OAuthSessions: oauthsessionStoreRedis, - SettingsActionGrantService: settingsActionGrantService, - Authorizations: authorizationService, - Graph: interactionService, + Logger: serviceLogger, + Request: request, + Sessions: sessionStoreRedis, + SessionCookie: sessionCookieDef, + SignedUpCookie: signedUpCookieDef, + MFADeviceTokenCookie: cookieDef, + ErrorCookie: errorCookie, + Cookies: cookieManager, + OAuthConfig: oAuthConfig, + UIConfig: uiConfig, + TrustProxy: trustProxy, + UIInfoResolver: uiInfoResolver, + OAuthClientResolver: oauthclientResolver, + Graph: interactionService, } uiFeatureConfig := featureConfig.UI forgotPasswordConfig := appConfig.ForgotPassword @@ -31636,39 +31048,6 @@ func newWebAppVerifyIdentitySuccessHandler(p *deps.RequestProvider) http.Handler Cookies: cookieManager, ClientResolver: oauthclientResolver, } - oauthsessionStoreRedis := oauthsession.StoreRedis{ - Context: contextContext, - Redis: appredisHandle, - AppID: appID, - } - tokenGenerator := _wireTokenGeneratorValue - settingsActionGrantService := handler.SettingsActionGrantService{ - AppID: appID, - CodeGenerator: tokenGenerator, - Clock: clockClock, - SettingsActionGrants: redisStore, - } - authorizationStore := &pq.AuthorizationStore{ - SQLBuilder: sqlBuilderApp, - SQLExecutor: sqlExecutor, - } - offlineGrantService := oauth2.OfflineGrantService{ - OAuthConfig: oAuthConfig, - Clock: clockClock, - IDPSessions: idpsessionProvider, - ClientResolver: oauthclientResolver, - } - sessionManager := &oauth2.SessionManager{ - Store: redisStore, - Config: oAuthConfig, - Service: offlineGrantService, - } - authorizationService := &oauth2.AuthorizationService{ - AppID: appID, - Store: authorizationStore, - Clock: clockClock, - OAuthSessionManager: sessionManager, - } interactionLogger := interaction.NewLogger(factory) eventLogger := event.NewLogger(factory) sqlBuilder := appdb.NewSQLBuilder(databaseCredentials) @@ -31787,6 +31166,10 @@ func newWebAppVerifyIdentitySuccessHandler(p *deps.RequestProvider) http.Handler UserStore: store, Events: eventService, } + authorizationStore := &pq.AuthorizationStore{ + SQLBuilder: sqlBuilderApp, + SQLExecutor: sqlExecutor, + } cookieDef2 := session.NewSessionCookieDef(sessionConfig) idpsessionManager := &idpsession.Manager{ Store: idpsessionStoreRedis, @@ -31794,6 +31177,17 @@ func newWebAppVerifyIdentitySuccessHandler(p *deps.RequestProvider) http.Handler Cookies: cookieManager, CookieDef: cookieDef2, } + offlineGrantService := oauth2.OfflineGrantService{ + OAuthConfig: oAuthConfig, + Clock: clockClock, + IDPSessions: idpsessionProvider, + ClientResolver: oauthclientResolver, + } + sessionManager := &oauth2.SessionManager{ + Store: redisStore, + Config: oAuthConfig, + Service: offlineGrantService, + } accountDeletionConfig := appConfig.AccountDeletion accountAnonymizationConfig := appConfig.AccountAnonymization coordinator := &facade.Coordinator{ @@ -31932,7 +31326,7 @@ func newWebAppVerifyIdentitySuccessHandler(p *deps.RequestProvider) http.Handler AccessTokenSessions: sessionManager, Events: eventService, } - storeRedis2 := &oauthsession.StoreRedis{ + oauthsessionStoreRedis := &oauthsession.StoreRedis{ Context: contextContext, Redis: appredisHandle, AppID: appID, @@ -31971,7 +31365,7 @@ func newWebAppVerifyIdentitySuccessHandler(p *deps.RequestProvider) http.Handler Sessions: idpsessionProvider, SessionManager: manager2, SessionCookie: cookieDef2, - OAuthSessions: storeRedis2, + OAuthSessions: oauthsessionStoreRedis, MFADeviceTokenCookie: cookieDef, } interactionStoreRedis := &interaction.StoreRedis{ @@ -31984,23 +31378,20 @@ func newWebAppVerifyIdentitySuccessHandler(p *deps.RequestProvider) http.Handler Store: interactionStoreRedis, } webappService2 := &webapp2.Service2{ - Logger: serviceLogger, - Request: request, - Sessions: sessionStoreRedis, - SessionCookie: sessionCookieDef, - SignedUpCookie: signedUpCookieDef, - MFADeviceTokenCookie: cookieDef, - ErrorCookie: errorCookie, - Cookies: cookieManager, - OAuthConfig: oAuthConfig, - UIConfig: uiConfig, - TrustProxy: trustProxy, - UIInfoResolver: uiInfoResolver, - OAuthClientResolver: oauthclientResolver, - OAuthSessions: oauthsessionStoreRedis, - SettingsActionGrantService: settingsActionGrantService, - Authorizations: authorizationService, - Graph: interactionService, + Logger: serviceLogger, + Request: request, + Sessions: sessionStoreRedis, + SessionCookie: sessionCookieDef, + SignedUpCookie: signedUpCookieDef, + MFADeviceTokenCookie: cookieDef, + ErrorCookie: errorCookie, + Cookies: cookieManager, + OAuthConfig: oAuthConfig, + UIConfig: uiConfig, + TrustProxy: trustProxy, + UIInfoResolver: uiInfoResolver, + OAuthClientResolver: oauthclientResolver, + Graph: interactionService, } uiFeatureConfig := featureConfig.UI forgotPasswordConfig := appConfig.ForgotPassword @@ -32503,39 +31894,6 @@ func newWebAppForgotPasswordHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, ClientResolver: oauthclientResolver, } - oauthsessionStoreRedis := oauthsession.StoreRedis{ - Context: contextContext, - Redis: appredisHandle, - AppID: appID, - } - tokenGenerator := _wireTokenGeneratorValue - settingsActionGrantService := handler.SettingsActionGrantService{ - AppID: appID, - CodeGenerator: tokenGenerator, - Clock: clockClock, - SettingsActionGrants: redisStore, - } - authorizationStore := &pq.AuthorizationStore{ - SQLBuilder: sqlBuilderApp, - SQLExecutor: sqlExecutor, - } - offlineGrantService := oauth2.OfflineGrantService{ - OAuthConfig: oAuthConfig, - Clock: clockClock, - IDPSessions: idpsessionProvider, - ClientResolver: oauthclientResolver, - } - sessionManager := &oauth2.SessionManager{ - Store: redisStore, - Config: oAuthConfig, - Service: offlineGrantService, - } - authorizationService := &oauth2.AuthorizationService{ - AppID: appID, - Store: authorizationStore, - Clock: clockClock, - OAuthSessionManager: sessionManager, - } interactionLogger := interaction.NewLogger(factory) eventLogger := event.NewLogger(factory) sqlBuilder := appdb.NewSQLBuilder(databaseCredentials) @@ -32654,6 +32012,10 @@ func newWebAppForgotPasswordHandler(p *deps.RequestProvider) http.Handler { UserStore: store, Events: eventService, } + authorizationStore := &pq.AuthorizationStore{ + SQLBuilder: sqlBuilderApp, + SQLExecutor: sqlExecutor, + } cookieDef2 := session.NewSessionCookieDef(sessionConfig) idpsessionManager := &idpsession.Manager{ Store: idpsessionStoreRedis, @@ -32661,6 +32023,17 @@ func newWebAppForgotPasswordHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, CookieDef: cookieDef2, } + offlineGrantService := oauth2.OfflineGrantService{ + OAuthConfig: oAuthConfig, + Clock: clockClock, + IDPSessions: idpsessionProvider, + ClientResolver: oauthclientResolver, + } + sessionManager := &oauth2.SessionManager{ + Store: redisStore, + Config: oAuthConfig, + Service: offlineGrantService, + } accountDeletionConfig := appConfig.AccountDeletion accountAnonymizationConfig := appConfig.AccountAnonymization coordinator := &facade.Coordinator{ @@ -32799,7 +32172,7 @@ func newWebAppForgotPasswordHandler(p *deps.RequestProvider) http.Handler { AccessTokenSessions: sessionManager, Events: eventService, } - storeRedis2 := &oauthsession.StoreRedis{ + oauthsessionStoreRedis := &oauthsession.StoreRedis{ Context: contextContext, Redis: appredisHandle, AppID: appID, @@ -32838,7 +32211,7 @@ func newWebAppForgotPasswordHandler(p *deps.RequestProvider) http.Handler { Sessions: idpsessionProvider, SessionManager: manager2, SessionCookie: cookieDef2, - OAuthSessions: storeRedis2, + OAuthSessions: oauthsessionStoreRedis, MFADeviceTokenCookie: cookieDef, } interactionStoreRedis := &interaction.StoreRedis{ @@ -32851,23 +32224,20 @@ func newWebAppForgotPasswordHandler(p *deps.RequestProvider) http.Handler { Store: interactionStoreRedis, } webappService2 := &webapp2.Service2{ - Logger: serviceLogger, - Request: request, - Sessions: sessionStoreRedis, - SessionCookie: sessionCookieDef, - SignedUpCookie: signedUpCookieDef, - MFADeviceTokenCookie: cookieDef, - ErrorCookie: errorCookie, - Cookies: cookieManager, - OAuthConfig: oAuthConfig, - UIConfig: uiConfig, - TrustProxy: trustProxy, - UIInfoResolver: uiInfoResolver, - OAuthClientResolver: oauthclientResolver, - OAuthSessions: oauthsessionStoreRedis, - SettingsActionGrantService: settingsActionGrantService, - Authorizations: authorizationService, - Graph: interactionService, + Logger: serviceLogger, + Request: request, + Sessions: sessionStoreRedis, + SessionCookie: sessionCookieDef, + SignedUpCookie: signedUpCookieDef, + MFADeviceTokenCookie: cookieDef, + ErrorCookie: errorCookie, + Cookies: cookieManager, + OAuthConfig: oAuthConfig, + UIConfig: uiConfig, + TrustProxy: trustProxy, + UIInfoResolver: uiInfoResolver, + OAuthClientResolver: oauthclientResolver, + Graph: interactionService, } uiFeatureConfig := featureConfig.UI forgotPasswordConfig := appConfig.ForgotPassword @@ -33380,39 +32750,6 @@ func newWebAppForgotPasswordSuccessHandler(p *deps.RequestProvider) http.Handler Cookies: cookieManager, ClientResolver: oauthclientResolver, } - oauthsessionStoreRedis := oauthsession.StoreRedis{ - Context: contextContext, - Redis: appredisHandle, - AppID: appID, - } - tokenGenerator := _wireTokenGeneratorValue - settingsActionGrantService := handler.SettingsActionGrantService{ - AppID: appID, - CodeGenerator: tokenGenerator, - Clock: clockClock, - SettingsActionGrants: redisStore, - } - authorizationStore := &pq.AuthorizationStore{ - SQLBuilder: sqlBuilderApp, - SQLExecutor: sqlExecutor, - } - offlineGrantService := oauth2.OfflineGrantService{ - OAuthConfig: oAuthConfig, - Clock: clockClock, - IDPSessions: idpsessionProvider, - ClientResolver: oauthclientResolver, - } - sessionManager := &oauth2.SessionManager{ - Store: redisStore, - Config: oAuthConfig, - Service: offlineGrantService, - } - authorizationService := &oauth2.AuthorizationService{ - AppID: appID, - Store: authorizationStore, - Clock: clockClock, - OAuthSessionManager: sessionManager, - } interactionLogger := interaction.NewLogger(factory) eventLogger := event.NewLogger(factory) sqlBuilder := appdb.NewSQLBuilder(databaseCredentials) @@ -33531,6 +32868,10 @@ func newWebAppForgotPasswordSuccessHandler(p *deps.RequestProvider) http.Handler UserStore: store, Events: eventService, } + authorizationStore := &pq.AuthorizationStore{ + SQLBuilder: sqlBuilderApp, + SQLExecutor: sqlExecutor, + } cookieDef2 := session.NewSessionCookieDef(sessionConfig) idpsessionManager := &idpsession.Manager{ Store: idpsessionStoreRedis, @@ -33538,6 +32879,17 @@ func newWebAppForgotPasswordSuccessHandler(p *deps.RequestProvider) http.Handler Cookies: cookieManager, CookieDef: cookieDef2, } + offlineGrantService := oauth2.OfflineGrantService{ + OAuthConfig: oAuthConfig, + Clock: clockClock, + IDPSessions: idpsessionProvider, + ClientResolver: oauthclientResolver, + } + sessionManager := &oauth2.SessionManager{ + Store: redisStore, + Config: oAuthConfig, + Service: offlineGrantService, + } accountDeletionConfig := appConfig.AccountDeletion accountAnonymizationConfig := appConfig.AccountAnonymization coordinator := &facade.Coordinator{ @@ -33676,7 +33028,7 @@ func newWebAppForgotPasswordSuccessHandler(p *deps.RequestProvider) http.Handler AccessTokenSessions: sessionManager, Events: eventService, } - storeRedis2 := &oauthsession.StoreRedis{ + oauthsessionStoreRedis := &oauthsession.StoreRedis{ Context: contextContext, Redis: appredisHandle, AppID: appID, @@ -33715,7 +33067,7 @@ func newWebAppForgotPasswordSuccessHandler(p *deps.RequestProvider) http.Handler Sessions: idpsessionProvider, SessionManager: manager2, SessionCookie: cookieDef2, - OAuthSessions: storeRedis2, + OAuthSessions: oauthsessionStoreRedis, MFADeviceTokenCookie: cookieDef, } interactionStoreRedis := &interaction.StoreRedis{ @@ -33728,23 +33080,20 @@ func newWebAppForgotPasswordSuccessHandler(p *deps.RequestProvider) http.Handler Store: interactionStoreRedis, } webappService2 := &webapp2.Service2{ - Logger: serviceLogger, - Request: request, - Sessions: sessionStoreRedis, - SessionCookie: sessionCookieDef, - SignedUpCookie: signedUpCookieDef, - MFADeviceTokenCookie: cookieDef, - ErrorCookie: errorCookie, - Cookies: cookieManager, - OAuthConfig: oAuthConfig, - UIConfig: uiConfig, - TrustProxy: trustProxy, - UIInfoResolver: uiInfoResolver, - OAuthClientResolver: oauthclientResolver, - OAuthSessions: oauthsessionStoreRedis, - SettingsActionGrantService: settingsActionGrantService, - Authorizations: authorizationService, - Graph: interactionService, + Logger: serviceLogger, + Request: request, + Sessions: sessionStoreRedis, + SessionCookie: sessionCookieDef, + SignedUpCookie: signedUpCookieDef, + MFADeviceTokenCookie: cookieDef, + ErrorCookie: errorCookie, + Cookies: cookieManager, + OAuthConfig: oAuthConfig, + UIConfig: uiConfig, + TrustProxy: trustProxy, + UIInfoResolver: uiInfoResolver, + OAuthClientResolver: oauthclientResolver, + Graph: interactionService, } uiFeatureConfig := featureConfig.UI forgotPasswordConfig := appConfig.ForgotPassword @@ -34247,39 +33596,6 @@ func newWebAppResetPasswordHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, ClientResolver: oauthclientResolver, } - oauthsessionStoreRedis := oauthsession.StoreRedis{ - Context: contextContext, - Redis: appredisHandle, - AppID: appID, - } - tokenGenerator := _wireTokenGeneratorValue - settingsActionGrantService := handler.SettingsActionGrantService{ - AppID: appID, - CodeGenerator: tokenGenerator, - Clock: clockClock, - SettingsActionGrants: redisStore, - } - authorizationStore := &pq.AuthorizationStore{ - SQLBuilder: sqlBuilderApp, - SQLExecutor: sqlExecutor, - } - offlineGrantService := oauth2.OfflineGrantService{ - OAuthConfig: oAuthConfig, - Clock: clockClock, - IDPSessions: idpsessionProvider, - ClientResolver: oauthclientResolver, - } - sessionManager := &oauth2.SessionManager{ - Store: redisStore, - Config: oAuthConfig, - Service: offlineGrantService, - } - authorizationService := &oauth2.AuthorizationService{ - AppID: appID, - Store: authorizationStore, - Clock: clockClock, - OAuthSessionManager: sessionManager, - } interactionLogger := interaction.NewLogger(factory) eventLogger := event.NewLogger(factory) sqlBuilder := appdb.NewSQLBuilder(databaseCredentials) @@ -34398,6 +33714,10 @@ func newWebAppResetPasswordHandler(p *deps.RequestProvider) http.Handler { UserStore: store, Events: eventService, } + authorizationStore := &pq.AuthorizationStore{ + SQLBuilder: sqlBuilderApp, + SQLExecutor: sqlExecutor, + } cookieDef2 := session.NewSessionCookieDef(sessionConfig) idpsessionManager := &idpsession.Manager{ Store: idpsessionStoreRedis, @@ -34405,6 +33725,17 @@ func newWebAppResetPasswordHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, CookieDef: cookieDef2, } + offlineGrantService := oauth2.OfflineGrantService{ + OAuthConfig: oAuthConfig, + Clock: clockClock, + IDPSessions: idpsessionProvider, + ClientResolver: oauthclientResolver, + } + sessionManager := &oauth2.SessionManager{ + Store: redisStore, + Config: oAuthConfig, + Service: offlineGrantService, + } accountDeletionConfig := appConfig.AccountDeletion accountAnonymizationConfig := appConfig.AccountAnonymization coordinator := &facade.Coordinator{ @@ -34543,7 +33874,7 @@ func newWebAppResetPasswordHandler(p *deps.RequestProvider) http.Handler { AccessTokenSessions: sessionManager, Events: eventService, } - storeRedis2 := &oauthsession.StoreRedis{ + oauthsessionStoreRedis := &oauthsession.StoreRedis{ Context: contextContext, Redis: appredisHandle, AppID: appID, @@ -34582,7 +33913,7 @@ func newWebAppResetPasswordHandler(p *deps.RequestProvider) http.Handler { Sessions: idpsessionProvider, SessionManager: manager2, SessionCookie: cookieDef2, - OAuthSessions: storeRedis2, + OAuthSessions: oauthsessionStoreRedis, MFADeviceTokenCookie: cookieDef, } interactionStoreRedis := &interaction.StoreRedis{ @@ -34595,23 +33926,20 @@ func newWebAppResetPasswordHandler(p *deps.RequestProvider) http.Handler { Store: interactionStoreRedis, } webappService2 := &webapp2.Service2{ - Logger: serviceLogger, - Request: request, - Sessions: sessionStoreRedis, - SessionCookie: sessionCookieDef, - SignedUpCookie: signedUpCookieDef, - MFADeviceTokenCookie: cookieDef, - ErrorCookie: errorCookie, - Cookies: cookieManager, - OAuthConfig: oAuthConfig, - UIConfig: uiConfig, - TrustProxy: trustProxy, - UIInfoResolver: uiInfoResolver, - OAuthClientResolver: oauthclientResolver, - OAuthSessions: oauthsessionStoreRedis, - SettingsActionGrantService: settingsActionGrantService, - Authorizations: authorizationService, - Graph: interactionService, + Logger: serviceLogger, + Request: request, + Sessions: sessionStoreRedis, + SessionCookie: sessionCookieDef, + SignedUpCookie: signedUpCookieDef, + MFADeviceTokenCookie: cookieDef, + ErrorCookie: errorCookie, + Cookies: cookieManager, + OAuthConfig: oAuthConfig, + UIConfig: uiConfig, + TrustProxy: trustProxy, + UIInfoResolver: uiInfoResolver, + OAuthClientResolver: oauthclientResolver, + Graph: interactionService, } uiFeatureConfig := featureConfig.UI forgotPasswordConfig := appConfig.ForgotPassword @@ -35116,39 +34444,6 @@ func newWebAppResetPasswordSuccessHandler(p *deps.RequestProvider) http.Handler Cookies: cookieManager, ClientResolver: oauthclientResolver, } - oauthsessionStoreRedis := oauthsession.StoreRedis{ - Context: contextContext, - Redis: appredisHandle, - AppID: appID, - } - tokenGenerator := _wireTokenGeneratorValue - settingsActionGrantService := handler.SettingsActionGrantService{ - AppID: appID, - CodeGenerator: tokenGenerator, - Clock: clockClock, - SettingsActionGrants: redisStore, - } - authorizationStore := &pq.AuthorizationStore{ - SQLBuilder: sqlBuilderApp, - SQLExecutor: sqlExecutor, - } - offlineGrantService := oauth2.OfflineGrantService{ - OAuthConfig: oAuthConfig, - Clock: clockClock, - IDPSessions: idpsessionProvider, - ClientResolver: oauthclientResolver, - } - sessionManager := &oauth2.SessionManager{ - Store: redisStore, - Config: oAuthConfig, - Service: offlineGrantService, - } - authorizationService := &oauth2.AuthorizationService{ - AppID: appID, - Store: authorizationStore, - Clock: clockClock, - OAuthSessionManager: sessionManager, - } interactionLogger := interaction.NewLogger(factory) eventLogger := event.NewLogger(factory) sqlBuilder := appdb.NewSQLBuilder(databaseCredentials) @@ -35267,6 +34562,10 @@ func newWebAppResetPasswordSuccessHandler(p *deps.RequestProvider) http.Handler UserStore: store, Events: eventService, } + authorizationStore := &pq.AuthorizationStore{ + SQLBuilder: sqlBuilderApp, + SQLExecutor: sqlExecutor, + } cookieDef2 := session.NewSessionCookieDef(sessionConfig) idpsessionManager := &idpsession.Manager{ Store: idpsessionStoreRedis, @@ -35274,6 +34573,17 @@ func newWebAppResetPasswordSuccessHandler(p *deps.RequestProvider) http.Handler Cookies: cookieManager, CookieDef: cookieDef2, } + offlineGrantService := oauth2.OfflineGrantService{ + OAuthConfig: oAuthConfig, + Clock: clockClock, + IDPSessions: idpsessionProvider, + ClientResolver: oauthclientResolver, + } + sessionManager := &oauth2.SessionManager{ + Store: redisStore, + Config: oAuthConfig, + Service: offlineGrantService, + } accountDeletionConfig := appConfig.AccountDeletion accountAnonymizationConfig := appConfig.AccountAnonymization coordinator := &facade.Coordinator{ @@ -35412,7 +34722,7 @@ func newWebAppResetPasswordSuccessHandler(p *deps.RequestProvider) http.Handler AccessTokenSessions: sessionManager, Events: eventService, } - storeRedis2 := &oauthsession.StoreRedis{ + oauthsessionStoreRedis := &oauthsession.StoreRedis{ Context: contextContext, Redis: appredisHandle, AppID: appID, @@ -35451,7 +34761,7 @@ func newWebAppResetPasswordSuccessHandler(p *deps.RequestProvider) http.Handler Sessions: idpsessionProvider, SessionManager: manager2, SessionCookie: cookieDef2, - OAuthSessions: storeRedis2, + OAuthSessions: oauthsessionStoreRedis, MFADeviceTokenCookie: cookieDef, } interactionStoreRedis := &interaction.StoreRedis{ @@ -35464,23 +34774,20 @@ func newWebAppResetPasswordSuccessHandler(p *deps.RequestProvider) http.Handler Store: interactionStoreRedis, } webappService2 := &webapp2.Service2{ - Logger: serviceLogger, - Request: request, - Sessions: sessionStoreRedis, - SessionCookie: sessionCookieDef, - SignedUpCookie: signedUpCookieDef, - MFADeviceTokenCookie: cookieDef, - ErrorCookie: errorCookie, - Cookies: cookieManager, - OAuthConfig: oAuthConfig, - UIConfig: uiConfig, - TrustProxy: trustProxy, - UIInfoResolver: uiInfoResolver, - OAuthClientResolver: oauthclientResolver, - OAuthSessions: oauthsessionStoreRedis, - SettingsActionGrantService: settingsActionGrantService, - Authorizations: authorizationService, - Graph: interactionService, + Logger: serviceLogger, + Request: request, + Sessions: sessionStoreRedis, + SessionCookie: sessionCookieDef, + SignedUpCookie: signedUpCookieDef, + MFADeviceTokenCookie: cookieDef, + ErrorCookie: errorCookie, + Cookies: cookieManager, + OAuthConfig: oAuthConfig, + UIConfig: uiConfig, + TrustProxy: trustProxy, + UIInfoResolver: uiInfoResolver, + OAuthClientResolver: oauthclientResolver, + Graph: interactionService, } uiFeatureConfig := featureConfig.UI forgotPasswordConfig := appConfig.ForgotPassword @@ -35983,39 +35290,6 @@ func newWebAppSettingsHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, ClientResolver: oauthclientResolver, } - oauthsessionStoreRedis := oauthsession.StoreRedis{ - Context: contextContext, - Redis: appredisHandle, - AppID: appID, - } - tokenGenerator := _wireTokenGeneratorValue - settingsActionGrantService := handler.SettingsActionGrantService{ - AppID: appID, - CodeGenerator: tokenGenerator, - Clock: clockClock, - SettingsActionGrants: redisStore, - } - authorizationStore := &pq.AuthorizationStore{ - SQLBuilder: sqlBuilderApp, - SQLExecutor: sqlExecutor, - } - offlineGrantService := oauth2.OfflineGrantService{ - OAuthConfig: oAuthConfig, - Clock: clockClock, - IDPSessions: idpsessionProvider, - ClientResolver: oauthclientResolver, - } - sessionManager := &oauth2.SessionManager{ - Store: redisStore, - Config: oAuthConfig, - Service: offlineGrantService, - } - authorizationService := &oauth2.AuthorizationService{ - AppID: appID, - Store: authorizationStore, - Clock: clockClock, - OAuthSessionManager: sessionManager, - } interactionLogger := interaction.NewLogger(factory) eventLogger := event.NewLogger(factory) sqlBuilder := appdb.NewSQLBuilder(databaseCredentials) @@ -36134,6 +35408,10 @@ func newWebAppSettingsHandler(p *deps.RequestProvider) http.Handler { UserStore: store, Events: eventService, } + authorizationStore := &pq.AuthorizationStore{ + SQLBuilder: sqlBuilderApp, + SQLExecutor: sqlExecutor, + } cookieDef2 := session.NewSessionCookieDef(sessionConfig) idpsessionManager := &idpsession.Manager{ Store: idpsessionStoreRedis, @@ -36141,6 +35419,17 @@ func newWebAppSettingsHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, CookieDef: cookieDef2, } + offlineGrantService := oauth2.OfflineGrantService{ + OAuthConfig: oAuthConfig, + Clock: clockClock, + IDPSessions: idpsessionProvider, + ClientResolver: oauthclientResolver, + } + sessionManager := &oauth2.SessionManager{ + Store: redisStore, + Config: oAuthConfig, + Service: offlineGrantService, + } accountDeletionConfig := appConfig.AccountDeletion accountAnonymizationConfig := appConfig.AccountAnonymization coordinator := &facade.Coordinator{ @@ -36279,7 +35568,7 @@ func newWebAppSettingsHandler(p *deps.RequestProvider) http.Handler { AccessTokenSessions: sessionManager, Events: eventService, } - storeRedis2 := &oauthsession.StoreRedis{ + oauthsessionStoreRedis := &oauthsession.StoreRedis{ Context: contextContext, Redis: appredisHandle, AppID: appID, @@ -36318,7 +35607,7 @@ func newWebAppSettingsHandler(p *deps.RequestProvider) http.Handler { Sessions: idpsessionProvider, SessionManager: manager2, SessionCookie: cookieDef2, - OAuthSessions: storeRedis2, + OAuthSessions: oauthsessionStoreRedis, MFADeviceTokenCookie: cookieDef, } interactionStoreRedis := &interaction.StoreRedis{ @@ -36331,23 +35620,20 @@ func newWebAppSettingsHandler(p *deps.RequestProvider) http.Handler { Store: interactionStoreRedis, } webappService2 := &webapp2.Service2{ - Logger: serviceLogger, - Request: request, - Sessions: sessionStoreRedis, - SessionCookie: sessionCookieDef, - SignedUpCookie: signedUpCookieDef, - MFADeviceTokenCookie: cookieDef, - ErrorCookie: errorCookie, - Cookies: cookieManager, - OAuthConfig: oAuthConfig, - UIConfig: uiConfig, - TrustProxy: trustProxy, - UIInfoResolver: uiInfoResolver, - OAuthClientResolver: oauthclientResolver, - OAuthSessions: oauthsessionStoreRedis, - SettingsActionGrantService: settingsActionGrantService, - Authorizations: authorizationService, - Graph: interactionService, + Logger: serviceLogger, + Request: request, + Sessions: sessionStoreRedis, + SessionCookie: sessionCookieDef, + SignedUpCookie: signedUpCookieDef, + MFADeviceTokenCookie: cookieDef, + ErrorCookie: errorCookie, + Cookies: cookieManager, + OAuthConfig: oAuthConfig, + UIConfig: uiConfig, + TrustProxy: trustProxy, + UIInfoResolver: uiInfoResolver, + OAuthClientResolver: oauthclientResolver, + Graph: interactionService, } uiFeatureConfig := featureConfig.UI forgotPasswordConfig := appConfig.ForgotPassword @@ -36882,39 +36168,6 @@ func newWebAppSettingsProfileHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, ClientResolver: oauthclientResolver, } - oauthsessionStoreRedis := oauthsession.StoreRedis{ - Context: contextContext, - Redis: appredisHandle, - AppID: appID, - } - tokenGenerator := _wireTokenGeneratorValue - settingsActionGrantService := handler.SettingsActionGrantService{ - AppID: appID, - CodeGenerator: tokenGenerator, - Clock: clockClock, - SettingsActionGrants: redisStore, - } - authorizationStore := &pq.AuthorizationStore{ - SQLBuilder: sqlBuilderApp, - SQLExecutor: sqlExecutor, - } - offlineGrantService := oauth2.OfflineGrantService{ - OAuthConfig: oAuthConfig, - Clock: clockClock, - IDPSessions: idpsessionProvider, - ClientResolver: oauthclientResolver, - } - sessionManager := &oauth2.SessionManager{ - Store: redisStore, - Config: oAuthConfig, - Service: offlineGrantService, - } - authorizationService := &oauth2.AuthorizationService{ - AppID: appID, - Store: authorizationStore, - Clock: clockClock, - OAuthSessionManager: sessionManager, - } interactionLogger := interaction.NewLogger(factory) eventLogger := event.NewLogger(factory) sqlBuilder := appdb.NewSQLBuilder(databaseCredentials) @@ -37033,6 +36286,10 @@ func newWebAppSettingsProfileHandler(p *deps.RequestProvider) http.Handler { UserStore: store, Events: eventService, } + authorizationStore := &pq.AuthorizationStore{ + SQLBuilder: sqlBuilderApp, + SQLExecutor: sqlExecutor, + } cookieDef2 := session.NewSessionCookieDef(sessionConfig) idpsessionManager := &idpsession.Manager{ Store: idpsessionStoreRedis, @@ -37040,6 +36297,17 @@ func newWebAppSettingsProfileHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, CookieDef: cookieDef2, } + offlineGrantService := oauth2.OfflineGrantService{ + OAuthConfig: oAuthConfig, + Clock: clockClock, + IDPSessions: idpsessionProvider, + ClientResolver: oauthclientResolver, + } + sessionManager := &oauth2.SessionManager{ + Store: redisStore, + Config: oAuthConfig, + Service: offlineGrantService, + } accountDeletionConfig := appConfig.AccountDeletion accountAnonymizationConfig := appConfig.AccountAnonymization coordinator := &facade.Coordinator{ @@ -37178,7 +36446,7 @@ func newWebAppSettingsProfileHandler(p *deps.RequestProvider) http.Handler { AccessTokenSessions: sessionManager, Events: eventService, } - storeRedis2 := &oauthsession.StoreRedis{ + oauthsessionStoreRedis := &oauthsession.StoreRedis{ Context: contextContext, Redis: appredisHandle, AppID: appID, @@ -37217,7 +36485,7 @@ func newWebAppSettingsProfileHandler(p *deps.RequestProvider) http.Handler { Sessions: idpsessionProvider, SessionManager: manager2, SessionCookie: cookieDef2, - OAuthSessions: storeRedis2, + OAuthSessions: oauthsessionStoreRedis, MFADeviceTokenCookie: cookieDef, } interactionStoreRedis := &interaction.StoreRedis{ @@ -37230,23 +36498,20 @@ func newWebAppSettingsProfileHandler(p *deps.RequestProvider) http.Handler { Store: interactionStoreRedis, } webappService2 := &webapp2.Service2{ - Logger: serviceLogger, - Request: request, - Sessions: sessionStoreRedis, - SessionCookie: sessionCookieDef, - SignedUpCookie: signedUpCookieDef, - MFADeviceTokenCookie: cookieDef, - ErrorCookie: errorCookie, - Cookies: cookieManager, - OAuthConfig: oAuthConfig, - UIConfig: uiConfig, - TrustProxy: trustProxy, - UIInfoResolver: uiInfoResolver, - OAuthClientResolver: oauthclientResolver, - OAuthSessions: oauthsessionStoreRedis, - SettingsActionGrantService: settingsActionGrantService, - Authorizations: authorizationService, - Graph: interactionService, + Logger: serviceLogger, + Request: request, + Sessions: sessionStoreRedis, + SessionCookie: sessionCookieDef, + SignedUpCookie: signedUpCookieDef, + MFADeviceTokenCookie: cookieDef, + ErrorCookie: errorCookie, + Cookies: cookieManager, + OAuthConfig: oAuthConfig, + UIConfig: uiConfig, + TrustProxy: trustProxy, + UIInfoResolver: uiInfoResolver, + OAuthClientResolver: oauthclientResolver, + Graph: interactionService, } uiFeatureConfig := featureConfig.UI forgotPasswordConfig := appConfig.ForgotPassword @@ -37760,39 +37025,6 @@ func newWebAppSettingsProfileEditHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, ClientResolver: oauthclientResolver, } - oauthsessionStoreRedis := oauthsession.StoreRedis{ - Context: contextContext, - Redis: appredisHandle, - AppID: appID, - } - tokenGenerator := _wireTokenGeneratorValue - settingsActionGrantService := handler.SettingsActionGrantService{ - AppID: appID, - CodeGenerator: tokenGenerator, - Clock: clockClock, - SettingsActionGrants: redisStore, - } - authorizationStore := &pq.AuthorizationStore{ - SQLBuilder: sqlBuilderApp, - SQLExecutor: sqlExecutor, - } - offlineGrantService := oauth2.OfflineGrantService{ - OAuthConfig: oAuthConfig, - Clock: clockClock, - IDPSessions: idpsessionProvider, - ClientResolver: oauthclientResolver, - } - sessionManager := &oauth2.SessionManager{ - Store: redisStore, - Config: oAuthConfig, - Service: offlineGrantService, - } - authorizationService := &oauth2.AuthorizationService{ - AppID: appID, - Store: authorizationStore, - Clock: clockClock, - OAuthSessionManager: sessionManager, - } interactionLogger := interaction.NewLogger(factory) eventLogger := event.NewLogger(factory) sqlBuilder := appdb.NewSQLBuilder(databaseCredentials) @@ -37911,6 +37143,10 @@ func newWebAppSettingsProfileEditHandler(p *deps.RequestProvider) http.Handler { UserStore: store, Events: eventService, } + authorizationStore := &pq.AuthorizationStore{ + SQLBuilder: sqlBuilderApp, + SQLExecutor: sqlExecutor, + } cookieDef2 := session.NewSessionCookieDef(sessionConfig) idpsessionManager := &idpsession.Manager{ Store: idpsessionStoreRedis, @@ -37918,6 +37154,17 @@ func newWebAppSettingsProfileEditHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, CookieDef: cookieDef2, } + offlineGrantService := oauth2.OfflineGrantService{ + OAuthConfig: oAuthConfig, + Clock: clockClock, + IDPSessions: idpsessionProvider, + ClientResolver: oauthclientResolver, + } + sessionManager := &oauth2.SessionManager{ + Store: redisStore, + Config: oAuthConfig, + Service: offlineGrantService, + } accountDeletionConfig := appConfig.AccountDeletion accountAnonymizationConfig := appConfig.AccountAnonymization coordinator := &facade.Coordinator{ @@ -38056,7 +37303,7 @@ func newWebAppSettingsProfileEditHandler(p *deps.RequestProvider) http.Handler { AccessTokenSessions: sessionManager, Events: eventService, } - storeRedis2 := &oauthsession.StoreRedis{ + oauthsessionStoreRedis := &oauthsession.StoreRedis{ Context: contextContext, Redis: appredisHandle, AppID: appID, @@ -38095,7 +37342,7 @@ func newWebAppSettingsProfileEditHandler(p *deps.RequestProvider) http.Handler { Sessions: idpsessionProvider, SessionManager: manager2, SessionCookie: cookieDef2, - OAuthSessions: storeRedis2, + OAuthSessions: oauthsessionStoreRedis, MFADeviceTokenCookie: cookieDef, } interactionStoreRedis := &interaction.StoreRedis{ @@ -38108,23 +37355,20 @@ func newWebAppSettingsProfileEditHandler(p *deps.RequestProvider) http.Handler { Store: interactionStoreRedis, } webappService2 := &webapp2.Service2{ - Logger: serviceLogger, - Request: request, - Sessions: sessionStoreRedis, - SessionCookie: sessionCookieDef, - SignedUpCookie: signedUpCookieDef, - MFADeviceTokenCookie: cookieDef, - ErrorCookie: errorCookie, - Cookies: cookieManager, - OAuthConfig: oAuthConfig, - UIConfig: uiConfig, - TrustProxy: trustProxy, - UIInfoResolver: uiInfoResolver, - OAuthClientResolver: oauthclientResolver, - OAuthSessions: oauthsessionStoreRedis, - SettingsActionGrantService: settingsActionGrantService, - Authorizations: authorizationService, - Graph: interactionService, + Logger: serviceLogger, + Request: request, + Sessions: sessionStoreRedis, + SessionCookie: sessionCookieDef, + SignedUpCookie: signedUpCookieDef, + MFADeviceTokenCookie: cookieDef, + ErrorCookie: errorCookie, + Cookies: cookieManager, + OAuthConfig: oAuthConfig, + UIConfig: uiConfig, + TrustProxy: trustProxy, + UIInfoResolver: uiInfoResolver, + OAuthClientResolver: oauthclientResolver, + Graph: interactionService, } uiFeatureConfig := featureConfig.UI forgotPasswordConfig := appConfig.ForgotPassword @@ -38651,39 +37895,6 @@ func newWebAppSettingsIdentityHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, ClientResolver: oauthclientResolver, } - oauthsessionStoreRedis := oauthsession.StoreRedis{ - Context: contextContext, - Redis: appredisHandle, - AppID: appID, - } - tokenGenerator := _wireTokenGeneratorValue - settingsActionGrantService := handler.SettingsActionGrantService{ - AppID: appID, - CodeGenerator: tokenGenerator, - Clock: clockClock, - SettingsActionGrants: redisStore, - } - authorizationStore := &pq.AuthorizationStore{ - SQLBuilder: sqlBuilderApp, - SQLExecutor: sqlExecutor, - } - offlineGrantService := oauth2.OfflineGrantService{ - OAuthConfig: oAuthConfig, - Clock: clockClock, - IDPSessions: idpsessionProvider, - ClientResolver: oauthclientResolver, - } - sessionManager := &oauth2.SessionManager{ - Store: redisStore, - Config: oAuthConfig, - Service: offlineGrantService, - } - authorizationService := &oauth2.AuthorizationService{ - AppID: appID, - Store: authorizationStore, - Clock: clockClock, - OAuthSessionManager: sessionManager, - } interactionLogger := interaction.NewLogger(factory) eventLogger := event.NewLogger(factory) sqlBuilder := appdb.NewSQLBuilder(databaseCredentials) @@ -38802,6 +38013,10 @@ func newWebAppSettingsIdentityHandler(p *deps.RequestProvider) http.Handler { UserStore: store, Events: eventService, } + authorizationStore := &pq.AuthorizationStore{ + SQLBuilder: sqlBuilderApp, + SQLExecutor: sqlExecutor, + } cookieDef2 := session.NewSessionCookieDef(sessionConfig) idpsessionManager := &idpsession.Manager{ Store: idpsessionStoreRedis, @@ -38809,6 +38024,17 @@ func newWebAppSettingsIdentityHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, CookieDef: cookieDef2, } + offlineGrantService := oauth2.OfflineGrantService{ + OAuthConfig: oAuthConfig, + Clock: clockClock, + IDPSessions: idpsessionProvider, + ClientResolver: oauthclientResolver, + } + sessionManager := &oauth2.SessionManager{ + Store: redisStore, + Config: oAuthConfig, + Service: offlineGrantService, + } accountDeletionConfig := appConfig.AccountDeletion accountAnonymizationConfig := appConfig.AccountAnonymization coordinator := &facade.Coordinator{ @@ -38947,7 +38173,7 @@ func newWebAppSettingsIdentityHandler(p *deps.RequestProvider) http.Handler { AccessTokenSessions: sessionManager, Events: eventService, } - storeRedis2 := &oauthsession.StoreRedis{ + oauthsessionStoreRedis := &oauthsession.StoreRedis{ Context: contextContext, Redis: appredisHandle, AppID: appID, @@ -38986,7 +38212,7 @@ func newWebAppSettingsIdentityHandler(p *deps.RequestProvider) http.Handler { Sessions: idpsessionProvider, SessionManager: manager2, SessionCookie: cookieDef2, - OAuthSessions: storeRedis2, + OAuthSessions: oauthsessionStoreRedis, MFADeviceTokenCookie: cookieDef, } interactionStoreRedis := &interaction.StoreRedis{ @@ -38999,23 +38225,20 @@ func newWebAppSettingsIdentityHandler(p *deps.RequestProvider) http.Handler { Store: interactionStoreRedis, } webappService2 := &webapp2.Service2{ - Logger: serviceLogger, - Request: request, - Sessions: sessionStoreRedis, - SessionCookie: sessionCookieDef, - SignedUpCookie: signedUpCookieDef, - MFADeviceTokenCookie: cookieDef, - ErrorCookie: errorCookie, - Cookies: cookieManager, - OAuthConfig: oAuthConfig, - UIConfig: uiConfig, - TrustProxy: trustProxy, - UIInfoResolver: uiInfoResolver, - OAuthClientResolver: oauthclientResolver, - OAuthSessions: oauthsessionStoreRedis, - SettingsActionGrantService: settingsActionGrantService, - Authorizations: authorizationService, - Graph: interactionService, + Logger: serviceLogger, + Request: request, + Sessions: sessionStoreRedis, + SessionCookie: sessionCookieDef, + SignedUpCookie: signedUpCookieDef, + MFADeviceTokenCookie: cookieDef, + ErrorCookie: errorCookie, + Cookies: cookieManager, + OAuthConfig: oAuthConfig, + UIConfig: uiConfig, + TrustProxy: trustProxy, + UIInfoResolver: uiInfoResolver, + OAuthClientResolver: oauthclientResolver, + Graph: interactionService, } uiFeatureConfig := featureConfig.UI forgotPasswordConfig := appConfig.ForgotPassword @@ -39526,39 +38749,6 @@ func newWebAppSettingsBiometricHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, ClientResolver: oauthclientResolver, } - oauthsessionStoreRedis := oauthsession.StoreRedis{ - Context: contextContext, - Redis: appredisHandle, - AppID: appID, - } - tokenGenerator := _wireTokenGeneratorValue - settingsActionGrantService := handler.SettingsActionGrantService{ - AppID: appID, - CodeGenerator: tokenGenerator, - Clock: clockClock, - SettingsActionGrants: redisStore, - } - authorizationStore := &pq.AuthorizationStore{ - SQLBuilder: sqlBuilderApp, - SQLExecutor: sqlExecutor, - } - offlineGrantService := oauth2.OfflineGrantService{ - OAuthConfig: oAuthConfig, - Clock: clockClock, - IDPSessions: idpsessionProvider, - ClientResolver: oauthclientResolver, - } - sessionManager := &oauth2.SessionManager{ - Store: redisStore, - Config: oAuthConfig, - Service: offlineGrantService, - } - authorizationService := &oauth2.AuthorizationService{ - AppID: appID, - Store: authorizationStore, - Clock: clockClock, - OAuthSessionManager: sessionManager, - } interactionLogger := interaction.NewLogger(factory) eventLogger := event.NewLogger(factory) sqlBuilder := appdb.NewSQLBuilder(databaseCredentials) @@ -39677,6 +38867,10 @@ func newWebAppSettingsBiometricHandler(p *deps.RequestProvider) http.Handler { UserStore: store, Events: eventService, } + authorizationStore := &pq.AuthorizationStore{ + SQLBuilder: sqlBuilderApp, + SQLExecutor: sqlExecutor, + } cookieDef2 := session.NewSessionCookieDef(sessionConfig) idpsessionManager := &idpsession.Manager{ Store: idpsessionStoreRedis, @@ -39684,6 +38878,17 @@ func newWebAppSettingsBiometricHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, CookieDef: cookieDef2, } + offlineGrantService := oauth2.OfflineGrantService{ + OAuthConfig: oAuthConfig, + Clock: clockClock, + IDPSessions: idpsessionProvider, + ClientResolver: oauthclientResolver, + } + sessionManager := &oauth2.SessionManager{ + Store: redisStore, + Config: oAuthConfig, + Service: offlineGrantService, + } accountDeletionConfig := appConfig.AccountDeletion accountAnonymizationConfig := appConfig.AccountAnonymization coordinator := &facade.Coordinator{ @@ -39822,7 +39027,7 @@ func newWebAppSettingsBiometricHandler(p *deps.RequestProvider) http.Handler { AccessTokenSessions: sessionManager, Events: eventService, } - storeRedis2 := &oauthsession.StoreRedis{ + oauthsessionStoreRedis := &oauthsession.StoreRedis{ Context: contextContext, Redis: appredisHandle, AppID: appID, @@ -39861,7 +39066,7 @@ func newWebAppSettingsBiometricHandler(p *deps.RequestProvider) http.Handler { Sessions: idpsessionProvider, SessionManager: manager2, SessionCookie: cookieDef2, - OAuthSessions: storeRedis2, + OAuthSessions: oauthsessionStoreRedis, MFADeviceTokenCookie: cookieDef, } interactionStoreRedis := &interaction.StoreRedis{ @@ -39874,23 +39079,20 @@ func newWebAppSettingsBiometricHandler(p *deps.RequestProvider) http.Handler { Store: interactionStoreRedis, } webappService2 := &webapp2.Service2{ - Logger: serviceLogger, - Request: request, - Sessions: sessionStoreRedis, - SessionCookie: sessionCookieDef, - SignedUpCookie: signedUpCookieDef, - MFADeviceTokenCookie: cookieDef, - ErrorCookie: errorCookie, - Cookies: cookieManager, - OAuthConfig: oAuthConfig, - UIConfig: uiConfig, - TrustProxy: trustProxy, - UIInfoResolver: uiInfoResolver, - OAuthClientResolver: oauthclientResolver, - OAuthSessions: oauthsessionStoreRedis, - SettingsActionGrantService: settingsActionGrantService, - Authorizations: authorizationService, - Graph: interactionService, + Logger: serviceLogger, + Request: request, + Sessions: sessionStoreRedis, + SessionCookie: sessionCookieDef, + SignedUpCookie: signedUpCookieDef, + MFADeviceTokenCookie: cookieDef, + ErrorCookie: errorCookie, + Cookies: cookieManager, + OAuthConfig: oAuthConfig, + UIConfig: uiConfig, + TrustProxy: trustProxy, + UIInfoResolver: uiInfoResolver, + OAuthClientResolver: oauthclientResolver, + Graph: interactionService, } uiFeatureConfig := featureConfig.UI forgotPasswordConfig := appConfig.ForgotPassword @@ -40394,39 +39596,6 @@ func newWebAppSettingsMFAHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, ClientResolver: oauthclientResolver, } - oauthsessionStoreRedis := oauthsession.StoreRedis{ - Context: contextContext, - Redis: appredisHandle, - AppID: appID, - } - tokenGenerator := _wireTokenGeneratorValue - settingsActionGrantService := handler.SettingsActionGrantService{ - AppID: appID, - CodeGenerator: tokenGenerator, - Clock: clockClock, - SettingsActionGrants: redisStore, - } - authorizationStore := &pq.AuthorizationStore{ - SQLBuilder: sqlBuilderApp, - SQLExecutor: sqlExecutor, - } - offlineGrantService := oauth2.OfflineGrantService{ - OAuthConfig: oAuthConfig, - Clock: clockClock, - IDPSessions: idpsessionProvider, - ClientResolver: oauthclientResolver, - } - sessionManager := &oauth2.SessionManager{ - Store: redisStore, - Config: oAuthConfig, - Service: offlineGrantService, - } - authorizationService := &oauth2.AuthorizationService{ - AppID: appID, - Store: authorizationStore, - Clock: clockClock, - OAuthSessionManager: sessionManager, - } interactionLogger := interaction.NewLogger(factory) eventLogger := event.NewLogger(factory) sqlBuilder := appdb.NewSQLBuilder(databaseCredentials) @@ -40545,6 +39714,10 @@ func newWebAppSettingsMFAHandler(p *deps.RequestProvider) http.Handler { UserStore: store, Events: eventService, } + authorizationStore := &pq.AuthorizationStore{ + SQLBuilder: sqlBuilderApp, + SQLExecutor: sqlExecutor, + } cookieDef2 := session.NewSessionCookieDef(sessionConfig) idpsessionManager := &idpsession.Manager{ Store: idpsessionStoreRedis, @@ -40552,6 +39725,17 @@ func newWebAppSettingsMFAHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, CookieDef: cookieDef2, } + offlineGrantService := oauth2.OfflineGrantService{ + OAuthConfig: oAuthConfig, + Clock: clockClock, + IDPSessions: idpsessionProvider, + ClientResolver: oauthclientResolver, + } + sessionManager := &oauth2.SessionManager{ + Store: redisStore, + Config: oAuthConfig, + Service: offlineGrantService, + } accountDeletionConfig := appConfig.AccountDeletion accountAnonymizationConfig := appConfig.AccountAnonymization coordinator := &facade.Coordinator{ @@ -40690,7 +39874,7 @@ func newWebAppSettingsMFAHandler(p *deps.RequestProvider) http.Handler { AccessTokenSessions: sessionManager, Events: eventService, } - storeRedis2 := &oauthsession.StoreRedis{ + oauthsessionStoreRedis := &oauthsession.StoreRedis{ Context: contextContext, Redis: appredisHandle, AppID: appID, @@ -40729,7 +39913,7 @@ func newWebAppSettingsMFAHandler(p *deps.RequestProvider) http.Handler { Sessions: idpsessionProvider, SessionManager: manager2, SessionCookie: cookieDef2, - OAuthSessions: storeRedis2, + OAuthSessions: oauthsessionStoreRedis, MFADeviceTokenCookie: cookieDef, } interactionStoreRedis := &interaction.StoreRedis{ @@ -40742,23 +39926,20 @@ func newWebAppSettingsMFAHandler(p *deps.RequestProvider) http.Handler { Store: interactionStoreRedis, } webappService2 := &webapp2.Service2{ - Logger: serviceLogger, - Request: request, - Sessions: sessionStoreRedis, - SessionCookie: sessionCookieDef, - SignedUpCookie: signedUpCookieDef, - MFADeviceTokenCookie: cookieDef, - ErrorCookie: errorCookie, - Cookies: cookieManager, - OAuthConfig: oAuthConfig, - UIConfig: uiConfig, - TrustProxy: trustProxy, - UIInfoResolver: uiInfoResolver, - OAuthClientResolver: oauthclientResolver, - OAuthSessions: oauthsessionStoreRedis, - SettingsActionGrantService: settingsActionGrantService, - Authorizations: authorizationService, - Graph: interactionService, + Logger: serviceLogger, + Request: request, + Sessions: sessionStoreRedis, + SessionCookie: sessionCookieDef, + SignedUpCookie: signedUpCookieDef, + MFADeviceTokenCookie: cookieDef, + ErrorCookie: errorCookie, + Cookies: cookieManager, + OAuthConfig: oAuthConfig, + UIConfig: uiConfig, + TrustProxy: trustProxy, + UIInfoResolver: uiInfoResolver, + OAuthClientResolver: oauthclientResolver, + Graph: interactionService, } uiFeatureConfig := featureConfig.UI forgotPasswordConfig := appConfig.ForgotPassword @@ -41270,39 +40451,6 @@ func newWebAppSettingsTOTPHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, ClientResolver: oauthclientResolver, } - oauthsessionStoreRedis := oauthsession.StoreRedis{ - Context: contextContext, - Redis: appredisHandle, - AppID: appID, - } - tokenGenerator := _wireTokenGeneratorValue - settingsActionGrantService := handler.SettingsActionGrantService{ - AppID: appID, - CodeGenerator: tokenGenerator, - Clock: clockClock, - SettingsActionGrants: redisStore, - } - authorizationStore := &pq.AuthorizationStore{ - SQLBuilder: sqlBuilderApp, - SQLExecutor: sqlExecutor, - } - offlineGrantService := oauth2.OfflineGrantService{ - OAuthConfig: oAuthConfig, - Clock: clockClock, - IDPSessions: idpsessionProvider, - ClientResolver: oauthclientResolver, - } - sessionManager := &oauth2.SessionManager{ - Store: redisStore, - Config: oAuthConfig, - Service: offlineGrantService, - } - authorizationService := &oauth2.AuthorizationService{ - AppID: appID, - Store: authorizationStore, - Clock: clockClock, - OAuthSessionManager: sessionManager, - } interactionLogger := interaction.NewLogger(factory) eventLogger := event.NewLogger(factory) sqlBuilder := appdb.NewSQLBuilder(databaseCredentials) @@ -41421,6 +40569,10 @@ func newWebAppSettingsTOTPHandler(p *deps.RequestProvider) http.Handler { UserStore: store, Events: eventService, } + authorizationStore := &pq.AuthorizationStore{ + SQLBuilder: sqlBuilderApp, + SQLExecutor: sqlExecutor, + } cookieDef2 := session.NewSessionCookieDef(sessionConfig) idpsessionManager := &idpsession.Manager{ Store: idpsessionStoreRedis, @@ -41428,6 +40580,17 @@ func newWebAppSettingsTOTPHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, CookieDef: cookieDef2, } + offlineGrantService := oauth2.OfflineGrantService{ + OAuthConfig: oAuthConfig, + Clock: clockClock, + IDPSessions: idpsessionProvider, + ClientResolver: oauthclientResolver, + } + sessionManager := &oauth2.SessionManager{ + Store: redisStore, + Config: oAuthConfig, + Service: offlineGrantService, + } accountDeletionConfig := appConfig.AccountDeletion accountAnonymizationConfig := appConfig.AccountAnonymization coordinator := &facade.Coordinator{ @@ -41566,7 +40729,7 @@ func newWebAppSettingsTOTPHandler(p *deps.RequestProvider) http.Handler { AccessTokenSessions: sessionManager, Events: eventService, } - storeRedis2 := &oauthsession.StoreRedis{ + oauthsessionStoreRedis := &oauthsession.StoreRedis{ Context: contextContext, Redis: appredisHandle, AppID: appID, @@ -41605,7 +40768,7 @@ func newWebAppSettingsTOTPHandler(p *deps.RequestProvider) http.Handler { Sessions: idpsessionProvider, SessionManager: manager2, SessionCookie: cookieDef2, - OAuthSessions: storeRedis2, + OAuthSessions: oauthsessionStoreRedis, MFADeviceTokenCookie: cookieDef, } interactionStoreRedis := &interaction.StoreRedis{ @@ -41618,23 +40781,20 @@ func newWebAppSettingsTOTPHandler(p *deps.RequestProvider) http.Handler { Store: interactionStoreRedis, } webappService2 := &webapp2.Service2{ - Logger: serviceLogger, - Request: request, - Sessions: sessionStoreRedis, - SessionCookie: sessionCookieDef, - SignedUpCookie: signedUpCookieDef, - MFADeviceTokenCookie: cookieDef, - ErrorCookie: errorCookie, - Cookies: cookieManager, - OAuthConfig: oAuthConfig, - UIConfig: uiConfig, - TrustProxy: trustProxy, - UIInfoResolver: uiInfoResolver, - OAuthClientResolver: oauthclientResolver, - OAuthSessions: oauthsessionStoreRedis, - SettingsActionGrantService: settingsActionGrantService, - Authorizations: authorizationService, - Graph: interactionService, + Logger: serviceLogger, + Request: request, + Sessions: sessionStoreRedis, + SessionCookie: sessionCookieDef, + SignedUpCookie: signedUpCookieDef, + MFADeviceTokenCookie: cookieDef, + ErrorCookie: errorCookie, + Cookies: cookieManager, + OAuthConfig: oAuthConfig, + UIConfig: uiConfig, + TrustProxy: trustProxy, + UIInfoResolver: uiInfoResolver, + OAuthClientResolver: oauthclientResolver, + Graph: interactionService, } uiFeatureConfig := featureConfig.UI forgotPasswordConfig := appConfig.ForgotPassword @@ -42138,39 +41298,6 @@ func newWebAppSettingsPasskeyHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, ClientResolver: oauthclientResolver, } - oauthsessionStoreRedis := oauthsession.StoreRedis{ - Context: contextContext, - Redis: appredisHandle, - AppID: appID, - } - tokenGenerator := _wireTokenGeneratorValue - settingsActionGrantService := handler.SettingsActionGrantService{ - AppID: appID, - CodeGenerator: tokenGenerator, - Clock: clockClock, - SettingsActionGrants: redisStore, - } - authorizationStore := &pq.AuthorizationStore{ - SQLBuilder: sqlBuilderApp, - SQLExecutor: sqlExecutor, - } - offlineGrantService := oauth2.OfflineGrantService{ - OAuthConfig: oAuthConfig, - Clock: clockClock, - IDPSessions: idpsessionProvider, - ClientResolver: oauthclientResolver, - } - sessionManager := &oauth2.SessionManager{ - Store: redisStore, - Config: oAuthConfig, - Service: offlineGrantService, - } - authorizationService := &oauth2.AuthorizationService{ - AppID: appID, - Store: authorizationStore, - Clock: clockClock, - OAuthSessionManager: sessionManager, - } interactionLogger := interaction.NewLogger(factory) eventLogger := event.NewLogger(factory) sqlBuilder := appdb.NewSQLBuilder(databaseCredentials) @@ -42289,6 +41416,10 @@ func newWebAppSettingsPasskeyHandler(p *deps.RequestProvider) http.Handler { UserStore: store, Events: eventService, } + authorizationStore := &pq.AuthorizationStore{ + SQLBuilder: sqlBuilderApp, + SQLExecutor: sqlExecutor, + } cookieDef2 := session.NewSessionCookieDef(sessionConfig) idpsessionManager := &idpsession.Manager{ Store: idpsessionStoreRedis, @@ -42296,6 +41427,17 @@ func newWebAppSettingsPasskeyHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, CookieDef: cookieDef2, } + offlineGrantService := oauth2.OfflineGrantService{ + OAuthConfig: oAuthConfig, + Clock: clockClock, + IDPSessions: idpsessionProvider, + ClientResolver: oauthclientResolver, + } + sessionManager := &oauth2.SessionManager{ + Store: redisStore, + Config: oAuthConfig, + Service: offlineGrantService, + } accountDeletionConfig := appConfig.AccountDeletion accountAnonymizationConfig := appConfig.AccountAnonymization coordinator := &facade.Coordinator{ @@ -42434,7 +41576,7 @@ func newWebAppSettingsPasskeyHandler(p *deps.RequestProvider) http.Handler { AccessTokenSessions: sessionManager, Events: eventService, } - storeRedis2 := &oauthsession.StoreRedis{ + oauthsessionStoreRedis := &oauthsession.StoreRedis{ Context: contextContext, Redis: appredisHandle, AppID: appID, @@ -42473,7 +41615,7 @@ func newWebAppSettingsPasskeyHandler(p *deps.RequestProvider) http.Handler { Sessions: idpsessionProvider, SessionManager: manager2, SessionCookie: cookieDef2, - OAuthSessions: storeRedis2, + OAuthSessions: oauthsessionStoreRedis, MFADeviceTokenCookie: cookieDef, } interactionStoreRedis := &interaction.StoreRedis{ @@ -42486,23 +41628,20 @@ func newWebAppSettingsPasskeyHandler(p *deps.RequestProvider) http.Handler { Store: interactionStoreRedis, } webappService2 := &webapp2.Service2{ - Logger: serviceLogger, - Request: request, - Sessions: sessionStoreRedis, - SessionCookie: sessionCookieDef, - SignedUpCookie: signedUpCookieDef, - MFADeviceTokenCookie: cookieDef, - ErrorCookie: errorCookie, - Cookies: cookieManager, - OAuthConfig: oAuthConfig, - UIConfig: uiConfig, - TrustProxy: trustProxy, - UIInfoResolver: uiInfoResolver, - OAuthClientResolver: oauthclientResolver, - OAuthSessions: oauthsessionStoreRedis, - SettingsActionGrantService: settingsActionGrantService, - Authorizations: authorizationService, - Graph: interactionService, + Logger: serviceLogger, + Request: request, + Sessions: sessionStoreRedis, + SessionCookie: sessionCookieDef, + SignedUpCookie: signedUpCookieDef, + MFADeviceTokenCookie: cookieDef, + ErrorCookie: errorCookie, + Cookies: cookieManager, + OAuthConfig: oAuthConfig, + UIConfig: uiConfig, + TrustProxy: trustProxy, + UIInfoResolver: uiInfoResolver, + OAuthClientResolver: oauthclientResolver, + Graph: interactionService, } uiFeatureConfig := featureConfig.UI forgotPasswordConfig := appConfig.ForgotPassword @@ -43006,39 +42145,6 @@ func newWebAppSettingsOOBOTPHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, ClientResolver: oauthclientResolver, } - oauthsessionStoreRedis := oauthsession.StoreRedis{ - Context: contextContext, - Redis: appredisHandle, - AppID: appID, - } - tokenGenerator := _wireTokenGeneratorValue - settingsActionGrantService := handler.SettingsActionGrantService{ - AppID: appID, - CodeGenerator: tokenGenerator, - Clock: clockClock, - SettingsActionGrants: redisStore, - } - authorizationStore := &pq.AuthorizationStore{ - SQLBuilder: sqlBuilderApp, - SQLExecutor: sqlExecutor, - } - offlineGrantService := oauth2.OfflineGrantService{ - OAuthConfig: oAuthConfig, - Clock: clockClock, - IDPSessions: idpsessionProvider, - ClientResolver: oauthclientResolver, - } - sessionManager := &oauth2.SessionManager{ - Store: redisStore, - Config: oAuthConfig, - Service: offlineGrantService, - } - authorizationService := &oauth2.AuthorizationService{ - AppID: appID, - Store: authorizationStore, - Clock: clockClock, - OAuthSessionManager: sessionManager, - } interactionLogger := interaction.NewLogger(factory) eventLogger := event.NewLogger(factory) sqlBuilder := appdb.NewSQLBuilder(databaseCredentials) @@ -43157,6 +42263,10 @@ func newWebAppSettingsOOBOTPHandler(p *deps.RequestProvider) http.Handler { UserStore: store, Events: eventService, } + authorizationStore := &pq.AuthorizationStore{ + SQLBuilder: sqlBuilderApp, + SQLExecutor: sqlExecutor, + } cookieDef2 := session.NewSessionCookieDef(sessionConfig) idpsessionManager := &idpsession.Manager{ Store: idpsessionStoreRedis, @@ -43164,6 +42274,17 @@ func newWebAppSettingsOOBOTPHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, CookieDef: cookieDef2, } + offlineGrantService := oauth2.OfflineGrantService{ + OAuthConfig: oAuthConfig, + Clock: clockClock, + IDPSessions: idpsessionProvider, + ClientResolver: oauthclientResolver, + } + sessionManager := &oauth2.SessionManager{ + Store: redisStore, + Config: oAuthConfig, + Service: offlineGrantService, + } accountDeletionConfig := appConfig.AccountDeletion accountAnonymizationConfig := appConfig.AccountAnonymization coordinator := &facade.Coordinator{ @@ -43302,7 +42423,7 @@ func newWebAppSettingsOOBOTPHandler(p *deps.RequestProvider) http.Handler { AccessTokenSessions: sessionManager, Events: eventService, } - storeRedis2 := &oauthsession.StoreRedis{ + oauthsessionStoreRedis := &oauthsession.StoreRedis{ Context: contextContext, Redis: appredisHandle, AppID: appID, @@ -43341,7 +42462,7 @@ func newWebAppSettingsOOBOTPHandler(p *deps.RequestProvider) http.Handler { Sessions: idpsessionProvider, SessionManager: manager2, SessionCookie: cookieDef2, - OAuthSessions: storeRedis2, + OAuthSessions: oauthsessionStoreRedis, MFADeviceTokenCookie: cookieDef, } interactionStoreRedis := &interaction.StoreRedis{ @@ -43354,23 +42475,20 @@ func newWebAppSettingsOOBOTPHandler(p *deps.RequestProvider) http.Handler { Store: interactionStoreRedis, } webappService2 := &webapp2.Service2{ - Logger: serviceLogger, - Request: request, - Sessions: sessionStoreRedis, - SessionCookie: sessionCookieDef, - SignedUpCookie: signedUpCookieDef, - MFADeviceTokenCookie: cookieDef, - ErrorCookie: errorCookie, - Cookies: cookieManager, - OAuthConfig: oAuthConfig, - UIConfig: uiConfig, - TrustProxy: trustProxy, - UIInfoResolver: uiInfoResolver, - OAuthClientResolver: oauthclientResolver, - OAuthSessions: oauthsessionStoreRedis, - SettingsActionGrantService: settingsActionGrantService, - Authorizations: authorizationService, - Graph: interactionService, + Logger: serviceLogger, + Request: request, + Sessions: sessionStoreRedis, + SessionCookie: sessionCookieDef, + SignedUpCookie: signedUpCookieDef, + MFADeviceTokenCookie: cookieDef, + ErrorCookie: errorCookie, + Cookies: cookieManager, + OAuthConfig: oAuthConfig, + UIConfig: uiConfig, + TrustProxy: trustProxy, + UIInfoResolver: uiInfoResolver, + OAuthClientResolver: oauthclientResolver, + Graph: interactionService, } uiFeatureConfig := featureConfig.UI forgotPasswordConfig := appConfig.ForgotPassword @@ -43874,39 +42992,6 @@ func newWebAppSettingsRecoveryCodeHandler(p *deps.RequestProvider) http.Handler Cookies: cookieManager, ClientResolver: oauthclientResolver, } - oauthsessionStoreRedis := oauthsession.StoreRedis{ - Context: contextContext, - Redis: appredisHandle, - AppID: appID, - } - tokenGenerator := _wireTokenGeneratorValue - settingsActionGrantService := handler.SettingsActionGrantService{ - AppID: appID, - CodeGenerator: tokenGenerator, - Clock: clockClock, - SettingsActionGrants: redisStore, - } - authorizationStore := &pq.AuthorizationStore{ - SQLBuilder: sqlBuilderApp, - SQLExecutor: sqlExecutor, - } - offlineGrantService := oauth2.OfflineGrantService{ - OAuthConfig: oAuthConfig, - Clock: clockClock, - IDPSessions: idpsessionProvider, - ClientResolver: oauthclientResolver, - } - sessionManager := &oauth2.SessionManager{ - Store: redisStore, - Config: oAuthConfig, - Service: offlineGrantService, - } - authorizationService := &oauth2.AuthorizationService{ - AppID: appID, - Store: authorizationStore, - Clock: clockClock, - OAuthSessionManager: sessionManager, - } interactionLogger := interaction.NewLogger(factory) eventLogger := event.NewLogger(factory) sqlBuilder := appdb.NewSQLBuilder(databaseCredentials) @@ -44025,6 +43110,10 @@ func newWebAppSettingsRecoveryCodeHandler(p *deps.RequestProvider) http.Handler UserStore: store, Events: eventService, } + authorizationStore := &pq.AuthorizationStore{ + SQLBuilder: sqlBuilderApp, + SQLExecutor: sqlExecutor, + } cookieDef2 := session.NewSessionCookieDef(sessionConfig) idpsessionManager := &idpsession.Manager{ Store: idpsessionStoreRedis, @@ -44032,6 +43121,17 @@ func newWebAppSettingsRecoveryCodeHandler(p *deps.RequestProvider) http.Handler Cookies: cookieManager, CookieDef: cookieDef2, } + offlineGrantService := oauth2.OfflineGrantService{ + OAuthConfig: oAuthConfig, + Clock: clockClock, + IDPSessions: idpsessionProvider, + ClientResolver: oauthclientResolver, + } + sessionManager := &oauth2.SessionManager{ + Store: redisStore, + Config: oAuthConfig, + Service: offlineGrantService, + } accountDeletionConfig := appConfig.AccountDeletion accountAnonymizationConfig := appConfig.AccountAnonymization coordinator := &facade.Coordinator{ @@ -44170,7 +43270,7 @@ func newWebAppSettingsRecoveryCodeHandler(p *deps.RequestProvider) http.Handler AccessTokenSessions: sessionManager, Events: eventService, } - storeRedis2 := &oauthsession.StoreRedis{ + oauthsessionStoreRedis := &oauthsession.StoreRedis{ Context: contextContext, Redis: appredisHandle, AppID: appID, @@ -44209,7 +43309,7 @@ func newWebAppSettingsRecoveryCodeHandler(p *deps.RequestProvider) http.Handler Sessions: idpsessionProvider, SessionManager: manager2, SessionCookie: cookieDef2, - OAuthSessions: storeRedis2, + OAuthSessions: oauthsessionStoreRedis, MFADeviceTokenCookie: cookieDef, } interactionStoreRedis := &interaction.StoreRedis{ @@ -44222,23 +43322,20 @@ func newWebAppSettingsRecoveryCodeHandler(p *deps.RequestProvider) http.Handler Store: interactionStoreRedis, } webappService2 := &webapp2.Service2{ - Logger: serviceLogger, - Request: request, - Sessions: sessionStoreRedis, - SessionCookie: sessionCookieDef, - SignedUpCookie: signedUpCookieDef, - MFADeviceTokenCookie: cookieDef, - ErrorCookie: errorCookie, - Cookies: cookieManager, - OAuthConfig: oAuthConfig, - UIConfig: uiConfig, - TrustProxy: trustProxy, - UIInfoResolver: uiInfoResolver, - OAuthClientResolver: oauthclientResolver, - OAuthSessions: oauthsessionStoreRedis, - SettingsActionGrantService: settingsActionGrantService, - Authorizations: authorizationService, - Graph: interactionService, + Logger: serviceLogger, + Request: request, + Sessions: sessionStoreRedis, + SessionCookie: sessionCookieDef, + SignedUpCookie: signedUpCookieDef, + MFADeviceTokenCookie: cookieDef, + ErrorCookie: errorCookie, + Cookies: cookieManager, + OAuthConfig: oAuthConfig, + UIConfig: uiConfig, + TrustProxy: trustProxy, + UIInfoResolver: uiInfoResolver, + OAuthClientResolver: oauthclientResolver, + Graph: interactionService, } uiFeatureConfig := featureConfig.UI forgotPasswordConfig := appConfig.ForgotPassword @@ -44743,39 +43840,6 @@ func newWebAppSettingsSessionsHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, ClientResolver: oauthclientResolver, } - oauthsessionStoreRedis := oauthsession.StoreRedis{ - Context: contextContext, - Redis: appredisHandle, - AppID: appID, - } - tokenGenerator := _wireTokenGeneratorValue - settingsActionGrantService := handler.SettingsActionGrantService{ - AppID: appID, - CodeGenerator: tokenGenerator, - Clock: clockClock, - SettingsActionGrants: redisStore, - } - authorizationStore := &pq.AuthorizationStore{ - SQLBuilder: sqlBuilderApp, - SQLExecutor: sqlExecutor, - } - offlineGrantService := oauth2.OfflineGrantService{ - OAuthConfig: oAuthConfig, - Clock: clockClock, - IDPSessions: idpsessionProvider, - ClientResolver: oauthclientResolver, - } - sessionManager := &oauth2.SessionManager{ - Store: redisStore, - Config: oAuthConfig, - Service: offlineGrantService, - } - authorizationService := &oauth2.AuthorizationService{ - AppID: appID, - Store: authorizationStore, - Clock: clockClock, - OAuthSessionManager: sessionManager, - } interactionLogger := interaction.NewLogger(factory) eventLogger := event.NewLogger(factory) sqlBuilder := appdb.NewSQLBuilder(databaseCredentials) @@ -44894,6 +43958,10 @@ func newWebAppSettingsSessionsHandler(p *deps.RequestProvider) http.Handler { UserStore: store, Events: eventService, } + authorizationStore := &pq.AuthorizationStore{ + SQLBuilder: sqlBuilderApp, + SQLExecutor: sqlExecutor, + } cookieDef2 := session.NewSessionCookieDef(sessionConfig) idpsessionManager := &idpsession.Manager{ Store: idpsessionStoreRedis, @@ -44901,6 +43969,17 @@ func newWebAppSettingsSessionsHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, CookieDef: cookieDef2, } + offlineGrantService := oauth2.OfflineGrantService{ + OAuthConfig: oAuthConfig, + Clock: clockClock, + IDPSessions: idpsessionProvider, + ClientResolver: oauthclientResolver, + } + sessionManager := &oauth2.SessionManager{ + Store: redisStore, + Config: oAuthConfig, + Service: offlineGrantService, + } accountDeletionConfig := appConfig.AccountDeletion accountAnonymizationConfig := appConfig.AccountAnonymization coordinator := &facade.Coordinator{ @@ -45039,7 +44118,7 @@ func newWebAppSettingsSessionsHandler(p *deps.RequestProvider) http.Handler { AccessTokenSessions: sessionManager, Events: eventService, } - storeRedis2 := &oauthsession.StoreRedis{ + oauthsessionStoreRedis := &oauthsession.StoreRedis{ Context: contextContext, Redis: appredisHandle, AppID: appID, @@ -45078,7 +44157,7 @@ func newWebAppSettingsSessionsHandler(p *deps.RequestProvider) http.Handler { Sessions: idpsessionProvider, SessionManager: manager2, SessionCookie: cookieDef2, - OAuthSessions: storeRedis2, + OAuthSessions: oauthsessionStoreRedis, MFADeviceTokenCookie: cookieDef, } interactionStoreRedis := &interaction.StoreRedis{ @@ -45091,23 +44170,20 @@ func newWebAppSettingsSessionsHandler(p *deps.RequestProvider) http.Handler { Store: interactionStoreRedis, } webappService2 := &webapp2.Service2{ - Logger: serviceLogger, - Request: request, - Sessions: sessionStoreRedis, - SessionCookie: sessionCookieDef, - SignedUpCookie: signedUpCookieDef, - MFADeviceTokenCookie: cookieDef, - ErrorCookie: errorCookie, - Cookies: cookieManager, - OAuthConfig: oAuthConfig, - UIConfig: uiConfig, - TrustProxy: trustProxy, - UIInfoResolver: uiInfoResolver, - OAuthClientResolver: oauthclientResolver, - OAuthSessions: oauthsessionStoreRedis, - SettingsActionGrantService: settingsActionGrantService, - Authorizations: authorizationService, - Graph: interactionService, + Logger: serviceLogger, + Request: request, + Sessions: sessionStoreRedis, + SessionCookie: sessionCookieDef, + SignedUpCookie: signedUpCookieDef, + MFADeviceTokenCookie: cookieDef, + ErrorCookie: errorCookie, + Cookies: cookieManager, + OAuthConfig: oAuthConfig, + UIConfig: uiConfig, + TrustProxy: trustProxy, + UIInfoResolver: uiInfoResolver, + OAuthClientResolver: oauthclientResolver, + Graph: interactionService, } uiFeatureConfig := featureConfig.UI forgotPasswordConfig := appConfig.ForgotPassword @@ -45156,6 +44232,12 @@ func newWebAppSettingsSessionsHandler(p *deps.RequestProvider) http.Handler { LoggerFactory: factory, ControllerDeps: controllerDeps, } + authorizationService := &oauth2.AuthorizationService{ + AppID: appID, + Store: authorizationStore, + Clock: clockClock, + OAuthSessionManager: sessionManager, + } oauthOfflineGrantService := &oauth2.OfflineGrantService{ OAuthConfig: oAuthConfig, Clock: clockClock, @@ -45625,39 +44707,6 @@ func newWebAppForceChangePasswordHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, ClientResolver: oauthclientResolver, } - oauthsessionStoreRedis := oauthsession.StoreRedis{ - Context: contextContext, - Redis: appredisHandle, - AppID: appID, - } - tokenGenerator := _wireTokenGeneratorValue - settingsActionGrantService := handler.SettingsActionGrantService{ - AppID: appID, - CodeGenerator: tokenGenerator, - Clock: clockClock, - SettingsActionGrants: redisStore, - } - authorizationStore := &pq.AuthorizationStore{ - SQLBuilder: sqlBuilderApp, - SQLExecutor: sqlExecutor, - } - offlineGrantService := oauth2.OfflineGrantService{ - OAuthConfig: oAuthConfig, - Clock: clockClock, - IDPSessions: idpsessionProvider, - ClientResolver: oauthclientResolver, - } - sessionManager := &oauth2.SessionManager{ - Store: redisStore, - Config: oAuthConfig, - Service: offlineGrantService, - } - authorizationService := &oauth2.AuthorizationService{ - AppID: appID, - Store: authorizationStore, - Clock: clockClock, - OAuthSessionManager: sessionManager, - } interactionLogger := interaction.NewLogger(factory) eventLogger := event.NewLogger(factory) sqlBuilder := appdb.NewSQLBuilder(databaseCredentials) @@ -45776,6 +44825,10 @@ func newWebAppForceChangePasswordHandler(p *deps.RequestProvider) http.Handler { UserStore: store, Events: eventService, } + authorizationStore := &pq.AuthorizationStore{ + SQLBuilder: sqlBuilderApp, + SQLExecutor: sqlExecutor, + } cookieDef2 := session.NewSessionCookieDef(sessionConfig) idpsessionManager := &idpsession.Manager{ Store: idpsessionStoreRedis, @@ -45783,6 +44836,17 @@ func newWebAppForceChangePasswordHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, CookieDef: cookieDef2, } + offlineGrantService := oauth2.OfflineGrantService{ + OAuthConfig: oAuthConfig, + Clock: clockClock, + IDPSessions: idpsessionProvider, + ClientResolver: oauthclientResolver, + } + sessionManager := &oauth2.SessionManager{ + Store: redisStore, + Config: oAuthConfig, + Service: offlineGrantService, + } accountDeletionConfig := appConfig.AccountDeletion accountAnonymizationConfig := appConfig.AccountAnonymization coordinator := &facade.Coordinator{ @@ -45921,7 +44985,7 @@ func newWebAppForceChangePasswordHandler(p *deps.RequestProvider) http.Handler { AccessTokenSessions: sessionManager, Events: eventService, } - storeRedis2 := &oauthsession.StoreRedis{ + oauthsessionStoreRedis := &oauthsession.StoreRedis{ Context: contextContext, Redis: appredisHandle, AppID: appID, @@ -45960,7 +45024,7 @@ func newWebAppForceChangePasswordHandler(p *deps.RequestProvider) http.Handler { Sessions: idpsessionProvider, SessionManager: manager2, SessionCookie: cookieDef2, - OAuthSessions: storeRedis2, + OAuthSessions: oauthsessionStoreRedis, MFADeviceTokenCookie: cookieDef, } interactionStoreRedis := &interaction.StoreRedis{ @@ -45973,23 +45037,20 @@ func newWebAppForceChangePasswordHandler(p *deps.RequestProvider) http.Handler { Store: interactionStoreRedis, } webappService2 := &webapp2.Service2{ - Logger: serviceLogger, - Request: request, - Sessions: sessionStoreRedis, - SessionCookie: sessionCookieDef, - SignedUpCookie: signedUpCookieDef, - MFADeviceTokenCookie: cookieDef, - ErrorCookie: errorCookie, - Cookies: cookieManager, - OAuthConfig: oAuthConfig, - UIConfig: uiConfig, - TrustProxy: trustProxy, - UIInfoResolver: uiInfoResolver, - OAuthClientResolver: oauthclientResolver, - OAuthSessions: oauthsessionStoreRedis, - SettingsActionGrantService: settingsActionGrantService, - Authorizations: authorizationService, - Graph: interactionService, + Logger: serviceLogger, + Request: request, + Sessions: sessionStoreRedis, + SessionCookie: sessionCookieDef, + SignedUpCookie: signedUpCookieDef, + MFADeviceTokenCookie: cookieDef, + ErrorCookie: errorCookie, + Cookies: cookieManager, + OAuthConfig: oAuthConfig, + UIConfig: uiConfig, + TrustProxy: trustProxy, + UIInfoResolver: uiInfoResolver, + OAuthClientResolver: oauthclientResolver, + Graph: interactionService, } uiFeatureConfig := featureConfig.UI forgotPasswordConfig := appConfig.ForgotPassword @@ -46493,39 +45554,6 @@ func newWebAppSettingsChangePasswordHandler(p *deps.RequestProvider) http.Handle Cookies: cookieManager, ClientResolver: oauthclientResolver, } - oauthsessionStoreRedis := oauthsession.StoreRedis{ - Context: contextContext, - Redis: appredisHandle, - AppID: appID, - } - tokenGenerator := _wireTokenGeneratorValue - settingsActionGrantService := handler.SettingsActionGrantService{ - AppID: appID, - CodeGenerator: tokenGenerator, - Clock: clockClock, - SettingsActionGrants: redisStore, - } - authorizationStore := &pq.AuthorizationStore{ - SQLBuilder: sqlBuilderApp, - SQLExecutor: sqlExecutor, - } - offlineGrantService := oauth2.OfflineGrantService{ - OAuthConfig: oAuthConfig, - Clock: clockClock, - IDPSessions: idpsessionProvider, - ClientResolver: oauthclientResolver, - } - sessionManager := &oauth2.SessionManager{ - Store: redisStore, - Config: oAuthConfig, - Service: offlineGrantService, - } - authorizationService := &oauth2.AuthorizationService{ - AppID: appID, - Store: authorizationStore, - Clock: clockClock, - OAuthSessionManager: sessionManager, - } interactionLogger := interaction.NewLogger(factory) eventLogger := event.NewLogger(factory) sqlBuilder := appdb.NewSQLBuilder(databaseCredentials) @@ -46644,6 +45672,10 @@ func newWebAppSettingsChangePasswordHandler(p *deps.RequestProvider) http.Handle UserStore: store, Events: eventService, } + authorizationStore := &pq.AuthorizationStore{ + SQLBuilder: sqlBuilderApp, + SQLExecutor: sqlExecutor, + } cookieDef2 := session.NewSessionCookieDef(sessionConfig) idpsessionManager := &idpsession.Manager{ Store: idpsessionStoreRedis, @@ -46651,6 +45683,17 @@ func newWebAppSettingsChangePasswordHandler(p *deps.RequestProvider) http.Handle Cookies: cookieManager, CookieDef: cookieDef2, } + offlineGrantService := oauth2.OfflineGrantService{ + OAuthConfig: oAuthConfig, + Clock: clockClock, + IDPSessions: idpsessionProvider, + ClientResolver: oauthclientResolver, + } + sessionManager := &oauth2.SessionManager{ + Store: redisStore, + Config: oAuthConfig, + Service: offlineGrantService, + } accountDeletionConfig := appConfig.AccountDeletion accountAnonymizationConfig := appConfig.AccountAnonymization coordinator := &facade.Coordinator{ @@ -46789,7 +45832,7 @@ func newWebAppSettingsChangePasswordHandler(p *deps.RequestProvider) http.Handle AccessTokenSessions: sessionManager, Events: eventService, } - storeRedis2 := &oauthsession.StoreRedis{ + oauthsessionStoreRedis := &oauthsession.StoreRedis{ Context: contextContext, Redis: appredisHandle, AppID: appID, @@ -46828,7 +45871,7 @@ func newWebAppSettingsChangePasswordHandler(p *deps.RequestProvider) http.Handle Sessions: idpsessionProvider, SessionManager: manager2, SessionCookie: cookieDef2, - OAuthSessions: storeRedis2, + OAuthSessions: oauthsessionStoreRedis, MFADeviceTokenCookie: cookieDef, } interactionStoreRedis := &interaction.StoreRedis{ @@ -46841,23 +45884,20 @@ func newWebAppSettingsChangePasswordHandler(p *deps.RequestProvider) http.Handle Store: interactionStoreRedis, } webappService2 := &webapp2.Service2{ - Logger: serviceLogger, - Request: request, - Sessions: sessionStoreRedis, - SessionCookie: sessionCookieDef, - SignedUpCookie: signedUpCookieDef, - MFADeviceTokenCookie: cookieDef, - ErrorCookie: errorCookie, - Cookies: cookieManager, - OAuthConfig: oAuthConfig, - UIConfig: uiConfig, - TrustProxy: trustProxy, - UIInfoResolver: uiInfoResolver, - OAuthClientResolver: oauthclientResolver, - OAuthSessions: oauthsessionStoreRedis, - SettingsActionGrantService: settingsActionGrantService, - Authorizations: authorizationService, - Graph: interactionService, + Logger: serviceLogger, + Request: request, + Sessions: sessionStoreRedis, + SessionCookie: sessionCookieDef, + SignedUpCookie: signedUpCookieDef, + MFADeviceTokenCookie: cookieDef, + ErrorCookie: errorCookie, + Cookies: cookieManager, + OAuthConfig: oAuthConfig, + UIConfig: uiConfig, + TrustProxy: trustProxy, + UIInfoResolver: uiInfoResolver, + OAuthClientResolver: oauthclientResolver, + Graph: interactionService, } uiFeatureConfig := featureConfig.UI forgotPasswordConfig := appConfig.ForgotPassword @@ -46907,11 +45947,10 @@ func newWebAppSettingsChangePasswordHandler(p *deps.RequestProvider) http.Handle ControllerDeps: controllerDeps, } settingsChangePasswordHandler := &webapp.SettingsChangePasswordHandler{ - ControllerFactory: controllerFactory, - BaseViewModel: baseViewModeler, - Renderer: responseRenderer, - PasswordPolicy: passwordChecker, - OAuthClientResolver: oauthclientResolver, + ControllerFactory: controllerFactory, + BaseViewModel: baseViewModeler, + Renderer: responseRenderer, + PasswordPolicy: passwordChecker, } return settingsChangePasswordHandler } @@ -47362,39 +46401,6 @@ func newWebAppForceChangeSecondaryPasswordHandler(p *deps.RequestProvider) http. Cookies: cookieManager, ClientResolver: oauthclientResolver, } - oauthsessionStoreRedis := oauthsession.StoreRedis{ - Context: contextContext, - Redis: appredisHandle, - AppID: appID, - } - tokenGenerator := _wireTokenGeneratorValue - settingsActionGrantService := handler.SettingsActionGrantService{ - AppID: appID, - CodeGenerator: tokenGenerator, - Clock: clockClock, - SettingsActionGrants: redisStore, - } - authorizationStore := &pq.AuthorizationStore{ - SQLBuilder: sqlBuilderApp, - SQLExecutor: sqlExecutor, - } - offlineGrantService := oauth2.OfflineGrantService{ - OAuthConfig: oAuthConfig, - Clock: clockClock, - IDPSessions: idpsessionProvider, - ClientResolver: oauthclientResolver, - } - sessionManager := &oauth2.SessionManager{ - Store: redisStore, - Config: oAuthConfig, - Service: offlineGrantService, - } - authorizationService := &oauth2.AuthorizationService{ - AppID: appID, - Store: authorizationStore, - Clock: clockClock, - OAuthSessionManager: sessionManager, - } interactionLogger := interaction.NewLogger(factory) eventLogger := event.NewLogger(factory) sqlBuilder := appdb.NewSQLBuilder(databaseCredentials) @@ -47513,6 +46519,10 @@ func newWebAppForceChangeSecondaryPasswordHandler(p *deps.RequestProvider) http. UserStore: store, Events: eventService, } + authorizationStore := &pq.AuthorizationStore{ + SQLBuilder: sqlBuilderApp, + SQLExecutor: sqlExecutor, + } cookieDef2 := session.NewSessionCookieDef(sessionConfig) idpsessionManager := &idpsession.Manager{ Store: idpsessionStoreRedis, @@ -47520,6 +46530,17 @@ func newWebAppForceChangeSecondaryPasswordHandler(p *deps.RequestProvider) http. Cookies: cookieManager, CookieDef: cookieDef2, } + offlineGrantService := oauth2.OfflineGrantService{ + OAuthConfig: oAuthConfig, + Clock: clockClock, + IDPSessions: idpsessionProvider, + ClientResolver: oauthclientResolver, + } + sessionManager := &oauth2.SessionManager{ + Store: redisStore, + Config: oAuthConfig, + Service: offlineGrantService, + } accountDeletionConfig := appConfig.AccountDeletion accountAnonymizationConfig := appConfig.AccountAnonymization coordinator := &facade.Coordinator{ @@ -47658,7 +46679,7 @@ func newWebAppForceChangeSecondaryPasswordHandler(p *deps.RequestProvider) http. AccessTokenSessions: sessionManager, Events: eventService, } - storeRedis2 := &oauthsession.StoreRedis{ + oauthsessionStoreRedis := &oauthsession.StoreRedis{ Context: contextContext, Redis: appredisHandle, AppID: appID, @@ -47697,7 +46718,7 @@ func newWebAppForceChangeSecondaryPasswordHandler(p *deps.RequestProvider) http. Sessions: idpsessionProvider, SessionManager: manager2, SessionCookie: cookieDef2, - OAuthSessions: storeRedis2, + OAuthSessions: oauthsessionStoreRedis, MFADeviceTokenCookie: cookieDef, } interactionStoreRedis := &interaction.StoreRedis{ @@ -47710,23 +46731,20 @@ func newWebAppForceChangeSecondaryPasswordHandler(p *deps.RequestProvider) http. Store: interactionStoreRedis, } webappService2 := &webapp2.Service2{ - Logger: serviceLogger, - Request: request, - Sessions: sessionStoreRedis, - SessionCookie: sessionCookieDef, - SignedUpCookie: signedUpCookieDef, - MFADeviceTokenCookie: cookieDef, - ErrorCookie: errorCookie, - Cookies: cookieManager, - OAuthConfig: oAuthConfig, - UIConfig: uiConfig, - TrustProxy: trustProxy, - UIInfoResolver: uiInfoResolver, - OAuthClientResolver: oauthclientResolver, - OAuthSessions: oauthsessionStoreRedis, - SettingsActionGrantService: settingsActionGrantService, - Authorizations: authorizationService, - Graph: interactionService, + Logger: serviceLogger, + Request: request, + Sessions: sessionStoreRedis, + SessionCookie: sessionCookieDef, + SignedUpCookie: signedUpCookieDef, + MFADeviceTokenCookie: cookieDef, + ErrorCookie: errorCookie, + Cookies: cookieManager, + OAuthConfig: oAuthConfig, + UIConfig: uiConfig, + TrustProxy: trustProxy, + UIInfoResolver: uiInfoResolver, + OAuthClientResolver: oauthclientResolver, + Graph: interactionService, } uiFeatureConfig := featureConfig.UI forgotPasswordConfig := appConfig.ForgotPassword @@ -48230,39 +47248,6 @@ func newWebAppSettingsChangeSecondaryPasswordHandler(p *deps.RequestProvider) ht Cookies: cookieManager, ClientResolver: oauthclientResolver, } - oauthsessionStoreRedis := oauthsession.StoreRedis{ - Context: contextContext, - Redis: appredisHandle, - AppID: appID, - } - tokenGenerator := _wireTokenGeneratorValue - settingsActionGrantService := handler.SettingsActionGrantService{ - AppID: appID, - CodeGenerator: tokenGenerator, - Clock: clockClock, - SettingsActionGrants: redisStore, - } - authorizationStore := &pq.AuthorizationStore{ - SQLBuilder: sqlBuilderApp, - SQLExecutor: sqlExecutor, - } - offlineGrantService := oauth2.OfflineGrantService{ - OAuthConfig: oAuthConfig, - Clock: clockClock, - IDPSessions: idpsessionProvider, - ClientResolver: oauthclientResolver, - } - sessionManager := &oauth2.SessionManager{ - Store: redisStore, - Config: oAuthConfig, - Service: offlineGrantService, - } - authorizationService := &oauth2.AuthorizationService{ - AppID: appID, - Store: authorizationStore, - Clock: clockClock, - OAuthSessionManager: sessionManager, - } interactionLogger := interaction.NewLogger(factory) eventLogger := event.NewLogger(factory) sqlBuilder := appdb.NewSQLBuilder(databaseCredentials) @@ -48381,6 +47366,10 @@ func newWebAppSettingsChangeSecondaryPasswordHandler(p *deps.RequestProvider) ht UserStore: store, Events: eventService, } + authorizationStore := &pq.AuthorizationStore{ + SQLBuilder: sqlBuilderApp, + SQLExecutor: sqlExecutor, + } cookieDef2 := session.NewSessionCookieDef(sessionConfig) idpsessionManager := &idpsession.Manager{ Store: idpsessionStoreRedis, @@ -48388,6 +47377,17 @@ func newWebAppSettingsChangeSecondaryPasswordHandler(p *deps.RequestProvider) ht Cookies: cookieManager, CookieDef: cookieDef2, } + offlineGrantService := oauth2.OfflineGrantService{ + OAuthConfig: oAuthConfig, + Clock: clockClock, + IDPSessions: idpsessionProvider, + ClientResolver: oauthclientResolver, + } + sessionManager := &oauth2.SessionManager{ + Store: redisStore, + Config: oAuthConfig, + Service: offlineGrantService, + } accountDeletionConfig := appConfig.AccountDeletion accountAnonymizationConfig := appConfig.AccountAnonymization coordinator := &facade.Coordinator{ @@ -48526,7 +47526,7 @@ func newWebAppSettingsChangeSecondaryPasswordHandler(p *deps.RequestProvider) ht AccessTokenSessions: sessionManager, Events: eventService, } - storeRedis2 := &oauthsession.StoreRedis{ + oauthsessionStoreRedis := &oauthsession.StoreRedis{ Context: contextContext, Redis: appredisHandle, AppID: appID, @@ -48565,7 +47565,7 @@ func newWebAppSettingsChangeSecondaryPasswordHandler(p *deps.RequestProvider) ht Sessions: idpsessionProvider, SessionManager: manager2, SessionCookie: cookieDef2, - OAuthSessions: storeRedis2, + OAuthSessions: oauthsessionStoreRedis, MFADeviceTokenCookie: cookieDef, } interactionStoreRedis := &interaction.StoreRedis{ @@ -48578,23 +47578,20 @@ func newWebAppSettingsChangeSecondaryPasswordHandler(p *deps.RequestProvider) ht Store: interactionStoreRedis, } webappService2 := &webapp2.Service2{ - Logger: serviceLogger, - Request: request, - Sessions: sessionStoreRedis, - SessionCookie: sessionCookieDef, - SignedUpCookie: signedUpCookieDef, - MFADeviceTokenCookie: cookieDef, - ErrorCookie: errorCookie, - Cookies: cookieManager, - OAuthConfig: oAuthConfig, - UIConfig: uiConfig, - TrustProxy: trustProxy, - UIInfoResolver: uiInfoResolver, - OAuthClientResolver: oauthclientResolver, - OAuthSessions: oauthsessionStoreRedis, - SettingsActionGrantService: settingsActionGrantService, - Authorizations: authorizationService, - Graph: interactionService, + Logger: serviceLogger, + Request: request, + Sessions: sessionStoreRedis, + SessionCookie: sessionCookieDef, + SignedUpCookie: signedUpCookieDef, + MFADeviceTokenCookie: cookieDef, + ErrorCookie: errorCookie, + Cookies: cookieManager, + OAuthConfig: oAuthConfig, + UIConfig: uiConfig, + TrustProxy: trustProxy, + UIInfoResolver: uiInfoResolver, + OAuthClientResolver: oauthclientResolver, + Graph: interactionService, } uiFeatureConfig := featureConfig.UI forgotPasswordConfig := appConfig.ForgotPassword @@ -49098,39 +48095,6 @@ func newWebAppSettingsDeleteAccountHandler(p *deps.RequestProvider) http.Handler Cookies: cookieManager, ClientResolver: oauthclientResolver, } - oauthsessionStoreRedis := oauthsession.StoreRedis{ - Context: contextContext, - Redis: appredisHandle, - AppID: appID, - } - tokenGenerator := _wireTokenGeneratorValue - settingsActionGrantService := handler.SettingsActionGrantService{ - AppID: appID, - CodeGenerator: tokenGenerator, - Clock: clockClock, - SettingsActionGrants: redisStore, - } - authorizationStore := &pq.AuthorizationStore{ - SQLBuilder: sqlBuilderApp, - SQLExecutor: sqlExecutor, - } - offlineGrantService := oauth2.OfflineGrantService{ - OAuthConfig: oAuthConfig, - Clock: clockClock, - IDPSessions: idpsessionProvider, - ClientResolver: oauthclientResolver, - } - sessionManager := &oauth2.SessionManager{ - Store: redisStore, - Config: oAuthConfig, - Service: offlineGrantService, - } - authorizationService := &oauth2.AuthorizationService{ - AppID: appID, - Store: authorizationStore, - Clock: clockClock, - OAuthSessionManager: sessionManager, - } interactionLogger := interaction.NewLogger(factory) eventLogger := event.NewLogger(factory) sqlBuilder := appdb.NewSQLBuilder(databaseCredentials) @@ -49249,6 +48213,10 @@ func newWebAppSettingsDeleteAccountHandler(p *deps.RequestProvider) http.Handler UserStore: store, Events: eventService, } + authorizationStore := &pq.AuthorizationStore{ + SQLBuilder: sqlBuilderApp, + SQLExecutor: sqlExecutor, + } cookieDef2 := session.NewSessionCookieDef(sessionConfig) idpsessionManager := &idpsession.Manager{ Store: idpsessionStoreRedis, @@ -49256,6 +48224,17 @@ func newWebAppSettingsDeleteAccountHandler(p *deps.RequestProvider) http.Handler Cookies: cookieManager, CookieDef: cookieDef2, } + offlineGrantService := oauth2.OfflineGrantService{ + OAuthConfig: oAuthConfig, + Clock: clockClock, + IDPSessions: idpsessionProvider, + ClientResolver: oauthclientResolver, + } + sessionManager := &oauth2.SessionManager{ + Store: redisStore, + Config: oAuthConfig, + Service: offlineGrantService, + } accountDeletionConfig := appConfig.AccountDeletion accountAnonymizationConfig := appConfig.AccountAnonymization coordinator := &facade.Coordinator{ @@ -49394,7 +48373,7 @@ func newWebAppSettingsDeleteAccountHandler(p *deps.RequestProvider) http.Handler AccessTokenSessions: sessionManager, Events: eventService, } - storeRedis2 := &oauthsession.StoreRedis{ + oauthsessionStoreRedis := &oauthsession.StoreRedis{ Context: contextContext, Redis: appredisHandle, AppID: appID, @@ -49433,7 +48412,7 @@ func newWebAppSettingsDeleteAccountHandler(p *deps.RequestProvider) http.Handler Sessions: idpsessionProvider, SessionManager: manager2, SessionCookie: cookieDef2, - OAuthSessions: storeRedis2, + OAuthSessions: oauthsessionStoreRedis, MFADeviceTokenCookie: cookieDef, } interactionStoreRedis := &interaction.StoreRedis{ @@ -49446,23 +48425,20 @@ func newWebAppSettingsDeleteAccountHandler(p *deps.RequestProvider) http.Handler Store: interactionStoreRedis, } webappService2 := &webapp2.Service2{ - Logger: serviceLogger, - Request: request, - Sessions: sessionStoreRedis, - SessionCookie: sessionCookieDef, - SignedUpCookie: signedUpCookieDef, - MFADeviceTokenCookie: cookieDef, - ErrorCookie: errorCookie, - Cookies: cookieManager, - OAuthConfig: oAuthConfig, - UIConfig: uiConfig, - TrustProxy: trustProxy, - UIInfoResolver: uiInfoResolver, - OAuthClientResolver: oauthclientResolver, - OAuthSessions: oauthsessionStoreRedis, - SettingsActionGrantService: settingsActionGrantService, - Authorizations: authorizationService, - Graph: interactionService, + Logger: serviceLogger, + Request: request, + Sessions: sessionStoreRedis, + SessionCookie: sessionCookieDef, + SignedUpCookie: signedUpCookieDef, + MFADeviceTokenCookie: cookieDef, + ErrorCookie: errorCookie, + Cookies: cookieManager, + OAuthConfig: oAuthConfig, + UIConfig: uiConfig, + TrustProxy: trustProxy, + UIInfoResolver: uiInfoResolver, + OAuthClientResolver: oauthclientResolver, + Graph: interactionService, } uiFeatureConfig := featureConfig.UI forgotPasswordConfig := appConfig.ForgotPassword @@ -49973,39 +48949,6 @@ func newWebAppSettingsDeleteAccountSuccessHandler(p *deps.RequestProvider) http. Cookies: cookieManager, ClientResolver: oauthclientResolver, } - oauthsessionStoreRedis := oauthsession.StoreRedis{ - Context: contextContext, - Redis: appredisHandle, - AppID: appID, - } - tokenGenerator := _wireTokenGeneratorValue - settingsActionGrantService := handler.SettingsActionGrantService{ - AppID: appID, - CodeGenerator: tokenGenerator, - Clock: clockClock, - SettingsActionGrants: redisStore, - } - authorizationStore := &pq.AuthorizationStore{ - SQLBuilder: sqlBuilderApp, - SQLExecutor: sqlExecutor, - } - offlineGrantService := oauth2.OfflineGrantService{ - OAuthConfig: oAuthConfig, - Clock: clockClock, - IDPSessions: idpsessionProvider, - ClientResolver: oauthclientResolver, - } - sessionManager := &oauth2.SessionManager{ - Store: redisStore, - Config: oAuthConfig, - Service: offlineGrantService, - } - authorizationService := &oauth2.AuthorizationService{ - AppID: appID, - Store: authorizationStore, - Clock: clockClock, - OAuthSessionManager: sessionManager, - } interactionLogger := interaction.NewLogger(factory) eventLogger := event.NewLogger(factory) sqlBuilder := appdb.NewSQLBuilder(databaseCredentials) @@ -50124,6 +49067,10 @@ func newWebAppSettingsDeleteAccountSuccessHandler(p *deps.RequestProvider) http. UserStore: store, Events: eventService, } + authorizationStore := &pq.AuthorizationStore{ + SQLBuilder: sqlBuilderApp, + SQLExecutor: sqlExecutor, + } cookieDef2 := session.NewSessionCookieDef(sessionConfig) idpsessionManager := &idpsession.Manager{ Store: idpsessionStoreRedis, @@ -50131,6 +49078,17 @@ func newWebAppSettingsDeleteAccountSuccessHandler(p *deps.RequestProvider) http. Cookies: cookieManager, CookieDef: cookieDef2, } + offlineGrantService := oauth2.OfflineGrantService{ + OAuthConfig: oAuthConfig, + Clock: clockClock, + IDPSessions: idpsessionProvider, + ClientResolver: oauthclientResolver, + } + sessionManager := &oauth2.SessionManager{ + Store: redisStore, + Config: oAuthConfig, + Service: offlineGrantService, + } accountDeletionConfig := appConfig.AccountDeletion accountAnonymizationConfig := appConfig.AccountAnonymization coordinator := &facade.Coordinator{ @@ -50269,7 +49227,7 @@ func newWebAppSettingsDeleteAccountSuccessHandler(p *deps.RequestProvider) http. AccessTokenSessions: sessionManager, Events: eventService, } - storeRedis2 := &oauthsession.StoreRedis{ + oauthsessionStoreRedis := &oauthsession.StoreRedis{ Context: contextContext, Redis: appredisHandle, AppID: appID, @@ -50308,7 +49266,7 @@ func newWebAppSettingsDeleteAccountSuccessHandler(p *deps.RequestProvider) http. Sessions: idpsessionProvider, SessionManager: manager2, SessionCookie: cookieDef2, - OAuthSessions: storeRedis2, + OAuthSessions: oauthsessionStoreRedis, MFADeviceTokenCookie: cookieDef, } interactionStoreRedis := &interaction.StoreRedis{ @@ -50321,23 +49279,20 @@ func newWebAppSettingsDeleteAccountSuccessHandler(p *deps.RequestProvider) http. Store: interactionStoreRedis, } webappService2 := &webapp2.Service2{ - Logger: serviceLogger, - Request: request, - Sessions: sessionStoreRedis, - SessionCookie: sessionCookieDef, - SignedUpCookie: signedUpCookieDef, - MFADeviceTokenCookie: cookieDef, - ErrorCookie: errorCookie, - Cookies: cookieManager, - OAuthConfig: oAuthConfig, - UIConfig: uiConfig, - TrustProxy: trustProxy, - UIInfoResolver: uiInfoResolver, - OAuthClientResolver: oauthclientResolver, - OAuthSessions: oauthsessionStoreRedis, - SettingsActionGrantService: settingsActionGrantService, - Authorizations: authorizationService, - Graph: interactionService, + Logger: serviceLogger, + Request: request, + Sessions: sessionStoreRedis, + SessionCookie: sessionCookieDef, + SignedUpCookie: signedUpCookieDef, + MFADeviceTokenCookie: cookieDef, + ErrorCookie: errorCookie, + Cookies: cookieManager, + OAuthConfig: oAuthConfig, + UIConfig: uiConfig, + TrustProxy: trustProxy, + UIInfoResolver: uiInfoResolver, + OAuthClientResolver: oauthclientResolver, + Graph: interactionService, } uiFeatureConfig := featureConfig.UI forgotPasswordConfig := appConfig.ForgotPassword @@ -50842,39 +49797,6 @@ func newWebAppAccountStatusHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, ClientResolver: oauthclientResolver, } - oauthsessionStoreRedis := oauthsession.StoreRedis{ - Context: contextContext, - Redis: appredisHandle, - AppID: appID, - } - tokenGenerator := _wireTokenGeneratorValue - settingsActionGrantService := handler.SettingsActionGrantService{ - AppID: appID, - CodeGenerator: tokenGenerator, - Clock: clockClock, - SettingsActionGrants: redisStore, - } - authorizationStore := &pq.AuthorizationStore{ - SQLBuilder: sqlBuilderApp, - SQLExecutor: sqlExecutor, - } - offlineGrantService := oauth2.OfflineGrantService{ - OAuthConfig: oAuthConfig, - Clock: clockClock, - IDPSessions: idpsessionProvider, - ClientResolver: oauthclientResolver, - } - sessionManager := &oauth2.SessionManager{ - Store: redisStore, - Config: oAuthConfig, - Service: offlineGrantService, - } - authorizationService := &oauth2.AuthorizationService{ - AppID: appID, - Store: authorizationStore, - Clock: clockClock, - OAuthSessionManager: sessionManager, - } interactionLogger := interaction.NewLogger(factory) eventLogger := event.NewLogger(factory) sqlBuilder := appdb.NewSQLBuilder(databaseCredentials) @@ -50993,6 +49915,10 @@ func newWebAppAccountStatusHandler(p *deps.RequestProvider) http.Handler { UserStore: store, Events: eventService, } + authorizationStore := &pq.AuthorizationStore{ + SQLBuilder: sqlBuilderApp, + SQLExecutor: sqlExecutor, + } cookieDef2 := session.NewSessionCookieDef(sessionConfig) idpsessionManager := &idpsession.Manager{ Store: idpsessionStoreRedis, @@ -51000,6 +49926,17 @@ func newWebAppAccountStatusHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, CookieDef: cookieDef2, } + offlineGrantService := oauth2.OfflineGrantService{ + OAuthConfig: oAuthConfig, + Clock: clockClock, + IDPSessions: idpsessionProvider, + ClientResolver: oauthclientResolver, + } + sessionManager := &oauth2.SessionManager{ + Store: redisStore, + Config: oAuthConfig, + Service: offlineGrantService, + } accountDeletionConfig := appConfig.AccountDeletion accountAnonymizationConfig := appConfig.AccountAnonymization coordinator := &facade.Coordinator{ @@ -51138,7 +50075,7 @@ func newWebAppAccountStatusHandler(p *deps.RequestProvider) http.Handler { AccessTokenSessions: sessionManager, Events: eventService, } - storeRedis2 := &oauthsession.StoreRedis{ + oauthsessionStoreRedis := &oauthsession.StoreRedis{ Context: contextContext, Redis: appredisHandle, AppID: appID, @@ -51177,7 +50114,7 @@ func newWebAppAccountStatusHandler(p *deps.RequestProvider) http.Handler { Sessions: idpsessionProvider, SessionManager: manager2, SessionCookie: cookieDef2, - OAuthSessions: storeRedis2, + OAuthSessions: oauthsessionStoreRedis, MFADeviceTokenCookie: cookieDef, } interactionStoreRedis := &interaction.StoreRedis{ @@ -51190,23 +50127,20 @@ func newWebAppAccountStatusHandler(p *deps.RequestProvider) http.Handler { Store: interactionStoreRedis, } webappService2 := &webapp2.Service2{ - Logger: serviceLogger, - Request: request, - Sessions: sessionStoreRedis, - SessionCookie: sessionCookieDef, - SignedUpCookie: signedUpCookieDef, - MFADeviceTokenCookie: cookieDef, - ErrorCookie: errorCookie, - Cookies: cookieManager, - OAuthConfig: oAuthConfig, - UIConfig: uiConfig, - TrustProxy: trustProxy, - UIInfoResolver: uiInfoResolver, - OAuthClientResolver: oauthclientResolver, - OAuthSessions: oauthsessionStoreRedis, - SettingsActionGrantService: settingsActionGrantService, - Authorizations: authorizationService, - Graph: interactionService, + Logger: serviceLogger, + Request: request, + Sessions: sessionStoreRedis, + SessionCookie: sessionCookieDef, + SignedUpCookie: signedUpCookieDef, + MFADeviceTokenCookie: cookieDef, + ErrorCookie: errorCookie, + Cookies: cookieManager, + OAuthConfig: oAuthConfig, + UIConfig: uiConfig, + TrustProxy: trustProxy, + UIInfoResolver: uiInfoResolver, + OAuthClientResolver: oauthclientResolver, + Graph: interactionService, } uiFeatureConfig := featureConfig.UI forgotPasswordConfig := appConfig.ForgotPassword @@ -51709,39 +50643,6 @@ func newWebAppLogoutHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, ClientResolver: oauthclientResolver, } - oauthsessionStoreRedis := oauthsession.StoreRedis{ - Context: contextContext, - Redis: appredisHandle, - AppID: appID, - } - tokenGenerator := _wireTokenGeneratorValue - settingsActionGrantService := handler.SettingsActionGrantService{ - AppID: appID, - CodeGenerator: tokenGenerator, - Clock: clockClock, - SettingsActionGrants: redisStore, - } - authorizationStore := &pq.AuthorizationStore{ - SQLBuilder: sqlBuilderApp, - SQLExecutor: sqlExecutor, - } - offlineGrantService := oauth2.OfflineGrantService{ - OAuthConfig: oAuthConfig, - Clock: clockClock, - IDPSessions: idpsessionProvider, - ClientResolver: oauthclientResolver, - } - sessionManager := &oauth2.SessionManager{ - Store: redisStore, - Config: oAuthConfig, - Service: offlineGrantService, - } - authorizationService := &oauth2.AuthorizationService{ - AppID: appID, - Store: authorizationStore, - Clock: clockClock, - OAuthSessionManager: sessionManager, - } interactionLogger := interaction.NewLogger(factory) eventLogger := event.NewLogger(factory) sqlBuilder := appdb.NewSQLBuilder(databaseCredentials) @@ -51860,6 +50761,10 @@ func newWebAppLogoutHandler(p *deps.RequestProvider) http.Handler { UserStore: store, Events: eventService, } + authorizationStore := &pq.AuthorizationStore{ + SQLBuilder: sqlBuilderApp, + SQLExecutor: sqlExecutor, + } cookieDef2 := session.NewSessionCookieDef(sessionConfig) idpsessionManager := &idpsession.Manager{ Store: idpsessionStoreRedis, @@ -51867,6 +50772,17 @@ func newWebAppLogoutHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, CookieDef: cookieDef2, } + offlineGrantService := oauth2.OfflineGrantService{ + OAuthConfig: oAuthConfig, + Clock: clockClock, + IDPSessions: idpsessionProvider, + ClientResolver: oauthclientResolver, + } + sessionManager := &oauth2.SessionManager{ + Store: redisStore, + Config: oAuthConfig, + Service: offlineGrantService, + } accountDeletionConfig := appConfig.AccountDeletion accountAnonymizationConfig := appConfig.AccountAnonymization coordinator := &facade.Coordinator{ @@ -52005,7 +50921,7 @@ func newWebAppLogoutHandler(p *deps.RequestProvider) http.Handler { AccessTokenSessions: sessionManager, Events: eventService, } - storeRedis2 := &oauthsession.StoreRedis{ + oauthsessionStoreRedis := &oauthsession.StoreRedis{ Context: contextContext, Redis: appredisHandle, AppID: appID, @@ -52044,7 +50960,7 @@ func newWebAppLogoutHandler(p *deps.RequestProvider) http.Handler { Sessions: idpsessionProvider, SessionManager: manager2, SessionCookie: cookieDef2, - OAuthSessions: storeRedis2, + OAuthSessions: oauthsessionStoreRedis, MFADeviceTokenCookie: cookieDef, } interactionStoreRedis := &interaction.StoreRedis{ @@ -52057,23 +50973,20 @@ func newWebAppLogoutHandler(p *deps.RequestProvider) http.Handler { Store: interactionStoreRedis, } webappService2 := &webapp2.Service2{ - Logger: serviceLogger, - Request: request, - Sessions: sessionStoreRedis, - SessionCookie: sessionCookieDef, - SignedUpCookie: signedUpCookieDef, - MFADeviceTokenCookie: cookieDef, - ErrorCookie: errorCookie, - Cookies: cookieManager, - OAuthConfig: oAuthConfig, - UIConfig: uiConfig, - TrustProxy: trustProxy, - UIInfoResolver: uiInfoResolver, - OAuthClientResolver: oauthclientResolver, - OAuthSessions: oauthsessionStoreRedis, - SettingsActionGrantService: settingsActionGrantService, - Authorizations: authorizationService, - Graph: interactionService, + Logger: serviceLogger, + Request: request, + Sessions: sessionStoreRedis, + SessionCookie: sessionCookieDef, + SignedUpCookie: signedUpCookieDef, + MFADeviceTokenCookie: cookieDef, + ErrorCookie: errorCookie, + Cookies: cookieManager, + OAuthConfig: oAuthConfig, + UIConfig: uiConfig, + TrustProxy: trustProxy, + UIInfoResolver: uiInfoResolver, + OAuthClientResolver: oauthclientResolver, + Graph: interactionService, } uiFeatureConfig := featureConfig.UI forgotPasswordConfig := appConfig.ForgotPassword @@ -52592,39 +51505,6 @@ func newWebAppReturnHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, ClientResolver: oauthclientResolver, } - oauthsessionStoreRedis := oauthsession.StoreRedis{ - Context: contextContext, - Redis: appredisHandle, - AppID: appID, - } - tokenGenerator := _wireTokenGeneratorValue - settingsActionGrantService := handler.SettingsActionGrantService{ - AppID: appID, - CodeGenerator: tokenGenerator, - Clock: clockClock, - SettingsActionGrants: redisStore, - } - authorizationStore := &pq.AuthorizationStore{ - SQLBuilder: sqlBuilderApp, - SQLExecutor: sqlExecutor, - } - offlineGrantService := oauth2.OfflineGrantService{ - OAuthConfig: oAuthConfig, - Clock: clockClock, - IDPSessions: idpsessionProvider, - ClientResolver: oauthclientResolver, - } - sessionManager := &oauth2.SessionManager{ - Store: redisStore, - Config: oAuthConfig, - Service: offlineGrantService, - } - authorizationService := &oauth2.AuthorizationService{ - AppID: appID, - Store: authorizationStore, - Clock: clockClock, - OAuthSessionManager: sessionManager, - } interactionLogger := interaction.NewLogger(factory) eventLogger := event.NewLogger(factory) sqlBuilder := appdb.NewSQLBuilder(databaseCredentials) @@ -52743,6 +51623,10 @@ func newWebAppReturnHandler(p *deps.RequestProvider) http.Handler { UserStore: store, Events: eventService, } + authorizationStore := &pq.AuthorizationStore{ + SQLBuilder: sqlBuilderApp, + SQLExecutor: sqlExecutor, + } cookieDef2 := session.NewSessionCookieDef(sessionConfig) idpsessionManager := &idpsession.Manager{ Store: idpsessionStoreRedis, @@ -52750,6 +51634,17 @@ func newWebAppReturnHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, CookieDef: cookieDef2, } + offlineGrantService := oauth2.OfflineGrantService{ + OAuthConfig: oAuthConfig, + Clock: clockClock, + IDPSessions: idpsessionProvider, + ClientResolver: oauthclientResolver, + } + sessionManager := &oauth2.SessionManager{ + Store: redisStore, + Config: oAuthConfig, + Service: offlineGrantService, + } accountDeletionConfig := appConfig.AccountDeletion accountAnonymizationConfig := appConfig.AccountAnonymization coordinator := &facade.Coordinator{ @@ -52888,7 +51783,7 @@ func newWebAppReturnHandler(p *deps.RequestProvider) http.Handler { AccessTokenSessions: sessionManager, Events: eventService, } - storeRedis2 := &oauthsession.StoreRedis{ + oauthsessionStoreRedis := &oauthsession.StoreRedis{ Context: contextContext, Redis: appredisHandle, AppID: appID, @@ -52927,7 +51822,7 @@ func newWebAppReturnHandler(p *deps.RequestProvider) http.Handler { Sessions: idpsessionProvider, SessionManager: manager2, SessionCookie: cookieDef2, - OAuthSessions: storeRedis2, + OAuthSessions: oauthsessionStoreRedis, MFADeviceTokenCookie: cookieDef, } interactionStoreRedis := &interaction.StoreRedis{ @@ -52940,23 +51835,20 @@ func newWebAppReturnHandler(p *deps.RequestProvider) http.Handler { Store: interactionStoreRedis, } webappService2 := &webapp2.Service2{ - Logger: serviceLogger, - Request: request, - Sessions: sessionStoreRedis, - SessionCookie: sessionCookieDef, - SignedUpCookie: signedUpCookieDef, - MFADeviceTokenCookie: cookieDef, - ErrorCookie: errorCookie, - Cookies: cookieManager, - OAuthConfig: oAuthConfig, - UIConfig: uiConfig, - TrustProxy: trustProxy, - UIInfoResolver: uiInfoResolver, - OAuthClientResolver: oauthclientResolver, - OAuthSessions: oauthsessionStoreRedis, - SettingsActionGrantService: settingsActionGrantService, - Authorizations: authorizationService, - Graph: interactionService, + Logger: serviceLogger, + Request: request, + Sessions: sessionStoreRedis, + SessionCookie: sessionCookieDef, + SignedUpCookie: signedUpCookieDef, + MFADeviceTokenCookie: cookieDef, + ErrorCookie: errorCookie, + Cookies: cookieManager, + OAuthConfig: oAuthConfig, + UIConfig: uiConfig, + TrustProxy: trustProxy, + UIInfoResolver: uiInfoResolver, + OAuthClientResolver: oauthclientResolver, + Graph: interactionService, } uiFeatureConfig := featureConfig.UI forgotPasswordConfig := appConfig.ForgotPassword @@ -53459,39 +52351,6 @@ func newWebAppErrorHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, ClientResolver: oauthclientResolver, } - oauthsessionStoreRedis := oauthsession.StoreRedis{ - Context: contextContext, - Redis: appredisHandle, - AppID: appID, - } - tokenGenerator := _wireTokenGeneratorValue - settingsActionGrantService := handler.SettingsActionGrantService{ - AppID: appID, - CodeGenerator: tokenGenerator, - Clock: clockClock, - SettingsActionGrants: redisStore, - } - authorizationStore := &pq.AuthorizationStore{ - SQLBuilder: sqlBuilderApp, - SQLExecutor: sqlExecutor, - } - offlineGrantService := oauth2.OfflineGrantService{ - OAuthConfig: oAuthConfig, - Clock: clockClock, - IDPSessions: idpsessionProvider, - ClientResolver: oauthclientResolver, - } - sessionManager := &oauth2.SessionManager{ - Store: redisStore, - Config: oAuthConfig, - Service: offlineGrantService, - } - authorizationService := &oauth2.AuthorizationService{ - AppID: appID, - Store: authorizationStore, - Clock: clockClock, - OAuthSessionManager: sessionManager, - } interactionLogger := interaction.NewLogger(factory) eventLogger := event.NewLogger(factory) sqlBuilder := appdb.NewSQLBuilder(databaseCredentials) @@ -53610,6 +52469,10 @@ func newWebAppErrorHandler(p *deps.RequestProvider) http.Handler { UserStore: store, Events: eventService, } + authorizationStore := &pq.AuthorizationStore{ + SQLBuilder: sqlBuilderApp, + SQLExecutor: sqlExecutor, + } cookieDef2 := session.NewSessionCookieDef(sessionConfig) idpsessionManager := &idpsession.Manager{ Store: idpsessionStoreRedis, @@ -53617,6 +52480,17 @@ func newWebAppErrorHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, CookieDef: cookieDef2, } + offlineGrantService := oauth2.OfflineGrantService{ + OAuthConfig: oAuthConfig, + Clock: clockClock, + IDPSessions: idpsessionProvider, + ClientResolver: oauthclientResolver, + } + sessionManager := &oauth2.SessionManager{ + Store: redisStore, + Config: oAuthConfig, + Service: offlineGrantService, + } accountDeletionConfig := appConfig.AccountDeletion accountAnonymizationConfig := appConfig.AccountAnonymization coordinator := &facade.Coordinator{ @@ -53755,7 +52629,7 @@ func newWebAppErrorHandler(p *deps.RequestProvider) http.Handler { AccessTokenSessions: sessionManager, Events: eventService, } - storeRedis2 := &oauthsession.StoreRedis{ + oauthsessionStoreRedis := &oauthsession.StoreRedis{ Context: contextContext, Redis: appredisHandle, AppID: appID, @@ -53794,7 +52668,7 @@ func newWebAppErrorHandler(p *deps.RequestProvider) http.Handler { Sessions: idpsessionProvider, SessionManager: manager2, SessionCookie: cookieDef2, - OAuthSessions: storeRedis2, + OAuthSessions: oauthsessionStoreRedis, MFADeviceTokenCookie: cookieDef, } interactionStoreRedis := &interaction.StoreRedis{ @@ -53807,23 +52681,20 @@ func newWebAppErrorHandler(p *deps.RequestProvider) http.Handler { Store: interactionStoreRedis, } webappService2 := &webapp2.Service2{ - Logger: serviceLogger, - Request: request, - Sessions: sessionStoreRedis, - SessionCookie: sessionCookieDef, - SignedUpCookie: signedUpCookieDef, - MFADeviceTokenCookie: cookieDef, - ErrorCookie: errorCookie, - Cookies: cookieManager, - OAuthConfig: oAuthConfig, - UIConfig: uiConfig, - TrustProxy: trustProxy, - UIInfoResolver: uiInfoResolver, - OAuthClientResolver: oauthclientResolver, - OAuthSessions: oauthsessionStoreRedis, - SettingsActionGrantService: settingsActionGrantService, - Authorizations: authorizationService, - Graph: interactionService, + Logger: serviceLogger, + Request: request, + Sessions: sessionStoreRedis, + SessionCookie: sessionCookieDef, + SignedUpCookie: signedUpCookieDef, + MFADeviceTokenCookie: cookieDef, + ErrorCookie: errorCookie, + Cookies: cookieManager, + OAuthConfig: oAuthConfig, + UIConfig: uiConfig, + TrustProxy: trustProxy, + UIInfoResolver: uiInfoResolver, + OAuthClientResolver: oauthclientResolver, + Graph: interactionService, } uiFeatureConfig := featureConfig.UI forgotPasswordConfig := appConfig.ForgotPassword @@ -55211,39 +54082,6 @@ func newWebAppNotFoundHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, ClientResolver: oauthclientResolver, } - oauthsessionStoreRedis := oauthsession.StoreRedis{ - Context: contextContext, - Redis: appredisHandle, - AppID: appID, - } - tokenGenerator := _wireTokenGeneratorValue - settingsActionGrantService := handler.SettingsActionGrantService{ - AppID: appID, - CodeGenerator: tokenGenerator, - Clock: clockClock, - SettingsActionGrants: redisStore, - } - authorizationStore := &pq.AuthorizationStore{ - SQLBuilder: sqlBuilderApp, - SQLExecutor: sqlExecutor, - } - offlineGrantService := oauth2.OfflineGrantService{ - OAuthConfig: oAuthConfig, - Clock: clockClock, - IDPSessions: idpsessionProvider, - ClientResolver: oauthclientResolver, - } - sessionManager := &oauth2.SessionManager{ - Store: redisStore, - Config: oAuthConfig, - Service: offlineGrantService, - } - authorizationService := &oauth2.AuthorizationService{ - AppID: appID, - Store: authorizationStore, - Clock: clockClock, - OAuthSessionManager: sessionManager, - } interactionLogger := interaction.NewLogger(factory) eventLogger := event.NewLogger(factory) sqlBuilder := appdb.NewSQLBuilder(databaseCredentials) @@ -55362,6 +54200,10 @@ func newWebAppNotFoundHandler(p *deps.RequestProvider) http.Handler { UserStore: store, Events: eventService, } + authorizationStore := &pq.AuthorizationStore{ + SQLBuilder: sqlBuilderApp, + SQLExecutor: sqlExecutor, + } cookieDef2 := session.NewSessionCookieDef(sessionConfig) idpsessionManager := &idpsession.Manager{ Store: idpsessionStoreRedis, @@ -55369,6 +54211,17 @@ func newWebAppNotFoundHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, CookieDef: cookieDef2, } + offlineGrantService := oauth2.OfflineGrantService{ + OAuthConfig: oAuthConfig, + Clock: clockClock, + IDPSessions: idpsessionProvider, + ClientResolver: oauthclientResolver, + } + sessionManager := &oauth2.SessionManager{ + Store: redisStore, + Config: oAuthConfig, + Service: offlineGrantService, + } accountDeletionConfig := appConfig.AccountDeletion accountAnonymizationConfig := appConfig.AccountAnonymization coordinator := &facade.Coordinator{ @@ -55507,7 +54360,7 @@ func newWebAppNotFoundHandler(p *deps.RequestProvider) http.Handler { AccessTokenSessions: sessionManager, Events: eventService, } - storeRedis2 := &oauthsession.StoreRedis{ + oauthsessionStoreRedis := &oauthsession.StoreRedis{ Context: contextContext, Redis: appredisHandle, AppID: appID, @@ -55546,7 +54399,7 @@ func newWebAppNotFoundHandler(p *deps.RequestProvider) http.Handler { Sessions: idpsessionProvider, SessionManager: manager2, SessionCookie: cookieDef2, - OAuthSessions: storeRedis2, + OAuthSessions: oauthsessionStoreRedis, MFADeviceTokenCookie: cookieDef, } interactionStoreRedis := &interaction.StoreRedis{ @@ -55559,23 +54412,20 @@ func newWebAppNotFoundHandler(p *deps.RequestProvider) http.Handler { Store: interactionStoreRedis, } webappService2 := &webapp2.Service2{ - Logger: serviceLogger, - Request: request, - Sessions: sessionStoreRedis, - SessionCookie: sessionCookieDef, - SignedUpCookie: signedUpCookieDef, - MFADeviceTokenCookie: cookieDef, - ErrorCookie: errorCookie, - Cookies: cookieManager, - OAuthConfig: oAuthConfig, - UIConfig: uiConfig, - TrustProxy: trustProxy, - UIInfoResolver: uiInfoResolver, - OAuthClientResolver: oauthclientResolver, - OAuthSessions: oauthsessionStoreRedis, - SettingsActionGrantService: settingsActionGrantService, - Authorizations: authorizationService, - Graph: interactionService, + Logger: serviceLogger, + Request: request, + Sessions: sessionStoreRedis, + SessionCookie: sessionCookieDef, + SignedUpCookie: signedUpCookieDef, + MFADeviceTokenCookie: cookieDef, + ErrorCookie: errorCookie, + Cookies: cookieManager, + OAuthConfig: oAuthConfig, + UIConfig: uiConfig, + TrustProxy: trustProxy, + UIInfoResolver: uiInfoResolver, + OAuthClientResolver: oauthclientResolver, + Graph: interactionService, } uiFeatureConfig := featureConfig.UI forgotPasswordConfig := appConfig.ForgotPassword @@ -56078,39 +54928,6 @@ func newWebAppAuthflowV2NotFoundHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, ClientResolver: oauthclientResolver, } - oauthsessionStoreRedis := oauthsession.StoreRedis{ - Context: contextContext, - Redis: appredisHandle, - AppID: appID, - } - tokenGenerator := _wireTokenGeneratorValue - settingsActionGrantService := handler.SettingsActionGrantService{ - AppID: appID, - CodeGenerator: tokenGenerator, - Clock: clockClock, - SettingsActionGrants: redisStore, - } - authorizationStore := &pq.AuthorizationStore{ - SQLBuilder: sqlBuilderApp, - SQLExecutor: sqlExecutor, - } - offlineGrantService := oauth2.OfflineGrantService{ - OAuthConfig: oAuthConfig, - Clock: clockClock, - IDPSessions: idpsessionProvider, - ClientResolver: oauthclientResolver, - } - sessionManager := &oauth2.SessionManager{ - Store: redisStore, - Config: oAuthConfig, - Service: offlineGrantService, - } - authorizationService := &oauth2.AuthorizationService{ - AppID: appID, - Store: authorizationStore, - Clock: clockClock, - OAuthSessionManager: sessionManager, - } interactionLogger := interaction.NewLogger(factory) eventLogger := event.NewLogger(factory) sqlBuilder := appdb.NewSQLBuilder(databaseCredentials) @@ -56229,6 +55046,10 @@ func newWebAppAuthflowV2NotFoundHandler(p *deps.RequestProvider) http.Handler { UserStore: store, Events: eventService, } + authorizationStore := &pq.AuthorizationStore{ + SQLBuilder: sqlBuilderApp, + SQLExecutor: sqlExecutor, + } cookieDef2 := session.NewSessionCookieDef(sessionConfig) idpsessionManager := &idpsession.Manager{ Store: idpsessionStoreRedis, @@ -56236,6 +55057,17 @@ func newWebAppAuthflowV2NotFoundHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, CookieDef: cookieDef2, } + offlineGrantService := oauth2.OfflineGrantService{ + OAuthConfig: oAuthConfig, + Clock: clockClock, + IDPSessions: idpsessionProvider, + ClientResolver: oauthclientResolver, + } + sessionManager := &oauth2.SessionManager{ + Store: redisStore, + Config: oAuthConfig, + Service: offlineGrantService, + } accountDeletionConfig := appConfig.AccountDeletion accountAnonymizationConfig := appConfig.AccountAnonymization coordinator := &facade.Coordinator{ @@ -56374,7 +55206,7 @@ func newWebAppAuthflowV2NotFoundHandler(p *deps.RequestProvider) http.Handler { AccessTokenSessions: sessionManager, Events: eventService, } - storeRedis2 := &oauthsession.StoreRedis{ + oauthsessionStoreRedis := &oauthsession.StoreRedis{ Context: contextContext, Redis: appredisHandle, AppID: appID, @@ -56413,7 +55245,7 @@ func newWebAppAuthflowV2NotFoundHandler(p *deps.RequestProvider) http.Handler { Sessions: idpsessionProvider, SessionManager: manager2, SessionCookie: cookieDef2, - OAuthSessions: storeRedis2, + OAuthSessions: oauthsessionStoreRedis, MFADeviceTokenCookie: cookieDef, } interactionStoreRedis := &interaction.StoreRedis{ @@ -56426,23 +55258,20 @@ func newWebAppAuthflowV2NotFoundHandler(p *deps.RequestProvider) http.Handler { Store: interactionStoreRedis, } webappService2 := &webapp2.Service2{ - Logger: serviceLogger, - Request: request, - Sessions: sessionStoreRedis, - SessionCookie: sessionCookieDef, - SignedUpCookie: signedUpCookieDef, - MFADeviceTokenCookie: cookieDef, - ErrorCookie: errorCookie, - Cookies: cookieManager, - OAuthConfig: oAuthConfig, - UIConfig: uiConfig, - TrustProxy: trustProxy, - UIInfoResolver: uiInfoResolver, - OAuthClientResolver: oauthclientResolver, - OAuthSessions: oauthsessionStoreRedis, - SettingsActionGrantService: settingsActionGrantService, - Authorizations: authorizationService, - Graph: interactionService, + Logger: serviceLogger, + Request: request, + Sessions: sessionStoreRedis, + SessionCookie: sessionCookieDef, + SignedUpCookie: signedUpCookieDef, + MFADeviceTokenCookie: cookieDef, + ErrorCookie: errorCookie, + Cookies: cookieManager, + OAuthConfig: oAuthConfig, + UIConfig: uiConfig, + TrustProxy: trustProxy, + UIInfoResolver: uiInfoResolver, + OAuthClientResolver: oauthclientResolver, + Graph: interactionService, } uiFeatureConfig := featureConfig.UI forgotPasswordConfig := appConfig.ForgotPassword @@ -56963,39 +55792,6 @@ func newWebAppPasskeyCreationOptionsHandler(p *deps.RequestProvider) http.Handle Cookies: cookieManager, ClientResolver: oauthclientResolver, } - oauthsessionStoreRedis := oauthsession.StoreRedis{ - Context: contextContext, - Redis: handle, - AppID: appID, - } - tokenGenerator := _wireTokenGeneratorValue - settingsActionGrantService := handler.SettingsActionGrantService{ - AppID: appID, - CodeGenerator: tokenGenerator, - Clock: clockClock, - SettingsActionGrants: redisStore, - } - authorizationStore := &pq.AuthorizationStore{ - SQLBuilder: sqlBuilderApp, - SQLExecutor: sqlExecutor, - } - offlineGrantService := oauth2.OfflineGrantService{ - OAuthConfig: oAuthConfig, - Clock: clockClock, - IDPSessions: idpsessionProvider, - ClientResolver: oauthclientResolver, - } - sessionManager := &oauth2.SessionManager{ - Store: redisStore, - Config: oAuthConfig, - Service: offlineGrantService, - } - authorizationService := &oauth2.AuthorizationService{ - AppID: appID, - Store: authorizationStore, - Clock: clockClock, - OAuthSessionManager: sessionManager, - } interactionLogger := interaction.NewLogger(factory) eventLogger := event.NewLogger(factory) sqlBuilder := appdb.NewSQLBuilder(databaseCredentials) @@ -57114,6 +55910,10 @@ func newWebAppPasskeyCreationOptionsHandler(p *deps.RequestProvider) http.Handle UserStore: store, Events: eventService, } + authorizationStore := &pq.AuthorizationStore{ + SQLBuilder: sqlBuilderApp, + SQLExecutor: sqlExecutor, + } cookieDef2 := session.NewSessionCookieDef(sessionConfig) idpsessionManager := &idpsession.Manager{ Store: idpsessionStoreRedis, @@ -57121,6 +55921,17 @@ func newWebAppPasskeyCreationOptionsHandler(p *deps.RequestProvider) http.Handle Cookies: cookieManager, CookieDef: cookieDef2, } + offlineGrantService := oauth2.OfflineGrantService{ + OAuthConfig: oAuthConfig, + Clock: clockClock, + IDPSessions: idpsessionProvider, + ClientResolver: oauthclientResolver, + } + sessionManager := &oauth2.SessionManager{ + Store: redisStore, + Config: oAuthConfig, + Service: offlineGrantService, + } accountDeletionConfig := appConfig.AccountDeletion accountAnonymizationConfig := appConfig.AccountAnonymization coordinator := &facade.Coordinator{ @@ -57259,7 +56070,7 @@ func newWebAppPasskeyCreationOptionsHandler(p *deps.RequestProvider) http.Handle AccessTokenSessions: sessionManager, Events: eventService, } - storeRedis2 := &oauthsession.StoreRedis{ + oauthsessionStoreRedis := &oauthsession.StoreRedis{ Context: contextContext, Redis: handle, AppID: appID, @@ -57298,7 +56109,7 @@ func newWebAppPasskeyCreationOptionsHandler(p *deps.RequestProvider) http.Handle Sessions: idpsessionProvider, SessionManager: manager2, SessionCookie: cookieDef2, - OAuthSessions: storeRedis2, + OAuthSessions: oauthsessionStoreRedis, MFADeviceTokenCookie: cookieDef, } interactionStoreRedis := &interaction.StoreRedis{ @@ -57311,23 +56122,20 @@ func newWebAppPasskeyCreationOptionsHandler(p *deps.RequestProvider) http.Handle Store: interactionStoreRedis, } webappService2 := &webapp2.Service2{ - Logger: serviceLogger, - Request: request, - Sessions: sessionStoreRedis, - SessionCookie: sessionCookieDef, - SignedUpCookie: signedUpCookieDef, - MFADeviceTokenCookie: cookieDef, - ErrorCookie: errorCookie, - Cookies: cookieManager, - OAuthConfig: oAuthConfig, - UIConfig: uiConfig, - TrustProxy: trustProxy, - UIInfoResolver: uiInfoResolver, - OAuthClientResolver: oauthclientResolver, - OAuthSessions: oauthsessionStoreRedis, - SettingsActionGrantService: settingsActionGrantService, - Authorizations: authorizationService, - Graph: interactionService, + Logger: serviceLogger, + Request: request, + Sessions: sessionStoreRedis, + SessionCookie: sessionCookieDef, + SignedUpCookie: signedUpCookieDef, + MFADeviceTokenCookie: cookieDef, + ErrorCookie: errorCookie, + Cookies: cookieManager, + OAuthConfig: oAuthConfig, + UIConfig: uiConfig, + TrustProxy: trustProxy, + UIInfoResolver: uiInfoResolver, + OAuthClientResolver: oauthclientResolver, + Graph: interactionService, } jsonResponseWriterLogger := httputil.NewJSONResponseWriterLogger(factory) jsonResponseWriter := &httputil.JSONResponseWriter{ @@ -57794,39 +56602,6 @@ func newWebAppPasskeyRequestOptionsHandler(p *deps.RequestProvider) http.Handler Cookies: cookieManager, ClientResolver: oauthclientResolver, } - oauthsessionStoreRedis := oauthsession.StoreRedis{ - Context: contextContext, - Redis: handle, - AppID: appID, - } - tokenGenerator := _wireTokenGeneratorValue - settingsActionGrantService := handler.SettingsActionGrantService{ - AppID: appID, - CodeGenerator: tokenGenerator, - Clock: clockClock, - SettingsActionGrants: redisStore, - } - authorizationStore := &pq.AuthorizationStore{ - SQLBuilder: sqlBuilderApp, - SQLExecutor: sqlExecutor, - } - offlineGrantService := oauth2.OfflineGrantService{ - OAuthConfig: oAuthConfig, - Clock: clockClock, - IDPSessions: idpsessionProvider, - ClientResolver: oauthclientResolver, - } - sessionManager := &oauth2.SessionManager{ - Store: redisStore, - Config: oAuthConfig, - Service: offlineGrantService, - } - authorizationService := &oauth2.AuthorizationService{ - AppID: appID, - Store: authorizationStore, - Clock: clockClock, - OAuthSessionManager: sessionManager, - } interactionLogger := interaction.NewLogger(factory) eventLogger := event.NewLogger(factory) sqlBuilder := appdb.NewSQLBuilder(databaseCredentials) @@ -57945,6 +56720,10 @@ func newWebAppPasskeyRequestOptionsHandler(p *deps.RequestProvider) http.Handler UserStore: store, Events: eventService, } + authorizationStore := &pq.AuthorizationStore{ + SQLBuilder: sqlBuilderApp, + SQLExecutor: sqlExecutor, + } cookieDef2 := session.NewSessionCookieDef(sessionConfig) idpsessionManager := &idpsession.Manager{ Store: idpsessionStoreRedis, @@ -57952,6 +56731,17 @@ func newWebAppPasskeyRequestOptionsHandler(p *deps.RequestProvider) http.Handler Cookies: cookieManager, CookieDef: cookieDef2, } + offlineGrantService := oauth2.OfflineGrantService{ + OAuthConfig: oAuthConfig, + Clock: clockClock, + IDPSessions: idpsessionProvider, + ClientResolver: oauthclientResolver, + } + sessionManager := &oauth2.SessionManager{ + Store: redisStore, + Config: oAuthConfig, + Service: offlineGrantService, + } accountDeletionConfig := appConfig.AccountDeletion accountAnonymizationConfig := appConfig.AccountAnonymization coordinator := &facade.Coordinator{ @@ -58090,7 +56880,7 @@ func newWebAppPasskeyRequestOptionsHandler(p *deps.RequestProvider) http.Handler AccessTokenSessions: sessionManager, Events: eventService, } - storeRedis2 := &oauthsession.StoreRedis{ + oauthsessionStoreRedis := &oauthsession.StoreRedis{ Context: contextContext, Redis: handle, AppID: appID, @@ -58129,7 +56919,7 @@ func newWebAppPasskeyRequestOptionsHandler(p *deps.RequestProvider) http.Handler Sessions: idpsessionProvider, SessionManager: manager2, SessionCookie: cookieDef2, - OAuthSessions: storeRedis2, + OAuthSessions: oauthsessionStoreRedis, MFADeviceTokenCookie: cookieDef, } interactionStoreRedis := &interaction.StoreRedis{ @@ -58142,23 +56932,20 @@ func newWebAppPasskeyRequestOptionsHandler(p *deps.RequestProvider) http.Handler Store: interactionStoreRedis, } webappService2 := &webapp2.Service2{ - Logger: serviceLogger, - Request: request, - Sessions: sessionStoreRedis, - SessionCookie: sessionCookieDef, - SignedUpCookie: signedUpCookieDef, - MFADeviceTokenCookie: cookieDef, - ErrorCookie: errorCookie, - Cookies: cookieManager, - OAuthConfig: oAuthConfig, - UIConfig: uiConfig, - TrustProxy: trustProxy, - UIInfoResolver: uiInfoResolver, - OAuthClientResolver: oauthclientResolver, - OAuthSessions: oauthsessionStoreRedis, - SettingsActionGrantService: settingsActionGrantService, - Authorizations: authorizationService, - Graph: interactionService, + Logger: serviceLogger, + Request: request, + Sessions: sessionStoreRedis, + SessionCookie: sessionCookieDef, + SignedUpCookie: signedUpCookieDef, + MFADeviceTokenCookie: cookieDef, + ErrorCookie: errorCookie, + Cookies: cookieManager, + OAuthConfig: oAuthConfig, + UIConfig: uiConfig, + TrustProxy: trustProxy, + UIInfoResolver: uiInfoResolver, + OAuthClientResolver: oauthclientResolver, + Graph: interactionService, } jsonResponseWriterLogger := httputil.NewJSONResponseWriterLogger(factory) jsonResponseWriter := &httputil.JSONResponseWriter{ @@ -58624,39 +57411,6 @@ func newWebAppConnectWeb3AccountHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, ClientResolver: oauthclientResolver, } - oauthsessionStoreRedis := oauthsession.StoreRedis{ - Context: contextContext, - Redis: appredisHandle, - AppID: appID, - } - tokenGenerator := _wireTokenGeneratorValue - settingsActionGrantService := handler.SettingsActionGrantService{ - AppID: appID, - CodeGenerator: tokenGenerator, - Clock: clockClock, - SettingsActionGrants: redisStore, - } - authorizationStore := &pq.AuthorizationStore{ - SQLBuilder: sqlBuilderApp, - SQLExecutor: sqlExecutor, - } - offlineGrantService := oauth2.OfflineGrantService{ - OAuthConfig: oAuthConfig, - Clock: clockClock, - IDPSessions: idpsessionProvider, - ClientResolver: oauthclientResolver, - } - sessionManager := &oauth2.SessionManager{ - Store: redisStore, - Config: oAuthConfig, - Service: offlineGrantService, - } - authorizationService := &oauth2.AuthorizationService{ - AppID: appID, - Store: authorizationStore, - Clock: clockClock, - OAuthSessionManager: sessionManager, - } interactionLogger := interaction.NewLogger(factory) eventLogger := event.NewLogger(factory) sqlBuilder := appdb.NewSQLBuilder(databaseCredentials) @@ -58775,6 +57529,10 @@ func newWebAppConnectWeb3AccountHandler(p *deps.RequestProvider) http.Handler { UserStore: store, Events: eventService, } + authorizationStore := &pq.AuthorizationStore{ + SQLBuilder: sqlBuilderApp, + SQLExecutor: sqlExecutor, + } cookieDef2 := session.NewSessionCookieDef(sessionConfig) idpsessionManager := &idpsession.Manager{ Store: idpsessionStoreRedis, @@ -58782,6 +57540,17 @@ func newWebAppConnectWeb3AccountHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, CookieDef: cookieDef2, } + offlineGrantService := oauth2.OfflineGrantService{ + OAuthConfig: oAuthConfig, + Clock: clockClock, + IDPSessions: idpsessionProvider, + ClientResolver: oauthclientResolver, + } + sessionManager := &oauth2.SessionManager{ + Store: redisStore, + Config: oAuthConfig, + Service: offlineGrantService, + } accountDeletionConfig := appConfig.AccountDeletion accountAnonymizationConfig := appConfig.AccountAnonymization coordinator := &facade.Coordinator{ @@ -58920,7 +57689,7 @@ func newWebAppConnectWeb3AccountHandler(p *deps.RequestProvider) http.Handler { AccessTokenSessions: sessionManager, Events: eventService, } - storeRedis2 := &oauthsession.StoreRedis{ + oauthsessionStoreRedis := &oauthsession.StoreRedis{ Context: contextContext, Redis: appredisHandle, AppID: appID, @@ -58959,7 +57728,7 @@ func newWebAppConnectWeb3AccountHandler(p *deps.RequestProvider) http.Handler { Sessions: idpsessionProvider, SessionManager: manager2, SessionCookie: cookieDef2, - OAuthSessions: storeRedis2, + OAuthSessions: oauthsessionStoreRedis, MFADeviceTokenCookie: cookieDef, } interactionStoreRedis := &interaction.StoreRedis{ @@ -58972,23 +57741,20 @@ func newWebAppConnectWeb3AccountHandler(p *deps.RequestProvider) http.Handler { Store: interactionStoreRedis, } webappService2 := &webapp2.Service2{ - Logger: serviceLogger, - Request: request, - Sessions: sessionStoreRedis, - SessionCookie: sessionCookieDef, - SignedUpCookie: signedUpCookieDef, - MFADeviceTokenCookie: cookieDef, - ErrorCookie: errorCookie, - Cookies: cookieManager, - OAuthConfig: oAuthConfig, - UIConfig: uiConfig, - TrustProxy: trustProxy, - UIInfoResolver: uiInfoResolver, - OAuthClientResolver: oauthclientResolver, - OAuthSessions: oauthsessionStoreRedis, - SettingsActionGrantService: settingsActionGrantService, - Authorizations: authorizationService, - Graph: interactionService, + Logger: serviceLogger, + Request: request, + Sessions: sessionStoreRedis, + SessionCookie: sessionCookieDef, + SignedUpCookie: signedUpCookieDef, + MFADeviceTokenCookie: cookieDef, + ErrorCookie: errorCookie, + Cookies: cookieManager, + OAuthConfig: oAuthConfig, + UIConfig: uiConfig, + TrustProxy: trustProxy, + UIInfoResolver: uiInfoResolver, + OAuthClientResolver: oauthclientResolver, + Graph: interactionService, } uiFeatureConfig := featureConfig.UI forgotPasswordConfig := appConfig.ForgotPassword @@ -59501,39 +58267,6 @@ func newWebAppMissingWeb3WalletHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, ClientResolver: oauthclientResolver, } - oauthsessionStoreRedis := oauthsession.StoreRedis{ - Context: contextContext, - Redis: appredisHandle, - AppID: appID, - } - tokenGenerator := _wireTokenGeneratorValue - settingsActionGrantService := handler.SettingsActionGrantService{ - AppID: appID, - CodeGenerator: tokenGenerator, - Clock: clockClock, - SettingsActionGrants: redisStore, - } - authorizationStore := &pq.AuthorizationStore{ - SQLBuilder: sqlBuilderApp, - SQLExecutor: sqlExecutor, - } - offlineGrantService := oauth2.OfflineGrantService{ - OAuthConfig: oAuthConfig, - Clock: clockClock, - IDPSessions: idpsessionProvider, - ClientResolver: oauthclientResolver, - } - sessionManager := &oauth2.SessionManager{ - Store: redisStore, - Config: oAuthConfig, - Service: offlineGrantService, - } - authorizationService := &oauth2.AuthorizationService{ - AppID: appID, - Store: authorizationStore, - Clock: clockClock, - OAuthSessionManager: sessionManager, - } interactionLogger := interaction.NewLogger(factory) eventLogger := event.NewLogger(factory) sqlBuilder := appdb.NewSQLBuilder(databaseCredentials) @@ -59652,6 +58385,10 @@ func newWebAppMissingWeb3WalletHandler(p *deps.RequestProvider) http.Handler { UserStore: store, Events: eventService, } + authorizationStore := &pq.AuthorizationStore{ + SQLBuilder: sqlBuilderApp, + SQLExecutor: sqlExecutor, + } cookieDef2 := session.NewSessionCookieDef(sessionConfig) idpsessionManager := &idpsession.Manager{ Store: idpsessionStoreRedis, @@ -59659,6 +58396,17 @@ func newWebAppMissingWeb3WalletHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, CookieDef: cookieDef2, } + offlineGrantService := oauth2.OfflineGrantService{ + OAuthConfig: oAuthConfig, + Clock: clockClock, + IDPSessions: idpsessionProvider, + ClientResolver: oauthclientResolver, + } + sessionManager := &oauth2.SessionManager{ + Store: redisStore, + Config: oAuthConfig, + Service: offlineGrantService, + } accountDeletionConfig := appConfig.AccountDeletion accountAnonymizationConfig := appConfig.AccountAnonymization coordinator := &facade.Coordinator{ @@ -59797,7 +58545,7 @@ func newWebAppMissingWeb3WalletHandler(p *deps.RequestProvider) http.Handler { AccessTokenSessions: sessionManager, Events: eventService, } - storeRedis2 := &oauthsession.StoreRedis{ + oauthsessionStoreRedis := &oauthsession.StoreRedis{ Context: contextContext, Redis: appredisHandle, AppID: appID, @@ -59836,7 +58584,7 @@ func newWebAppMissingWeb3WalletHandler(p *deps.RequestProvider) http.Handler { Sessions: idpsessionProvider, SessionManager: manager2, SessionCookie: cookieDef2, - OAuthSessions: storeRedis2, + OAuthSessions: oauthsessionStoreRedis, MFADeviceTokenCookie: cookieDef, } interactionStoreRedis := &interaction.StoreRedis{ @@ -59849,23 +58597,20 @@ func newWebAppMissingWeb3WalletHandler(p *deps.RequestProvider) http.Handler { Store: interactionStoreRedis, } webappService2 := &webapp2.Service2{ - Logger: serviceLogger, - Request: request, - Sessions: sessionStoreRedis, - SessionCookie: sessionCookieDef, - SignedUpCookie: signedUpCookieDef, - MFADeviceTokenCookie: cookieDef, - ErrorCookie: errorCookie, - Cookies: cookieManager, - OAuthConfig: oAuthConfig, - UIConfig: uiConfig, - TrustProxy: trustProxy, - UIInfoResolver: uiInfoResolver, - OAuthClientResolver: oauthclientResolver, - OAuthSessions: oauthsessionStoreRedis, - SettingsActionGrantService: settingsActionGrantService, - Authorizations: authorizationService, - Graph: interactionService, + Logger: serviceLogger, + Request: request, + Sessions: sessionStoreRedis, + SessionCookie: sessionCookieDef, + SignedUpCookie: signedUpCookieDef, + MFADeviceTokenCookie: cookieDef, + ErrorCookie: errorCookie, + Cookies: cookieManager, + OAuthConfig: oAuthConfig, + UIConfig: uiConfig, + TrustProxy: trustProxy, + UIInfoResolver: uiInfoResolver, + OAuthClientResolver: oauthclientResolver, + Graph: interactionService, } uiFeatureConfig := featureConfig.UI forgotPasswordConfig := appConfig.ForgotPassword @@ -60369,39 +59114,6 @@ func newWebAppFeatureDisabledHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, ClientResolver: oauthclientResolver, } - oauthsessionStoreRedis := oauthsession.StoreRedis{ - Context: contextContext, - Redis: appredisHandle, - AppID: appID, - } - tokenGenerator := _wireTokenGeneratorValue - settingsActionGrantService := handler.SettingsActionGrantService{ - AppID: appID, - CodeGenerator: tokenGenerator, - Clock: clockClock, - SettingsActionGrants: redisStore, - } - authorizationStore := &pq.AuthorizationStore{ - SQLBuilder: sqlBuilderApp, - SQLExecutor: sqlExecutor, - } - offlineGrantService := oauth2.OfflineGrantService{ - OAuthConfig: oAuthConfig, - Clock: clockClock, - IDPSessions: idpsessionProvider, - ClientResolver: oauthclientResolver, - } - sessionManager := &oauth2.SessionManager{ - Store: redisStore, - Config: oAuthConfig, - Service: offlineGrantService, - } - authorizationService := &oauth2.AuthorizationService{ - AppID: appID, - Store: authorizationStore, - Clock: clockClock, - OAuthSessionManager: sessionManager, - } interactionLogger := interaction.NewLogger(factory) eventLogger := event.NewLogger(factory) sqlBuilder := appdb.NewSQLBuilder(databaseCredentials) @@ -60520,6 +59232,10 @@ func newWebAppFeatureDisabledHandler(p *deps.RequestProvider) http.Handler { UserStore: store, Events: eventService, } + authorizationStore := &pq.AuthorizationStore{ + SQLBuilder: sqlBuilderApp, + SQLExecutor: sqlExecutor, + } cookieDef2 := session.NewSessionCookieDef(sessionConfig) idpsessionManager := &idpsession.Manager{ Store: idpsessionStoreRedis, @@ -60527,6 +59243,17 @@ func newWebAppFeatureDisabledHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, CookieDef: cookieDef2, } + offlineGrantService := oauth2.OfflineGrantService{ + OAuthConfig: oAuthConfig, + Clock: clockClock, + IDPSessions: idpsessionProvider, + ClientResolver: oauthclientResolver, + } + sessionManager := &oauth2.SessionManager{ + Store: redisStore, + Config: oAuthConfig, + Service: offlineGrantService, + } accountDeletionConfig := appConfig.AccountDeletion accountAnonymizationConfig := appConfig.AccountAnonymization coordinator := &facade.Coordinator{ @@ -60665,7 +59392,7 @@ func newWebAppFeatureDisabledHandler(p *deps.RequestProvider) http.Handler { AccessTokenSessions: sessionManager, Events: eventService, } - storeRedis2 := &oauthsession.StoreRedis{ + oauthsessionStoreRedis := &oauthsession.StoreRedis{ Context: contextContext, Redis: appredisHandle, AppID: appID, @@ -60704,7 +59431,7 @@ func newWebAppFeatureDisabledHandler(p *deps.RequestProvider) http.Handler { Sessions: idpsessionProvider, SessionManager: manager2, SessionCookie: cookieDef2, - OAuthSessions: storeRedis2, + OAuthSessions: oauthsessionStoreRedis, MFADeviceTokenCookie: cookieDef, } interactionStoreRedis := &interaction.StoreRedis{ @@ -60717,23 +59444,20 @@ func newWebAppFeatureDisabledHandler(p *deps.RequestProvider) http.Handler { Store: interactionStoreRedis, } webappService2 := &webapp2.Service2{ - Logger: serviceLogger, - Request: request, - Sessions: sessionStoreRedis, - SessionCookie: sessionCookieDef, - SignedUpCookie: signedUpCookieDef, - MFADeviceTokenCookie: cookieDef, - ErrorCookie: errorCookie, - Cookies: cookieManager, - OAuthConfig: oAuthConfig, - UIConfig: uiConfig, - TrustProxy: trustProxy, - UIInfoResolver: uiInfoResolver, - OAuthClientResolver: oauthclientResolver, - OAuthSessions: oauthsessionStoreRedis, - SettingsActionGrantService: settingsActionGrantService, - Authorizations: authorizationService, - Graph: interactionService, + Logger: serviceLogger, + Request: request, + Sessions: sessionStoreRedis, + SessionCookie: sessionCookieDef, + SignedUpCookie: signedUpCookieDef, + MFADeviceTokenCookie: cookieDef, + ErrorCookie: errorCookie, + Cookies: cookieManager, + OAuthConfig: oAuthConfig, + UIConfig: uiConfig, + TrustProxy: trustProxy, + UIInfoResolver: uiInfoResolver, + OAuthClientResolver: oauthclientResolver, + Graph: interactionService, } uiFeatureConfig := featureConfig.UI forgotPasswordConfig := appConfig.ForgotPassword @@ -61236,39 +59960,6 @@ func newWebAppTesterHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, ClientResolver: oauthclientResolver, } - oauthsessionStoreRedis := oauthsession.StoreRedis{ - Context: contextContext, - Redis: appredisHandle, - AppID: appID, - } - tokenGenerator := _wireTokenGeneratorValue - settingsActionGrantService := handler.SettingsActionGrantService{ - AppID: appID, - CodeGenerator: tokenGenerator, - Clock: clockClock, - SettingsActionGrants: redisStore, - } - authorizationStore := &pq.AuthorizationStore{ - SQLBuilder: sqlBuilderApp, - SQLExecutor: sqlExecutor, - } - offlineGrantService := oauth2.OfflineGrantService{ - OAuthConfig: oAuthConfig, - Clock: clockClock, - IDPSessions: idpsessionProvider, - ClientResolver: oauthclientResolver, - } - sessionManager := &oauth2.SessionManager{ - Store: redisStore, - Config: oAuthConfig, - Service: offlineGrantService, - } - authorizationService := &oauth2.AuthorizationService{ - AppID: appID, - Store: authorizationStore, - Clock: clockClock, - OAuthSessionManager: sessionManager, - } interactionLogger := interaction.NewLogger(factory) eventLogger := event.NewLogger(factory) sqlBuilder := appdb.NewSQLBuilder(databaseCredentials) @@ -61387,6 +60078,10 @@ func newWebAppTesterHandler(p *deps.RequestProvider) http.Handler { UserStore: store, Events: eventService, } + authorizationStore := &pq.AuthorizationStore{ + SQLBuilder: sqlBuilderApp, + SQLExecutor: sqlExecutor, + } cookieDef2 := session.NewSessionCookieDef(sessionConfig) idpsessionManager := &idpsession.Manager{ Store: idpsessionStoreRedis, @@ -61394,6 +60089,17 @@ func newWebAppTesterHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, CookieDef: cookieDef2, } + offlineGrantService := oauth2.OfflineGrantService{ + OAuthConfig: oAuthConfig, + Clock: clockClock, + IDPSessions: idpsessionProvider, + ClientResolver: oauthclientResolver, + } + sessionManager := &oauth2.SessionManager{ + Store: redisStore, + Config: oAuthConfig, + Service: offlineGrantService, + } accountDeletionConfig := appConfig.AccountDeletion accountAnonymizationConfig := appConfig.AccountAnonymization coordinator := &facade.Coordinator{ @@ -61532,7 +60238,7 @@ func newWebAppTesterHandler(p *deps.RequestProvider) http.Handler { AccessTokenSessions: sessionManager, Events: eventService, } - storeRedis2 := &oauthsession.StoreRedis{ + oauthsessionStoreRedis := &oauthsession.StoreRedis{ Context: contextContext, Redis: appredisHandle, AppID: appID, @@ -61571,7 +60277,7 @@ func newWebAppTesterHandler(p *deps.RequestProvider) http.Handler { Sessions: idpsessionProvider, SessionManager: manager2, SessionCookie: cookieDef2, - OAuthSessions: storeRedis2, + OAuthSessions: oauthsessionStoreRedis, MFADeviceTokenCookie: cookieDef, } interactionStoreRedis := &interaction.StoreRedis{ @@ -61584,23 +60290,20 @@ func newWebAppTesterHandler(p *deps.RequestProvider) http.Handler { Store: interactionStoreRedis, } webappService2 := &webapp2.Service2{ - Logger: serviceLogger, - Request: request, - Sessions: sessionStoreRedis, - SessionCookie: sessionCookieDef, - SignedUpCookie: signedUpCookieDef, - MFADeviceTokenCookie: cookieDef, - ErrorCookie: errorCookie, - Cookies: cookieManager, - OAuthConfig: oAuthConfig, - UIConfig: uiConfig, - TrustProxy: trustProxy, - UIInfoResolver: uiInfoResolver, - OAuthClientResolver: oauthclientResolver, - OAuthSessions: oauthsessionStoreRedis, - SettingsActionGrantService: settingsActionGrantService, - Authorizations: authorizationService, - Graph: interactionService, + Logger: serviceLogger, + Request: request, + Sessions: sessionStoreRedis, + SessionCookie: sessionCookieDef, + SignedUpCookie: signedUpCookieDef, + MFADeviceTokenCookie: cookieDef, + ErrorCookie: errorCookie, + Cookies: cookieManager, + OAuthConfig: oAuthConfig, + UIConfig: uiConfig, + TrustProxy: trustProxy, + UIInfoResolver: uiInfoResolver, + OAuthClientResolver: oauthclientResolver, + Graph: interactionService, } uiFeatureConfig := featureConfig.UI forgotPasswordConfig := appConfig.ForgotPassword @@ -61658,6 +60361,12 @@ func newWebAppTesterHandler(p *deps.RequestProvider) http.Handler { oAuthFeatureConfig := featureConfig.OAuth oAuthClientCredentials := deps.ProvideOAuthClientCredentials(secretConfig) tokenHandlerLogger := handler.NewTokenHandlerLogger(factory) + authorizationService := &oauth2.AuthorizationService{ + AppID: appID, + Store: authorizationStore, + Clock: clockClock, + OAuthSessionManager: sessionManager, + } accessTokenEncoding := &oauth2.AccessTokenEncoding{ Secrets: oAuthKeyMaterials, Clock: clockClock, @@ -61665,6 +60374,7 @@ func newWebAppTesterHandler(p *deps.RequestProvider) http.Handler { BaseURL: endpointsEndpoints, Events: eventService, } + tokenGenerator := _wireTokenGeneratorValue tokenService := handler.TokenService{ RemoteIP: remoteIP, UserAgentString: userAgentString, @@ -104308,39 +103018,6 @@ func newWebAppReauthHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, ClientResolver: oauthclientResolver, } - oauthsessionStoreRedis := oauthsession.StoreRedis{ - Context: contextContext, - Redis: appredisHandle, - AppID: appID, - } - tokenGenerator := _wireTokenGeneratorValue - settingsActionGrantService := handler.SettingsActionGrantService{ - AppID: appID, - CodeGenerator: tokenGenerator, - Clock: clockClock, - SettingsActionGrants: redisStore, - } - authorizationStore := &pq.AuthorizationStore{ - SQLBuilder: sqlBuilderApp, - SQLExecutor: sqlExecutor, - } - offlineGrantService := oauth2.OfflineGrantService{ - OAuthConfig: oAuthConfig, - Clock: clockClock, - IDPSessions: idpsessionProvider, - ClientResolver: oauthclientResolver, - } - sessionManager := &oauth2.SessionManager{ - Store: redisStore, - Config: oAuthConfig, - Service: offlineGrantService, - } - authorizationService := &oauth2.AuthorizationService{ - AppID: appID, - Store: authorizationStore, - Clock: clockClock, - OAuthSessionManager: sessionManager, - } interactionLogger := interaction.NewLogger(factory) eventLogger := event.NewLogger(factory) sqlBuilder := appdb.NewSQLBuilder(databaseCredentials) @@ -104459,6 +103136,10 @@ func newWebAppReauthHandler(p *deps.RequestProvider) http.Handler { UserStore: store, Events: eventService, } + authorizationStore := &pq.AuthorizationStore{ + SQLBuilder: sqlBuilderApp, + SQLExecutor: sqlExecutor, + } cookieDef2 := session.NewSessionCookieDef(sessionConfig) idpsessionManager := &idpsession.Manager{ Store: idpsessionStoreRedis, @@ -104466,6 +103147,17 @@ func newWebAppReauthHandler(p *deps.RequestProvider) http.Handler { Cookies: cookieManager, CookieDef: cookieDef2, } + offlineGrantService := oauth2.OfflineGrantService{ + OAuthConfig: oAuthConfig, + Clock: clockClock, + IDPSessions: idpsessionProvider, + ClientResolver: oauthclientResolver, + } + sessionManager := &oauth2.SessionManager{ + Store: redisStore, + Config: oAuthConfig, + Service: offlineGrantService, + } accountDeletionConfig := appConfig.AccountDeletion accountAnonymizationConfig := appConfig.AccountAnonymization coordinator := &facade.Coordinator{ @@ -104604,7 +103296,7 @@ func newWebAppReauthHandler(p *deps.RequestProvider) http.Handler { AccessTokenSessions: sessionManager, Events: eventService, } - storeRedis2 := &oauthsession.StoreRedis{ + oauthsessionStoreRedis := &oauthsession.StoreRedis{ Context: contextContext, Redis: appredisHandle, AppID: appID, @@ -104643,7 +103335,7 @@ func newWebAppReauthHandler(p *deps.RequestProvider) http.Handler { Sessions: idpsessionProvider, SessionManager: manager2, SessionCookie: cookieDef2, - OAuthSessions: storeRedis2, + OAuthSessions: oauthsessionStoreRedis, MFADeviceTokenCookie: cookieDef, } interactionStoreRedis := &interaction.StoreRedis{ @@ -104656,23 +103348,20 @@ func newWebAppReauthHandler(p *deps.RequestProvider) http.Handler { Store: interactionStoreRedis, } webappService2 := &webapp2.Service2{ - Logger: serviceLogger, - Request: request, - Sessions: sessionStoreRedis, - SessionCookie: sessionCookieDef, - SignedUpCookie: signedUpCookieDef, - MFADeviceTokenCookie: cookieDef, - ErrorCookie: errorCookie, - Cookies: cookieManager, - OAuthConfig: oAuthConfig, - UIConfig: uiConfig, - TrustProxy: trustProxy, - UIInfoResolver: uiInfoResolver, - OAuthClientResolver: oauthclientResolver, - OAuthSessions: oauthsessionStoreRedis, - SettingsActionGrantService: settingsActionGrantService, - Authorizations: authorizationService, - Graph: interactionService, + Logger: serviceLogger, + Request: request, + Sessions: sessionStoreRedis, + SessionCookie: sessionCookieDef, + SignedUpCookie: signedUpCookieDef, + MFADeviceTokenCookie: cookieDef, + ErrorCookie: errorCookie, + Cookies: cookieManager, + OAuthConfig: oAuthConfig, + UIConfig: uiConfig, + TrustProxy: trustProxy, + UIInfoResolver: uiInfoResolver, + OAuthClientResolver: oauthclientResolver, + Graph: interactionService, } uiFeatureConfig := featureConfig.UI forgotPasswordConfig := appConfig.ForgotPassword @@ -113561,39 +112250,6 @@ func newWebAppSessionMiddleware(p *deps.RequestProvider) httproute.Middleware { Cookies: cookieManager, ClientResolver: oauthclientResolver, } - oauthsessionStoreRedis := oauthsession.StoreRedis{ - Context: contextContext, - Redis: handle, - AppID: appID, - } - tokenGenerator := _wireTokenGeneratorValue - settingsActionGrantService := handler.SettingsActionGrantService{ - AppID: appID, - CodeGenerator: tokenGenerator, - Clock: clockClock, - SettingsActionGrants: redisStore, - } - authorizationStore := &pq.AuthorizationStore{ - SQLBuilder: sqlBuilderApp, - SQLExecutor: sqlExecutor, - } - offlineGrantService := oauth2.OfflineGrantService{ - OAuthConfig: oAuthConfig, - Clock: clockClock, - IDPSessions: idpsessionProvider, - ClientResolver: oauthclientResolver, - } - sessionManager := &oauth2.SessionManager{ - Store: redisStore, - Config: oAuthConfig, - Service: offlineGrantService, - } - authorizationService := &oauth2.AuthorizationService{ - AppID: appID, - Store: authorizationStore, - Clock: clockClock, - OAuthSessionManager: sessionManager, - } interactionLogger := interaction.NewLogger(factory) eventLogger := event.NewLogger(factory) sqlBuilder := appdb.NewSQLBuilder(databaseCredentials) @@ -113712,6 +112368,10 @@ func newWebAppSessionMiddleware(p *deps.RequestProvider) httproute.Middleware { UserStore: store, Events: eventService, } + authorizationStore := &pq.AuthorizationStore{ + SQLBuilder: sqlBuilderApp, + SQLExecutor: sqlExecutor, + } cookieDef2 := session.NewSessionCookieDef(sessionConfig) idpsessionManager := &idpsession.Manager{ Store: idpsessionStoreRedis, @@ -113719,6 +112379,17 @@ func newWebAppSessionMiddleware(p *deps.RequestProvider) httproute.Middleware { Cookies: cookieManager, CookieDef: cookieDef2, } + offlineGrantService := oauth2.OfflineGrantService{ + OAuthConfig: oAuthConfig, + Clock: clockClock, + IDPSessions: idpsessionProvider, + ClientResolver: oauthclientResolver, + } + sessionManager := &oauth2.SessionManager{ + Store: redisStore, + Config: oAuthConfig, + Service: offlineGrantService, + } accountDeletionConfig := appConfig.AccountDeletion accountAnonymizationConfig := appConfig.AccountAnonymization coordinator := &facade.Coordinator{ @@ -113857,7 +112528,7 @@ func newWebAppSessionMiddleware(p *deps.RequestProvider) httproute.Middleware { AccessTokenSessions: sessionManager, Events: eventService, } - storeRedis2 := &oauthsession.StoreRedis{ + oauthsessionStoreRedis := &oauthsession.StoreRedis{ Context: contextContext, Redis: handle, AppID: appID, @@ -113896,7 +112567,7 @@ func newWebAppSessionMiddleware(p *deps.RequestProvider) httproute.Middleware { Sessions: idpsessionProvider, SessionManager: manager2, SessionCookie: cookieDef2, - OAuthSessions: storeRedis2, + OAuthSessions: oauthsessionStoreRedis, MFADeviceTokenCookie: cookieDef, } interactionStoreRedis := &interaction.StoreRedis{ @@ -113909,27 +112580,24 @@ func newWebAppSessionMiddleware(p *deps.RequestProvider) httproute.Middleware { Store: interactionStoreRedis, } webappService2 := &webapp2.Service2{ - Logger: serviceLogger, - Request: request, - Sessions: sessionStoreRedis, - SessionCookie: sessionCookieDef, - SignedUpCookie: signedUpCookieDef, - MFADeviceTokenCookie: cookieDef, - ErrorCookie: errorCookie, - Cookies: cookieManager, - OAuthConfig: oAuthConfig, - UIConfig: uiConfig, - TrustProxy: trustProxy, - UIInfoResolver: uiInfoResolver, - OAuthClientResolver: oauthclientResolver, - OAuthSessions: oauthsessionStoreRedis, - SettingsActionGrantService: settingsActionGrantService, - Authorizations: authorizationService, - Graph: interactionService, + Logger: serviceLogger, + Request: request, + Sessions: sessionStoreRedis, + SessionCookie: sessionCookieDef, + SignedUpCookie: signedUpCookieDef, + MFADeviceTokenCookie: cookieDef, + ErrorCookie: errorCookie, + Cookies: cookieManager, + OAuthConfig: oAuthConfig, + UIConfig: uiConfig, + TrustProxy: trustProxy, + UIInfoResolver: uiInfoResolver, + OAuthClientResolver: oauthclientResolver, + Graph: interactionService, } sessionMiddleware := &webapp2.SessionMiddleware{ Sessions: webappService2, - OAuthSessions: storeRedis2, + OAuthSessions: oauthsessionStoreRedis, States: sessionStoreRedis, UIInfoResolver: uiInfoResolver, CookieDef: sessionCookieDef, diff --git a/pkg/lib/interaction/nodes/do_ensure_session.go b/pkg/lib/interaction/nodes/do_ensure_session.go index 819b9a73fc5..9636ed51eaa 100644 --- a/pkg/lib/interaction/nodes/do_ensure_session.go +++ b/pkg/lib/interaction/nodes/do_ensure_session.go @@ -8,7 +8,6 @@ import ( "github.com/authgear/authgear-server/pkg/api/model" "github.com/authgear/authgear-server/pkg/lib/authn/authenticationinfo" "github.com/authgear/authgear-server/pkg/lib/interaction" - "github.com/authgear/authgear-server/pkg/lib/oauth/oauthsession" "github.com/authgear/authgear-server/pkg/lib/session" "github.com/authgear/authgear-server/pkg/lib/session/idpsession" ) @@ -222,21 +221,6 @@ func (n *NodeDoEnsureSession) GetEffects() ([]interaction.Effect, error) { } } - return nil - }), - interaction.EffectOnCommit(func(ctx *interaction.Context, graph *interaction.Graph, nodeIndex int) error { - entry, err := ctx.OAuthSessions.Get(ctx.OAuthSessionID) - if err != nil { - return err - } - - if entry.T.AuthorizationRequest.ResponseType() != "settings_action" { - return nil - } - - entry.T.SettingsActionResult = oauthsession.NewSettingsActionResult() - ctx.OAuthSessions.Save(entry) - return nil }), }, nil diff --git a/pkg/lib/interaction/nodes/settings_action_end.go b/pkg/lib/interaction/nodes/settings_action_end.go index 7550cf414bd..32d277e3c9d 100644 --- a/pkg/lib/interaction/nodes/settings_action_end.go +++ b/pkg/lib/interaction/nodes/settings_action_end.go @@ -1,6 +1,8 @@ package nodes import ( + "errors" + "github.com/authgear/authgear-server/pkg/lib/interaction" "github.com/authgear/authgear-server/pkg/lib/oauth/oauthsession" ) @@ -25,12 +27,10 @@ func (n *NodeSettingsActionEnd) GetEffects() ([]interaction.Effect, error) { return []interaction.Effect{ interaction.EffectOnCommit(func(ctx *interaction.Context, graph *interaction.Graph, nodeIndex int) error { entry, err := ctx.OAuthSessions.Get(ctx.OAuthSessionID) - if err != nil { - return err - } - - if entry.T.AuthorizationRequest.ResponseType() != "settings_action" { + if errors.Is(err, oauthsession.ErrNotFound) { return nil + } else if err != nil { + return err } entry.T.SettingsActionResult = oauthsession.NewSettingsActionResult() diff --git a/pkg/lib/oauth/handler/handler_authz.go b/pkg/lib/oauth/handler/handler_authz.go index 7fb76564e53..9885694929d 100644 --- a/pkg/lib/oauth/handler/handler_authz.go +++ b/pkg/lib/oauth/handler/handler_authz.go @@ -28,7 +28,7 @@ import ( const ( CodeResponseType = "code" NoneResponseType = "none" - SettingsActonResponseType = "settings_action" + SettingsActonResponseType = "urn:authgear:params:oauth:response-type:settings-action" ) // whiteslistedResponseTypes is a list of response types that would be always allowed @@ -126,7 +126,6 @@ func (h *AuthorizationHandler) Handle(r protocol.AuthorizationRequest) httputil. } } - // create oauth session and redirect to the web app oauthSessionEntry := oauthsession.NewEntry(oauthsession.T{ AuthorizationRequest: r, }) @@ -137,7 +136,6 @@ func (h *AuthorizationHandler) Handle(r protocol.AuthorizationRequest) httputil. Response: protocol.NewErrorResponse("server_error", "internal server error"), } } - // FIXME: remove settings action code redirectURI, errResp := parseAuthzRedirectURI(client, h.UIURLBuilder, h.HTTPProto, h.HTTPOrigin, h.AppDomains, oauthSessionEntry, r) if errResp != nil { return authorizationResultError{ @@ -499,13 +497,19 @@ func (h *AuthorizationHandler) finish( resp := protocol.AuthorizationResponse{} switch r.ResponseType() { - case "code": + case SettingsActonResponseType: + err = h.generateSettingsActionResponse(redirectURI.String(), idpSessionID, authenticationInfo, idTokenHintSID, r, authz, resp) + if err != nil { + return nil, err + } + + case CodeResponseType: err = h.generateCodeResponse(redirectURI.String(), idpSessionID, authenticationInfo, idTokenHintSID, r, authz, resp) if err != nil { return nil, err } - case "none": + case NoneResponseType: break default: @@ -591,9 +595,9 @@ func (h *AuthorizationHandler) validateRequest( } switch r.ResponseType() { - case "settings_action": + case SettingsActonResponseType: fallthrough - case "code": + case CodeResponseType: if client.IsPublic() { if r.CodeChallenge() == "" { return protocol.NewError("invalid_request", "PKCE code challenge is required for public clients") @@ -602,7 +606,7 @@ func (h *AuthorizationHandler) validateRequest( if r.CodeChallenge() != "" && r.CodeChallengeMethod() != pkce.CodeChallengeMethodS256 { return protocol.NewError("invalid_request", "only 'S256' PKCE transform is supported") } - case "none": + case NoneResponseType: break default: return protocol.NewError("unsupported_response_type", "only 'code' response type is supported") @@ -640,70 +644,27 @@ func (h *AuthorizationHandler) generateCodeResponse( return nil } -func (h *AuthorizationHandler) generateSettingsActionGrant( - client *config.OAuthClientConfig, +func (h *AuthorizationHandler) generateSettingsActionResponse( + redirectURI string, + idpSessionID string, + authenticationInfo authenticationinfo.T, + idTokenHintSID string, r protocol.AuthorizationRequest, -) (string, protocol.ErrorResponse) { - if r.ResponseType() != string(SettingsActonResponseType) { - return "", nil - } - - var err error - - // Require login_hint for settings action - _, loginHintOk := r.LoginHint() - if !loginHintOk { - return "", protocol.NewErrorResponse("login_required", "authentication required") - } - - // Assume prompt=none for settings action - _, uiInfoByProduct, err := h.UIInfoResolver.ResolveForAuthorizationEndpoint(client, r) - if err != nil { - return "", protocol.NewErrorResponse("server_error", err.Error()) - } - idToken := uiInfoByProduct.IDToken - idTokenHintSID := uiInfoByProduct.IDTokenHintSID - - var idpSession session.Session - if s := session.GetSession(h.Context); s != nil && s.SessionType() == session.TypeIdentityProvider { - idpSession = s - } - if idpSession == nil || (idToken != nil && idpSession.GetAuthenticationInfo().UserID != idToken.Subject()) { - return "", protocol.NewErrorResponse("login_required", "authentication required") - } - - authenticationInfo := idpSession.GetAuthenticationInfo() - autoGrantAuthz := client.IsFirstParty() - - var authz *oauth.Authorization - if autoGrantAuthz { - authz, err = h.Authorizations.CheckAndGrant( - r.ClientID(), - authenticationInfo.UserID, - r.Scope(), - ) - } else { - authz, err = h.Authorizations.Check( - r.ClientID(), - authenticationInfo.UserID, - r.Scope(), - ) - } - if err != nil { - return "", protocol.NewErrorResponse("server_error", err.Error()) - } - + authz *oauth.Authorization, + resp protocol.AuthorizationResponse, +) error { code, _, err := h.SettingsActionGrantService.CreateSettingsActionGrant(&CreateSettingsActionGrantOptions{ Authorization: authz, - IDPSessionID: idpSession.SessionID(), + IDPSessionID: idpSessionID, AuthenticationInfo: authenticationInfo, IDTokenHintSID: idTokenHintSID, - RedirectURI: r.RedirectURI(), + RedirectURI: redirectURI, AuthorizationRequest: r, }) if err != nil { - return "", protocol.NewErrorResponse("server_error", err.Error()) + return err } - return code, nil + resp.Code(code) + return nil } diff --git a/pkg/lib/oauth/handler/handler_authz_mock_test.go b/pkg/lib/oauth/handler/handler_authz_mock_test.go index c421ad26c1d..81f2b3ada9d 100644 --- a/pkg/lib/oauth/handler/handler_authz_mock_test.go +++ b/pkg/lib/oauth/handler/handler_authz_mock_test.go @@ -112,18 +112,18 @@ func (mr *MockUIURLBuilderMockRecorder) BuildAuthenticationURL(client, r, e inte } // BuildSettingsActionURL mocks base method. -func (m *MockUIURLBuilder) BuildSettingsActionURL(client *config.OAuthClientConfig, r protocol.AuthorizationRequest, e *oauthsession.Entry, redirectURI *url.URL) (*url.URL, error) { +func (m *MockUIURLBuilder) BuildSettingsActionURL(client *config.OAuthClientConfig, r protocol.AuthorizationRequest, redirectURI *url.URL) (*url.URL, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "BuildSettingsActionURL", client, r, e, redirectURI) + ret := m.ctrl.Call(m, "BuildSettingsActionURL", client, r, redirectURI) ret0, _ := ret[0].(*url.URL) ret1, _ := ret[1].(error) return ret0, ret1 } // BuildSettingsActionURL indicates an expected call of BuildSettingsActionURL. -func (mr *MockUIURLBuilderMockRecorder) BuildSettingsActionURL(client, r, e, redirectURI interface{}) *gomock.Call { +func (mr *MockUIURLBuilderMockRecorder) BuildSettingsActionURL(client, r, redirectURI interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BuildSettingsActionURL", reflect.TypeOf((*MockUIURLBuilder)(nil).BuildSettingsActionURL), client, r, e, redirectURI) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BuildSettingsActionURL", reflect.TypeOf((*MockUIURLBuilder)(nil).BuildSettingsActionURL), client, r, redirectURI) } // MockAppSessionTokenService is a mock of AppSessionTokenService interface. diff --git a/pkg/lib/oauth/metadata.go b/pkg/lib/oauth/metadata.go index 2ba784d2156..d4e86c041c5 100644 --- a/pkg/lib/oauth/metadata.go +++ b/pkg/lib/oauth/metadata.go @@ -9,7 +9,7 @@ type MetadataProvider struct { func (p *MetadataProvider) PopulateMetadata(meta map[string]interface{}) { meta["authorization_endpoint"] = p.Endpoints.AuthorizeEndpointURL().String() meta["token_endpoint"] = p.Endpoints.TokenEndpointURL().String() - meta["response_types_supported"] = []string{"code", "settings_action", "none"} + meta["response_types_supported"] = []string{"code", "urn:authgear:params:oauth:response-type:settings-action", "none"} meta["response_modes_supported"] = []string{"query", "fragment", "form_post"} meta["grant_types_supported"] = []string{"authorization_code", "refresh_token"} meta["code_challenge_methods_supported"] = []string{pkce.CodeChallengeMethodS256} diff --git a/pkg/lib/oauth/oidc/ui.go b/pkg/lib/oauth/oidc/ui.go index 1a75f98af28..2314c7aaac7 100644 --- a/pkg/lib/oauth/oidc/ui.go +++ b/pkg/lib/oauth/oidc/ui.go @@ -101,6 +101,12 @@ type UIInfoResolver struct { } func (r *UIInfoResolver) SetAuthenticationInfoInQuery(redirectURI string, e *authenticationinfo.Entry) string { + consentURI := r.EndpointsProvider.ConsentEndpointURL().String() + // Not redirecting to the consent endpoint. + // Do not set anything. + if redirectURI != consentURI { + return redirectURI + } u, err := url.Parse(redirectURI) if err != nil { panic(err)