From 199f98cee1bcf47938dd9ffb27056596f38175f6 Mon Sep 17 00:00:00 2001 From: Arne Luenser Date: Thu, 12 Oct 2023 16:16:47 +0200 Subject: [PATCH 1/4] WIP: refactor Transactional interface --- handler/oauth2/flow_authorize_code_token.go | 34 +++----- handler/oauth2/flow_refresh.go | 93 ++++++++------------- storage/transactional.go | 58 +++---------- 3 files changed, 58 insertions(+), 127 deletions(-) diff --git a/handler/oauth2/flow_authorize_code_token.go b/handler/oauth2/flow_authorize_code_token.go index dceb8300..dc669eed 100644 --- a/handler/oauth2/flow_authorize_code_token.go +++ b/handler/oauth2/flow_authorize_code_token.go @@ -152,26 +152,21 @@ func (c *AuthorizeExplicitGrantHandler) PopulateTokenEndpointResponse(ctx contex } } - ctx, err = storage.MaybeBeginTx(ctx, c.CoreStorage) - if err != nil { - return errorsx.WithStack(fosite.ErrServerError.WithWrap(err).WithDebug(err.Error())) - } - defer func() { - if err != nil { - if rollBackTxnErr := storage.MaybeRollbackTx(ctx, c.CoreStorage); rollBackTxnErr != nil { - err = errorsx.WithStack(fosite.ErrServerError.WithWrap(err).WithDebugf("error: %s; rollback error: %s", err, rollBackTxnErr)) - } + if err := storage.MaybeTransaction(ctx, c.CoreStorage, func(ctx context.Context) error { + if err := c.CoreStorage.InvalidateAuthorizeCodeSession(ctx, signature); err != nil { + return errorsx.WithStack(fosite.ErrServerError.WithWrap(err).WithDebug(err.Error())) } - }() - - if err = c.CoreStorage.InvalidateAuthorizeCodeSession(ctx, signature); err != nil { - return errorsx.WithStack(fosite.ErrServerError.WithWrap(err).WithDebug(err.Error())) - } else if err = c.CoreStorage.CreateAccessTokenSession(ctx, accessSignature, requester.Sanitize([]string{})); err != nil { - return errorsx.WithStack(fosite.ErrServerError.WithWrap(err).WithDebug(err.Error())) - } else if refreshSignature != "" { - if err = c.CoreStorage.CreateRefreshTokenSession(ctx, refreshSignature, requester.Sanitize([]string{})); err != nil { + if err := c.CoreStorage.CreateAccessTokenSession(ctx, accessSignature, requester.Sanitize([]string{})); err != nil { return errorsx.WithStack(fosite.ErrServerError.WithWrap(err).WithDebug(err.Error())) } + if refreshSignature != "" { + if err := c.CoreStorage.CreateRefreshTokenSession(ctx, refreshSignature, requester.Sanitize([]string{})); err != nil { + return errorsx.WithStack(fosite.ErrServerError.WithWrap(err).WithDebug(err.Error())) + } + } + return nil + }); err != nil { + return err // error already wrapped inside tx callback } responder.SetAccessToken(access) @@ -182,11 +177,6 @@ func (c *AuthorizeExplicitGrantHandler) PopulateTokenEndpointResponse(ctx contex if refresh != "" { responder.SetExtra("refresh_token", refresh) } - - if err = storage.MaybeCommitTx(ctx, c.CoreStorage); err != nil { - return errorsx.WithStack(fosite.ErrServerError.WithWrap(err).WithDebug(err.Error())) - } - return nil } diff --git a/handler/oauth2/flow_refresh.go b/handler/oauth2/flow_refresh.go index 5bf68070..acfaa35b 100644 --- a/handler/oauth2/flow_refresh.go +++ b/handler/oauth2/flow_refresh.go @@ -126,34 +126,29 @@ func (c *RefreshTokenGrantHandler) PopulateTokenEndpointResponse(ctx context.Con signature := c.RefreshTokenStrategy.RefreshTokenSignature(ctx, requester.GetRequestForm().Get("refresh_token")) - ctx, err = storage.MaybeBeginTx(ctx, c.TokenRevocationStorage) - if err != nil { - return errorsx.WithStack(fosite.ErrServerError.WithWrap(err).WithDebug(err.Error())) - } defer func() { err = c.handleRefreshTokenEndpointStorageError(ctx, err) }() - ts, err := c.TokenRevocationStorage.GetRefreshTokenSession(ctx, signature, nil) - if err != nil { - return err - } else if err := c.TokenRevocationStorage.RevokeAccessToken(ctx, ts.GetID()); err != nil { - return err - } - - if err := c.TokenRevocationStorage.RevokeRefreshTokenMaybeGracePeriod(ctx, ts.GetID(), signature); err != nil { - return err - } - - storeReq := requester.Sanitize([]string{}) - storeReq.SetID(ts.GetID()) - - if err = c.TokenRevocationStorage.CreateAccessTokenSession(ctx, accessSignature, storeReq); err != nil { - return err - } - - if err = c.TokenRevocationStorage.CreateRefreshTokenSession(ctx, refreshSignature, storeReq); err != nil { - return err + if err := storage.MaybeTransaction(ctx, c.TokenRevocationStorage, func(ctx context.Context) error { + ts, err := c.TokenRevocationStorage.GetRefreshTokenSession(ctx, signature, nil) + if err != nil { + return err + } + if err := c.TokenRevocationStorage.RevokeAccessToken(ctx, ts.GetID()); err != nil { + return err + } + if err := c.TokenRevocationStorage.RevokeRefreshTokenMaybeGracePeriod(ctx, ts.GetID(), signature); err != nil { + return err + } + storeReq := requester.Sanitize([]string{}) + storeReq.SetID(ts.GetID()) + if err := c.TokenRevocationStorage.CreateAccessTokenSession(ctx, accessSignature, storeReq); err != nil { + return err + } + return c.TokenRevocationStorage.CreateRefreshTokenSession(ctx, refreshSignature, storeReq) + }); err != nil { + return errorsx.WithStack(fosite.ErrServerError.WithWrap(err).WithDebug(err.Error())) } responder.SetAccessToken(accessToken) @@ -163,10 +158,6 @@ func (c *RefreshTokenGrantHandler) PopulateTokenEndpointResponse(ctx context.Con responder.SetScopes(requester.GetGrantedScopes()) responder.SetExtra("refresh_token", refreshToken) - if err = storage.MaybeCommitTx(ctx, c.TokenRevocationStorage); err != nil { - return err - } - return nil } @@ -179,32 +170,20 @@ func (c *RefreshTokenGrantHandler) PopulateTokenEndpointResponse(ctx context.Con // legitimate client is trying to access, in case of such an access // attempt the valid refresh token and the access authorization // associated with it are both revoked. -func (c *RefreshTokenGrantHandler) handleRefreshTokenReuse(ctx context.Context, signature string, req fosite.Requester) (err error) { - ctx, err = storage.MaybeBeginTx(ctx, c.TokenRevocationStorage) - if err != nil { - return errorsx.WithStack(fosite.ErrServerError.WithWrap(err).WithDebug(err.Error())) - } - defer func() { - err = c.handleRefreshTokenEndpointStorageError(ctx, err) - }() - - if err = c.TokenRevocationStorage.DeleteRefreshTokenSession(ctx, signature); err != nil { - return err - } else if err = c.TokenRevocationStorage.RevokeRefreshToken( - ctx, req.GetID(), - ); err != nil && !errors.Is(err, fosite.ErrNotFound) { - return err - } else if err = c.TokenRevocationStorage.RevokeAccessToken( - ctx, req.GetID(), - ); err != nil && !errors.Is(err, fosite.ErrNotFound) { - return err - } - - if err = storage.MaybeCommitTx(ctx, c.TokenRevocationStorage); err != nil { - return err - } - - return nil +func (c *RefreshTokenGrantHandler) handleRefreshTokenReuse(ctx context.Context, signature string, req fosite.Requester) error { + err := storage.MaybeTransaction(ctx, c.TokenRevocationStorage, func(ctx context.Context) error { + if err := c.TokenRevocationStorage.DeleteRefreshTokenSession(ctx, signature); err != nil { + return err + } + if err := c.TokenRevocationStorage.RevokeRefreshToken(ctx, req.GetID()); err != nil && !errors.Is(err, fosite.ErrNotFound) { + return err + } + if err := c.TokenRevocationStorage.RevokeAccessToken(ctx, req.GetID()); err != nil && !errors.Is(err, fosite.ErrNotFound) { + return err + } + return nil + }) + return c.handleRefreshTokenEndpointStorageError(ctx, err) } func (c *RefreshTokenGrantHandler) handleRefreshTokenEndpointStorageError(ctx context.Context, storageErr error) (err error) { @@ -212,12 +191,6 @@ func (c *RefreshTokenGrantHandler) handleRefreshTokenEndpointStorageError(ctx co return nil } - defer func() { - if rollBackTxnErr := storage.MaybeRollbackTx(ctx, c.TokenRevocationStorage); rollBackTxnErr != nil { - err = errorsx.WithStack(fosite.ErrServerError.WithWrap(err).WithDebugf("error: %s; rollback error: %s", err, rollBackTxnErr)) - } - }() - if errors.Is(storageErr, fosite.ErrSerializationFailure) { return errorsx.WithStack(fosite.ErrInvalidRequest. WithDebugf(storageErr.Error()). diff --git a/storage/transactional.go b/storage/transactional.go index f144340f..87d57d9e 100644 --- a/storage/transactional.go +++ b/storage/transactional.go @@ -5,54 +5,22 @@ package storage import "context" -// A storage provider that has support for transactions should implement this interface to ensure atomicity for certain flows -// that require transactional semantics. Fosite will call these methods (when atomicity is required) if and only if the storage -// provider has implemented `Transactional`. It is expected that the storage provider will examine context for an existing transaction -// each time a database operation is to be performed. +// A storage provider that has support for transactions should implement this +// interface to ensure atomicity for certain flows that require transactional +// semantics. When atomicity is required, Fosite will group calls to the storage +// provider in a function and passes that to Transaction. Implementations are +// expected to execute these calls in a transactional manner. Typically, a +// handle to the transaction will be stored in the context. // -// An implementation of `BeginTX` should attempt to initiate a new transaction and store that under a unique key -// in the context that can be accessible by `Commit` and `Rollback`. The "transactional aware" context will then be -// returned for further propagation, eventually to be consumed by `Commit` or `Rollback` to finish the transaction. -// -// Implementations for `Commit` & `Rollback` should look for the transaction object inside the supplied context using the same -// key used by `BeginTX`. If these methods have been called, it is expected that a txn object should be available in the provided -// context. +// Implementations should rollback (or retry) the transaction if the callback +// returns an error. type Transactional interface { - BeginTX(ctx context.Context) (context.Context, error) - Commit(ctx context.Context) error - Rollback(ctx context.Context) error -} - -// MaybeBeginTx is a helper function that can be used to initiate a transaction if the supplied storage -// implements the `Transactional` interface. -func MaybeBeginTx(ctx context.Context, storage interface{}) (context.Context, error) { - // the type assertion checks whether the dynamic type of `storage` implements `Transactional` - txnStorage, transactional := storage.(Transactional) - if transactional { - return txnStorage.BeginTX(ctx) - } else { - return ctx, nil - } -} - -// MaybeCommitTx is a helper function that can be used to commit a transaction if the supplied storage -// implements the `Transactional` interface. -func MaybeCommitTx(ctx context.Context, storage interface{}) error { - txnStorage, transactional := storage.(Transactional) - if transactional { - return txnStorage.Commit(ctx) - } else { - return nil - } + Transaction(context.Context, func(context.Context) error) error } -// MaybeRollbackTx is a helper function that can be used to rollback a transaction if the supplied storage -// implements the `Transactional` interface. -func MaybeRollbackTx(ctx context.Context, storage interface{}) error { - txnStorage, transactional := storage.(Transactional) - if transactional { - return txnStorage.Rollback(ctx) - } else { - return nil +func MaybeTransaction(ctx context.Context, storage any, f func(context.Context) error) error { + if tx, ok := storage.(Transactional); ok { + return tx.Transaction(ctx, f) } + return f(ctx) } From 715f5419afd450840a737c36d0a4fed9cddbb53f Mon Sep 17 00:00:00 2001 From: aeneasr <3372410+aeneasr@users.noreply.github.com> Date: Tue, 7 May 2024 14:00:35 +0200 Subject: [PATCH 2/4] chore: synchronize workspaces --- .../oauth2/flow_authorize_code_token_test.go | 237 ------- handler/oauth2/flow_refresh_test.go | 656 ------------------ internal/access_request.go | 88 ++- internal/access_response.go | 48 +- internal/access_token_storage.go | 24 +- internal/access_token_strategy.go | 24 +- internal/authorize_code_storage.go | 24 +- internal/authorize_code_strategy.go | 24 +- internal/authorize_handler.go | 16 +- internal/authorize_request.go | 120 ++-- internal/authorize_response.go | 31 +- internal/client.go | 71 +- internal/hash.go | 19 +- internal/id_token_strategy.go | 16 +- internal/introspector.go | 16 +- internal/oauth2_auth_jwt_storage.go | 41 +- internal/oauth2_client_storage.go | 24 +- internal/oauth2_owner_storage.go | 40 +- internal/oauth2_revoke_storage.go | 48 +- internal/oauth2_storage.go | 48 +- internal/oauth2_strategy.go | 48 +- internal/openid_id_token_storage.go | 24 +- internal/pkce_storage_strategy.go | 24 +- internal/refresh_token_strategy.go | 24 +- internal/request.go | 84 ++- internal/revoke_handler.go | 16 +- internal/storage.go | 24 +- internal/token_handler.go | 28 +- internal/transactional.go | 52 +- 29 files changed, 443 insertions(+), 1496 deletions(-) diff --git a/handler/oauth2/flow_authorize_code_token_test.go b/handler/oauth2/flow_authorize_code_token_test.go index bd854fbb..541c4273 100644 --- a/handler/oauth2/flow_authorize_code_token_test.go +++ b/handler/oauth2/flow_authorize_code_token_test.go @@ -12,13 +12,8 @@ import ( //"github.com/golang/mock/gomock" "time" - "github.com/golang/mock/gomock" - - "github.com/ory/fosite/internal" - "github.com/ory/fosite" //"github.com/ory/fosite/internal" "github.com/ory/fosite/storage" - "github.com/pkg/errors" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) @@ -441,235 +436,3 @@ func TestAuthorizeCode_HandleTokenEndpointRequest(t *testing.T) { }) } } - -func TestAuthorizeCodeTransactional_HandleTokenEndpointRequest(t *testing.T) { - var mockTransactional *internal.MockTransactional - var mockCoreStore *internal.MockCoreStorage - strategy := hmacshaStrategy - request := &fosite.AccessRequest{ - GrantTypes: fosite.Arguments{"authorization_code"}, - Request: fosite.Request{ - Client: &fosite.DefaultClient{ - GrantTypes: fosite.Arguments{"authorization_code", "refresh_token"}, - }, - GrantedScope: fosite.Arguments{"offline"}, - Session: &fosite.DefaultSession{}, - RequestedAt: time.Now().UTC(), - }, - } - token, _, err := strategy.GenerateAuthorizeCode(context.Background(), nil) - require.NoError(t, err) - request.Form = url.Values{"code": {token}} - response := fosite.NewAccessResponse() - propagatedContext := context.Background() - - // some storage implementation that has support for transactions, notice the embedded type `storage.Transactional` - type transactionalStore struct { - storage.Transactional - CoreStorage - } - - for _, testCase := range []struct { - description string - setup func() - expectError error - }{ - { - description: "transaction should be committed successfully if no errors occur", - setup: func() { - mockCoreStore. - EXPECT(). - GetAuthorizeCodeSession(gomock.Any(), gomock.Any(), gomock.Any()). - Return(request, nil). - Times(1) - mockTransactional. - EXPECT(). - BeginTX(propagatedContext). - Return(propagatedContext, nil) - mockCoreStore. - EXPECT(). - InvalidateAuthorizeCodeSession(gomock.Any(), gomock.Any()). - Return(nil). - Times(1) - mockCoreStore. - EXPECT(). - CreateAccessTokenSession(propagatedContext, gomock.Any(), gomock.Any()). - Return(nil). - Times(1) - mockCoreStore. - EXPECT(). - CreateRefreshTokenSession(propagatedContext, gomock.Any(), gomock.Any()). - Return(nil). - Times(1) - mockTransactional. - EXPECT(). - Commit(propagatedContext). - Return(nil). - Times(1) - }, - }, - { - description: "transaction should be rolled back if `InvalidateAuthorizeCodeSession` returns an error", - setup: func() { - mockCoreStore. - EXPECT(). - GetAuthorizeCodeSession(gomock.Any(), gomock.Any(), gomock.Any()). - Return(request, nil). - Times(1) - mockTransactional. - EXPECT(). - BeginTX(propagatedContext). - Return(propagatedContext, nil) - mockCoreStore. - EXPECT(). - InvalidateAuthorizeCodeSession(gomock.Any(), gomock.Any()). - Return(errors.New("Whoops, a nasty database error occurred!")). - Times(1) - mockTransactional. - EXPECT(). - Rollback(propagatedContext). - Return(nil). - Times(1) - }, - expectError: fosite.ErrServerError, - }, - { - description: "transaction should be rolled back if `CreateAccessTokenSession` returns an error", - setup: func() { - mockCoreStore. - EXPECT(). - GetAuthorizeCodeSession(gomock.Any(), gomock.Any(), gomock.Any()). - Return(request, nil). - Times(1) - mockTransactional. - EXPECT(). - BeginTX(propagatedContext). - Return(propagatedContext, nil) - mockCoreStore. - EXPECT(). - InvalidateAuthorizeCodeSession(gomock.Any(), gomock.Any()). - Return(nil). - Times(1) - mockCoreStore. - EXPECT(). - CreateAccessTokenSession(propagatedContext, gomock.Any(), gomock.Any()). - Return(errors.New("Whoops, a nasty database error occurred!")). - Times(1) - mockTransactional. - EXPECT(). - Rollback(propagatedContext). - Return(nil). - Times(1) - }, - expectError: fosite.ErrServerError, - }, - { - description: "should result in a server error if transaction cannot be created", - setup: func() { - mockCoreStore. - EXPECT(). - GetAuthorizeCodeSession(gomock.Any(), gomock.Any(), gomock.Any()). - Return(request, nil). - Times(1) - mockTransactional. - EXPECT(). - BeginTX(propagatedContext). - Return(nil, errors.New("Whoops, unable to create transaction!")) - }, - expectError: fosite.ErrServerError, - }, - { - description: "should result in a server error if transaction cannot be rolled back", - setup: func() { - mockCoreStore. - EXPECT(). - GetAuthorizeCodeSession(gomock.Any(), gomock.Any(), gomock.Any()). - Return(request, nil). - Times(1) - mockTransactional. - EXPECT(). - BeginTX(propagatedContext). - Return(propagatedContext, nil) - mockCoreStore. - EXPECT(). - InvalidateAuthorizeCodeSession(gomock.Any(), gomock.Any()). - Return(errors.New("Whoops, a nasty database error occurred!")). - Times(1) - mockTransactional. - EXPECT(). - Rollback(propagatedContext). - Return(errors.New("Whoops, unable to rollback transaction!")). - Times(1) - }, - expectError: fosite.ErrServerError, - }, - { - description: "should result in a server error if transaction cannot be committed", - setup: func() { - mockCoreStore. - EXPECT(). - GetAuthorizeCodeSession(gomock.Any(), gomock.Any(), gomock.Any()). - Return(request, nil). - Times(1) - mockTransactional. - EXPECT(). - BeginTX(propagatedContext). - Return(propagatedContext, nil) - mockCoreStore. - EXPECT(). - InvalidateAuthorizeCodeSession(gomock.Any(), gomock.Any()). - Return(nil). - Times(1) - mockCoreStore. - EXPECT(). - CreateAccessTokenSession(propagatedContext, gomock.Any(), gomock.Any()). - Return(nil). - Times(1) - mockCoreStore. - EXPECT(). - CreateRefreshTokenSession(propagatedContext, gomock.Any(), gomock.Any()). - Return(nil). - Times(1) - mockTransactional. - EXPECT(). - Commit(propagatedContext). - Return(errors.New("Whoops, unable to commit transaction!")). - Times(1) - mockTransactional. - EXPECT(). - Rollback(propagatedContext). - Return(nil). - Times(1) - }, - expectError: fosite.ErrServerError, - }, - } { - t.Run(fmt.Sprintf("scenario=%s", testCase.description), func(t *testing.T) { - ctrl := gomock.NewController(t) - defer ctrl.Finish() - - mockTransactional = internal.NewMockTransactional(ctrl) - mockCoreStore = internal.NewMockCoreStorage(ctrl) - testCase.setup() - - handler := AuthorizeExplicitGrantHandler{ - CoreStorage: transactionalStore{ - mockTransactional, - mockCoreStore, - }, - AccessTokenStrategy: &strategy, - RefreshTokenStrategy: &strategy, - AuthorizeCodeStrategy: &strategy, - Config: &fosite.Config{ - ScopeStrategy: fosite.HierarchicScopeStrategy, - AudienceMatchingStrategy: fosite.DefaultAudienceMatchingStrategy, - AuthorizeCodeLifespan: time.Minute, - }, - } - - if err := handler.PopulateTokenEndpointResponse(propagatedContext, request, response); testCase.expectError != nil { - assert.EqualError(t, err, testCase.expectError.Error()) - } - }) - } -} diff --git a/handler/oauth2/flow_refresh_test.go b/handler/oauth2/flow_refresh_test.go index 54df6cda..1f6f5a3a 100644 --- a/handler/oauth2/flow_refresh_test.go +++ b/handler/oauth2/flow_refresh_test.go @@ -5,16 +5,12 @@ package oauth2 import ( "context" - "fmt" "net/url" "testing" "time" - "github.com/golang/mock/gomock" - "github.com/ory/fosite/internal" - "github.com/pkg/errors" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -348,93 +344,6 @@ func TestRefreshFlow_HandleTokenEndpointRequest(t *testing.T) { } } -func TestRefreshFlowTransactional_HandleTokenEndpointRequest(t *testing.T) { - var mockTransactional *internal.MockTransactional - var mockRevocationStore *internal.MockTokenRevocationStorage - request := fosite.NewAccessRequest(&fosite.DefaultSession{}) - propagatedContext := context.Background() - - type transactionalStore struct { - storage.Transactional - TokenRevocationStorage - } - - for _, testCase := range []struct { - description string - setup func() - expectError error - }{ - { - description: "should revoke session on token reuse", - setup: func() { - request.GrantTypes = fosite.Arguments{"refresh_token"} - request.Client = &fosite.DefaultClient{ - ID: "foo", - GrantTypes: fosite.Arguments{"refresh_token"}, - } - mockRevocationStore. - EXPECT(). - GetRefreshTokenSession(propagatedContext, gomock.Any(), gomock.Any()). - Return(request, fosite.ErrInactiveToken). - Times(1) - mockTransactional. - EXPECT(). - BeginTX(propagatedContext). - Return(propagatedContext, nil). - Times(1) - mockRevocationStore. - EXPECT(). - DeleteRefreshTokenSession(propagatedContext, gomock.Any()). - Return(nil). - Times(1) - mockRevocationStore. - EXPECT(). - RevokeRefreshToken(propagatedContext, gomock.Any()). - Return(nil). - Times(1) - mockRevocationStore. - EXPECT(). - RevokeAccessToken(propagatedContext, gomock.Any()). - Return(nil). - Times(1) - mockTransactional. - EXPECT(). - Commit(propagatedContext). - Return(nil). - Times(1) - }, - expectError: fosite.ErrInactiveToken, - }, - } { - t.Run(fmt.Sprintf("scenario=%s", testCase.description), func(t *testing.T) { - ctrl := gomock.NewController(t) - defer ctrl.Finish() - - mockTransactional = internal.NewMockTransactional(ctrl) - mockRevocationStore = internal.NewMockTokenRevocationStorage(ctrl) - testCase.setup() - - handler := RefreshTokenGrantHandler{ - TokenRevocationStorage: transactionalStore{ - mockTransactional, - mockRevocationStore, - }, - AccessTokenStrategy: &hmacshaStrategy, - RefreshTokenStrategy: &hmacshaStrategy, - Config: &fosite.Config{ - AccessTokenLifespan: time.Hour, - ScopeStrategy: fosite.HierarchicScopeStrategy, - AudienceMatchingStrategy: fosite.DefaultAudienceMatchingStrategy, - }, - } - - if err := handler.HandleTokenEndpointRequest(propagatedContext, request); testCase.expectError != nil { - assert.EqualError(t, err, testCase.expectError.Error()) - } - }) - } -} - func TestRefreshFlow_PopulateTokenEndpointResponse(t *testing.T) { var areq *fosite.AccessRequest var aresp *fosite.AccessResponse @@ -521,568 +430,3 @@ func TestRefreshFlow_PopulateTokenEndpointResponse(t *testing.T) { }) } } - -func TestRefreshFlowTransactional_PopulateTokenEndpointResponse(t *testing.T) { - var mockTransactional *internal.MockTransactional - var mockRevocationStore *internal.MockTokenRevocationStorage - request := fosite.NewAccessRequest(&fosite.DefaultSession{}) - response := fosite.NewAccessResponse() - propagatedContext := context.Background() - - // some storage implementation that has support for transactions, notice the embedded type `storage.Transactional` - type transactionalStore struct { - storage.Transactional - TokenRevocationStorage - } - - for _, testCase := range []struct { - description string - setup func() - expectError error - }{ - { - description: "transaction should be committed successfully if no errors occur", - setup: func() { - request.GrantTypes = fosite.Arguments{"refresh_token"} - mockTransactional. - EXPECT(). - BeginTX(propagatedContext). - Return(propagatedContext, nil). - Times(1) - mockRevocationStore. - EXPECT(). - GetRefreshTokenSession(propagatedContext, gomock.Any(), nil). - Return(request, nil). - Times(1) - mockRevocationStore. - EXPECT(). - RevokeAccessToken(propagatedContext, gomock.Any()). - Return(nil). - Times(1) - mockRevocationStore. - EXPECT(). - RevokeRefreshTokenMaybeGracePeriod(propagatedContext, gomock.Any(), gomock.Any()). - Return(nil). - Times(1) - mockRevocationStore. - EXPECT(). - CreateAccessTokenSession(propagatedContext, gomock.Any(), gomock.Any()). - Return(nil). - Times(1) - mockRevocationStore. - EXPECT(). - CreateRefreshTokenSession(propagatedContext, gomock.Any(), gomock.Any()). - Return(nil). - Times(1) - mockTransactional. - EXPECT(). - Commit(propagatedContext). - Return(nil). - Times(1) - }, - }, - { - description: "transaction should be rolled back if call to `GetRefreshTokenSession` results in an error", - setup: func() { - request.GrantTypes = fosite.Arguments{"refresh_token"} - mockTransactional. - EXPECT(). - BeginTX(propagatedContext). - Return(propagatedContext, nil). - Times(1) - mockRevocationStore. - EXPECT(). - GetRefreshTokenSession(propagatedContext, gomock.Any(), nil). - Return(nil, errors.New("Whoops, a nasty database error occurred!")). - Times(1) - mockTransactional. - EXPECT(). - Rollback(propagatedContext). - Return(nil). - Times(1) - }, - expectError: fosite.ErrServerError, - }, - { - description: "should result in a fosite.ErrInvalidRequest if `GetRefreshTokenSession` results in a " + - "fosite.ErrNotFound error", - setup: func() { - request.GrantTypes = fosite.Arguments{"refresh_token"} - mockTransactional. - EXPECT(). - BeginTX(propagatedContext). - Return(propagatedContext, nil). - Times(1) - mockRevocationStore. - EXPECT(). - GetRefreshTokenSession(propagatedContext, gomock.Any(), nil). - Return(nil, fosite.ErrNotFound). - Times(1) - mockTransactional. - EXPECT(). - Rollback(propagatedContext). - Return(nil). - Times(1) - }, - expectError: fosite.ErrInvalidRequest, - }, - { - description: "transaction should be rolled back if call to `RevokeAccessToken` results in an error", - setup: func() { - request.GrantTypes = fosite.Arguments{"refresh_token"} - mockTransactional. - EXPECT(). - BeginTX(propagatedContext). - Return(propagatedContext, nil). - Times(1) - mockRevocationStore. - EXPECT(). - GetRefreshTokenSession(propagatedContext, gomock.Any(), nil). - Return(request, nil). - Times(1) - mockRevocationStore. - EXPECT(). - RevokeAccessToken(propagatedContext, gomock.Any()). - Return(errors.New("Whoops, a nasty database error occurred!")). - Times(1) - mockTransactional. - EXPECT(). - Rollback(propagatedContext). - Return(nil). - Times(1) - }, - expectError: fosite.ErrServerError, - }, - { - description: "should result in a fosite.ErrInvalidRequest if call to `RevokeAccessToken` results in a " + - "fosite.ErrSerializationFailure error", - setup: func() { - request.GrantTypes = fosite.Arguments{"refresh_token"} - mockTransactional. - EXPECT(). - BeginTX(propagatedContext). - Return(propagatedContext, nil). - Times(1) - mockRevocationStore. - EXPECT(). - GetRefreshTokenSession(propagatedContext, gomock.Any(), nil). - Return(request, nil). - Times(1) - mockRevocationStore. - EXPECT(). - RevokeAccessToken(propagatedContext, gomock.Any()). - Return(fosite.ErrSerializationFailure). - Times(1) - mockTransactional. - EXPECT(). - Rollback(propagatedContext). - Return(nil). - Times(1) - }, - expectError: fosite.ErrInvalidRequest, - }, - { - description: "should result in a fosite.ErrInactiveToken if call to `RevokeAccessToken` results in a " + - "fosite.ErrInvalidRequest error", - setup: func() { - request.GrantTypes = fosite.Arguments{"refresh_token"} - mockTransactional. - EXPECT(). - BeginTX(propagatedContext). - Return(propagatedContext, nil). - Times(1) - mockRevocationStore. - EXPECT(). - GetRefreshTokenSession(propagatedContext, gomock.Any(), nil). - Return(nil, fosite.ErrInactiveToken). - Times(1) - mockTransactional. - EXPECT(). - Rollback(propagatedContext). - Return(nil). - Times(1) - }, - expectError: fosite.ErrInvalidRequest, - }, - { - description: "transaction should be rolled back if call to `RevokeRefreshTokenMaybeGracePeriod` results in an error", - setup: func() { - request.GrantTypes = fosite.Arguments{"refresh_token"} - mockTransactional. - EXPECT(). - BeginTX(propagatedContext). - Return(propagatedContext, nil). - Times(1) - mockRevocationStore. - EXPECT(). - GetRefreshTokenSession(propagatedContext, gomock.Any(), nil). - Return(request, nil). - Times(1) - mockRevocationStore. - EXPECT(). - RevokeAccessToken(propagatedContext, gomock.Any()). - Return(nil). - Times(1) - mockRevocationStore. - EXPECT(). - RevokeRefreshTokenMaybeGracePeriod(propagatedContext, gomock.Any(), gomock.Any()). - Return(errors.New("Whoops, a nasty database error occurred!")). - Times(1) - mockTransactional. - EXPECT(). - Rollback(propagatedContext). - Return(nil). - Times(1) - }, - expectError: fosite.ErrServerError, - }, - { - description: "should result in a fosite.ErrInvalidRequest if call to `RevokeRefreshTokenMaybeGracePeriod` results in a " + - "fosite.ErrSerializationFailure error", - setup: func() { - request.GrantTypes = fosite.Arguments{"refresh_token"} - mockTransactional. - EXPECT(). - BeginTX(propagatedContext). - Return(propagatedContext, nil). - Times(1) - mockRevocationStore. - EXPECT(). - GetRefreshTokenSession(propagatedContext, gomock.Any(), nil). - Return(request, nil). - Times(1) - mockRevocationStore. - EXPECT(). - RevokeAccessToken(propagatedContext, gomock.Any()). - Return(nil). - Times(1) - mockRevocationStore. - EXPECT(). - RevokeRefreshTokenMaybeGracePeriod(propagatedContext, gomock.Any(), gomock.Any()). - Return(fosite.ErrSerializationFailure). - Times(1) - mockTransactional. - EXPECT(). - Rollback(propagatedContext). - Return(nil). - Times(1) - }, - expectError: fosite.ErrInvalidRequest, - }, - { - description: "should result in a fosite.ErrInvalidRequest if call to `CreateAccessTokenSession` results in " + - "a fosite.ErrSerializationFailure error", - setup: func() { - mockTransactional. - EXPECT(). - BeginTX(propagatedContext). - Return(propagatedContext, nil). - Times(1) - mockRevocationStore. - EXPECT(). - GetRefreshTokenSession(propagatedContext, gomock.Any(), nil). - Return(request, nil). - Times(1) - mockRevocationStore. - EXPECT(). - RevokeAccessToken(propagatedContext, gomock.Any()). - Return(nil). - Times(1) - mockRevocationStore. - EXPECT(). - RevokeRefreshTokenMaybeGracePeriod(propagatedContext, gomock.Any(), gomock.Any()). - Return(nil). - Times(1) - mockRevocationStore. - EXPECT(). - CreateAccessTokenSession(propagatedContext, gomock.Any(), gomock.Any()). - Return(fosite.ErrSerializationFailure). - Times(1) - mockTransactional. - EXPECT(). - Rollback(propagatedContext). - Return(nil). - Times(1) - }, - expectError: fosite.ErrInvalidRequest, - }, - { - description: "transaction should be rolled back if call to `CreateAccessTokenSession` results in an error", - setup: func() { - mockTransactional. - EXPECT(). - BeginTX(propagatedContext). - Return(propagatedContext, nil). - Times(1) - mockRevocationStore. - EXPECT(). - GetRefreshTokenSession(propagatedContext, gomock.Any(), nil). - Return(request, nil). - Times(1) - mockRevocationStore. - EXPECT(). - RevokeAccessToken(propagatedContext, gomock.Any()). - Return(nil). - Times(1) - mockRevocationStore. - EXPECT(). - RevokeRefreshTokenMaybeGracePeriod(propagatedContext, gomock.Any(), gomock.Any()). - Return(nil). - Times(1) - mockRevocationStore. - EXPECT(). - CreateAccessTokenSession(propagatedContext, gomock.Any(), gomock.Any()). - Return(errors.New("Whoops, a nasty database error occurred!")). - Times(1) - mockTransactional. - EXPECT(). - Rollback(propagatedContext). - Return(nil). - Times(1) - }, - expectError: fosite.ErrServerError, - }, - { - description: "transaction should be rolled back if call to `CreateRefreshTokenSession` results in an error", - setup: func() { - request.GrantTypes = fosite.Arguments{"refresh_token"} - mockTransactional. - EXPECT(). - BeginTX(propagatedContext). - Return(propagatedContext, nil). - Times(1) - mockRevocationStore. - EXPECT(). - GetRefreshTokenSession(propagatedContext, gomock.Any(), nil). - Return(request, nil). - Times(1) - mockRevocationStore. - EXPECT(). - RevokeAccessToken(propagatedContext, gomock.Any()). - Return(nil). - Times(1) - mockRevocationStore. - EXPECT(). - RevokeRefreshTokenMaybeGracePeriod(propagatedContext, gomock.Any(), gomock.Any()). - Return(nil). - Times(1) - mockRevocationStore. - EXPECT(). - CreateAccessTokenSession(propagatedContext, gomock.Any(), gomock.Any()). - Return(nil). - Times(1) - mockRevocationStore. - EXPECT(). - CreateRefreshTokenSession(propagatedContext, gomock.Any(), gomock.Any()). - Return(errors.New("Whoops, a nasty database error occurred!")). - Times(1) - mockTransactional. - EXPECT(). - Rollback(propagatedContext). - Return(nil). - Times(1) - }, - expectError: fosite.ErrServerError, - }, - { - description: "should result in a fosite.ErrInvalidRequest if call to `CreateRefreshTokenSession` results in " + - "a fosite.ErrSerializationFailure error", - setup: func() { - request.GrantTypes = fosite.Arguments{"refresh_token"} - mockTransactional. - EXPECT(). - BeginTX(propagatedContext). - Return(propagatedContext, nil). - Times(1) - mockRevocationStore. - EXPECT(). - GetRefreshTokenSession(propagatedContext, gomock.Any(), nil). - Return(request, nil). - Times(1) - mockRevocationStore. - EXPECT(). - RevokeAccessToken(propagatedContext, gomock.Any()). - Return(nil). - Times(1) - mockRevocationStore. - EXPECT(). - RevokeRefreshTokenMaybeGracePeriod(propagatedContext, gomock.Any(), gomock.Any()). - Return(nil). - Times(1) - mockRevocationStore. - EXPECT(). - CreateAccessTokenSession(propagatedContext, gomock.Any(), gomock.Any()). - Return(nil). - Times(1) - mockRevocationStore. - EXPECT(). - CreateRefreshTokenSession(propagatedContext, gomock.Any(), gomock.Any()). - Return(fosite.ErrSerializationFailure). - Times(1) - mockTransactional. - EXPECT(). - Rollback(propagatedContext). - Return(nil). - Times(1) - }, - expectError: fosite.ErrInvalidRequest, - }, - { - description: "should result in a server error if transaction cannot be created", - setup: func() { - request.GrantTypes = fosite.Arguments{"refresh_token"} - mockTransactional. - EXPECT(). - BeginTX(propagatedContext). - Return(nil, errors.New("Could not create transaction!")). - Times(1) - }, - expectError: fosite.ErrServerError, - }, - { - description: "should result in a server error if transaction cannot be rolled back", - setup: func() { - request.GrantTypes = fosite.Arguments{"refresh_token"} - mockTransactional. - EXPECT(). - BeginTX(propagatedContext). - Return(propagatedContext, nil). - Times(1) - mockRevocationStore. - EXPECT(). - GetRefreshTokenSession(propagatedContext, gomock.Any(), nil). - Return(nil, fosite.ErrNotFound). - Times(1) - mockTransactional. - EXPECT(). - Rollback(propagatedContext). - Return(errors.New("Could not rollback transaction!")). - Times(1) - }, - expectError: fosite.ErrServerError, - }, - { - description: "should result in a server error if transaction cannot be committed", - setup: func() { - request.GrantTypes = fosite.Arguments{"refresh_token"} - mockTransactional. - EXPECT(). - BeginTX(propagatedContext). - Return(propagatedContext, nil). - Times(1) - mockRevocationStore. - EXPECT(). - GetRefreshTokenSession(propagatedContext, gomock.Any(), nil). - Return(request, nil). - Times(1) - mockRevocationStore. - EXPECT(). - RevokeAccessToken(propagatedContext, gomock.Any()). - Return(nil). - Times(1) - mockRevocationStore. - EXPECT(). - RevokeRefreshTokenMaybeGracePeriod(propagatedContext, gomock.Any(), gomock.Any()). - Return(nil). - Times(1) - mockRevocationStore. - EXPECT(). - CreateAccessTokenSession(propagatedContext, gomock.Any(), gomock.Any()). - Return(nil). - Times(1) - mockRevocationStore. - EXPECT(). - CreateRefreshTokenSession(propagatedContext, gomock.Any(), gomock.Any()). - Return(nil). - Times(1) - mockTransactional. - EXPECT(). - Commit(propagatedContext). - Return(errors.New("Could not commit transaction!")). - Times(1) - mockTransactional. - EXPECT(). - Rollback(propagatedContext). - Return(nil). - Times(1) - }, - expectError: fosite.ErrServerError, - }, - { - description: "should result in a `fosite.ErrInvalidRequest` if transaction fails to commit due to a " + - "`fosite.ErrSerializationFailure` error", - setup: func() { - request.GrantTypes = fosite.Arguments{"refresh_token"} - mockTransactional. - EXPECT(). - BeginTX(propagatedContext). - Return(propagatedContext, nil). - Times(1) - mockRevocationStore. - EXPECT(). - GetRefreshTokenSession(propagatedContext, gomock.Any(), nil). - Return(request, nil). - Times(1) - mockRevocationStore. - EXPECT(). - RevokeAccessToken(propagatedContext, gomock.Any()). - Return(nil). - Times(1) - mockRevocationStore. - EXPECT(). - RevokeRefreshTokenMaybeGracePeriod(propagatedContext, gomock.Any(), gomock.Any()). - Return(nil). - Times(1) - mockRevocationStore. - EXPECT(). - CreateAccessTokenSession(propagatedContext, gomock.Any(), gomock.Any()). - Return(nil). - Times(1) - mockRevocationStore. - EXPECT(). - CreateRefreshTokenSession(propagatedContext, gomock.Any(), gomock.Any()). - Return(nil). - Times(1) - mockTransactional. - EXPECT(). - Commit(propagatedContext). - Return(fosite.ErrSerializationFailure). - Times(1) - mockTransactional. - EXPECT(). - Rollback(propagatedContext). - Return(nil). - Times(1) - }, - expectError: fosite.ErrInvalidRequest, - }, - } { - t.Run(fmt.Sprintf("scenario=%s", testCase.description), func(t *testing.T) { - ctrl := gomock.NewController(t) - defer ctrl.Finish() - - mockTransactional = internal.NewMockTransactional(ctrl) - mockRevocationStore = internal.NewMockTokenRevocationStorage(ctrl) - testCase.setup() - - handler := RefreshTokenGrantHandler{ - // Notice how we are passing in a store that has support for transactions! - TokenRevocationStorage: transactionalStore{ - mockTransactional, - mockRevocationStore, - }, - AccessTokenStrategy: &hmacshaStrategy, - RefreshTokenStrategy: &hmacshaStrategy, - Config: &fosite.Config{ - AccessTokenLifespan: time.Hour, - ScopeStrategy: fosite.HierarchicScopeStrategy, - AudienceMatchingStrategy: fosite.DefaultAudienceMatchingStrategy, - }, - } - - if err := handler.PopulateTokenEndpointResponse(propagatedContext, request, response); testCase.expectError != nil { - assert.EqualError(t, err, testCase.expectError.Error()) - } - }) - } -} diff --git a/internal/access_request.go b/internal/access_request.go index fd05e542..9faa921d 100644 --- a/internal/access_request.go +++ b/internal/access_request.go @@ -1,6 +1,3 @@ -// Copyright © 2024 Ory Corp -// SPDX-License-Identifier: Apache-2.0 - // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ory/fosite (interfaces: AccessRequester) @@ -13,46 +10,45 @@ import ( time "time" gomock "github.com/golang/mock/gomock" - fosite "github.com/ory/fosite" ) -// MockAccessRequester is a mock of AccessRequester interface. +// MockAccessRequester is a mock of AccessRequester interface type MockAccessRequester struct { ctrl *gomock.Controller recorder *MockAccessRequesterMockRecorder } -// MockAccessRequesterMockRecorder is the mock recorder for MockAccessRequester. +// MockAccessRequesterMockRecorder is the mock recorder for MockAccessRequester type MockAccessRequesterMockRecorder struct { mock *MockAccessRequester } -// NewMockAccessRequester creates a new mock instance. +// NewMockAccessRequester creates a new mock instance func NewMockAccessRequester(ctrl *gomock.Controller) *MockAccessRequester { mock := &MockAccessRequester{ctrl: ctrl} mock.recorder = &MockAccessRequesterMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use. +// EXPECT returns an object that allows the caller to indicate expected use func (m *MockAccessRequester) EXPECT() *MockAccessRequesterMockRecorder { return m.recorder } -// AppendRequestedScope mocks base method. +// AppendRequestedScope mocks base method func (m *MockAccessRequester) AppendRequestedScope(arg0 string) { m.ctrl.T.Helper() m.ctrl.Call(m, "AppendRequestedScope", arg0) } -// AppendRequestedScope indicates an expected call of AppendRequestedScope. +// AppendRequestedScope indicates an expected call of AppendRequestedScope func (mr *MockAccessRequesterMockRecorder) AppendRequestedScope(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AppendRequestedScope", reflect.TypeOf((*MockAccessRequester)(nil).AppendRequestedScope), arg0) } -// GetClient mocks base method. +// GetClient mocks base method func (m *MockAccessRequester) GetClient() fosite.Client { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetClient") @@ -60,13 +56,13 @@ func (m *MockAccessRequester) GetClient() fosite.Client { return ret0 } -// GetClient indicates an expected call of GetClient. +// GetClient indicates an expected call of GetClient func (mr *MockAccessRequesterMockRecorder) GetClient() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetClient", reflect.TypeOf((*MockAccessRequester)(nil).GetClient)) } -// GetGrantTypes mocks base method. +// GetGrantTypes mocks base method func (m *MockAccessRequester) GetGrantTypes() fosite.Arguments { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetGrantTypes") @@ -74,13 +70,13 @@ func (m *MockAccessRequester) GetGrantTypes() fosite.Arguments { return ret0 } -// GetGrantTypes indicates an expected call of GetGrantTypes. +// GetGrantTypes indicates an expected call of GetGrantTypes func (mr *MockAccessRequesterMockRecorder) GetGrantTypes() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetGrantTypes", reflect.TypeOf((*MockAccessRequester)(nil).GetGrantTypes)) } -// GetGrantedAudience mocks base method. +// GetGrantedAudience mocks base method func (m *MockAccessRequester) GetGrantedAudience() fosite.Arguments { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetGrantedAudience") @@ -88,13 +84,13 @@ func (m *MockAccessRequester) GetGrantedAudience() fosite.Arguments { return ret0 } -// GetGrantedAudience indicates an expected call of GetGrantedAudience. +// GetGrantedAudience indicates an expected call of GetGrantedAudience func (mr *MockAccessRequesterMockRecorder) GetGrantedAudience() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetGrantedAudience", reflect.TypeOf((*MockAccessRequester)(nil).GetGrantedAudience)) } -// GetGrantedScopes mocks base method. +// GetGrantedScopes mocks base method func (m *MockAccessRequester) GetGrantedScopes() fosite.Arguments { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetGrantedScopes") @@ -102,13 +98,13 @@ func (m *MockAccessRequester) GetGrantedScopes() fosite.Arguments { return ret0 } -// GetGrantedScopes indicates an expected call of GetGrantedScopes. +// GetGrantedScopes indicates an expected call of GetGrantedScopes func (mr *MockAccessRequesterMockRecorder) GetGrantedScopes() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetGrantedScopes", reflect.TypeOf((*MockAccessRequester)(nil).GetGrantedScopes)) } -// GetID mocks base method. +// GetID mocks base method func (m *MockAccessRequester) GetID() string { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetID") @@ -116,13 +112,13 @@ func (m *MockAccessRequester) GetID() string { return ret0 } -// GetID indicates an expected call of GetID. +// GetID indicates an expected call of GetID func (mr *MockAccessRequesterMockRecorder) GetID() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetID", reflect.TypeOf((*MockAccessRequester)(nil).GetID)) } -// GetRequestForm mocks base method. +// GetRequestForm mocks base method func (m *MockAccessRequester) GetRequestForm() url.Values { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetRequestForm") @@ -130,13 +126,13 @@ func (m *MockAccessRequester) GetRequestForm() url.Values { return ret0 } -// GetRequestForm indicates an expected call of GetRequestForm. +// GetRequestForm indicates an expected call of GetRequestForm func (mr *MockAccessRequesterMockRecorder) GetRequestForm() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetRequestForm", reflect.TypeOf((*MockAccessRequester)(nil).GetRequestForm)) } -// GetRequestedAt mocks base method. +// GetRequestedAt mocks base method func (m *MockAccessRequester) GetRequestedAt() time.Time { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetRequestedAt") @@ -144,13 +140,13 @@ func (m *MockAccessRequester) GetRequestedAt() time.Time { return ret0 } -// GetRequestedAt indicates an expected call of GetRequestedAt. +// GetRequestedAt indicates an expected call of GetRequestedAt func (mr *MockAccessRequesterMockRecorder) GetRequestedAt() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetRequestedAt", reflect.TypeOf((*MockAccessRequester)(nil).GetRequestedAt)) } -// GetRequestedAudience mocks base method. +// GetRequestedAudience mocks base method func (m *MockAccessRequester) GetRequestedAudience() fosite.Arguments { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetRequestedAudience") @@ -158,13 +154,13 @@ func (m *MockAccessRequester) GetRequestedAudience() fosite.Arguments { return ret0 } -// GetRequestedAudience indicates an expected call of GetRequestedAudience. +// GetRequestedAudience indicates an expected call of GetRequestedAudience func (mr *MockAccessRequesterMockRecorder) GetRequestedAudience() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetRequestedAudience", reflect.TypeOf((*MockAccessRequester)(nil).GetRequestedAudience)) } -// GetRequestedScopes mocks base method. +// GetRequestedScopes mocks base method func (m *MockAccessRequester) GetRequestedScopes() fosite.Arguments { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetRequestedScopes") @@ -172,13 +168,13 @@ func (m *MockAccessRequester) GetRequestedScopes() fosite.Arguments { return ret0 } -// GetRequestedScopes indicates an expected call of GetRequestedScopes. +// GetRequestedScopes indicates an expected call of GetRequestedScopes func (mr *MockAccessRequesterMockRecorder) GetRequestedScopes() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetRequestedScopes", reflect.TypeOf((*MockAccessRequester)(nil).GetRequestedScopes)) } -// GetSession mocks base method. +// GetSession mocks base method func (m *MockAccessRequester) GetSession() fosite.Session { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetSession") @@ -186,49 +182,49 @@ func (m *MockAccessRequester) GetSession() fosite.Session { return ret0 } -// GetSession indicates an expected call of GetSession. +// GetSession indicates an expected call of GetSession func (mr *MockAccessRequesterMockRecorder) GetSession() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSession", reflect.TypeOf((*MockAccessRequester)(nil).GetSession)) } -// GrantAudience mocks base method. +// GrantAudience mocks base method func (m *MockAccessRequester) GrantAudience(arg0 string) { m.ctrl.T.Helper() m.ctrl.Call(m, "GrantAudience", arg0) } -// GrantAudience indicates an expected call of GrantAudience. +// GrantAudience indicates an expected call of GrantAudience func (mr *MockAccessRequesterMockRecorder) GrantAudience(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GrantAudience", reflect.TypeOf((*MockAccessRequester)(nil).GrantAudience), arg0) } -// GrantScope mocks base method. +// GrantScope mocks base method func (m *MockAccessRequester) GrantScope(arg0 string) { m.ctrl.T.Helper() m.ctrl.Call(m, "GrantScope", arg0) } -// GrantScope indicates an expected call of GrantScope. +// GrantScope indicates an expected call of GrantScope func (mr *MockAccessRequesterMockRecorder) GrantScope(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GrantScope", reflect.TypeOf((*MockAccessRequester)(nil).GrantScope), arg0) } -// Merge mocks base method. +// Merge mocks base method func (m *MockAccessRequester) Merge(arg0 fosite.Requester) { m.ctrl.T.Helper() m.ctrl.Call(m, "Merge", arg0) } -// Merge indicates an expected call of Merge. +// Merge indicates an expected call of Merge func (mr *MockAccessRequesterMockRecorder) Merge(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Merge", reflect.TypeOf((*MockAccessRequester)(nil).Merge), arg0) } -// Sanitize mocks base method. +// Sanitize mocks base method func (m *MockAccessRequester) Sanitize(arg0 []string) fosite.Requester { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Sanitize", arg0) @@ -236,55 +232,55 @@ func (m *MockAccessRequester) Sanitize(arg0 []string) fosite.Requester { return ret0 } -// Sanitize indicates an expected call of Sanitize. +// Sanitize indicates an expected call of Sanitize func (mr *MockAccessRequesterMockRecorder) Sanitize(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Sanitize", reflect.TypeOf((*MockAccessRequester)(nil).Sanitize), arg0) } -// SetID mocks base method. +// SetID mocks base method func (m *MockAccessRequester) SetID(arg0 string) { m.ctrl.T.Helper() m.ctrl.Call(m, "SetID", arg0) } -// SetID indicates an expected call of SetID. +// SetID indicates an expected call of SetID func (mr *MockAccessRequesterMockRecorder) SetID(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetID", reflect.TypeOf((*MockAccessRequester)(nil).SetID), arg0) } -// SetRequestedAudience mocks base method. +// SetRequestedAudience mocks base method func (m *MockAccessRequester) SetRequestedAudience(arg0 fosite.Arguments) { m.ctrl.T.Helper() m.ctrl.Call(m, "SetRequestedAudience", arg0) } -// SetRequestedAudience indicates an expected call of SetRequestedAudience. +// SetRequestedAudience indicates an expected call of SetRequestedAudience func (mr *MockAccessRequesterMockRecorder) SetRequestedAudience(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetRequestedAudience", reflect.TypeOf((*MockAccessRequester)(nil).SetRequestedAudience), arg0) } -// SetRequestedScopes mocks base method. +// SetRequestedScopes mocks base method func (m *MockAccessRequester) SetRequestedScopes(arg0 fosite.Arguments) { m.ctrl.T.Helper() m.ctrl.Call(m, "SetRequestedScopes", arg0) } -// SetRequestedScopes indicates an expected call of SetRequestedScopes. +// SetRequestedScopes indicates an expected call of SetRequestedScopes func (mr *MockAccessRequesterMockRecorder) SetRequestedScopes(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetRequestedScopes", reflect.TypeOf((*MockAccessRequester)(nil).SetRequestedScopes), arg0) } -// SetSession mocks base method. +// SetSession mocks base method func (m *MockAccessRequester) SetSession(arg0 fosite.Session) { m.ctrl.T.Helper() m.ctrl.Call(m, "SetSession", arg0) } -// SetSession indicates an expected call of SetSession. +// SetSession indicates an expected call of SetSession func (mr *MockAccessRequesterMockRecorder) SetSession(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetSession", reflect.TypeOf((*MockAccessRequester)(nil).SetSession), arg0) diff --git a/internal/access_response.go b/internal/access_response.go index 340c2476..928d7fba 100644 --- a/internal/access_response.go +++ b/internal/access_response.go @@ -1,6 +1,3 @@ -// Copyright © 2024 Ory Corp -// SPDX-License-Identifier: Apache-2.0 - // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ory/fosite (interfaces: AccessResponder) @@ -12,34 +9,33 @@ import ( time "time" gomock "github.com/golang/mock/gomock" - fosite "github.com/ory/fosite" ) -// MockAccessResponder is a mock of AccessResponder interface. +// MockAccessResponder is a mock of AccessResponder interface type MockAccessResponder struct { ctrl *gomock.Controller recorder *MockAccessResponderMockRecorder } -// MockAccessResponderMockRecorder is the mock recorder for MockAccessResponder. +// MockAccessResponderMockRecorder is the mock recorder for MockAccessResponder type MockAccessResponderMockRecorder struct { mock *MockAccessResponder } -// NewMockAccessResponder creates a new mock instance. +// NewMockAccessResponder creates a new mock instance func NewMockAccessResponder(ctrl *gomock.Controller) *MockAccessResponder { mock := &MockAccessResponder{ctrl: ctrl} mock.recorder = &MockAccessResponderMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use. +// EXPECT returns an object that allows the caller to indicate expected use func (m *MockAccessResponder) EXPECT() *MockAccessResponderMockRecorder { return m.recorder } -// GetAccessToken mocks base method. +// GetAccessToken mocks base method func (m *MockAccessResponder) GetAccessToken() string { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetAccessToken") @@ -47,13 +43,13 @@ func (m *MockAccessResponder) GetAccessToken() string { return ret0 } -// GetAccessToken indicates an expected call of GetAccessToken. +// GetAccessToken indicates an expected call of GetAccessToken func (mr *MockAccessResponderMockRecorder) GetAccessToken() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAccessToken", reflect.TypeOf((*MockAccessResponder)(nil).GetAccessToken)) } -// GetExtra mocks base method. +// GetExtra mocks base method func (m *MockAccessResponder) GetExtra(arg0 string) interface{} { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetExtra", arg0) @@ -61,13 +57,13 @@ func (m *MockAccessResponder) GetExtra(arg0 string) interface{} { return ret0 } -// GetExtra indicates an expected call of GetExtra. +// GetExtra indicates an expected call of GetExtra func (mr *MockAccessResponderMockRecorder) GetExtra(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetExtra", reflect.TypeOf((*MockAccessResponder)(nil).GetExtra), arg0) } -// GetTokenType mocks base method. +// GetTokenType mocks base method func (m *MockAccessResponder) GetTokenType() string { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetTokenType") @@ -75,73 +71,73 @@ func (m *MockAccessResponder) GetTokenType() string { return ret0 } -// GetTokenType indicates an expected call of GetTokenType. +// GetTokenType indicates an expected call of GetTokenType func (mr *MockAccessResponderMockRecorder) GetTokenType() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTokenType", reflect.TypeOf((*MockAccessResponder)(nil).GetTokenType)) } -// SetAccessToken mocks base method. +// SetAccessToken mocks base method func (m *MockAccessResponder) SetAccessToken(arg0 string) { m.ctrl.T.Helper() m.ctrl.Call(m, "SetAccessToken", arg0) } -// SetAccessToken indicates an expected call of SetAccessToken. +// SetAccessToken indicates an expected call of SetAccessToken func (mr *MockAccessResponderMockRecorder) SetAccessToken(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetAccessToken", reflect.TypeOf((*MockAccessResponder)(nil).SetAccessToken), arg0) } -// SetExpiresIn mocks base method. +// SetExpiresIn mocks base method func (m *MockAccessResponder) SetExpiresIn(arg0 time.Duration) { m.ctrl.T.Helper() m.ctrl.Call(m, "SetExpiresIn", arg0) } -// SetExpiresIn indicates an expected call of SetExpiresIn. +// SetExpiresIn indicates an expected call of SetExpiresIn func (mr *MockAccessResponderMockRecorder) SetExpiresIn(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetExpiresIn", reflect.TypeOf((*MockAccessResponder)(nil).SetExpiresIn), arg0) } -// SetExtra mocks base method. +// SetExtra mocks base method func (m *MockAccessResponder) SetExtra(arg0 string, arg1 interface{}) { m.ctrl.T.Helper() m.ctrl.Call(m, "SetExtra", arg0, arg1) } -// SetExtra indicates an expected call of SetExtra. +// SetExtra indicates an expected call of SetExtra func (mr *MockAccessResponderMockRecorder) SetExtra(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetExtra", reflect.TypeOf((*MockAccessResponder)(nil).SetExtra), arg0, arg1) } -// SetScopes mocks base method. +// SetScopes mocks base method func (m *MockAccessResponder) SetScopes(arg0 fosite.Arguments) { m.ctrl.T.Helper() m.ctrl.Call(m, "SetScopes", arg0) } -// SetScopes indicates an expected call of SetScopes. +// SetScopes indicates an expected call of SetScopes func (mr *MockAccessResponderMockRecorder) SetScopes(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetScopes", reflect.TypeOf((*MockAccessResponder)(nil).SetScopes), arg0) } -// SetTokenType mocks base method. +// SetTokenType mocks base method func (m *MockAccessResponder) SetTokenType(arg0 string) { m.ctrl.T.Helper() m.ctrl.Call(m, "SetTokenType", arg0) } -// SetTokenType indicates an expected call of SetTokenType. +// SetTokenType indicates an expected call of SetTokenType func (mr *MockAccessResponderMockRecorder) SetTokenType(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetTokenType", reflect.TypeOf((*MockAccessResponder)(nil).SetTokenType), arg0) } -// ToMap mocks base method. +// ToMap mocks base method func (m *MockAccessResponder) ToMap() map[string]interface{} { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ToMap") @@ -149,7 +145,7 @@ func (m *MockAccessResponder) ToMap() map[string]interface{} { return ret0 } -// ToMap indicates an expected call of ToMap. +// ToMap indicates an expected call of ToMap func (mr *MockAccessResponderMockRecorder) ToMap() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ToMap", reflect.TypeOf((*MockAccessResponder)(nil).ToMap)) diff --git a/internal/access_token_storage.go b/internal/access_token_storage.go index 38542453..af63d36f 100644 --- a/internal/access_token_storage.go +++ b/internal/access_token_storage.go @@ -1,6 +1,3 @@ -// Copyright © 2024 Ory Corp -// SPDX-License-Identifier: Apache-2.0 - // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ory/fosite/handler/oauth2 (interfaces: AccessTokenStorage) @@ -12,34 +9,33 @@ import ( reflect "reflect" gomock "github.com/golang/mock/gomock" - fosite "github.com/ory/fosite" ) -// MockAccessTokenStorage is a mock of AccessTokenStorage interface. +// MockAccessTokenStorage is a mock of AccessTokenStorage interface type MockAccessTokenStorage struct { ctrl *gomock.Controller recorder *MockAccessTokenStorageMockRecorder } -// MockAccessTokenStorageMockRecorder is the mock recorder for MockAccessTokenStorage. +// MockAccessTokenStorageMockRecorder is the mock recorder for MockAccessTokenStorage type MockAccessTokenStorageMockRecorder struct { mock *MockAccessTokenStorage } -// NewMockAccessTokenStorage creates a new mock instance. +// NewMockAccessTokenStorage creates a new mock instance func NewMockAccessTokenStorage(ctrl *gomock.Controller) *MockAccessTokenStorage { mock := &MockAccessTokenStorage{ctrl: ctrl} mock.recorder = &MockAccessTokenStorageMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use. +// EXPECT returns an object that allows the caller to indicate expected use func (m *MockAccessTokenStorage) EXPECT() *MockAccessTokenStorageMockRecorder { return m.recorder } -// CreateAccessTokenSession mocks base method. +// CreateAccessTokenSession mocks base method func (m *MockAccessTokenStorage) CreateAccessTokenSession(arg0 context.Context, arg1 string, arg2 fosite.Requester) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "CreateAccessTokenSession", arg0, arg1, arg2) @@ -47,13 +43,13 @@ func (m *MockAccessTokenStorage) CreateAccessTokenSession(arg0 context.Context, return ret0 } -// CreateAccessTokenSession indicates an expected call of CreateAccessTokenSession. +// CreateAccessTokenSession indicates an expected call of CreateAccessTokenSession func (mr *MockAccessTokenStorageMockRecorder) CreateAccessTokenSession(arg0, arg1, arg2 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateAccessTokenSession", reflect.TypeOf((*MockAccessTokenStorage)(nil).CreateAccessTokenSession), arg0, arg1, arg2) } -// DeleteAccessTokenSession mocks base method. +// DeleteAccessTokenSession mocks base method func (m *MockAccessTokenStorage) DeleteAccessTokenSession(arg0 context.Context, arg1 string) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "DeleteAccessTokenSession", arg0, arg1) @@ -61,13 +57,13 @@ func (m *MockAccessTokenStorage) DeleteAccessTokenSession(arg0 context.Context, return ret0 } -// DeleteAccessTokenSession indicates an expected call of DeleteAccessTokenSession. +// DeleteAccessTokenSession indicates an expected call of DeleteAccessTokenSession func (mr *MockAccessTokenStorageMockRecorder) DeleteAccessTokenSession(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteAccessTokenSession", reflect.TypeOf((*MockAccessTokenStorage)(nil).DeleteAccessTokenSession), arg0, arg1) } -// GetAccessTokenSession mocks base method. +// GetAccessTokenSession mocks base method func (m *MockAccessTokenStorage) GetAccessTokenSession(arg0 context.Context, arg1 string, arg2 fosite.Session) (fosite.Requester, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetAccessTokenSession", arg0, arg1, arg2) @@ -76,7 +72,7 @@ func (m *MockAccessTokenStorage) GetAccessTokenSession(arg0 context.Context, arg return ret0, ret1 } -// GetAccessTokenSession indicates an expected call of GetAccessTokenSession. +// GetAccessTokenSession indicates an expected call of GetAccessTokenSession func (mr *MockAccessTokenStorageMockRecorder) GetAccessTokenSession(arg0, arg1, arg2 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAccessTokenSession", reflect.TypeOf((*MockAccessTokenStorage)(nil).GetAccessTokenSession), arg0, arg1, arg2) diff --git a/internal/access_token_strategy.go b/internal/access_token_strategy.go index d8c64c9b..ee950dda 100644 --- a/internal/access_token_strategy.go +++ b/internal/access_token_strategy.go @@ -1,6 +1,3 @@ -// Copyright © 2024 Ory Corp -// SPDX-License-Identifier: Apache-2.0 - // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ory/fosite/handler/oauth2 (interfaces: AccessTokenStrategy) @@ -12,34 +9,33 @@ import ( reflect "reflect" gomock "github.com/golang/mock/gomock" - fosite "github.com/ory/fosite" ) -// MockAccessTokenStrategy is a mock of AccessTokenStrategy interface. +// MockAccessTokenStrategy is a mock of AccessTokenStrategy interface type MockAccessTokenStrategy struct { ctrl *gomock.Controller recorder *MockAccessTokenStrategyMockRecorder } -// MockAccessTokenStrategyMockRecorder is the mock recorder for MockAccessTokenStrategy. +// MockAccessTokenStrategyMockRecorder is the mock recorder for MockAccessTokenStrategy type MockAccessTokenStrategyMockRecorder struct { mock *MockAccessTokenStrategy } -// NewMockAccessTokenStrategy creates a new mock instance. +// NewMockAccessTokenStrategy creates a new mock instance func NewMockAccessTokenStrategy(ctrl *gomock.Controller) *MockAccessTokenStrategy { mock := &MockAccessTokenStrategy{ctrl: ctrl} mock.recorder = &MockAccessTokenStrategyMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use. +// EXPECT returns an object that allows the caller to indicate expected use func (m *MockAccessTokenStrategy) EXPECT() *MockAccessTokenStrategyMockRecorder { return m.recorder } -// AccessTokenSignature mocks base method. +// AccessTokenSignature mocks base method func (m *MockAccessTokenStrategy) AccessTokenSignature(arg0 context.Context, arg1 string) string { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "AccessTokenSignature", arg0, arg1) @@ -47,13 +43,13 @@ func (m *MockAccessTokenStrategy) AccessTokenSignature(arg0 context.Context, arg return ret0 } -// AccessTokenSignature indicates an expected call of AccessTokenSignature. +// AccessTokenSignature indicates an expected call of AccessTokenSignature func (mr *MockAccessTokenStrategyMockRecorder) AccessTokenSignature(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AccessTokenSignature", reflect.TypeOf((*MockAccessTokenStrategy)(nil).AccessTokenSignature), arg0, arg1) } -// GenerateAccessToken mocks base method. +// GenerateAccessToken mocks base method func (m *MockAccessTokenStrategy) GenerateAccessToken(arg0 context.Context, arg1 fosite.Requester) (string, string, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GenerateAccessToken", arg0, arg1) @@ -63,13 +59,13 @@ func (m *MockAccessTokenStrategy) GenerateAccessToken(arg0 context.Context, arg1 return ret0, ret1, ret2 } -// GenerateAccessToken indicates an expected call of GenerateAccessToken. +// GenerateAccessToken indicates an expected call of GenerateAccessToken func (mr *MockAccessTokenStrategyMockRecorder) GenerateAccessToken(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GenerateAccessToken", reflect.TypeOf((*MockAccessTokenStrategy)(nil).GenerateAccessToken), arg0, arg1) } -// ValidateAccessToken mocks base method. +// ValidateAccessToken mocks base method func (m *MockAccessTokenStrategy) ValidateAccessToken(arg0 context.Context, arg1 fosite.Requester, arg2 string) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ValidateAccessToken", arg0, arg1, arg2) @@ -77,7 +73,7 @@ func (m *MockAccessTokenStrategy) ValidateAccessToken(arg0 context.Context, arg1 return ret0 } -// ValidateAccessToken indicates an expected call of ValidateAccessToken. +// ValidateAccessToken indicates an expected call of ValidateAccessToken func (mr *MockAccessTokenStrategyMockRecorder) ValidateAccessToken(arg0, arg1, arg2 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidateAccessToken", reflect.TypeOf((*MockAccessTokenStrategy)(nil).ValidateAccessToken), arg0, arg1, arg2) diff --git a/internal/authorize_code_storage.go b/internal/authorize_code_storage.go index 1543b682..a04b9e3f 100644 --- a/internal/authorize_code_storage.go +++ b/internal/authorize_code_storage.go @@ -1,6 +1,3 @@ -// Copyright © 2024 Ory Corp -// SPDX-License-Identifier: Apache-2.0 - // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ory/fosite/handler/oauth2 (interfaces: AuthorizeCodeStorage) @@ -12,34 +9,33 @@ import ( reflect "reflect" gomock "github.com/golang/mock/gomock" - fosite "github.com/ory/fosite" ) -// MockAuthorizeCodeStorage is a mock of AuthorizeCodeStorage interface. +// MockAuthorizeCodeStorage is a mock of AuthorizeCodeStorage interface type MockAuthorizeCodeStorage struct { ctrl *gomock.Controller recorder *MockAuthorizeCodeStorageMockRecorder } -// MockAuthorizeCodeStorageMockRecorder is the mock recorder for MockAuthorizeCodeStorage. +// MockAuthorizeCodeStorageMockRecorder is the mock recorder for MockAuthorizeCodeStorage type MockAuthorizeCodeStorageMockRecorder struct { mock *MockAuthorizeCodeStorage } -// NewMockAuthorizeCodeStorage creates a new mock instance. +// NewMockAuthorizeCodeStorage creates a new mock instance func NewMockAuthorizeCodeStorage(ctrl *gomock.Controller) *MockAuthorizeCodeStorage { mock := &MockAuthorizeCodeStorage{ctrl: ctrl} mock.recorder = &MockAuthorizeCodeStorageMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use. +// EXPECT returns an object that allows the caller to indicate expected use func (m *MockAuthorizeCodeStorage) EXPECT() *MockAuthorizeCodeStorageMockRecorder { return m.recorder } -// CreateAuthorizeCodeSession mocks base method. +// CreateAuthorizeCodeSession mocks base method func (m *MockAuthorizeCodeStorage) CreateAuthorizeCodeSession(arg0 context.Context, arg1 string, arg2 fosite.Requester) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "CreateAuthorizeCodeSession", arg0, arg1, arg2) @@ -47,13 +43,13 @@ func (m *MockAuthorizeCodeStorage) CreateAuthorizeCodeSession(arg0 context.Conte return ret0 } -// CreateAuthorizeCodeSession indicates an expected call of CreateAuthorizeCodeSession. +// CreateAuthorizeCodeSession indicates an expected call of CreateAuthorizeCodeSession func (mr *MockAuthorizeCodeStorageMockRecorder) CreateAuthorizeCodeSession(arg0, arg1, arg2 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateAuthorizeCodeSession", reflect.TypeOf((*MockAuthorizeCodeStorage)(nil).CreateAuthorizeCodeSession), arg0, arg1, arg2) } -// GetAuthorizeCodeSession mocks base method. +// GetAuthorizeCodeSession mocks base method func (m *MockAuthorizeCodeStorage) GetAuthorizeCodeSession(arg0 context.Context, arg1 string, arg2 fosite.Session) (fosite.Requester, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetAuthorizeCodeSession", arg0, arg1, arg2) @@ -62,13 +58,13 @@ func (m *MockAuthorizeCodeStorage) GetAuthorizeCodeSession(arg0 context.Context, return ret0, ret1 } -// GetAuthorizeCodeSession indicates an expected call of GetAuthorizeCodeSession. +// GetAuthorizeCodeSession indicates an expected call of GetAuthorizeCodeSession func (mr *MockAuthorizeCodeStorageMockRecorder) GetAuthorizeCodeSession(arg0, arg1, arg2 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAuthorizeCodeSession", reflect.TypeOf((*MockAuthorizeCodeStorage)(nil).GetAuthorizeCodeSession), arg0, arg1, arg2) } -// InvalidateAuthorizeCodeSession mocks base method. +// InvalidateAuthorizeCodeSession mocks base method func (m *MockAuthorizeCodeStorage) InvalidateAuthorizeCodeSession(arg0 context.Context, arg1 string) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "InvalidateAuthorizeCodeSession", arg0, arg1) @@ -76,7 +72,7 @@ func (m *MockAuthorizeCodeStorage) InvalidateAuthorizeCodeSession(arg0 context.C return ret0 } -// InvalidateAuthorizeCodeSession indicates an expected call of InvalidateAuthorizeCodeSession. +// InvalidateAuthorizeCodeSession indicates an expected call of InvalidateAuthorizeCodeSession func (mr *MockAuthorizeCodeStorageMockRecorder) InvalidateAuthorizeCodeSession(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InvalidateAuthorizeCodeSession", reflect.TypeOf((*MockAuthorizeCodeStorage)(nil).InvalidateAuthorizeCodeSession), arg0, arg1) diff --git a/internal/authorize_code_strategy.go b/internal/authorize_code_strategy.go index 44edd644..351a74c2 100644 --- a/internal/authorize_code_strategy.go +++ b/internal/authorize_code_strategy.go @@ -1,6 +1,3 @@ -// Copyright © 2024 Ory Corp -// SPDX-License-Identifier: Apache-2.0 - // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ory/fosite/handler/oauth2 (interfaces: AuthorizeCodeStrategy) @@ -12,34 +9,33 @@ import ( reflect "reflect" gomock "github.com/golang/mock/gomock" - fosite "github.com/ory/fosite" ) -// MockAuthorizeCodeStrategy is a mock of AuthorizeCodeStrategy interface. +// MockAuthorizeCodeStrategy is a mock of AuthorizeCodeStrategy interface type MockAuthorizeCodeStrategy struct { ctrl *gomock.Controller recorder *MockAuthorizeCodeStrategyMockRecorder } -// MockAuthorizeCodeStrategyMockRecorder is the mock recorder for MockAuthorizeCodeStrategy. +// MockAuthorizeCodeStrategyMockRecorder is the mock recorder for MockAuthorizeCodeStrategy type MockAuthorizeCodeStrategyMockRecorder struct { mock *MockAuthorizeCodeStrategy } -// NewMockAuthorizeCodeStrategy creates a new mock instance. +// NewMockAuthorizeCodeStrategy creates a new mock instance func NewMockAuthorizeCodeStrategy(ctrl *gomock.Controller) *MockAuthorizeCodeStrategy { mock := &MockAuthorizeCodeStrategy{ctrl: ctrl} mock.recorder = &MockAuthorizeCodeStrategyMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use. +// EXPECT returns an object that allows the caller to indicate expected use func (m *MockAuthorizeCodeStrategy) EXPECT() *MockAuthorizeCodeStrategyMockRecorder { return m.recorder } -// AuthorizeCodeSignature mocks base method. +// AuthorizeCodeSignature mocks base method func (m *MockAuthorizeCodeStrategy) AuthorizeCodeSignature(arg0 context.Context, arg1 string) string { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "AuthorizeCodeSignature", arg0, arg1) @@ -47,13 +43,13 @@ func (m *MockAuthorizeCodeStrategy) AuthorizeCodeSignature(arg0 context.Context, return ret0 } -// AuthorizeCodeSignature indicates an expected call of AuthorizeCodeSignature. +// AuthorizeCodeSignature indicates an expected call of AuthorizeCodeSignature func (mr *MockAuthorizeCodeStrategyMockRecorder) AuthorizeCodeSignature(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AuthorizeCodeSignature", reflect.TypeOf((*MockAuthorizeCodeStrategy)(nil).AuthorizeCodeSignature), arg0, arg1) } -// GenerateAuthorizeCode mocks base method. +// GenerateAuthorizeCode mocks base method func (m *MockAuthorizeCodeStrategy) GenerateAuthorizeCode(arg0 context.Context, arg1 fosite.Requester) (string, string, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GenerateAuthorizeCode", arg0, arg1) @@ -63,13 +59,13 @@ func (m *MockAuthorizeCodeStrategy) GenerateAuthorizeCode(arg0 context.Context, return ret0, ret1, ret2 } -// GenerateAuthorizeCode indicates an expected call of GenerateAuthorizeCode. +// GenerateAuthorizeCode indicates an expected call of GenerateAuthorizeCode func (mr *MockAuthorizeCodeStrategyMockRecorder) GenerateAuthorizeCode(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GenerateAuthorizeCode", reflect.TypeOf((*MockAuthorizeCodeStrategy)(nil).GenerateAuthorizeCode), arg0, arg1) } -// ValidateAuthorizeCode mocks base method. +// ValidateAuthorizeCode mocks base method func (m *MockAuthorizeCodeStrategy) ValidateAuthorizeCode(arg0 context.Context, arg1 fosite.Requester, arg2 string) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ValidateAuthorizeCode", arg0, arg1, arg2) @@ -77,7 +73,7 @@ func (m *MockAuthorizeCodeStrategy) ValidateAuthorizeCode(arg0 context.Context, return ret0 } -// ValidateAuthorizeCode indicates an expected call of ValidateAuthorizeCode. +// ValidateAuthorizeCode indicates an expected call of ValidateAuthorizeCode func (mr *MockAuthorizeCodeStrategyMockRecorder) ValidateAuthorizeCode(arg0, arg1, arg2 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidateAuthorizeCode", reflect.TypeOf((*MockAuthorizeCodeStrategy)(nil).ValidateAuthorizeCode), arg0, arg1, arg2) diff --git a/internal/authorize_handler.go b/internal/authorize_handler.go index d7420fed..4f0f9a8f 100644 --- a/internal/authorize_handler.go +++ b/internal/authorize_handler.go @@ -1,6 +1,3 @@ -// Copyright © 2024 Ory Corp -// SPDX-License-Identifier: Apache-2.0 - // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ory/fosite (interfaces: AuthorizeEndpointHandler) @@ -12,34 +9,33 @@ import ( reflect "reflect" gomock "github.com/golang/mock/gomock" - fosite "github.com/ory/fosite" ) -// MockAuthorizeEndpointHandler is a mock of AuthorizeEndpointHandler interface. +// MockAuthorizeEndpointHandler is a mock of AuthorizeEndpointHandler interface type MockAuthorizeEndpointHandler struct { ctrl *gomock.Controller recorder *MockAuthorizeEndpointHandlerMockRecorder } -// MockAuthorizeEndpointHandlerMockRecorder is the mock recorder for MockAuthorizeEndpointHandler. +// MockAuthorizeEndpointHandlerMockRecorder is the mock recorder for MockAuthorizeEndpointHandler type MockAuthorizeEndpointHandlerMockRecorder struct { mock *MockAuthorizeEndpointHandler } -// NewMockAuthorizeEndpointHandler creates a new mock instance. +// NewMockAuthorizeEndpointHandler creates a new mock instance func NewMockAuthorizeEndpointHandler(ctrl *gomock.Controller) *MockAuthorizeEndpointHandler { mock := &MockAuthorizeEndpointHandler{ctrl: ctrl} mock.recorder = &MockAuthorizeEndpointHandlerMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use. +// EXPECT returns an object that allows the caller to indicate expected use func (m *MockAuthorizeEndpointHandler) EXPECT() *MockAuthorizeEndpointHandlerMockRecorder { return m.recorder } -// HandleAuthorizeEndpointRequest mocks base method. +// HandleAuthorizeEndpointRequest mocks base method func (m *MockAuthorizeEndpointHandler) HandleAuthorizeEndpointRequest(arg0 context.Context, arg1 fosite.AuthorizeRequester, arg2 fosite.AuthorizeResponder) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "HandleAuthorizeEndpointRequest", arg0, arg1, arg2) @@ -47,7 +43,7 @@ func (m *MockAuthorizeEndpointHandler) HandleAuthorizeEndpointRequest(arg0 conte return ret0 } -// HandleAuthorizeEndpointRequest indicates an expected call of HandleAuthorizeEndpointRequest. +// HandleAuthorizeEndpointRequest indicates an expected call of HandleAuthorizeEndpointRequest func (mr *MockAuthorizeEndpointHandlerMockRecorder) HandleAuthorizeEndpointRequest(arg0, arg1, arg2 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HandleAuthorizeEndpointRequest", reflect.TypeOf((*MockAuthorizeEndpointHandler)(nil).HandleAuthorizeEndpointRequest), arg0, arg1, arg2) diff --git a/internal/authorize_request.go b/internal/authorize_request.go index 5cceafff..3134a77a 100644 --- a/internal/authorize_request.go +++ b/internal/authorize_request.go @@ -1,6 +1,3 @@ -// Copyright © 2024 Ory Corp -// SPDX-License-Identifier: Apache-2.0 - // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ory/fosite (interfaces: AuthorizeRequester) @@ -13,46 +10,45 @@ import ( time "time" gomock "github.com/golang/mock/gomock" - fosite "github.com/ory/fosite" ) -// MockAuthorizeRequester is a mock of AuthorizeRequester interface. +// MockAuthorizeRequester is a mock of AuthorizeRequester interface type MockAuthorizeRequester struct { ctrl *gomock.Controller recorder *MockAuthorizeRequesterMockRecorder } -// MockAuthorizeRequesterMockRecorder is the mock recorder for MockAuthorizeRequester. +// MockAuthorizeRequesterMockRecorder is the mock recorder for MockAuthorizeRequester type MockAuthorizeRequesterMockRecorder struct { mock *MockAuthorizeRequester } -// NewMockAuthorizeRequester creates a new mock instance. +// NewMockAuthorizeRequester creates a new mock instance func NewMockAuthorizeRequester(ctrl *gomock.Controller) *MockAuthorizeRequester { mock := &MockAuthorizeRequester{ctrl: ctrl} mock.recorder = &MockAuthorizeRequesterMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use. +// EXPECT returns an object that allows the caller to indicate expected use func (m *MockAuthorizeRequester) EXPECT() *MockAuthorizeRequesterMockRecorder { return m.recorder } -// AppendRequestedScope mocks base method. +// AppendRequestedScope mocks base method func (m *MockAuthorizeRequester) AppendRequestedScope(arg0 string) { m.ctrl.T.Helper() m.ctrl.Call(m, "AppendRequestedScope", arg0) } -// AppendRequestedScope indicates an expected call of AppendRequestedScope. +// AppendRequestedScope indicates an expected call of AppendRequestedScope func (mr *MockAuthorizeRequesterMockRecorder) AppendRequestedScope(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AppendRequestedScope", reflect.TypeOf((*MockAuthorizeRequester)(nil).AppendRequestedScope), arg0) } -// DidHandleAllResponseTypes mocks base method. +// DidHandleAllResponseTypes mocks base method func (m *MockAuthorizeRequester) DidHandleAllResponseTypes() bool { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "DidHandleAllResponseTypes") @@ -60,13 +56,13 @@ func (m *MockAuthorizeRequester) DidHandleAllResponseTypes() bool { return ret0 } -// DidHandleAllResponseTypes indicates an expected call of DidHandleAllResponseTypes. +// DidHandleAllResponseTypes indicates an expected call of DidHandleAllResponseTypes func (mr *MockAuthorizeRequesterMockRecorder) DidHandleAllResponseTypes() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DidHandleAllResponseTypes", reflect.TypeOf((*MockAuthorizeRequester)(nil).DidHandleAllResponseTypes)) } -// GetClient mocks base method. +// GetClient mocks base method func (m *MockAuthorizeRequester) GetClient() fosite.Client { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetClient") @@ -74,13 +70,13 @@ func (m *MockAuthorizeRequester) GetClient() fosite.Client { return ret0 } -// GetClient indicates an expected call of GetClient. +// GetClient indicates an expected call of GetClient func (mr *MockAuthorizeRequesterMockRecorder) GetClient() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetClient", reflect.TypeOf((*MockAuthorizeRequester)(nil).GetClient)) } -// GetDefaultResponseMode mocks base method. +// GetDefaultResponseMode mocks base method func (m *MockAuthorizeRequester) GetDefaultResponseMode() fosite.ResponseModeType { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetDefaultResponseMode") @@ -88,13 +84,13 @@ func (m *MockAuthorizeRequester) GetDefaultResponseMode() fosite.ResponseModeTyp return ret0 } -// GetDefaultResponseMode indicates an expected call of GetDefaultResponseMode. +// GetDefaultResponseMode indicates an expected call of GetDefaultResponseMode func (mr *MockAuthorizeRequesterMockRecorder) GetDefaultResponseMode() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetDefaultResponseMode", reflect.TypeOf((*MockAuthorizeRequester)(nil).GetDefaultResponseMode)) } -// GetGrantedAudience mocks base method. +// GetGrantedAudience mocks base method func (m *MockAuthorizeRequester) GetGrantedAudience() fosite.Arguments { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetGrantedAudience") @@ -102,13 +98,13 @@ func (m *MockAuthorizeRequester) GetGrantedAudience() fosite.Arguments { return ret0 } -// GetGrantedAudience indicates an expected call of GetGrantedAudience. +// GetGrantedAudience indicates an expected call of GetGrantedAudience func (mr *MockAuthorizeRequesterMockRecorder) GetGrantedAudience() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetGrantedAudience", reflect.TypeOf((*MockAuthorizeRequester)(nil).GetGrantedAudience)) } -// GetGrantedScopes mocks base method. +// GetGrantedScopes mocks base method func (m *MockAuthorizeRequester) GetGrantedScopes() fosite.Arguments { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetGrantedScopes") @@ -116,13 +112,13 @@ func (m *MockAuthorizeRequester) GetGrantedScopes() fosite.Arguments { return ret0 } -// GetGrantedScopes indicates an expected call of GetGrantedScopes. +// GetGrantedScopes indicates an expected call of GetGrantedScopes func (mr *MockAuthorizeRequesterMockRecorder) GetGrantedScopes() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetGrantedScopes", reflect.TypeOf((*MockAuthorizeRequester)(nil).GetGrantedScopes)) } -// GetID mocks base method. +// GetID mocks base method func (m *MockAuthorizeRequester) GetID() string { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetID") @@ -130,13 +126,13 @@ func (m *MockAuthorizeRequester) GetID() string { return ret0 } -// GetID indicates an expected call of GetID. +// GetID indicates an expected call of GetID func (mr *MockAuthorizeRequesterMockRecorder) GetID() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetID", reflect.TypeOf((*MockAuthorizeRequester)(nil).GetID)) } -// GetRedirectURI mocks base method. +// GetRedirectURI mocks base method func (m *MockAuthorizeRequester) GetRedirectURI() *url.URL { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetRedirectURI") @@ -144,13 +140,13 @@ func (m *MockAuthorizeRequester) GetRedirectURI() *url.URL { return ret0 } -// GetRedirectURI indicates an expected call of GetRedirectURI. +// GetRedirectURI indicates an expected call of GetRedirectURI func (mr *MockAuthorizeRequesterMockRecorder) GetRedirectURI() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetRedirectURI", reflect.TypeOf((*MockAuthorizeRequester)(nil).GetRedirectURI)) } -// GetRequestForm mocks base method. +// GetRequestForm mocks base method func (m *MockAuthorizeRequester) GetRequestForm() url.Values { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetRequestForm") @@ -158,13 +154,13 @@ func (m *MockAuthorizeRequester) GetRequestForm() url.Values { return ret0 } -// GetRequestForm indicates an expected call of GetRequestForm. +// GetRequestForm indicates an expected call of GetRequestForm func (mr *MockAuthorizeRequesterMockRecorder) GetRequestForm() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetRequestForm", reflect.TypeOf((*MockAuthorizeRequester)(nil).GetRequestForm)) } -// GetRequestedAt mocks base method. +// GetRequestedAt mocks base method func (m *MockAuthorizeRequester) GetRequestedAt() time.Time { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetRequestedAt") @@ -172,13 +168,13 @@ func (m *MockAuthorizeRequester) GetRequestedAt() time.Time { return ret0 } -// GetRequestedAt indicates an expected call of GetRequestedAt. +// GetRequestedAt indicates an expected call of GetRequestedAt func (mr *MockAuthorizeRequesterMockRecorder) GetRequestedAt() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetRequestedAt", reflect.TypeOf((*MockAuthorizeRequester)(nil).GetRequestedAt)) } -// GetRequestedAudience mocks base method. +// GetRequestedAudience mocks base method func (m *MockAuthorizeRequester) GetRequestedAudience() fosite.Arguments { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetRequestedAudience") @@ -186,13 +182,13 @@ func (m *MockAuthorizeRequester) GetRequestedAudience() fosite.Arguments { return ret0 } -// GetRequestedAudience indicates an expected call of GetRequestedAudience. +// GetRequestedAudience indicates an expected call of GetRequestedAudience func (mr *MockAuthorizeRequesterMockRecorder) GetRequestedAudience() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetRequestedAudience", reflect.TypeOf((*MockAuthorizeRequester)(nil).GetRequestedAudience)) } -// GetRequestedScopes mocks base method. +// GetRequestedScopes mocks base method func (m *MockAuthorizeRequester) GetRequestedScopes() fosite.Arguments { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetRequestedScopes") @@ -200,13 +196,13 @@ func (m *MockAuthorizeRequester) GetRequestedScopes() fosite.Arguments { return ret0 } -// GetRequestedScopes indicates an expected call of GetRequestedScopes. +// GetRequestedScopes indicates an expected call of GetRequestedScopes func (mr *MockAuthorizeRequesterMockRecorder) GetRequestedScopes() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetRequestedScopes", reflect.TypeOf((*MockAuthorizeRequester)(nil).GetRequestedScopes)) } -// GetResponseMode mocks base method. +// GetResponseMode mocks base method func (m *MockAuthorizeRequester) GetResponseMode() fosite.ResponseModeType { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetResponseMode") @@ -214,13 +210,13 @@ func (m *MockAuthorizeRequester) GetResponseMode() fosite.ResponseModeType { return ret0 } -// GetResponseMode indicates an expected call of GetResponseMode. +// GetResponseMode indicates an expected call of GetResponseMode func (mr *MockAuthorizeRequesterMockRecorder) GetResponseMode() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetResponseMode", reflect.TypeOf((*MockAuthorizeRequester)(nil).GetResponseMode)) } -// GetResponseTypes mocks base method. +// GetResponseTypes mocks base method func (m *MockAuthorizeRequester) GetResponseTypes() fosite.Arguments { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetResponseTypes") @@ -228,13 +224,13 @@ func (m *MockAuthorizeRequester) GetResponseTypes() fosite.Arguments { return ret0 } -// GetResponseTypes indicates an expected call of GetResponseTypes. +// GetResponseTypes indicates an expected call of GetResponseTypes func (mr *MockAuthorizeRequesterMockRecorder) GetResponseTypes() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetResponseTypes", reflect.TypeOf((*MockAuthorizeRequester)(nil).GetResponseTypes)) } -// GetSession mocks base method. +// GetSession mocks base method func (m *MockAuthorizeRequester) GetSession() fosite.Session { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetSession") @@ -242,13 +238,13 @@ func (m *MockAuthorizeRequester) GetSession() fosite.Session { return ret0 } -// GetSession indicates an expected call of GetSession. +// GetSession indicates an expected call of GetSession func (mr *MockAuthorizeRequesterMockRecorder) GetSession() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSession", reflect.TypeOf((*MockAuthorizeRequester)(nil).GetSession)) } -// GetState mocks base method. +// GetState mocks base method func (m *MockAuthorizeRequester) GetState() string { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetState") @@ -256,37 +252,37 @@ func (m *MockAuthorizeRequester) GetState() string { return ret0 } -// GetState indicates an expected call of GetState. +// GetState indicates an expected call of GetState func (mr *MockAuthorizeRequesterMockRecorder) GetState() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetState", reflect.TypeOf((*MockAuthorizeRequester)(nil).GetState)) } -// GrantAudience mocks base method. +// GrantAudience mocks base method func (m *MockAuthorizeRequester) GrantAudience(arg0 string) { m.ctrl.T.Helper() m.ctrl.Call(m, "GrantAudience", arg0) } -// GrantAudience indicates an expected call of GrantAudience. +// GrantAudience indicates an expected call of GrantAudience func (mr *MockAuthorizeRequesterMockRecorder) GrantAudience(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GrantAudience", reflect.TypeOf((*MockAuthorizeRequester)(nil).GrantAudience), arg0) } -// GrantScope mocks base method. +// GrantScope mocks base method func (m *MockAuthorizeRequester) GrantScope(arg0 string) { m.ctrl.T.Helper() m.ctrl.Call(m, "GrantScope", arg0) } -// GrantScope indicates an expected call of GrantScope. +// GrantScope indicates an expected call of GrantScope func (mr *MockAuthorizeRequesterMockRecorder) GrantScope(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GrantScope", reflect.TypeOf((*MockAuthorizeRequester)(nil).GrantScope), arg0) } -// IsRedirectURIValid mocks base method. +// IsRedirectURIValid mocks base method func (m *MockAuthorizeRequester) IsRedirectURIValid() bool { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "IsRedirectURIValid") @@ -294,25 +290,25 @@ func (m *MockAuthorizeRequester) IsRedirectURIValid() bool { return ret0 } -// IsRedirectURIValid indicates an expected call of IsRedirectURIValid. +// IsRedirectURIValid indicates an expected call of IsRedirectURIValid func (mr *MockAuthorizeRequesterMockRecorder) IsRedirectURIValid() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsRedirectURIValid", reflect.TypeOf((*MockAuthorizeRequester)(nil).IsRedirectURIValid)) } -// Merge mocks base method. +// Merge mocks base method func (m *MockAuthorizeRequester) Merge(arg0 fosite.Requester) { m.ctrl.T.Helper() m.ctrl.Call(m, "Merge", arg0) } -// Merge indicates an expected call of Merge. +// Merge indicates an expected call of Merge func (mr *MockAuthorizeRequesterMockRecorder) Merge(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Merge", reflect.TypeOf((*MockAuthorizeRequester)(nil).Merge), arg0) } -// Sanitize mocks base method. +// Sanitize mocks base method func (m *MockAuthorizeRequester) Sanitize(arg0 []string) fosite.Requester { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Sanitize", arg0) @@ -320,79 +316,79 @@ func (m *MockAuthorizeRequester) Sanitize(arg0 []string) fosite.Requester { return ret0 } -// Sanitize indicates an expected call of Sanitize. +// Sanitize indicates an expected call of Sanitize func (mr *MockAuthorizeRequesterMockRecorder) Sanitize(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Sanitize", reflect.TypeOf((*MockAuthorizeRequester)(nil).Sanitize), arg0) } -// SetDefaultResponseMode mocks base method. +// SetDefaultResponseMode mocks base method func (m *MockAuthorizeRequester) SetDefaultResponseMode(arg0 fosite.ResponseModeType) { m.ctrl.T.Helper() m.ctrl.Call(m, "SetDefaultResponseMode", arg0) } -// SetDefaultResponseMode indicates an expected call of SetDefaultResponseMode. +// SetDefaultResponseMode indicates an expected call of SetDefaultResponseMode func (mr *MockAuthorizeRequesterMockRecorder) SetDefaultResponseMode(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetDefaultResponseMode", reflect.TypeOf((*MockAuthorizeRequester)(nil).SetDefaultResponseMode), arg0) } -// SetID mocks base method. +// SetID mocks base method func (m *MockAuthorizeRequester) SetID(arg0 string) { m.ctrl.T.Helper() m.ctrl.Call(m, "SetID", arg0) } -// SetID indicates an expected call of SetID. +// SetID indicates an expected call of SetID func (mr *MockAuthorizeRequesterMockRecorder) SetID(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetID", reflect.TypeOf((*MockAuthorizeRequester)(nil).SetID), arg0) } -// SetRequestedAudience mocks base method. +// SetRequestedAudience mocks base method func (m *MockAuthorizeRequester) SetRequestedAudience(arg0 fosite.Arguments) { m.ctrl.T.Helper() m.ctrl.Call(m, "SetRequestedAudience", arg0) } -// SetRequestedAudience indicates an expected call of SetRequestedAudience. +// SetRequestedAudience indicates an expected call of SetRequestedAudience func (mr *MockAuthorizeRequesterMockRecorder) SetRequestedAudience(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetRequestedAudience", reflect.TypeOf((*MockAuthorizeRequester)(nil).SetRequestedAudience), arg0) } -// SetRequestedScopes mocks base method. +// SetRequestedScopes mocks base method func (m *MockAuthorizeRequester) SetRequestedScopes(arg0 fosite.Arguments) { m.ctrl.T.Helper() m.ctrl.Call(m, "SetRequestedScopes", arg0) } -// SetRequestedScopes indicates an expected call of SetRequestedScopes. +// SetRequestedScopes indicates an expected call of SetRequestedScopes func (mr *MockAuthorizeRequesterMockRecorder) SetRequestedScopes(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetRequestedScopes", reflect.TypeOf((*MockAuthorizeRequester)(nil).SetRequestedScopes), arg0) } -// SetResponseTypeHandled mocks base method. +// SetResponseTypeHandled mocks base method func (m *MockAuthorizeRequester) SetResponseTypeHandled(arg0 string) { m.ctrl.T.Helper() m.ctrl.Call(m, "SetResponseTypeHandled", arg0) } -// SetResponseTypeHandled indicates an expected call of SetResponseTypeHandled. +// SetResponseTypeHandled indicates an expected call of SetResponseTypeHandled func (mr *MockAuthorizeRequesterMockRecorder) SetResponseTypeHandled(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetResponseTypeHandled", reflect.TypeOf((*MockAuthorizeRequester)(nil).SetResponseTypeHandled), arg0) } -// SetSession mocks base method. +// SetSession mocks base method func (m *MockAuthorizeRequester) SetSession(arg0 fosite.Session) { m.ctrl.T.Helper() m.ctrl.Call(m, "SetSession", arg0) } -// SetSession indicates an expected call of SetSession. +// SetSession indicates an expected call of SetSession func (mr *MockAuthorizeRequesterMockRecorder) SetSession(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetSession", reflect.TypeOf((*MockAuthorizeRequester)(nil).SetSession), arg0) diff --git a/internal/authorize_response.go b/internal/authorize_response.go index 5526adf1..09bfe76c 100644 --- a/internal/authorize_response.go +++ b/internal/authorize_response.go @@ -1,6 +1,3 @@ -// Copyright © 2024 Ory Corp -// SPDX-License-Identifier: Apache-2.0 - // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ory/fosite (interfaces: AuthorizeResponder) @@ -15,54 +12,54 @@ import ( gomock "github.com/golang/mock/gomock" ) -// MockAuthorizeResponder is a mock of AuthorizeResponder interface. +// MockAuthorizeResponder is a mock of AuthorizeResponder interface type MockAuthorizeResponder struct { ctrl *gomock.Controller recorder *MockAuthorizeResponderMockRecorder } -// MockAuthorizeResponderMockRecorder is the mock recorder for MockAuthorizeResponder. +// MockAuthorizeResponderMockRecorder is the mock recorder for MockAuthorizeResponder type MockAuthorizeResponderMockRecorder struct { mock *MockAuthorizeResponder } -// NewMockAuthorizeResponder creates a new mock instance. +// NewMockAuthorizeResponder creates a new mock instance func NewMockAuthorizeResponder(ctrl *gomock.Controller) *MockAuthorizeResponder { mock := &MockAuthorizeResponder{ctrl: ctrl} mock.recorder = &MockAuthorizeResponderMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use. +// EXPECT returns an object that allows the caller to indicate expected use func (m *MockAuthorizeResponder) EXPECT() *MockAuthorizeResponderMockRecorder { return m.recorder } -// AddHeader mocks base method. +// AddHeader mocks base method func (m *MockAuthorizeResponder) AddHeader(arg0, arg1 string) { m.ctrl.T.Helper() m.ctrl.Call(m, "AddHeader", arg0, arg1) } -// AddHeader indicates an expected call of AddHeader. +// AddHeader indicates an expected call of AddHeader func (mr *MockAuthorizeResponderMockRecorder) AddHeader(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddHeader", reflect.TypeOf((*MockAuthorizeResponder)(nil).AddHeader), arg0, arg1) } -// AddParameter mocks base method. +// AddParameter mocks base method func (m *MockAuthorizeResponder) AddParameter(arg0, arg1 string) { m.ctrl.T.Helper() m.ctrl.Call(m, "AddParameter", arg0, arg1) } -// AddParameter indicates an expected call of AddParameter. +// AddParameter indicates an expected call of AddParameter func (mr *MockAuthorizeResponderMockRecorder) AddParameter(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddParameter", reflect.TypeOf((*MockAuthorizeResponder)(nil).AddParameter), arg0, arg1) } -// GetCode mocks base method. +// GetCode mocks base method func (m *MockAuthorizeResponder) GetCode() string { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetCode") @@ -70,13 +67,13 @@ func (m *MockAuthorizeResponder) GetCode() string { return ret0 } -// GetCode indicates an expected call of GetCode. +// GetCode indicates an expected call of GetCode func (mr *MockAuthorizeResponderMockRecorder) GetCode() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCode", reflect.TypeOf((*MockAuthorizeResponder)(nil).GetCode)) } -// GetHeader mocks base method. +// GetHeader mocks base method func (m *MockAuthorizeResponder) GetHeader() http.Header { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetHeader") @@ -84,13 +81,13 @@ func (m *MockAuthorizeResponder) GetHeader() http.Header { return ret0 } -// GetHeader indicates an expected call of GetHeader. +// GetHeader indicates an expected call of GetHeader func (mr *MockAuthorizeResponderMockRecorder) GetHeader() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetHeader", reflect.TypeOf((*MockAuthorizeResponder)(nil).GetHeader)) } -// GetParameters mocks base method. +// GetParameters mocks base method func (m *MockAuthorizeResponder) GetParameters() url.Values { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetParameters") @@ -98,7 +95,7 @@ func (m *MockAuthorizeResponder) GetParameters() url.Values { return ret0 } -// GetParameters indicates an expected call of GetParameters. +// GetParameters indicates an expected call of GetParameters func (mr *MockAuthorizeResponderMockRecorder) GetParameters() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetParameters", reflect.TypeOf((*MockAuthorizeResponder)(nil).GetParameters)) diff --git a/internal/client.go b/internal/client.go index 2923cf70..e34afd89 100644 --- a/internal/client.go +++ b/internal/client.go @@ -1,6 +1,3 @@ -// Copyright © 2024 Ory Corp -// SPDX-License-Identifier: Apache-2.0 - // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ory/fosite (interfaces: Client) @@ -9,37 +6,35 @@ package internal import ( reflect "reflect" - time "time" gomock "github.com/golang/mock/gomock" - fosite "github.com/ory/fosite" ) -// MockClient is a mock of Client interface. +// MockClient is a mock of Client interface type MockClient struct { ctrl *gomock.Controller recorder *MockClientMockRecorder } -// MockClientMockRecorder is the mock recorder for MockClient. +// MockClientMockRecorder is the mock recorder for MockClient type MockClientMockRecorder struct { mock *MockClient } -// NewMockClient creates a new mock instance. +// NewMockClient creates a new mock instance func NewMockClient(ctrl *gomock.Controller) *MockClient { mock := &MockClient{ctrl: ctrl} mock.recorder = &MockClientMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use. +// EXPECT returns an object that allows the caller to indicate expected use func (m *MockClient) EXPECT() *MockClientMockRecorder { return m.recorder } -// GetAudience mocks base method. +// GetAudience mocks base method func (m *MockClient) GetAudience() fosite.Arguments { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetAudience") @@ -47,13 +42,13 @@ func (m *MockClient) GetAudience() fosite.Arguments { return ret0 } -// GetAudience indicates an expected call of GetAudience. +// GetAudience indicates an expected call of GetAudience func (mr *MockClientMockRecorder) GetAudience() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAudience", reflect.TypeOf((*MockClient)(nil).GetAudience)) } -// GetGrantTypes mocks base method. +// GetGrantTypes mocks base method func (m *MockClient) GetGrantTypes() fosite.Arguments { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetGrantTypes") @@ -61,13 +56,13 @@ func (m *MockClient) GetGrantTypes() fosite.Arguments { return ret0 } -// GetGrantTypes indicates an expected call of GetGrantTypes. +// GetGrantTypes indicates an expected call of GetGrantTypes func (mr *MockClientMockRecorder) GetGrantTypes() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetGrantTypes", reflect.TypeOf((*MockClient)(nil).GetGrantTypes)) } -// GetHashedSecret mocks base method. +// GetHashedSecret mocks base method func (m *MockClient) GetHashedSecret() []byte { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetHashedSecret") @@ -75,13 +70,13 @@ func (m *MockClient) GetHashedSecret() []byte { return ret0 } -// GetHashedSecret indicates an expected call of GetHashedSecret. +// GetHashedSecret indicates an expected call of GetHashedSecret func (mr *MockClientMockRecorder) GetHashedSecret() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetHashedSecret", reflect.TypeOf((*MockClient)(nil).GetHashedSecret)) } -// GetID mocks base method. +// GetID mocks base method func (m *MockClient) GetID() string { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetID") @@ -89,13 +84,13 @@ func (m *MockClient) GetID() string { return ret0 } -// GetID indicates an expected call of GetID. +// GetID indicates an expected call of GetID func (mr *MockClientMockRecorder) GetID() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetID", reflect.TypeOf((*MockClient)(nil).GetID)) } -// GetRedirectURIs mocks base method. +// GetRedirectURIs mocks base method func (m *MockClient) GetRedirectURIs() []string { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetRedirectURIs") @@ -103,13 +98,13 @@ func (m *MockClient) GetRedirectURIs() []string { return ret0 } -// GetRedirectURIs indicates an expected call of GetRedirectURIs. +// GetRedirectURIs indicates an expected call of GetRedirectURIs func (mr *MockClientMockRecorder) GetRedirectURIs() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetRedirectURIs", reflect.TypeOf((*MockClient)(nil).GetRedirectURIs)) } -// GetResponseTypes mocks base method. +// GetResponseTypes mocks base method func (m *MockClient) GetResponseTypes() fosite.Arguments { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetResponseTypes") @@ -117,13 +112,13 @@ func (m *MockClient) GetResponseTypes() fosite.Arguments { return ret0 } -// GetResponseTypes indicates an expected call of GetResponseTypes. +// GetResponseTypes indicates an expected call of GetResponseTypes func (mr *MockClientMockRecorder) GetResponseTypes() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetResponseTypes", reflect.TypeOf((*MockClient)(nil).GetResponseTypes)) } -// GetScopes mocks base method. +// GetScopes mocks base method func (m *MockClient) GetScopes() fosite.Arguments { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetScopes") @@ -131,27 +126,13 @@ func (m *MockClient) GetScopes() fosite.Arguments { return ret0 } -// GetScopes indicates an expected call of GetScopes. +// GetScopes indicates an expected call of GetScopes func (mr *MockClientMockRecorder) GetScopes() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetScopes", reflect.TypeOf((*MockClient)(nil).GetScopes)) } -// GetTokenLifespan mocks base method. -func (m *MockClient) GetTokenLifespan(arg0 fosite.GrantType, arg1 fosite.TokenType, arg2 time.Duration) time.Duration { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetTokenLifespan", arg0, arg1, arg2) - ret0, _ := ret[0].(time.Duration) - return ret0 -} - -// GetTokenLifespan indicates an expected call of GetTokenLifespan. -func (mr *MockClientMockRecorder) GetTokenLifespan(arg0, arg1, arg2 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTokenLifespan", reflect.TypeOf((*MockClient)(nil).GetTokenLifespan), arg0, arg1, arg2) -} - -// IsPublic mocks base method. +// IsPublic mocks base method func (m *MockClient) IsPublic() bool { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "IsPublic") @@ -159,20 +140,8 @@ func (m *MockClient) IsPublic() bool { return ret0 } -// IsPublic indicates an expected call of IsPublic. +// IsPublic indicates an expected call of IsPublic func (mr *MockClientMockRecorder) IsPublic() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsPublic", reflect.TypeOf((*MockClient)(nil).IsPublic)) } - -// SetTokenLifespans mocks base method. -func (m *MockClient) SetTokenLifespans(arg0 map[fosite.TokenType]time.Duration) { - m.ctrl.T.Helper() - m.ctrl.Call(m, "SetTokenLifespans", arg0) -} - -// SetTokenLifespans indicates an expected call of SetTokenLifespans. -func (mr *MockClientMockRecorder) SetTokenLifespans(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetTokenLifespans", reflect.TypeOf((*MockClient)(nil).SetTokenLifespans), arg0) -} diff --git a/internal/hash.go b/internal/hash.go index 687984e7..7c627f74 100644 --- a/internal/hash.go +++ b/internal/hash.go @@ -1,6 +1,3 @@ -// Copyright © 2024 Ory Corp -// SPDX-License-Identifier: Apache-2.0 - // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ory/fosite (interfaces: Hasher) @@ -14,30 +11,30 @@ import ( gomock "github.com/golang/mock/gomock" ) -// MockHasher is a mock of Hasher interface. +// MockHasher is a mock of Hasher interface type MockHasher struct { ctrl *gomock.Controller recorder *MockHasherMockRecorder } -// MockHasherMockRecorder is the mock recorder for MockHasher. +// MockHasherMockRecorder is the mock recorder for MockHasher type MockHasherMockRecorder struct { mock *MockHasher } -// NewMockHasher creates a new mock instance. +// NewMockHasher creates a new mock instance func NewMockHasher(ctrl *gomock.Controller) *MockHasher { mock := &MockHasher{ctrl: ctrl} mock.recorder = &MockHasherMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use. +// EXPECT returns an object that allows the caller to indicate expected use func (m *MockHasher) EXPECT() *MockHasherMockRecorder { return m.recorder } -// Compare mocks base method. +// Compare mocks base method func (m *MockHasher) Compare(arg0 context.Context, arg1, arg2 []byte) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Compare", arg0, arg1, arg2) @@ -45,13 +42,13 @@ func (m *MockHasher) Compare(arg0 context.Context, arg1, arg2 []byte) error { return ret0 } -// Compare indicates an expected call of Compare. +// Compare indicates an expected call of Compare func (mr *MockHasherMockRecorder) Compare(arg0, arg1, arg2 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Compare", reflect.TypeOf((*MockHasher)(nil).Compare), arg0, arg1, arg2) } -// Hash mocks base method. +// Hash mocks base method func (m *MockHasher) Hash(arg0 context.Context, arg1 []byte) ([]byte, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Hash", arg0, arg1) @@ -60,7 +57,7 @@ func (m *MockHasher) Hash(arg0 context.Context, arg1 []byte) ([]byte, error) { return ret0, ret1 } -// Hash indicates an expected call of Hash. +// Hash indicates an expected call of Hash func (mr *MockHasherMockRecorder) Hash(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Hash", reflect.TypeOf((*MockHasher)(nil).Hash), arg0, arg1) diff --git a/internal/id_token_strategy.go b/internal/id_token_strategy.go index 330adeae..21800ad5 100644 --- a/internal/id_token_strategy.go +++ b/internal/id_token_strategy.go @@ -1,6 +1,3 @@ -// Copyright © 2024 Ory Corp -// SPDX-License-Identifier: Apache-2.0 - // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ory/fosite/handler/openid (interfaces: OpenIDConnectTokenStrategy) @@ -13,34 +10,33 @@ import ( time "time" gomock "github.com/golang/mock/gomock" - fosite "github.com/ory/fosite" ) -// MockOpenIDConnectTokenStrategy is a mock of OpenIDConnectTokenStrategy interface. +// MockOpenIDConnectTokenStrategy is a mock of OpenIDConnectTokenStrategy interface type MockOpenIDConnectTokenStrategy struct { ctrl *gomock.Controller recorder *MockOpenIDConnectTokenStrategyMockRecorder } -// MockOpenIDConnectTokenStrategyMockRecorder is the mock recorder for MockOpenIDConnectTokenStrategy. +// MockOpenIDConnectTokenStrategyMockRecorder is the mock recorder for MockOpenIDConnectTokenStrategy type MockOpenIDConnectTokenStrategyMockRecorder struct { mock *MockOpenIDConnectTokenStrategy } -// NewMockOpenIDConnectTokenStrategy creates a new mock instance. +// NewMockOpenIDConnectTokenStrategy creates a new mock instance func NewMockOpenIDConnectTokenStrategy(ctrl *gomock.Controller) *MockOpenIDConnectTokenStrategy { mock := &MockOpenIDConnectTokenStrategy{ctrl: ctrl} mock.recorder = &MockOpenIDConnectTokenStrategyMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use. +// EXPECT returns an object that allows the caller to indicate expected use func (m *MockOpenIDConnectTokenStrategy) EXPECT() *MockOpenIDConnectTokenStrategyMockRecorder { return m.recorder } -// GenerateIDToken mocks base method. +// GenerateIDToken mocks base method func (m *MockOpenIDConnectTokenStrategy) GenerateIDToken(arg0 context.Context, arg1 time.Duration, arg2 fosite.Requester) (string, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GenerateIDToken", arg0, arg1, arg2) @@ -49,7 +45,7 @@ func (m *MockOpenIDConnectTokenStrategy) GenerateIDToken(arg0 context.Context, a return ret0, ret1 } -// GenerateIDToken indicates an expected call of GenerateIDToken. +// GenerateIDToken indicates an expected call of GenerateIDToken func (mr *MockOpenIDConnectTokenStrategyMockRecorder) GenerateIDToken(arg0, arg1, arg2 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GenerateIDToken", reflect.TypeOf((*MockOpenIDConnectTokenStrategy)(nil).GenerateIDToken), arg0, arg1, arg2) diff --git a/internal/introspector.go b/internal/introspector.go index 7b68fbf4..138ef9dd 100644 --- a/internal/introspector.go +++ b/internal/introspector.go @@ -1,6 +1,3 @@ -// Copyright © 2024 Ory Corp -// SPDX-License-Identifier: Apache-2.0 - // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ory/fosite (interfaces: TokenIntrospector) @@ -12,34 +9,33 @@ import ( reflect "reflect" gomock "github.com/golang/mock/gomock" - fosite "github.com/ory/fosite" ) -// MockTokenIntrospector is a mock of TokenIntrospector interface. +// MockTokenIntrospector is a mock of TokenIntrospector interface type MockTokenIntrospector struct { ctrl *gomock.Controller recorder *MockTokenIntrospectorMockRecorder } -// MockTokenIntrospectorMockRecorder is the mock recorder for MockTokenIntrospector. +// MockTokenIntrospectorMockRecorder is the mock recorder for MockTokenIntrospector type MockTokenIntrospectorMockRecorder struct { mock *MockTokenIntrospector } -// NewMockTokenIntrospector creates a new mock instance. +// NewMockTokenIntrospector creates a new mock instance func NewMockTokenIntrospector(ctrl *gomock.Controller) *MockTokenIntrospector { mock := &MockTokenIntrospector{ctrl: ctrl} mock.recorder = &MockTokenIntrospectorMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use. +// EXPECT returns an object that allows the caller to indicate expected use func (m *MockTokenIntrospector) EXPECT() *MockTokenIntrospectorMockRecorder { return m.recorder } -// IntrospectToken mocks base method. +// IntrospectToken mocks base method func (m *MockTokenIntrospector) IntrospectToken(arg0 context.Context, arg1 string, arg2 fosite.TokenType, arg3 fosite.AccessRequester, arg4 []string) (fosite.TokenType, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "IntrospectToken", arg0, arg1, arg2, arg3, arg4) @@ -48,7 +44,7 @@ func (m *MockTokenIntrospector) IntrospectToken(arg0 context.Context, arg1 strin return ret0, ret1 } -// IntrospectToken indicates an expected call of IntrospectToken. +// IntrospectToken indicates an expected call of IntrospectToken func (mr *MockTokenIntrospectorMockRecorder) IntrospectToken(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IntrospectToken", reflect.TypeOf((*MockTokenIntrospector)(nil).IntrospectToken), arg0, arg1, arg2, arg3, arg4) diff --git a/internal/oauth2_auth_jwt_storage.go b/internal/oauth2_auth_jwt_storage.go index 80c7278e..1064bca0 100644 --- a/internal/oauth2_auth_jwt_storage.go +++ b/internal/oauth2_auth_jwt_storage.go @@ -1,6 +1,3 @@ -// Copyright © 2024 Ory Corp -// SPDX-License-Identifier: Apache-2.0 - // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ory/fosite/handler/rfc7523 (interfaces: RFC7523KeyStorage) @@ -12,49 +9,49 @@ import ( reflect "reflect" time "time" - jose "github.com/go-jose/go-jose/v3" + v3 "github.com/go-jose/go-jose/v3" gomock "github.com/golang/mock/gomock" ) -// MockRFC7523KeyStorage is a mock of RFC7523KeyStorage interface. +// MockRFC7523KeyStorage is a mock of RFC7523KeyStorage interface type MockRFC7523KeyStorage struct { ctrl *gomock.Controller recorder *MockRFC7523KeyStorageMockRecorder } -// MockRFC7523KeyStorageMockRecorder is the mock recorder for MockRFC7523KeyStorage. +// MockRFC7523KeyStorageMockRecorder is the mock recorder for MockRFC7523KeyStorage type MockRFC7523KeyStorageMockRecorder struct { mock *MockRFC7523KeyStorage } -// NewMockRFC7523KeyStorage creates a new mock instance. +// NewMockRFC7523KeyStorage creates a new mock instance func NewMockRFC7523KeyStorage(ctrl *gomock.Controller) *MockRFC7523KeyStorage { mock := &MockRFC7523KeyStorage{ctrl: ctrl} mock.recorder = &MockRFC7523KeyStorageMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use. +// EXPECT returns an object that allows the caller to indicate expected use func (m *MockRFC7523KeyStorage) EXPECT() *MockRFC7523KeyStorageMockRecorder { return m.recorder } -// GetPublicKey mocks base method. -func (m *MockRFC7523KeyStorage) GetPublicKey(arg0 context.Context, arg1, arg2, arg3 string) (*jose.JSONWebKey, error) { +// GetPublicKey mocks base method +func (m *MockRFC7523KeyStorage) GetPublicKey(arg0 context.Context, arg1, arg2, arg3 string) (*v3.JSONWebKey, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetPublicKey", arg0, arg1, arg2, arg3) - ret0, _ := ret[0].(*jose.JSONWebKey) + ret0, _ := ret[0].(*v3.JSONWebKey) ret1, _ := ret[1].(error) return ret0, ret1 } -// GetPublicKey indicates an expected call of GetPublicKey. +// GetPublicKey indicates an expected call of GetPublicKey func (mr *MockRFC7523KeyStorageMockRecorder) GetPublicKey(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPublicKey", reflect.TypeOf((*MockRFC7523KeyStorage)(nil).GetPublicKey), arg0, arg1, arg2, arg3) } -// GetPublicKeyScopes mocks base method. +// GetPublicKeyScopes mocks base method func (m *MockRFC7523KeyStorage) GetPublicKeyScopes(arg0 context.Context, arg1, arg2, arg3 string) ([]string, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetPublicKeyScopes", arg0, arg1, arg2, arg3) @@ -63,28 +60,28 @@ func (m *MockRFC7523KeyStorage) GetPublicKeyScopes(arg0 context.Context, arg1, a return ret0, ret1 } -// GetPublicKeyScopes indicates an expected call of GetPublicKeyScopes. +// GetPublicKeyScopes indicates an expected call of GetPublicKeyScopes func (mr *MockRFC7523KeyStorageMockRecorder) GetPublicKeyScopes(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPublicKeyScopes", reflect.TypeOf((*MockRFC7523KeyStorage)(nil).GetPublicKeyScopes), arg0, arg1, arg2, arg3) } -// GetPublicKeys mocks base method. -func (m *MockRFC7523KeyStorage) GetPublicKeys(arg0 context.Context, arg1, arg2 string) (*jose.JSONWebKeySet, error) { +// GetPublicKeys mocks base method +func (m *MockRFC7523KeyStorage) GetPublicKeys(arg0 context.Context, arg1, arg2 string) (*v3.JSONWebKeySet, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetPublicKeys", arg0, arg1, arg2) - ret0, _ := ret[0].(*jose.JSONWebKeySet) + ret0, _ := ret[0].(*v3.JSONWebKeySet) ret1, _ := ret[1].(error) return ret0, ret1 } -// GetPublicKeys indicates an expected call of GetPublicKeys. +// GetPublicKeys indicates an expected call of GetPublicKeys func (mr *MockRFC7523KeyStorageMockRecorder) GetPublicKeys(arg0, arg1, arg2 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPublicKeys", reflect.TypeOf((*MockRFC7523KeyStorage)(nil).GetPublicKeys), arg0, arg1, arg2) } -// IsJWTUsed mocks base method. +// IsJWTUsed mocks base method func (m *MockRFC7523KeyStorage) IsJWTUsed(arg0 context.Context, arg1 string) (bool, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "IsJWTUsed", arg0, arg1) @@ -93,13 +90,13 @@ func (m *MockRFC7523KeyStorage) IsJWTUsed(arg0 context.Context, arg1 string) (bo return ret0, ret1 } -// IsJWTUsed indicates an expected call of IsJWTUsed. +// IsJWTUsed indicates an expected call of IsJWTUsed func (mr *MockRFC7523KeyStorageMockRecorder) IsJWTUsed(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsJWTUsed", reflect.TypeOf((*MockRFC7523KeyStorage)(nil).IsJWTUsed), arg0, arg1) } -// MarkJWTUsedForTime mocks base method. +// MarkJWTUsedForTime mocks base method func (m *MockRFC7523KeyStorage) MarkJWTUsedForTime(arg0 context.Context, arg1 string, arg2 time.Time) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "MarkJWTUsedForTime", arg0, arg1, arg2) @@ -107,7 +104,7 @@ func (m *MockRFC7523KeyStorage) MarkJWTUsedForTime(arg0 context.Context, arg1 st return ret0 } -// MarkJWTUsedForTime indicates an expected call of MarkJWTUsedForTime. +// MarkJWTUsedForTime indicates an expected call of MarkJWTUsedForTime func (mr *MockRFC7523KeyStorageMockRecorder) MarkJWTUsedForTime(arg0, arg1, arg2 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MarkJWTUsedForTime", reflect.TypeOf((*MockRFC7523KeyStorage)(nil).MarkJWTUsedForTime), arg0, arg1, arg2) diff --git a/internal/oauth2_client_storage.go b/internal/oauth2_client_storage.go index d33dfd77..dc70e8f5 100644 --- a/internal/oauth2_client_storage.go +++ b/internal/oauth2_client_storage.go @@ -1,6 +1,3 @@ -// Copyright © 2024 Ory Corp -// SPDX-License-Identifier: Apache-2.0 - // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ory/fosite/handler/oauth2 (interfaces: ClientCredentialsGrantStorage) @@ -12,34 +9,33 @@ import ( reflect "reflect" gomock "github.com/golang/mock/gomock" - fosite "github.com/ory/fosite" ) -// MockClientCredentialsGrantStorage is a mock of ClientCredentialsGrantStorage interface. +// MockClientCredentialsGrantStorage is a mock of ClientCredentialsGrantStorage interface type MockClientCredentialsGrantStorage struct { ctrl *gomock.Controller recorder *MockClientCredentialsGrantStorageMockRecorder } -// MockClientCredentialsGrantStorageMockRecorder is the mock recorder for MockClientCredentialsGrantStorage. +// MockClientCredentialsGrantStorageMockRecorder is the mock recorder for MockClientCredentialsGrantStorage type MockClientCredentialsGrantStorageMockRecorder struct { mock *MockClientCredentialsGrantStorage } -// NewMockClientCredentialsGrantStorage creates a new mock instance. +// NewMockClientCredentialsGrantStorage creates a new mock instance func NewMockClientCredentialsGrantStorage(ctrl *gomock.Controller) *MockClientCredentialsGrantStorage { mock := &MockClientCredentialsGrantStorage{ctrl: ctrl} mock.recorder = &MockClientCredentialsGrantStorageMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use. +// EXPECT returns an object that allows the caller to indicate expected use func (m *MockClientCredentialsGrantStorage) EXPECT() *MockClientCredentialsGrantStorageMockRecorder { return m.recorder } -// CreateAccessTokenSession mocks base method. +// CreateAccessTokenSession mocks base method func (m *MockClientCredentialsGrantStorage) CreateAccessTokenSession(arg0 context.Context, arg1 string, arg2 fosite.Requester) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "CreateAccessTokenSession", arg0, arg1, arg2) @@ -47,13 +43,13 @@ func (m *MockClientCredentialsGrantStorage) CreateAccessTokenSession(arg0 contex return ret0 } -// CreateAccessTokenSession indicates an expected call of CreateAccessTokenSession. +// CreateAccessTokenSession indicates an expected call of CreateAccessTokenSession func (mr *MockClientCredentialsGrantStorageMockRecorder) CreateAccessTokenSession(arg0, arg1, arg2 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateAccessTokenSession", reflect.TypeOf((*MockClientCredentialsGrantStorage)(nil).CreateAccessTokenSession), arg0, arg1, arg2) } -// DeleteAccessTokenSession mocks base method. +// DeleteAccessTokenSession mocks base method func (m *MockClientCredentialsGrantStorage) DeleteAccessTokenSession(arg0 context.Context, arg1 string) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "DeleteAccessTokenSession", arg0, arg1) @@ -61,13 +57,13 @@ func (m *MockClientCredentialsGrantStorage) DeleteAccessTokenSession(arg0 contex return ret0 } -// DeleteAccessTokenSession indicates an expected call of DeleteAccessTokenSession. +// DeleteAccessTokenSession indicates an expected call of DeleteAccessTokenSession func (mr *MockClientCredentialsGrantStorageMockRecorder) DeleteAccessTokenSession(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteAccessTokenSession", reflect.TypeOf((*MockClientCredentialsGrantStorage)(nil).DeleteAccessTokenSession), arg0, arg1) } -// GetAccessTokenSession mocks base method. +// GetAccessTokenSession mocks base method func (m *MockClientCredentialsGrantStorage) GetAccessTokenSession(arg0 context.Context, arg1 string, arg2 fosite.Session) (fosite.Requester, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetAccessTokenSession", arg0, arg1, arg2) @@ -76,7 +72,7 @@ func (m *MockClientCredentialsGrantStorage) GetAccessTokenSession(arg0 context.C return ret0, ret1 } -// GetAccessTokenSession indicates an expected call of GetAccessTokenSession. +// GetAccessTokenSession indicates an expected call of GetAccessTokenSession func (mr *MockClientCredentialsGrantStorageMockRecorder) GetAccessTokenSession(arg0, arg1, arg2 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAccessTokenSession", reflect.TypeOf((*MockClientCredentialsGrantStorage)(nil).GetAccessTokenSession), arg0, arg1, arg2) diff --git a/internal/oauth2_owner_storage.go b/internal/oauth2_owner_storage.go index 79e79795..ee6e4647 100644 --- a/internal/oauth2_owner_storage.go +++ b/internal/oauth2_owner_storage.go @@ -1,6 +1,3 @@ -// Copyright © 2024 Ory Corp -// SPDX-License-Identifier: Apache-2.0 - // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ory/fosite/handler/oauth2 (interfaces: ResourceOwnerPasswordCredentialsGrantStorage) @@ -12,34 +9,33 @@ import ( reflect "reflect" gomock "github.com/golang/mock/gomock" - fosite "github.com/ory/fosite" ) -// MockResourceOwnerPasswordCredentialsGrantStorage is a mock of ResourceOwnerPasswordCredentialsGrantStorage interface. +// MockResourceOwnerPasswordCredentialsGrantStorage is a mock of ResourceOwnerPasswordCredentialsGrantStorage interface type MockResourceOwnerPasswordCredentialsGrantStorage struct { ctrl *gomock.Controller recorder *MockResourceOwnerPasswordCredentialsGrantStorageMockRecorder } -// MockResourceOwnerPasswordCredentialsGrantStorageMockRecorder is the mock recorder for MockResourceOwnerPasswordCredentialsGrantStorage. +// MockResourceOwnerPasswordCredentialsGrantStorageMockRecorder is the mock recorder for MockResourceOwnerPasswordCredentialsGrantStorage type MockResourceOwnerPasswordCredentialsGrantStorageMockRecorder struct { mock *MockResourceOwnerPasswordCredentialsGrantStorage } -// NewMockResourceOwnerPasswordCredentialsGrantStorage creates a new mock instance. +// NewMockResourceOwnerPasswordCredentialsGrantStorage creates a new mock instance func NewMockResourceOwnerPasswordCredentialsGrantStorage(ctrl *gomock.Controller) *MockResourceOwnerPasswordCredentialsGrantStorage { mock := &MockResourceOwnerPasswordCredentialsGrantStorage{ctrl: ctrl} mock.recorder = &MockResourceOwnerPasswordCredentialsGrantStorageMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use. +// EXPECT returns an object that allows the caller to indicate expected use func (m *MockResourceOwnerPasswordCredentialsGrantStorage) EXPECT() *MockResourceOwnerPasswordCredentialsGrantStorageMockRecorder { return m.recorder } -// Authenticate mocks base method. +// Authenticate mocks base method func (m *MockResourceOwnerPasswordCredentialsGrantStorage) Authenticate(arg0 context.Context, arg1, arg2 string) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Authenticate", arg0, arg1, arg2) @@ -47,13 +43,13 @@ func (m *MockResourceOwnerPasswordCredentialsGrantStorage) Authenticate(arg0 con return ret0 } -// Authenticate indicates an expected call of Authenticate. +// Authenticate indicates an expected call of Authenticate func (mr *MockResourceOwnerPasswordCredentialsGrantStorageMockRecorder) Authenticate(arg0, arg1, arg2 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Authenticate", reflect.TypeOf((*MockResourceOwnerPasswordCredentialsGrantStorage)(nil).Authenticate), arg0, arg1, arg2) } -// CreateAccessTokenSession mocks base method. +// CreateAccessTokenSession mocks base method func (m *MockResourceOwnerPasswordCredentialsGrantStorage) CreateAccessTokenSession(arg0 context.Context, arg1 string, arg2 fosite.Requester) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "CreateAccessTokenSession", arg0, arg1, arg2) @@ -61,13 +57,13 @@ func (m *MockResourceOwnerPasswordCredentialsGrantStorage) CreateAccessTokenSess return ret0 } -// CreateAccessTokenSession indicates an expected call of CreateAccessTokenSession. +// CreateAccessTokenSession indicates an expected call of CreateAccessTokenSession func (mr *MockResourceOwnerPasswordCredentialsGrantStorageMockRecorder) CreateAccessTokenSession(arg0, arg1, arg2 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateAccessTokenSession", reflect.TypeOf((*MockResourceOwnerPasswordCredentialsGrantStorage)(nil).CreateAccessTokenSession), arg0, arg1, arg2) } -// CreateRefreshTokenSession mocks base method. +// CreateRefreshTokenSession mocks base method func (m *MockResourceOwnerPasswordCredentialsGrantStorage) CreateRefreshTokenSession(arg0 context.Context, arg1 string, arg2 fosite.Requester) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "CreateRefreshTokenSession", arg0, arg1, arg2) @@ -75,13 +71,13 @@ func (m *MockResourceOwnerPasswordCredentialsGrantStorage) CreateRefreshTokenSes return ret0 } -// CreateRefreshTokenSession indicates an expected call of CreateRefreshTokenSession. +// CreateRefreshTokenSession indicates an expected call of CreateRefreshTokenSession func (mr *MockResourceOwnerPasswordCredentialsGrantStorageMockRecorder) CreateRefreshTokenSession(arg0, arg1, arg2 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateRefreshTokenSession", reflect.TypeOf((*MockResourceOwnerPasswordCredentialsGrantStorage)(nil).CreateRefreshTokenSession), arg0, arg1, arg2) } -// DeleteAccessTokenSession mocks base method. +// DeleteAccessTokenSession mocks base method func (m *MockResourceOwnerPasswordCredentialsGrantStorage) DeleteAccessTokenSession(arg0 context.Context, arg1 string) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "DeleteAccessTokenSession", arg0, arg1) @@ -89,13 +85,13 @@ func (m *MockResourceOwnerPasswordCredentialsGrantStorage) DeleteAccessTokenSess return ret0 } -// DeleteAccessTokenSession indicates an expected call of DeleteAccessTokenSession. +// DeleteAccessTokenSession indicates an expected call of DeleteAccessTokenSession func (mr *MockResourceOwnerPasswordCredentialsGrantStorageMockRecorder) DeleteAccessTokenSession(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteAccessTokenSession", reflect.TypeOf((*MockResourceOwnerPasswordCredentialsGrantStorage)(nil).DeleteAccessTokenSession), arg0, arg1) } -// DeleteRefreshTokenSession mocks base method. +// DeleteRefreshTokenSession mocks base method func (m *MockResourceOwnerPasswordCredentialsGrantStorage) DeleteRefreshTokenSession(arg0 context.Context, arg1 string) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "DeleteRefreshTokenSession", arg0, arg1) @@ -103,13 +99,13 @@ func (m *MockResourceOwnerPasswordCredentialsGrantStorage) DeleteRefreshTokenSes return ret0 } -// DeleteRefreshTokenSession indicates an expected call of DeleteRefreshTokenSession. +// DeleteRefreshTokenSession indicates an expected call of DeleteRefreshTokenSession func (mr *MockResourceOwnerPasswordCredentialsGrantStorageMockRecorder) DeleteRefreshTokenSession(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteRefreshTokenSession", reflect.TypeOf((*MockResourceOwnerPasswordCredentialsGrantStorage)(nil).DeleteRefreshTokenSession), arg0, arg1) } -// GetAccessTokenSession mocks base method. +// GetAccessTokenSession mocks base method func (m *MockResourceOwnerPasswordCredentialsGrantStorage) GetAccessTokenSession(arg0 context.Context, arg1 string, arg2 fosite.Session) (fosite.Requester, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetAccessTokenSession", arg0, arg1, arg2) @@ -118,13 +114,13 @@ func (m *MockResourceOwnerPasswordCredentialsGrantStorage) GetAccessTokenSession return ret0, ret1 } -// GetAccessTokenSession indicates an expected call of GetAccessTokenSession. +// GetAccessTokenSession indicates an expected call of GetAccessTokenSession func (mr *MockResourceOwnerPasswordCredentialsGrantStorageMockRecorder) GetAccessTokenSession(arg0, arg1, arg2 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAccessTokenSession", reflect.TypeOf((*MockResourceOwnerPasswordCredentialsGrantStorage)(nil).GetAccessTokenSession), arg0, arg1, arg2) } -// GetRefreshTokenSession mocks base method. +// GetRefreshTokenSession mocks base method func (m *MockResourceOwnerPasswordCredentialsGrantStorage) GetRefreshTokenSession(arg0 context.Context, arg1 string, arg2 fosite.Session) (fosite.Requester, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetRefreshTokenSession", arg0, arg1, arg2) @@ -133,7 +129,7 @@ func (m *MockResourceOwnerPasswordCredentialsGrantStorage) GetRefreshTokenSessio return ret0, ret1 } -// GetRefreshTokenSession indicates an expected call of GetRefreshTokenSession. +// GetRefreshTokenSession indicates an expected call of GetRefreshTokenSession func (mr *MockResourceOwnerPasswordCredentialsGrantStorageMockRecorder) GetRefreshTokenSession(arg0, arg1, arg2 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetRefreshTokenSession", reflect.TypeOf((*MockResourceOwnerPasswordCredentialsGrantStorage)(nil).GetRefreshTokenSession), arg0, arg1, arg2) diff --git a/internal/oauth2_revoke_storage.go b/internal/oauth2_revoke_storage.go index 12580b4b..39bfc6c4 100644 --- a/internal/oauth2_revoke_storage.go +++ b/internal/oauth2_revoke_storage.go @@ -1,6 +1,3 @@ -// Copyright © 2024 Ory Corp -// SPDX-License-Identifier: Apache-2.0 - // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ory/fosite/handler/oauth2 (interfaces: TokenRevocationStorage) @@ -12,34 +9,33 @@ import ( reflect "reflect" gomock "github.com/golang/mock/gomock" - fosite "github.com/ory/fosite" ) -// MockTokenRevocationStorage is a mock of TokenRevocationStorage interface. +// MockTokenRevocationStorage is a mock of TokenRevocationStorage interface type MockTokenRevocationStorage struct { ctrl *gomock.Controller recorder *MockTokenRevocationStorageMockRecorder } -// MockTokenRevocationStorageMockRecorder is the mock recorder for MockTokenRevocationStorage. +// MockTokenRevocationStorageMockRecorder is the mock recorder for MockTokenRevocationStorage type MockTokenRevocationStorageMockRecorder struct { mock *MockTokenRevocationStorage } -// NewMockTokenRevocationStorage creates a new mock instance. +// NewMockTokenRevocationStorage creates a new mock instance func NewMockTokenRevocationStorage(ctrl *gomock.Controller) *MockTokenRevocationStorage { mock := &MockTokenRevocationStorage{ctrl: ctrl} mock.recorder = &MockTokenRevocationStorageMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use. +// EXPECT returns an object that allows the caller to indicate expected use func (m *MockTokenRevocationStorage) EXPECT() *MockTokenRevocationStorageMockRecorder { return m.recorder } -// CreateAccessTokenSession mocks base method. +// CreateAccessTokenSession mocks base method func (m *MockTokenRevocationStorage) CreateAccessTokenSession(arg0 context.Context, arg1 string, arg2 fosite.Requester) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "CreateAccessTokenSession", arg0, arg1, arg2) @@ -47,13 +43,13 @@ func (m *MockTokenRevocationStorage) CreateAccessTokenSession(arg0 context.Conte return ret0 } -// CreateAccessTokenSession indicates an expected call of CreateAccessTokenSession. +// CreateAccessTokenSession indicates an expected call of CreateAccessTokenSession func (mr *MockTokenRevocationStorageMockRecorder) CreateAccessTokenSession(arg0, arg1, arg2 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateAccessTokenSession", reflect.TypeOf((*MockTokenRevocationStorage)(nil).CreateAccessTokenSession), arg0, arg1, arg2) } -// CreateRefreshTokenSession mocks base method. +// CreateRefreshTokenSession mocks base method func (m *MockTokenRevocationStorage) CreateRefreshTokenSession(arg0 context.Context, arg1 string, arg2 fosite.Requester) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "CreateRefreshTokenSession", arg0, arg1, arg2) @@ -61,13 +57,13 @@ func (m *MockTokenRevocationStorage) CreateRefreshTokenSession(arg0 context.Cont return ret0 } -// CreateRefreshTokenSession indicates an expected call of CreateRefreshTokenSession. +// CreateRefreshTokenSession indicates an expected call of CreateRefreshTokenSession func (mr *MockTokenRevocationStorageMockRecorder) CreateRefreshTokenSession(arg0, arg1, arg2 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateRefreshTokenSession", reflect.TypeOf((*MockTokenRevocationStorage)(nil).CreateRefreshTokenSession), arg0, arg1, arg2) } -// DeleteAccessTokenSession mocks base method. +// DeleteAccessTokenSession mocks base method func (m *MockTokenRevocationStorage) DeleteAccessTokenSession(arg0 context.Context, arg1 string) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "DeleteAccessTokenSession", arg0, arg1) @@ -75,13 +71,13 @@ func (m *MockTokenRevocationStorage) DeleteAccessTokenSession(arg0 context.Conte return ret0 } -// DeleteAccessTokenSession indicates an expected call of DeleteAccessTokenSession. +// DeleteAccessTokenSession indicates an expected call of DeleteAccessTokenSession func (mr *MockTokenRevocationStorageMockRecorder) DeleteAccessTokenSession(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteAccessTokenSession", reflect.TypeOf((*MockTokenRevocationStorage)(nil).DeleteAccessTokenSession), arg0, arg1) } -// DeleteRefreshTokenSession mocks base method. +// DeleteRefreshTokenSession mocks base method func (m *MockTokenRevocationStorage) DeleteRefreshTokenSession(arg0 context.Context, arg1 string) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "DeleteRefreshTokenSession", arg0, arg1) @@ -89,13 +85,13 @@ func (m *MockTokenRevocationStorage) DeleteRefreshTokenSession(arg0 context.Cont return ret0 } -// DeleteRefreshTokenSession indicates an expected call of DeleteRefreshTokenSession. +// DeleteRefreshTokenSession indicates an expected call of DeleteRefreshTokenSession func (mr *MockTokenRevocationStorageMockRecorder) DeleteRefreshTokenSession(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteRefreshTokenSession", reflect.TypeOf((*MockTokenRevocationStorage)(nil).DeleteRefreshTokenSession), arg0, arg1) } -// GetAccessTokenSession mocks base method. +// GetAccessTokenSession mocks base method func (m *MockTokenRevocationStorage) GetAccessTokenSession(arg0 context.Context, arg1 string, arg2 fosite.Session) (fosite.Requester, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetAccessTokenSession", arg0, arg1, arg2) @@ -104,13 +100,13 @@ func (m *MockTokenRevocationStorage) GetAccessTokenSession(arg0 context.Context, return ret0, ret1 } -// GetAccessTokenSession indicates an expected call of GetAccessTokenSession. +// GetAccessTokenSession indicates an expected call of GetAccessTokenSession func (mr *MockTokenRevocationStorageMockRecorder) GetAccessTokenSession(arg0, arg1, arg2 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAccessTokenSession", reflect.TypeOf((*MockTokenRevocationStorage)(nil).GetAccessTokenSession), arg0, arg1, arg2) } -// GetRefreshTokenSession mocks base method. +// GetRefreshTokenSession mocks base method func (m *MockTokenRevocationStorage) GetRefreshTokenSession(arg0 context.Context, arg1 string, arg2 fosite.Session) (fosite.Requester, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetRefreshTokenSession", arg0, arg1, arg2) @@ -119,13 +115,13 @@ func (m *MockTokenRevocationStorage) GetRefreshTokenSession(arg0 context.Context return ret0, ret1 } -// GetRefreshTokenSession indicates an expected call of GetRefreshTokenSession. +// GetRefreshTokenSession indicates an expected call of GetRefreshTokenSession func (mr *MockTokenRevocationStorageMockRecorder) GetRefreshTokenSession(arg0, arg1, arg2 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetRefreshTokenSession", reflect.TypeOf((*MockTokenRevocationStorage)(nil).GetRefreshTokenSession), arg0, arg1, arg2) } -// RevokeAccessToken mocks base method. +// RevokeAccessToken mocks base method func (m *MockTokenRevocationStorage) RevokeAccessToken(arg0 context.Context, arg1 string) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "RevokeAccessToken", arg0, arg1) @@ -133,13 +129,13 @@ func (m *MockTokenRevocationStorage) RevokeAccessToken(arg0 context.Context, arg return ret0 } -// RevokeAccessToken indicates an expected call of RevokeAccessToken. +// RevokeAccessToken indicates an expected call of RevokeAccessToken func (mr *MockTokenRevocationStorageMockRecorder) RevokeAccessToken(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RevokeAccessToken", reflect.TypeOf((*MockTokenRevocationStorage)(nil).RevokeAccessToken), arg0, arg1) } -// RevokeRefreshToken mocks base method. +// RevokeRefreshToken mocks base method func (m *MockTokenRevocationStorage) RevokeRefreshToken(arg0 context.Context, arg1 string) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "RevokeRefreshToken", arg0, arg1) @@ -147,13 +143,13 @@ func (m *MockTokenRevocationStorage) RevokeRefreshToken(arg0 context.Context, ar return ret0 } -// RevokeRefreshToken indicates an expected call of RevokeRefreshToken. +// RevokeRefreshToken indicates an expected call of RevokeRefreshToken func (mr *MockTokenRevocationStorageMockRecorder) RevokeRefreshToken(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RevokeRefreshToken", reflect.TypeOf((*MockTokenRevocationStorage)(nil).RevokeRefreshToken), arg0, arg1) } -// RevokeRefreshTokenMaybeGracePeriod mocks base method. +// RevokeRefreshTokenMaybeGracePeriod mocks base method func (m *MockTokenRevocationStorage) RevokeRefreshTokenMaybeGracePeriod(arg0 context.Context, arg1, arg2 string) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "RevokeRefreshTokenMaybeGracePeriod", arg0, arg1, arg2) @@ -161,7 +157,7 @@ func (m *MockTokenRevocationStorage) RevokeRefreshTokenMaybeGracePeriod(arg0 con return ret0 } -// RevokeRefreshTokenMaybeGracePeriod indicates an expected call of RevokeRefreshTokenMaybeGracePeriod. +// RevokeRefreshTokenMaybeGracePeriod indicates an expected call of RevokeRefreshTokenMaybeGracePeriod func (mr *MockTokenRevocationStorageMockRecorder) RevokeRefreshTokenMaybeGracePeriod(arg0, arg1, arg2 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RevokeRefreshTokenMaybeGracePeriod", reflect.TypeOf((*MockTokenRevocationStorage)(nil).RevokeRefreshTokenMaybeGracePeriod), arg0, arg1, arg2) diff --git a/internal/oauth2_storage.go b/internal/oauth2_storage.go index a67815f7..14747eb8 100644 --- a/internal/oauth2_storage.go +++ b/internal/oauth2_storage.go @@ -1,6 +1,3 @@ -// Copyright © 2024 Ory Corp -// SPDX-License-Identifier: Apache-2.0 - // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ory/fosite/handler/oauth2 (interfaces: CoreStorage) @@ -12,34 +9,33 @@ import ( reflect "reflect" gomock "github.com/golang/mock/gomock" - fosite "github.com/ory/fosite" ) -// MockCoreStorage is a mock of CoreStorage interface. +// MockCoreStorage is a mock of CoreStorage interface type MockCoreStorage struct { ctrl *gomock.Controller recorder *MockCoreStorageMockRecorder } -// MockCoreStorageMockRecorder is the mock recorder for MockCoreStorage. +// MockCoreStorageMockRecorder is the mock recorder for MockCoreStorage type MockCoreStorageMockRecorder struct { mock *MockCoreStorage } -// NewMockCoreStorage creates a new mock instance. +// NewMockCoreStorage creates a new mock instance func NewMockCoreStorage(ctrl *gomock.Controller) *MockCoreStorage { mock := &MockCoreStorage{ctrl: ctrl} mock.recorder = &MockCoreStorageMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use. +// EXPECT returns an object that allows the caller to indicate expected use func (m *MockCoreStorage) EXPECT() *MockCoreStorageMockRecorder { return m.recorder } -// CreateAccessTokenSession mocks base method. +// CreateAccessTokenSession mocks base method func (m *MockCoreStorage) CreateAccessTokenSession(arg0 context.Context, arg1 string, arg2 fosite.Requester) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "CreateAccessTokenSession", arg0, arg1, arg2) @@ -47,13 +43,13 @@ func (m *MockCoreStorage) CreateAccessTokenSession(arg0 context.Context, arg1 st return ret0 } -// CreateAccessTokenSession indicates an expected call of CreateAccessTokenSession. +// CreateAccessTokenSession indicates an expected call of CreateAccessTokenSession func (mr *MockCoreStorageMockRecorder) CreateAccessTokenSession(arg0, arg1, arg2 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateAccessTokenSession", reflect.TypeOf((*MockCoreStorage)(nil).CreateAccessTokenSession), arg0, arg1, arg2) } -// CreateAuthorizeCodeSession mocks base method. +// CreateAuthorizeCodeSession mocks base method func (m *MockCoreStorage) CreateAuthorizeCodeSession(arg0 context.Context, arg1 string, arg2 fosite.Requester) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "CreateAuthorizeCodeSession", arg0, arg1, arg2) @@ -61,13 +57,13 @@ func (m *MockCoreStorage) CreateAuthorizeCodeSession(arg0 context.Context, arg1 return ret0 } -// CreateAuthorizeCodeSession indicates an expected call of CreateAuthorizeCodeSession. +// CreateAuthorizeCodeSession indicates an expected call of CreateAuthorizeCodeSession func (mr *MockCoreStorageMockRecorder) CreateAuthorizeCodeSession(arg0, arg1, arg2 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateAuthorizeCodeSession", reflect.TypeOf((*MockCoreStorage)(nil).CreateAuthorizeCodeSession), arg0, arg1, arg2) } -// CreateRefreshTokenSession mocks base method. +// CreateRefreshTokenSession mocks base method func (m *MockCoreStorage) CreateRefreshTokenSession(arg0 context.Context, arg1 string, arg2 fosite.Requester) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "CreateRefreshTokenSession", arg0, arg1, arg2) @@ -75,13 +71,13 @@ func (m *MockCoreStorage) CreateRefreshTokenSession(arg0 context.Context, arg1 s return ret0 } -// CreateRefreshTokenSession indicates an expected call of CreateRefreshTokenSession. +// CreateRefreshTokenSession indicates an expected call of CreateRefreshTokenSession func (mr *MockCoreStorageMockRecorder) CreateRefreshTokenSession(arg0, arg1, arg2 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateRefreshTokenSession", reflect.TypeOf((*MockCoreStorage)(nil).CreateRefreshTokenSession), arg0, arg1, arg2) } -// DeleteAccessTokenSession mocks base method. +// DeleteAccessTokenSession mocks base method func (m *MockCoreStorage) DeleteAccessTokenSession(arg0 context.Context, arg1 string) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "DeleteAccessTokenSession", arg0, arg1) @@ -89,13 +85,13 @@ func (m *MockCoreStorage) DeleteAccessTokenSession(arg0 context.Context, arg1 st return ret0 } -// DeleteAccessTokenSession indicates an expected call of DeleteAccessTokenSession. +// DeleteAccessTokenSession indicates an expected call of DeleteAccessTokenSession func (mr *MockCoreStorageMockRecorder) DeleteAccessTokenSession(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteAccessTokenSession", reflect.TypeOf((*MockCoreStorage)(nil).DeleteAccessTokenSession), arg0, arg1) } -// DeleteRefreshTokenSession mocks base method. +// DeleteRefreshTokenSession mocks base method func (m *MockCoreStorage) DeleteRefreshTokenSession(arg0 context.Context, arg1 string) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "DeleteRefreshTokenSession", arg0, arg1) @@ -103,13 +99,13 @@ func (m *MockCoreStorage) DeleteRefreshTokenSession(arg0 context.Context, arg1 s return ret0 } -// DeleteRefreshTokenSession indicates an expected call of DeleteRefreshTokenSession. +// DeleteRefreshTokenSession indicates an expected call of DeleteRefreshTokenSession func (mr *MockCoreStorageMockRecorder) DeleteRefreshTokenSession(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteRefreshTokenSession", reflect.TypeOf((*MockCoreStorage)(nil).DeleteRefreshTokenSession), arg0, arg1) } -// GetAccessTokenSession mocks base method. +// GetAccessTokenSession mocks base method func (m *MockCoreStorage) GetAccessTokenSession(arg0 context.Context, arg1 string, arg2 fosite.Session) (fosite.Requester, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetAccessTokenSession", arg0, arg1, arg2) @@ -118,13 +114,13 @@ func (m *MockCoreStorage) GetAccessTokenSession(arg0 context.Context, arg1 strin return ret0, ret1 } -// GetAccessTokenSession indicates an expected call of GetAccessTokenSession. +// GetAccessTokenSession indicates an expected call of GetAccessTokenSession func (mr *MockCoreStorageMockRecorder) GetAccessTokenSession(arg0, arg1, arg2 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAccessTokenSession", reflect.TypeOf((*MockCoreStorage)(nil).GetAccessTokenSession), arg0, arg1, arg2) } -// GetAuthorizeCodeSession mocks base method. +// GetAuthorizeCodeSession mocks base method func (m *MockCoreStorage) GetAuthorizeCodeSession(arg0 context.Context, arg1 string, arg2 fosite.Session) (fosite.Requester, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetAuthorizeCodeSession", arg0, arg1, arg2) @@ -133,13 +129,13 @@ func (m *MockCoreStorage) GetAuthorizeCodeSession(arg0 context.Context, arg1 str return ret0, ret1 } -// GetAuthorizeCodeSession indicates an expected call of GetAuthorizeCodeSession. +// GetAuthorizeCodeSession indicates an expected call of GetAuthorizeCodeSession func (mr *MockCoreStorageMockRecorder) GetAuthorizeCodeSession(arg0, arg1, arg2 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAuthorizeCodeSession", reflect.TypeOf((*MockCoreStorage)(nil).GetAuthorizeCodeSession), arg0, arg1, arg2) } -// GetRefreshTokenSession mocks base method. +// GetRefreshTokenSession mocks base method func (m *MockCoreStorage) GetRefreshTokenSession(arg0 context.Context, arg1 string, arg2 fosite.Session) (fosite.Requester, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetRefreshTokenSession", arg0, arg1, arg2) @@ -148,13 +144,13 @@ func (m *MockCoreStorage) GetRefreshTokenSession(arg0 context.Context, arg1 stri return ret0, ret1 } -// GetRefreshTokenSession indicates an expected call of GetRefreshTokenSession. +// GetRefreshTokenSession indicates an expected call of GetRefreshTokenSession func (mr *MockCoreStorageMockRecorder) GetRefreshTokenSession(arg0, arg1, arg2 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetRefreshTokenSession", reflect.TypeOf((*MockCoreStorage)(nil).GetRefreshTokenSession), arg0, arg1, arg2) } -// InvalidateAuthorizeCodeSession mocks base method. +// InvalidateAuthorizeCodeSession mocks base method func (m *MockCoreStorage) InvalidateAuthorizeCodeSession(arg0 context.Context, arg1 string) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "InvalidateAuthorizeCodeSession", arg0, arg1) @@ -162,7 +158,7 @@ func (m *MockCoreStorage) InvalidateAuthorizeCodeSession(arg0 context.Context, a return ret0 } -// InvalidateAuthorizeCodeSession indicates an expected call of InvalidateAuthorizeCodeSession. +// InvalidateAuthorizeCodeSession indicates an expected call of InvalidateAuthorizeCodeSession func (mr *MockCoreStorageMockRecorder) InvalidateAuthorizeCodeSession(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InvalidateAuthorizeCodeSession", reflect.TypeOf((*MockCoreStorage)(nil).InvalidateAuthorizeCodeSession), arg0, arg1) diff --git a/internal/oauth2_strategy.go b/internal/oauth2_strategy.go index 53920205..7122455a 100644 --- a/internal/oauth2_strategy.go +++ b/internal/oauth2_strategy.go @@ -1,6 +1,3 @@ -// Copyright © 2024 Ory Corp -// SPDX-License-Identifier: Apache-2.0 - // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ory/fosite/handler/oauth2 (interfaces: CoreStrategy) @@ -12,34 +9,33 @@ import ( reflect "reflect" gomock "github.com/golang/mock/gomock" - fosite "github.com/ory/fosite" ) -// MockCoreStrategy is a mock of CoreStrategy interface. +// MockCoreStrategy is a mock of CoreStrategy interface type MockCoreStrategy struct { ctrl *gomock.Controller recorder *MockCoreStrategyMockRecorder } -// MockCoreStrategyMockRecorder is the mock recorder for MockCoreStrategy. +// MockCoreStrategyMockRecorder is the mock recorder for MockCoreStrategy type MockCoreStrategyMockRecorder struct { mock *MockCoreStrategy } -// NewMockCoreStrategy creates a new mock instance. +// NewMockCoreStrategy creates a new mock instance func NewMockCoreStrategy(ctrl *gomock.Controller) *MockCoreStrategy { mock := &MockCoreStrategy{ctrl: ctrl} mock.recorder = &MockCoreStrategyMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use. +// EXPECT returns an object that allows the caller to indicate expected use func (m *MockCoreStrategy) EXPECT() *MockCoreStrategyMockRecorder { return m.recorder } -// AccessTokenSignature mocks base method. +// AccessTokenSignature mocks base method func (m *MockCoreStrategy) AccessTokenSignature(arg0 context.Context, arg1 string) string { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "AccessTokenSignature", arg0, arg1) @@ -47,13 +43,13 @@ func (m *MockCoreStrategy) AccessTokenSignature(arg0 context.Context, arg1 strin return ret0 } -// AccessTokenSignature indicates an expected call of AccessTokenSignature. +// AccessTokenSignature indicates an expected call of AccessTokenSignature func (mr *MockCoreStrategyMockRecorder) AccessTokenSignature(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AccessTokenSignature", reflect.TypeOf((*MockCoreStrategy)(nil).AccessTokenSignature), arg0, arg1) } -// AuthorizeCodeSignature mocks base method. +// AuthorizeCodeSignature mocks base method func (m *MockCoreStrategy) AuthorizeCodeSignature(arg0 context.Context, arg1 string) string { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "AuthorizeCodeSignature", arg0, arg1) @@ -61,13 +57,13 @@ func (m *MockCoreStrategy) AuthorizeCodeSignature(arg0 context.Context, arg1 str return ret0 } -// AuthorizeCodeSignature indicates an expected call of AuthorizeCodeSignature. +// AuthorizeCodeSignature indicates an expected call of AuthorizeCodeSignature func (mr *MockCoreStrategyMockRecorder) AuthorizeCodeSignature(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AuthorizeCodeSignature", reflect.TypeOf((*MockCoreStrategy)(nil).AuthorizeCodeSignature), arg0, arg1) } -// GenerateAccessToken mocks base method. +// GenerateAccessToken mocks base method func (m *MockCoreStrategy) GenerateAccessToken(arg0 context.Context, arg1 fosite.Requester) (string, string, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GenerateAccessToken", arg0, arg1) @@ -77,13 +73,13 @@ func (m *MockCoreStrategy) GenerateAccessToken(arg0 context.Context, arg1 fosite return ret0, ret1, ret2 } -// GenerateAccessToken indicates an expected call of GenerateAccessToken. +// GenerateAccessToken indicates an expected call of GenerateAccessToken func (mr *MockCoreStrategyMockRecorder) GenerateAccessToken(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GenerateAccessToken", reflect.TypeOf((*MockCoreStrategy)(nil).GenerateAccessToken), arg0, arg1) } -// GenerateAuthorizeCode mocks base method. +// GenerateAuthorizeCode mocks base method func (m *MockCoreStrategy) GenerateAuthorizeCode(arg0 context.Context, arg1 fosite.Requester) (string, string, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GenerateAuthorizeCode", arg0, arg1) @@ -93,13 +89,13 @@ func (m *MockCoreStrategy) GenerateAuthorizeCode(arg0 context.Context, arg1 fosi return ret0, ret1, ret2 } -// GenerateAuthorizeCode indicates an expected call of GenerateAuthorizeCode. +// GenerateAuthorizeCode indicates an expected call of GenerateAuthorizeCode func (mr *MockCoreStrategyMockRecorder) GenerateAuthorizeCode(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GenerateAuthorizeCode", reflect.TypeOf((*MockCoreStrategy)(nil).GenerateAuthorizeCode), arg0, arg1) } -// GenerateRefreshToken mocks base method. +// GenerateRefreshToken mocks base method func (m *MockCoreStrategy) GenerateRefreshToken(arg0 context.Context, arg1 fosite.Requester) (string, string, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GenerateRefreshToken", arg0, arg1) @@ -109,13 +105,13 @@ func (m *MockCoreStrategy) GenerateRefreshToken(arg0 context.Context, arg1 fosit return ret0, ret1, ret2 } -// GenerateRefreshToken indicates an expected call of GenerateRefreshToken. +// GenerateRefreshToken indicates an expected call of GenerateRefreshToken func (mr *MockCoreStrategyMockRecorder) GenerateRefreshToken(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GenerateRefreshToken", reflect.TypeOf((*MockCoreStrategy)(nil).GenerateRefreshToken), arg0, arg1) } -// RefreshTokenSignature mocks base method. +// RefreshTokenSignature mocks base method func (m *MockCoreStrategy) RefreshTokenSignature(arg0 context.Context, arg1 string) string { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "RefreshTokenSignature", arg0, arg1) @@ -123,13 +119,13 @@ func (m *MockCoreStrategy) RefreshTokenSignature(arg0 context.Context, arg1 stri return ret0 } -// RefreshTokenSignature indicates an expected call of RefreshTokenSignature. +// RefreshTokenSignature indicates an expected call of RefreshTokenSignature func (mr *MockCoreStrategyMockRecorder) RefreshTokenSignature(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RefreshTokenSignature", reflect.TypeOf((*MockCoreStrategy)(nil).RefreshTokenSignature), arg0, arg1) } -// ValidateAccessToken mocks base method. +// ValidateAccessToken mocks base method func (m *MockCoreStrategy) ValidateAccessToken(arg0 context.Context, arg1 fosite.Requester, arg2 string) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ValidateAccessToken", arg0, arg1, arg2) @@ -137,13 +133,13 @@ func (m *MockCoreStrategy) ValidateAccessToken(arg0 context.Context, arg1 fosite return ret0 } -// ValidateAccessToken indicates an expected call of ValidateAccessToken. +// ValidateAccessToken indicates an expected call of ValidateAccessToken func (mr *MockCoreStrategyMockRecorder) ValidateAccessToken(arg0, arg1, arg2 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidateAccessToken", reflect.TypeOf((*MockCoreStrategy)(nil).ValidateAccessToken), arg0, arg1, arg2) } -// ValidateAuthorizeCode mocks base method. +// ValidateAuthorizeCode mocks base method func (m *MockCoreStrategy) ValidateAuthorizeCode(arg0 context.Context, arg1 fosite.Requester, arg2 string) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ValidateAuthorizeCode", arg0, arg1, arg2) @@ -151,13 +147,13 @@ func (m *MockCoreStrategy) ValidateAuthorizeCode(arg0 context.Context, arg1 fosi return ret0 } -// ValidateAuthorizeCode indicates an expected call of ValidateAuthorizeCode. +// ValidateAuthorizeCode indicates an expected call of ValidateAuthorizeCode func (mr *MockCoreStrategyMockRecorder) ValidateAuthorizeCode(arg0, arg1, arg2 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidateAuthorizeCode", reflect.TypeOf((*MockCoreStrategy)(nil).ValidateAuthorizeCode), arg0, arg1, arg2) } -// ValidateRefreshToken mocks base method. +// ValidateRefreshToken mocks base method func (m *MockCoreStrategy) ValidateRefreshToken(arg0 context.Context, arg1 fosite.Requester, arg2 string) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ValidateRefreshToken", arg0, arg1, arg2) @@ -165,7 +161,7 @@ func (m *MockCoreStrategy) ValidateRefreshToken(arg0 context.Context, arg1 fosit return ret0 } -// ValidateRefreshToken indicates an expected call of ValidateRefreshToken. +// ValidateRefreshToken indicates an expected call of ValidateRefreshToken func (mr *MockCoreStrategyMockRecorder) ValidateRefreshToken(arg0, arg1, arg2 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidateRefreshToken", reflect.TypeOf((*MockCoreStrategy)(nil).ValidateRefreshToken), arg0, arg1, arg2) diff --git a/internal/openid_id_token_storage.go b/internal/openid_id_token_storage.go index bfcd0d62..62452b08 100644 --- a/internal/openid_id_token_storage.go +++ b/internal/openid_id_token_storage.go @@ -1,6 +1,3 @@ -// Copyright © 2024 Ory Corp -// SPDX-License-Identifier: Apache-2.0 - // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ory/fosite/handler/openid (interfaces: OpenIDConnectRequestStorage) @@ -12,34 +9,33 @@ import ( reflect "reflect" gomock "github.com/golang/mock/gomock" - fosite "github.com/ory/fosite" ) -// MockOpenIDConnectRequestStorage is a mock of OpenIDConnectRequestStorage interface. +// MockOpenIDConnectRequestStorage is a mock of OpenIDConnectRequestStorage interface type MockOpenIDConnectRequestStorage struct { ctrl *gomock.Controller recorder *MockOpenIDConnectRequestStorageMockRecorder } -// MockOpenIDConnectRequestStorageMockRecorder is the mock recorder for MockOpenIDConnectRequestStorage. +// MockOpenIDConnectRequestStorageMockRecorder is the mock recorder for MockOpenIDConnectRequestStorage type MockOpenIDConnectRequestStorageMockRecorder struct { mock *MockOpenIDConnectRequestStorage } -// NewMockOpenIDConnectRequestStorage creates a new mock instance. +// NewMockOpenIDConnectRequestStorage creates a new mock instance func NewMockOpenIDConnectRequestStorage(ctrl *gomock.Controller) *MockOpenIDConnectRequestStorage { mock := &MockOpenIDConnectRequestStorage{ctrl: ctrl} mock.recorder = &MockOpenIDConnectRequestStorageMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use. +// EXPECT returns an object that allows the caller to indicate expected use func (m *MockOpenIDConnectRequestStorage) EXPECT() *MockOpenIDConnectRequestStorageMockRecorder { return m.recorder } -// CreateOpenIDConnectSession mocks base method. +// CreateOpenIDConnectSession mocks base method func (m *MockOpenIDConnectRequestStorage) CreateOpenIDConnectSession(arg0 context.Context, arg1 string, arg2 fosite.Requester) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "CreateOpenIDConnectSession", arg0, arg1, arg2) @@ -47,13 +43,13 @@ func (m *MockOpenIDConnectRequestStorage) CreateOpenIDConnectSession(arg0 contex return ret0 } -// CreateOpenIDConnectSession indicates an expected call of CreateOpenIDConnectSession. +// CreateOpenIDConnectSession indicates an expected call of CreateOpenIDConnectSession func (mr *MockOpenIDConnectRequestStorageMockRecorder) CreateOpenIDConnectSession(arg0, arg1, arg2 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateOpenIDConnectSession", reflect.TypeOf((*MockOpenIDConnectRequestStorage)(nil).CreateOpenIDConnectSession), arg0, arg1, arg2) } -// DeleteOpenIDConnectSession mocks base method. +// DeleteOpenIDConnectSession mocks base method func (m *MockOpenIDConnectRequestStorage) DeleteOpenIDConnectSession(arg0 context.Context, arg1 string) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "DeleteOpenIDConnectSession", arg0, arg1) @@ -61,13 +57,13 @@ func (m *MockOpenIDConnectRequestStorage) DeleteOpenIDConnectSession(arg0 contex return ret0 } -// DeleteOpenIDConnectSession indicates an expected call of DeleteOpenIDConnectSession. +// DeleteOpenIDConnectSession indicates an expected call of DeleteOpenIDConnectSession func (mr *MockOpenIDConnectRequestStorageMockRecorder) DeleteOpenIDConnectSession(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteOpenIDConnectSession", reflect.TypeOf((*MockOpenIDConnectRequestStorage)(nil).DeleteOpenIDConnectSession), arg0, arg1) } -// GetOpenIDConnectSession mocks base method. +// GetOpenIDConnectSession mocks base method func (m *MockOpenIDConnectRequestStorage) GetOpenIDConnectSession(arg0 context.Context, arg1 string, arg2 fosite.Requester) (fosite.Requester, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetOpenIDConnectSession", arg0, arg1, arg2) @@ -76,7 +72,7 @@ func (m *MockOpenIDConnectRequestStorage) GetOpenIDConnectSession(arg0 context.C return ret0, ret1 } -// GetOpenIDConnectSession indicates an expected call of GetOpenIDConnectSession. +// GetOpenIDConnectSession indicates an expected call of GetOpenIDConnectSession func (mr *MockOpenIDConnectRequestStorageMockRecorder) GetOpenIDConnectSession(arg0, arg1, arg2 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetOpenIDConnectSession", reflect.TypeOf((*MockOpenIDConnectRequestStorage)(nil).GetOpenIDConnectSession), arg0, arg1, arg2) diff --git a/internal/pkce_storage_strategy.go b/internal/pkce_storage_strategy.go index 46de92ea..4a2fc270 100644 --- a/internal/pkce_storage_strategy.go +++ b/internal/pkce_storage_strategy.go @@ -1,6 +1,3 @@ -// Copyright © 2024 Ory Corp -// SPDX-License-Identifier: Apache-2.0 - // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ory/fosite/handler/pkce (interfaces: PKCERequestStorage) @@ -12,34 +9,33 @@ import ( reflect "reflect" gomock "github.com/golang/mock/gomock" - fosite "github.com/ory/fosite" ) -// MockPKCERequestStorage is a mock of PKCERequestStorage interface. +// MockPKCERequestStorage is a mock of PKCERequestStorage interface type MockPKCERequestStorage struct { ctrl *gomock.Controller recorder *MockPKCERequestStorageMockRecorder } -// MockPKCERequestStorageMockRecorder is the mock recorder for MockPKCERequestStorage. +// MockPKCERequestStorageMockRecorder is the mock recorder for MockPKCERequestStorage type MockPKCERequestStorageMockRecorder struct { mock *MockPKCERequestStorage } -// NewMockPKCERequestStorage creates a new mock instance. +// NewMockPKCERequestStorage creates a new mock instance func NewMockPKCERequestStorage(ctrl *gomock.Controller) *MockPKCERequestStorage { mock := &MockPKCERequestStorage{ctrl: ctrl} mock.recorder = &MockPKCERequestStorageMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use. +// EXPECT returns an object that allows the caller to indicate expected use func (m *MockPKCERequestStorage) EXPECT() *MockPKCERequestStorageMockRecorder { return m.recorder } -// CreatePKCERequestSession mocks base method. +// CreatePKCERequestSession mocks base method func (m *MockPKCERequestStorage) CreatePKCERequestSession(arg0 context.Context, arg1 string, arg2 fosite.Requester) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "CreatePKCERequestSession", arg0, arg1, arg2) @@ -47,13 +43,13 @@ func (m *MockPKCERequestStorage) CreatePKCERequestSession(arg0 context.Context, return ret0 } -// CreatePKCERequestSession indicates an expected call of CreatePKCERequestSession. +// CreatePKCERequestSession indicates an expected call of CreatePKCERequestSession func (mr *MockPKCERequestStorageMockRecorder) CreatePKCERequestSession(arg0, arg1, arg2 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreatePKCERequestSession", reflect.TypeOf((*MockPKCERequestStorage)(nil).CreatePKCERequestSession), arg0, arg1, arg2) } -// DeletePKCERequestSession mocks base method. +// DeletePKCERequestSession mocks base method func (m *MockPKCERequestStorage) DeletePKCERequestSession(arg0 context.Context, arg1 string) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "DeletePKCERequestSession", arg0, arg1) @@ -61,13 +57,13 @@ func (m *MockPKCERequestStorage) DeletePKCERequestSession(arg0 context.Context, return ret0 } -// DeletePKCERequestSession indicates an expected call of DeletePKCERequestSession. +// DeletePKCERequestSession indicates an expected call of DeletePKCERequestSession func (mr *MockPKCERequestStorageMockRecorder) DeletePKCERequestSession(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeletePKCERequestSession", reflect.TypeOf((*MockPKCERequestStorage)(nil).DeletePKCERequestSession), arg0, arg1) } -// GetPKCERequestSession mocks base method. +// GetPKCERequestSession mocks base method func (m *MockPKCERequestStorage) GetPKCERequestSession(arg0 context.Context, arg1 string, arg2 fosite.Session) (fosite.Requester, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetPKCERequestSession", arg0, arg1, arg2) @@ -76,7 +72,7 @@ func (m *MockPKCERequestStorage) GetPKCERequestSession(arg0 context.Context, arg return ret0, ret1 } -// GetPKCERequestSession indicates an expected call of GetPKCERequestSession. +// GetPKCERequestSession indicates an expected call of GetPKCERequestSession func (mr *MockPKCERequestStorageMockRecorder) GetPKCERequestSession(arg0, arg1, arg2 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPKCERequestSession", reflect.TypeOf((*MockPKCERequestStorage)(nil).GetPKCERequestSession), arg0, arg1, arg2) diff --git a/internal/refresh_token_strategy.go b/internal/refresh_token_strategy.go index 5338bfb7..17fd4959 100644 --- a/internal/refresh_token_strategy.go +++ b/internal/refresh_token_strategy.go @@ -1,6 +1,3 @@ -// Copyright © 2024 Ory Corp -// SPDX-License-Identifier: Apache-2.0 - // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ory/fosite/handler/oauth2 (interfaces: RefreshTokenStrategy) @@ -12,34 +9,33 @@ import ( reflect "reflect" gomock "github.com/golang/mock/gomock" - fosite "github.com/ory/fosite" ) -// MockRefreshTokenStrategy is a mock of RefreshTokenStrategy interface. +// MockRefreshTokenStrategy is a mock of RefreshTokenStrategy interface type MockRefreshTokenStrategy struct { ctrl *gomock.Controller recorder *MockRefreshTokenStrategyMockRecorder } -// MockRefreshTokenStrategyMockRecorder is the mock recorder for MockRefreshTokenStrategy. +// MockRefreshTokenStrategyMockRecorder is the mock recorder for MockRefreshTokenStrategy type MockRefreshTokenStrategyMockRecorder struct { mock *MockRefreshTokenStrategy } -// NewMockRefreshTokenStrategy creates a new mock instance. +// NewMockRefreshTokenStrategy creates a new mock instance func NewMockRefreshTokenStrategy(ctrl *gomock.Controller) *MockRefreshTokenStrategy { mock := &MockRefreshTokenStrategy{ctrl: ctrl} mock.recorder = &MockRefreshTokenStrategyMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use. +// EXPECT returns an object that allows the caller to indicate expected use func (m *MockRefreshTokenStrategy) EXPECT() *MockRefreshTokenStrategyMockRecorder { return m.recorder } -// GenerateRefreshToken mocks base method. +// GenerateRefreshToken mocks base method func (m *MockRefreshTokenStrategy) GenerateRefreshToken(arg0 context.Context, arg1 fosite.Requester) (string, string, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GenerateRefreshToken", arg0, arg1) @@ -49,13 +45,13 @@ func (m *MockRefreshTokenStrategy) GenerateRefreshToken(arg0 context.Context, ar return ret0, ret1, ret2 } -// GenerateRefreshToken indicates an expected call of GenerateRefreshToken. +// GenerateRefreshToken indicates an expected call of GenerateRefreshToken func (mr *MockRefreshTokenStrategyMockRecorder) GenerateRefreshToken(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GenerateRefreshToken", reflect.TypeOf((*MockRefreshTokenStrategy)(nil).GenerateRefreshToken), arg0, arg1) } -// RefreshTokenSignature mocks base method. +// RefreshTokenSignature mocks base method func (m *MockRefreshTokenStrategy) RefreshTokenSignature(arg0 context.Context, arg1 string) string { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "RefreshTokenSignature", arg0, arg1) @@ -63,13 +59,13 @@ func (m *MockRefreshTokenStrategy) RefreshTokenSignature(arg0 context.Context, a return ret0 } -// RefreshTokenSignature indicates an expected call of RefreshTokenSignature. +// RefreshTokenSignature indicates an expected call of RefreshTokenSignature func (mr *MockRefreshTokenStrategyMockRecorder) RefreshTokenSignature(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RefreshTokenSignature", reflect.TypeOf((*MockRefreshTokenStrategy)(nil).RefreshTokenSignature), arg0, arg1) } -// ValidateRefreshToken mocks base method. +// ValidateRefreshToken mocks base method func (m *MockRefreshTokenStrategy) ValidateRefreshToken(arg0 context.Context, arg1 fosite.Requester, arg2 string) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ValidateRefreshToken", arg0, arg1, arg2) @@ -77,7 +73,7 @@ func (m *MockRefreshTokenStrategy) ValidateRefreshToken(arg0 context.Context, ar return ret0 } -// ValidateRefreshToken indicates an expected call of ValidateRefreshToken. +// ValidateRefreshToken indicates an expected call of ValidateRefreshToken func (mr *MockRefreshTokenStrategyMockRecorder) ValidateRefreshToken(arg0, arg1, arg2 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidateRefreshToken", reflect.TypeOf((*MockRefreshTokenStrategy)(nil).ValidateRefreshToken), arg0, arg1, arg2) diff --git a/internal/request.go b/internal/request.go index c74969c9..50d7bba2 100644 --- a/internal/request.go +++ b/internal/request.go @@ -1,6 +1,3 @@ -// Copyright © 2024 Ory Corp -// SPDX-License-Identifier: Apache-2.0 - // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ory/fosite (interfaces: Requester) @@ -13,46 +10,45 @@ import ( time "time" gomock "github.com/golang/mock/gomock" - fosite "github.com/ory/fosite" ) -// MockRequester is a mock of Requester interface. +// MockRequester is a mock of Requester interface type MockRequester struct { ctrl *gomock.Controller recorder *MockRequesterMockRecorder } -// MockRequesterMockRecorder is the mock recorder for MockRequester. +// MockRequesterMockRecorder is the mock recorder for MockRequester type MockRequesterMockRecorder struct { mock *MockRequester } -// NewMockRequester creates a new mock instance. +// NewMockRequester creates a new mock instance func NewMockRequester(ctrl *gomock.Controller) *MockRequester { mock := &MockRequester{ctrl: ctrl} mock.recorder = &MockRequesterMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use. +// EXPECT returns an object that allows the caller to indicate expected use func (m *MockRequester) EXPECT() *MockRequesterMockRecorder { return m.recorder } -// AppendRequestedScope mocks base method. +// AppendRequestedScope mocks base method func (m *MockRequester) AppendRequestedScope(arg0 string) { m.ctrl.T.Helper() m.ctrl.Call(m, "AppendRequestedScope", arg0) } -// AppendRequestedScope indicates an expected call of AppendRequestedScope. +// AppendRequestedScope indicates an expected call of AppendRequestedScope func (mr *MockRequesterMockRecorder) AppendRequestedScope(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AppendRequestedScope", reflect.TypeOf((*MockRequester)(nil).AppendRequestedScope), arg0) } -// GetClient mocks base method. +// GetClient mocks base method func (m *MockRequester) GetClient() fosite.Client { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetClient") @@ -60,13 +56,13 @@ func (m *MockRequester) GetClient() fosite.Client { return ret0 } -// GetClient indicates an expected call of GetClient. +// GetClient indicates an expected call of GetClient func (mr *MockRequesterMockRecorder) GetClient() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetClient", reflect.TypeOf((*MockRequester)(nil).GetClient)) } -// GetGrantedAudience mocks base method. +// GetGrantedAudience mocks base method func (m *MockRequester) GetGrantedAudience() fosite.Arguments { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetGrantedAudience") @@ -74,13 +70,13 @@ func (m *MockRequester) GetGrantedAudience() fosite.Arguments { return ret0 } -// GetGrantedAudience indicates an expected call of GetGrantedAudience. +// GetGrantedAudience indicates an expected call of GetGrantedAudience func (mr *MockRequesterMockRecorder) GetGrantedAudience() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetGrantedAudience", reflect.TypeOf((*MockRequester)(nil).GetGrantedAudience)) } -// GetGrantedScopes mocks base method. +// GetGrantedScopes mocks base method func (m *MockRequester) GetGrantedScopes() fosite.Arguments { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetGrantedScopes") @@ -88,13 +84,13 @@ func (m *MockRequester) GetGrantedScopes() fosite.Arguments { return ret0 } -// GetGrantedScopes indicates an expected call of GetGrantedScopes. +// GetGrantedScopes indicates an expected call of GetGrantedScopes func (mr *MockRequesterMockRecorder) GetGrantedScopes() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetGrantedScopes", reflect.TypeOf((*MockRequester)(nil).GetGrantedScopes)) } -// GetID mocks base method. +// GetID mocks base method func (m *MockRequester) GetID() string { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetID") @@ -102,13 +98,13 @@ func (m *MockRequester) GetID() string { return ret0 } -// GetID indicates an expected call of GetID. +// GetID indicates an expected call of GetID func (mr *MockRequesterMockRecorder) GetID() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetID", reflect.TypeOf((*MockRequester)(nil).GetID)) } -// GetRequestForm mocks base method. +// GetRequestForm mocks base method func (m *MockRequester) GetRequestForm() url.Values { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetRequestForm") @@ -116,13 +112,13 @@ func (m *MockRequester) GetRequestForm() url.Values { return ret0 } -// GetRequestForm indicates an expected call of GetRequestForm. +// GetRequestForm indicates an expected call of GetRequestForm func (mr *MockRequesterMockRecorder) GetRequestForm() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetRequestForm", reflect.TypeOf((*MockRequester)(nil).GetRequestForm)) } -// GetRequestedAt mocks base method. +// GetRequestedAt mocks base method func (m *MockRequester) GetRequestedAt() time.Time { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetRequestedAt") @@ -130,13 +126,13 @@ func (m *MockRequester) GetRequestedAt() time.Time { return ret0 } -// GetRequestedAt indicates an expected call of GetRequestedAt. +// GetRequestedAt indicates an expected call of GetRequestedAt func (mr *MockRequesterMockRecorder) GetRequestedAt() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetRequestedAt", reflect.TypeOf((*MockRequester)(nil).GetRequestedAt)) } -// GetRequestedAudience mocks base method. +// GetRequestedAudience mocks base method func (m *MockRequester) GetRequestedAudience() fosite.Arguments { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetRequestedAudience") @@ -144,13 +140,13 @@ func (m *MockRequester) GetRequestedAudience() fosite.Arguments { return ret0 } -// GetRequestedAudience indicates an expected call of GetRequestedAudience. +// GetRequestedAudience indicates an expected call of GetRequestedAudience func (mr *MockRequesterMockRecorder) GetRequestedAudience() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetRequestedAudience", reflect.TypeOf((*MockRequester)(nil).GetRequestedAudience)) } -// GetRequestedScopes mocks base method. +// GetRequestedScopes mocks base method func (m *MockRequester) GetRequestedScopes() fosite.Arguments { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetRequestedScopes") @@ -158,13 +154,13 @@ func (m *MockRequester) GetRequestedScopes() fosite.Arguments { return ret0 } -// GetRequestedScopes indicates an expected call of GetRequestedScopes. +// GetRequestedScopes indicates an expected call of GetRequestedScopes func (mr *MockRequesterMockRecorder) GetRequestedScopes() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetRequestedScopes", reflect.TypeOf((*MockRequester)(nil).GetRequestedScopes)) } -// GetSession mocks base method. +// GetSession mocks base method func (m *MockRequester) GetSession() fosite.Session { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetSession") @@ -172,49 +168,49 @@ func (m *MockRequester) GetSession() fosite.Session { return ret0 } -// GetSession indicates an expected call of GetSession. +// GetSession indicates an expected call of GetSession func (mr *MockRequesterMockRecorder) GetSession() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSession", reflect.TypeOf((*MockRequester)(nil).GetSession)) } -// GrantAudience mocks base method. +// GrantAudience mocks base method func (m *MockRequester) GrantAudience(arg0 string) { m.ctrl.T.Helper() m.ctrl.Call(m, "GrantAudience", arg0) } -// GrantAudience indicates an expected call of GrantAudience. +// GrantAudience indicates an expected call of GrantAudience func (mr *MockRequesterMockRecorder) GrantAudience(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GrantAudience", reflect.TypeOf((*MockRequester)(nil).GrantAudience), arg0) } -// GrantScope mocks base method. +// GrantScope mocks base method func (m *MockRequester) GrantScope(arg0 string) { m.ctrl.T.Helper() m.ctrl.Call(m, "GrantScope", arg0) } -// GrantScope indicates an expected call of GrantScope. +// GrantScope indicates an expected call of GrantScope func (mr *MockRequesterMockRecorder) GrantScope(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GrantScope", reflect.TypeOf((*MockRequester)(nil).GrantScope), arg0) } -// Merge mocks base method. +// Merge mocks base method func (m *MockRequester) Merge(arg0 fosite.Requester) { m.ctrl.T.Helper() m.ctrl.Call(m, "Merge", arg0) } -// Merge indicates an expected call of Merge. +// Merge indicates an expected call of Merge func (mr *MockRequesterMockRecorder) Merge(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Merge", reflect.TypeOf((*MockRequester)(nil).Merge), arg0) } -// Sanitize mocks base method. +// Sanitize mocks base method func (m *MockRequester) Sanitize(arg0 []string) fosite.Requester { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Sanitize", arg0) @@ -222,55 +218,55 @@ func (m *MockRequester) Sanitize(arg0 []string) fosite.Requester { return ret0 } -// Sanitize indicates an expected call of Sanitize. +// Sanitize indicates an expected call of Sanitize func (mr *MockRequesterMockRecorder) Sanitize(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Sanitize", reflect.TypeOf((*MockRequester)(nil).Sanitize), arg0) } -// SetID mocks base method. +// SetID mocks base method func (m *MockRequester) SetID(arg0 string) { m.ctrl.T.Helper() m.ctrl.Call(m, "SetID", arg0) } -// SetID indicates an expected call of SetID. +// SetID indicates an expected call of SetID func (mr *MockRequesterMockRecorder) SetID(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetID", reflect.TypeOf((*MockRequester)(nil).SetID), arg0) } -// SetRequestedAudience mocks base method. +// SetRequestedAudience mocks base method func (m *MockRequester) SetRequestedAudience(arg0 fosite.Arguments) { m.ctrl.T.Helper() m.ctrl.Call(m, "SetRequestedAudience", arg0) } -// SetRequestedAudience indicates an expected call of SetRequestedAudience. +// SetRequestedAudience indicates an expected call of SetRequestedAudience func (mr *MockRequesterMockRecorder) SetRequestedAudience(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetRequestedAudience", reflect.TypeOf((*MockRequester)(nil).SetRequestedAudience), arg0) } -// SetRequestedScopes mocks base method. +// SetRequestedScopes mocks base method func (m *MockRequester) SetRequestedScopes(arg0 fosite.Arguments) { m.ctrl.T.Helper() m.ctrl.Call(m, "SetRequestedScopes", arg0) } -// SetRequestedScopes indicates an expected call of SetRequestedScopes. +// SetRequestedScopes indicates an expected call of SetRequestedScopes func (mr *MockRequesterMockRecorder) SetRequestedScopes(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetRequestedScopes", reflect.TypeOf((*MockRequester)(nil).SetRequestedScopes), arg0) } -// SetSession mocks base method. +// SetSession mocks base method func (m *MockRequester) SetSession(arg0 fosite.Session) { m.ctrl.T.Helper() m.ctrl.Call(m, "SetSession", arg0) } -// SetSession indicates an expected call of SetSession. +// SetSession indicates an expected call of SetSession func (mr *MockRequesterMockRecorder) SetSession(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetSession", reflect.TypeOf((*MockRequester)(nil).SetSession), arg0) diff --git a/internal/revoke_handler.go b/internal/revoke_handler.go index 948178e1..ad0ed281 100644 --- a/internal/revoke_handler.go +++ b/internal/revoke_handler.go @@ -1,6 +1,3 @@ -// Copyright © 2024 Ory Corp -// SPDX-License-Identifier: Apache-2.0 - // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ory/fosite (interfaces: RevocationHandler) @@ -12,34 +9,33 @@ import ( reflect "reflect" gomock "github.com/golang/mock/gomock" - fosite "github.com/ory/fosite" ) -// MockRevocationHandler is a mock of RevocationHandler interface. +// MockRevocationHandler is a mock of RevocationHandler interface type MockRevocationHandler struct { ctrl *gomock.Controller recorder *MockRevocationHandlerMockRecorder } -// MockRevocationHandlerMockRecorder is the mock recorder for MockRevocationHandler. +// MockRevocationHandlerMockRecorder is the mock recorder for MockRevocationHandler type MockRevocationHandlerMockRecorder struct { mock *MockRevocationHandler } -// NewMockRevocationHandler creates a new mock instance. +// NewMockRevocationHandler creates a new mock instance func NewMockRevocationHandler(ctrl *gomock.Controller) *MockRevocationHandler { mock := &MockRevocationHandler{ctrl: ctrl} mock.recorder = &MockRevocationHandlerMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use. +// EXPECT returns an object that allows the caller to indicate expected use func (m *MockRevocationHandler) EXPECT() *MockRevocationHandlerMockRecorder { return m.recorder } -// RevokeToken mocks base method. +// RevokeToken mocks base method func (m *MockRevocationHandler) RevokeToken(arg0 context.Context, arg1 string, arg2 fosite.TokenType, arg3 fosite.Client) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "RevokeToken", arg0, arg1, arg2, arg3) @@ -47,7 +43,7 @@ func (m *MockRevocationHandler) RevokeToken(arg0 context.Context, arg1 string, a return ret0 } -// RevokeToken indicates an expected call of RevokeToken. +// RevokeToken indicates an expected call of RevokeToken func (mr *MockRevocationHandlerMockRecorder) RevokeToken(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RevokeToken", reflect.TypeOf((*MockRevocationHandler)(nil).RevokeToken), arg0, arg1, arg2, arg3) diff --git a/internal/storage.go b/internal/storage.go index 14fa7c32..c64288b4 100644 --- a/internal/storage.go +++ b/internal/storage.go @@ -1,6 +1,3 @@ -// Copyright © 2024 Ory Corp -// SPDX-License-Identifier: Apache-2.0 - // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ory/fosite (interfaces: Storage) @@ -13,34 +10,33 @@ import ( time "time" gomock "github.com/golang/mock/gomock" - fosite "github.com/ory/fosite" ) -// MockStorage is a mock of Storage interface. +// MockStorage is a mock of Storage interface type MockStorage struct { ctrl *gomock.Controller recorder *MockStorageMockRecorder } -// MockStorageMockRecorder is the mock recorder for MockStorage. +// MockStorageMockRecorder is the mock recorder for MockStorage type MockStorageMockRecorder struct { mock *MockStorage } -// NewMockStorage creates a new mock instance. +// NewMockStorage creates a new mock instance func NewMockStorage(ctrl *gomock.Controller) *MockStorage { mock := &MockStorage{ctrl: ctrl} mock.recorder = &MockStorageMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use. +// EXPECT returns an object that allows the caller to indicate expected use func (m *MockStorage) EXPECT() *MockStorageMockRecorder { return m.recorder } -// ClientAssertionJWTValid mocks base method. +// ClientAssertionJWTValid mocks base method func (m *MockStorage) ClientAssertionJWTValid(arg0 context.Context, arg1 string) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ClientAssertionJWTValid", arg0, arg1) @@ -48,13 +44,13 @@ func (m *MockStorage) ClientAssertionJWTValid(arg0 context.Context, arg1 string) return ret0 } -// ClientAssertionJWTValid indicates an expected call of ClientAssertionJWTValid. +// ClientAssertionJWTValid indicates an expected call of ClientAssertionJWTValid func (mr *MockStorageMockRecorder) ClientAssertionJWTValid(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientAssertionJWTValid", reflect.TypeOf((*MockStorage)(nil).ClientAssertionJWTValid), arg0, arg1) } -// GetClient mocks base method. +// GetClient mocks base method func (m *MockStorage) GetClient(arg0 context.Context, arg1 string) (fosite.Client, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetClient", arg0, arg1) @@ -63,13 +59,13 @@ func (m *MockStorage) GetClient(arg0 context.Context, arg1 string) (fosite.Clien return ret0, ret1 } -// GetClient indicates an expected call of GetClient. +// GetClient indicates an expected call of GetClient func (mr *MockStorageMockRecorder) GetClient(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetClient", reflect.TypeOf((*MockStorage)(nil).GetClient), arg0, arg1) } -// SetClientAssertionJWT mocks base method. +// SetClientAssertionJWT mocks base method func (m *MockStorage) SetClientAssertionJWT(arg0 context.Context, arg1 string, arg2 time.Time) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "SetClientAssertionJWT", arg0, arg1, arg2) @@ -77,7 +73,7 @@ func (m *MockStorage) SetClientAssertionJWT(arg0 context.Context, arg1 string, a return ret0 } -// SetClientAssertionJWT indicates an expected call of SetClientAssertionJWT. +// SetClientAssertionJWT indicates an expected call of SetClientAssertionJWT func (mr *MockStorageMockRecorder) SetClientAssertionJWT(arg0, arg1, arg2 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetClientAssertionJWT", reflect.TypeOf((*MockStorage)(nil).SetClientAssertionJWT), arg0, arg1, arg2) diff --git a/internal/token_handler.go b/internal/token_handler.go index 9eb17067..97bfcaa2 100644 --- a/internal/token_handler.go +++ b/internal/token_handler.go @@ -1,6 +1,3 @@ -// Copyright © 2024 Ory Corp -// SPDX-License-Identifier: Apache-2.0 - // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ory/fosite (interfaces: TokenEndpointHandler) @@ -12,34 +9,33 @@ import ( reflect "reflect" gomock "github.com/golang/mock/gomock" - fosite "github.com/ory/fosite" ) -// MockTokenEndpointHandler is a mock of TokenEndpointHandler interface. +// MockTokenEndpointHandler is a mock of TokenEndpointHandler interface type MockTokenEndpointHandler struct { ctrl *gomock.Controller recorder *MockTokenEndpointHandlerMockRecorder } -// MockTokenEndpointHandlerMockRecorder is the mock recorder for MockTokenEndpointHandler. +// MockTokenEndpointHandlerMockRecorder is the mock recorder for MockTokenEndpointHandler type MockTokenEndpointHandlerMockRecorder struct { mock *MockTokenEndpointHandler } -// NewMockTokenEndpointHandler creates a new mock instance. +// NewMockTokenEndpointHandler creates a new mock instance func NewMockTokenEndpointHandler(ctrl *gomock.Controller) *MockTokenEndpointHandler { mock := &MockTokenEndpointHandler{ctrl: ctrl} mock.recorder = &MockTokenEndpointHandlerMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use. +// EXPECT returns an object that allows the caller to indicate expected use func (m *MockTokenEndpointHandler) EXPECT() *MockTokenEndpointHandlerMockRecorder { return m.recorder } -// CanHandleTokenEndpointRequest mocks base method. +// CanHandleTokenEndpointRequest mocks base method func (m *MockTokenEndpointHandler) CanHandleTokenEndpointRequest(arg0 context.Context, arg1 fosite.AccessRequester) bool { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "CanHandleTokenEndpointRequest", arg0, arg1) @@ -47,13 +43,13 @@ func (m *MockTokenEndpointHandler) CanHandleTokenEndpointRequest(arg0 context.Co return ret0 } -// CanHandleTokenEndpointRequest indicates an expected call of CanHandleTokenEndpointRequest. +// CanHandleTokenEndpointRequest indicates an expected call of CanHandleTokenEndpointRequest func (mr *MockTokenEndpointHandlerMockRecorder) CanHandleTokenEndpointRequest(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CanHandleTokenEndpointRequest", reflect.TypeOf((*MockTokenEndpointHandler)(nil).CanHandleTokenEndpointRequest), arg0, arg1) } -// CanSkipClientAuth mocks base method. +// CanSkipClientAuth mocks base method func (m *MockTokenEndpointHandler) CanSkipClientAuth(arg0 context.Context, arg1 fosite.AccessRequester) bool { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "CanSkipClientAuth", arg0, arg1) @@ -61,13 +57,13 @@ func (m *MockTokenEndpointHandler) CanSkipClientAuth(arg0 context.Context, arg1 return ret0 } -// CanSkipClientAuth indicates an expected call of CanSkipClientAuth. +// CanSkipClientAuth indicates an expected call of CanSkipClientAuth func (mr *MockTokenEndpointHandlerMockRecorder) CanSkipClientAuth(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CanSkipClientAuth", reflect.TypeOf((*MockTokenEndpointHandler)(nil).CanSkipClientAuth), arg0, arg1) } -// HandleTokenEndpointRequest mocks base method. +// HandleTokenEndpointRequest mocks base method func (m *MockTokenEndpointHandler) HandleTokenEndpointRequest(arg0 context.Context, arg1 fosite.AccessRequester) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "HandleTokenEndpointRequest", arg0, arg1) @@ -75,13 +71,13 @@ func (m *MockTokenEndpointHandler) HandleTokenEndpointRequest(arg0 context.Conte return ret0 } -// HandleTokenEndpointRequest indicates an expected call of HandleTokenEndpointRequest. +// HandleTokenEndpointRequest indicates an expected call of HandleTokenEndpointRequest func (mr *MockTokenEndpointHandlerMockRecorder) HandleTokenEndpointRequest(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HandleTokenEndpointRequest", reflect.TypeOf((*MockTokenEndpointHandler)(nil).HandleTokenEndpointRequest), arg0, arg1) } -// PopulateTokenEndpointResponse mocks base method. +// PopulateTokenEndpointResponse mocks base method func (m *MockTokenEndpointHandler) PopulateTokenEndpointResponse(arg0 context.Context, arg1 fosite.AccessRequester, arg2 fosite.AccessResponder) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "PopulateTokenEndpointResponse", arg0, arg1, arg2) @@ -89,7 +85,7 @@ func (m *MockTokenEndpointHandler) PopulateTokenEndpointResponse(arg0 context.Co return ret0 } -// PopulateTokenEndpointResponse indicates an expected call of PopulateTokenEndpointResponse. +// PopulateTokenEndpointResponse indicates an expected call of PopulateTokenEndpointResponse func (mr *MockTokenEndpointHandlerMockRecorder) PopulateTokenEndpointResponse(arg0, arg1, arg2 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PopulateTokenEndpointResponse", reflect.TypeOf((*MockTokenEndpointHandler)(nil).PopulateTokenEndpointResponse), arg0, arg1, arg2) diff --git a/internal/transactional.go b/internal/transactional.go index d98d63ab..fab46f66 100644 --- a/internal/transactional.go +++ b/internal/transactional.go @@ -1,6 +1,3 @@ -// Copyright © 2024 Ory Corp -// SPDX-License-Identifier: Apache-2.0 - // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ory/fosite/storage (interfaces: Transactional) @@ -14,68 +11,39 @@ import ( gomock "github.com/golang/mock/gomock" ) -// MockTransactional is a mock of Transactional interface. +// MockTransactional is a mock of Transactional interface type MockTransactional struct { ctrl *gomock.Controller recorder *MockTransactionalMockRecorder } -// MockTransactionalMockRecorder is the mock recorder for MockTransactional. +// MockTransactionalMockRecorder is the mock recorder for MockTransactional type MockTransactionalMockRecorder struct { mock *MockTransactional } -// NewMockTransactional creates a new mock instance. +// NewMockTransactional creates a new mock instance func NewMockTransactional(ctrl *gomock.Controller) *MockTransactional { mock := &MockTransactional{ctrl: ctrl} mock.recorder = &MockTransactionalMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use. +// EXPECT returns an object that allows the caller to indicate expected use func (m *MockTransactional) EXPECT() *MockTransactionalMockRecorder { return m.recorder } -// BeginTX mocks base method. -func (m *MockTransactional) BeginTX(arg0 context.Context) (context.Context, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "BeginTX", arg0) - ret0, _ := ret[0].(context.Context) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// BeginTX indicates an expected call of BeginTX. -func (mr *MockTransactionalMockRecorder) BeginTX(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BeginTX", reflect.TypeOf((*MockTransactional)(nil).BeginTX), arg0) -} - -// Commit mocks base method. -func (m *MockTransactional) Commit(arg0 context.Context) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Commit", arg0) - ret0, _ := ret[0].(error) - return ret0 -} - -// Commit indicates an expected call of Commit. -func (mr *MockTransactionalMockRecorder) Commit(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Commit", reflect.TypeOf((*MockTransactional)(nil).Commit), arg0) -} - -// Rollback mocks base method. -func (m *MockTransactional) Rollback(arg0 context.Context) error { +// Transaction mocks base method +func (m *MockTransactional) Transaction(arg0 context.Context, arg1 func(context.Context) error) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Rollback", arg0) + ret := m.ctrl.Call(m, "Transaction", arg0, arg1) ret0, _ := ret[0].(error) return ret0 } -// Rollback indicates an expected call of Rollback. -func (mr *MockTransactionalMockRecorder) Rollback(arg0 interface{}) *gomock.Call { +// Transaction indicates an expected call of Transaction +func (mr *MockTransactionalMockRecorder) Transaction(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Rollback", reflect.TypeOf((*MockTransactional)(nil).Rollback), arg0) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Transaction", reflect.TypeOf((*MockTransactional)(nil).Transaction), arg0, arg1) } From 8f9df122cfbd1689e2f27c84e5622ce23ea89b36 Mon Sep 17 00:00:00 2001 From: aeneasr <3372410+aeneasr@users.noreply.github.com> Date: Tue, 7 May 2024 14:00:51 +0200 Subject: [PATCH 3/4] chore: synchronize workspaces --- internal/access_request.go | 3 +++ internal/access_response.go | 3 +++ internal/access_token_storage.go | 3 +++ internal/access_token_strategy.go | 3 +++ internal/authorize_code_storage.go | 3 +++ internal/authorize_code_strategy.go | 3 +++ internal/authorize_handler.go | 3 +++ internal/authorize_request.go | 3 +++ internal/authorize_response.go | 3 +++ internal/client.go | 3 +++ internal/hash.go | 3 +++ internal/id_token_strategy.go | 3 +++ internal/introspector.go | 3 +++ internal/oauth2_auth_jwt_storage.go | 3 +++ internal/oauth2_client_storage.go | 3 +++ internal/oauth2_owner_storage.go | 3 +++ internal/oauth2_revoke_storage.go | 3 +++ internal/oauth2_storage.go | 3 +++ internal/oauth2_strategy.go | 3 +++ internal/openid_id_token_storage.go | 3 +++ internal/pkce_storage_strategy.go | 3 +++ internal/refresh_token_strategy.go | 3 +++ internal/request.go | 3 +++ internal/revoke_handler.go | 3 +++ internal/storage.go | 3 +++ internal/token_handler.go | 3 +++ internal/transactional.go | 3 +++ 27 files changed, 81 insertions(+) diff --git a/internal/access_request.go b/internal/access_request.go index 9faa921d..326b2ca0 100644 --- a/internal/access_request.go +++ b/internal/access_request.go @@ -1,3 +1,6 @@ +// Copyright © 2024 Ory Corp +// SPDX-License-Identifier: Apache-2.0 + // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ory/fosite (interfaces: AccessRequester) diff --git a/internal/access_response.go b/internal/access_response.go index 928d7fba..c91bb9d5 100644 --- a/internal/access_response.go +++ b/internal/access_response.go @@ -1,3 +1,6 @@ +// Copyright © 2024 Ory Corp +// SPDX-License-Identifier: Apache-2.0 + // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ory/fosite (interfaces: AccessResponder) diff --git a/internal/access_token_storage.go b/internal/access_token_storage.go index af63d36f..ef0af514 100644 --- a/internal/access_token_storage.go +++ b/internal/access_token_storage.go @@ -1,3 +1,6 @@ +// Copyright © 2024 Ory Corp +// SPDX-License-Identifier: Apache-2.0 + // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ory/fosite/handler/oauth2 (interfaces: AccessTokenStorage) diff --git a/internal/access_token_strategy.go b/internal/access_token_strategy.go index ee950dda..a6dcae8a 100644 --- a/internal/access_token_strategy.go +++ b/internal/access_token_strategy.go @@ -1,3 +1,6 @@ +// Copyright © 2024 Ory Corp +// SPDX-License-Identifier: Apache-2.0 + // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ory/fosite/handler/oauth2 (interfaces: AccessTokenStrategy) diff --git a/internal/authorize_code_storage.go b/internal/authorize_code_storage.go index a04b9e3f..d911109d 100644 --- a/internal/authorize_code_storage.go +++ b/internal/authorize_code_storage.go @@ -1,3 +1,6 @@ +// Copyright © 2024 Ory Corp +// SPDX-License-Identifier: Apache-2.0 + // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ory/fosite/handler/oauth2 (interfaces: AuthorizeCodeStorage) diff --git a/internal/authorize_code_strategy.go b/internal/authorize_code_strategy.go index 351a74c2..e42c2324 100644 --- a/internal/authorize_code_strategy.go +++ b/internal/authorize_code_strategy.go @@ -1,3 +1,6 @@ +// Copyright © 2024 Ory Corp +// SPDX-License-Identifier: Apache-2.0 + // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ory/fosite/handler/oauth2 (interfaces: AuthorizeCodeStrategy) diff --git a/internal/authorize_handler.go b/internal/authorize_handler.go index 4f0f9a8f..b4a5a101 100644 --- a/internal/authorize_handler.go +++ b/internal/authorize_handler.go @@ -1,3 +1,6 @@ +// Copyright © 2024 Ory Corp +// SPDX-License-Identifier: Apache-2.0 + // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ory/fosite (interfaces: AuthorizeEndpointHandler) diff --git a/internal/authorize_request.go b/internal/authorize_request.go index 3134a77a..4002e30c 100644 --- a/internal/authorize_request.go +++ b/internal/authorize_request.go @@ -1,3 +1,6 @@ +// Copyright © 2024 Ory Corp +// SPDX-License-Identifier: Apache-2.0 + // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ory/fosite (interfaces: AuthorizeRequester) diff --git a/internal/authorize_response.go b/internal/authorize_response.go index 09bfe76c..6b4af821 100644 --- a/internal/authorize_response.go +++ b/internal/authorize_response.go @@ -1,3 +1,6 @@ +// Copyright © 2024 Ory Corp +// SPDX-License-Identifier: Apache-2.0 + // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ory/fosite (interfaces: AuthorizeResponder) diff --git a/internal/client.go b/internal/client.go index e34afd89..fd23117b 100644 --- a/internal/client.go +++ b/internal/client.go @@ -1,3 +1,6 @@ +// Copyright © 2024 Ory Corp +// SPDX-License-Identifier: Apache-2.0 + // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ory/fosite (interfaces: Client) diff --git a/internal/hash.go b/internal/hash.go index 7c627f74..dc46566a 100644 --- a/internal/hash.go +++ b/internal/hash.go @@ -1,3 +1,6 @@ +// Copyright © 2024 Ory Corp +// SPDX-License-Identifier: Apache-2.0 + // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ory/fosite (interfaces: Hasher) diff --git a/internal/id_token_strategy.go b/internal/id_token_strategy.go index 21800ad5..502a3e27 100644 --- a/internal/id_token_strategy.go +++ b/internal/id_token_strategy.go @@ -1,3 +1,6 @@ +// Copyright © 2024 Ory Corp +// SPDX-License-Identifier: Apache-2.0 + // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ory/fosite/handler/openid (interfaces: OpenIDConnectTokenStrategy) diff --git a/internal/introspector.go b/internal/introspector.go index 138ef9dd..3db6d7c6 100644 --- a/internal/introspector.go +++ b/internal/introspector.go @@ -1,3 +1,6 @@ +// Copyright © 2024 Ory Corp +// SPDX-License-Identifier: Apache-2.0 + // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ory/fosite (interfaces: TokenIntrospector) diff --git a/internal/oauth2_auth_jwt_storage.go b/internal/oauth2_auth_jwt_storage.go index 1064bca0..025f210a 100644 --- a/internal/oauth2_auth_jwt_storage.go +++ b/internal/oauth2_auth_jwt_storage.go @@ -1,3 +1,6 @@ +// Copyright © 2024 Ory Corp +// SPDX-License-Identifier: Apache-2.0 + // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ory/fosite/handler/rfc7523 (interfaces: RFC7523KeyStorage) diff --git a/internal/oauth2_client_storage.go b/internal/oauth2_client_storage.go index dc70e8f5..e07df2e1 100644 --- a/internal/oauth2_client_storage.go +++ b/internal/oauth2_client_storage.go @@ -1,3 +1,6 @@ +// Copyright © 2024 Ory Corp +// SPDX-License-Identifier: Apache-2.0 + // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ory/fosite/handler/oauth2 (interfaces: ClientCredentialsGrantStorage) diff --git a/internal/oauth2_owner_storage.go b/internal/oauth2_owner_storage.go index ee6e4647..92188e2c 100644 --- a/internal/oauth2_owner_storage.go +++ b/internal/oauth2_owner_storage.go @@ -1,3 +1,6 @@ +// Copyright © 2024 Ory Corp +// SPDX-License-Identifier: Apache-2.0 + // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ory/fosite/handler/oauth2 (interfaces: ResourceOwnerPasswordCredentialsGrantStorage) diff --git a/internal/oauth2_revoke_storage.go b/internal/oauth2_revoke_storage.go index 39bfc6c4..df0b0ccc 100644 --- a/internal/oauth2_revoke_storage.go +++ b/internal/oauth2_revoke_storage.go @@ -1,3 +1,6 @@ +// Copyright © 2024 Ory Corp +// SPDX-License-Identifier: Apache-2.0 + // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ory/fosite/handler/oauth2 (interfaces: TokenRevocationStorage) diff --git a/internal/oauth2_storage.go b/internal/oauth2_storage.go index 14747eb8..014595c8 100644 --- a/internal/oauth2_storage.go +++ b/internal/oauth2_storage.go @@ -1,3 +1,6 @@ +// Copyright © 2024 Ory Corp +// SPDX-License-Identifier: Apache-2.0 + // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ory/fosite/handler/oauth2 (interfaces: CoreStorage) diff --git a/internal/oauth2_strategy.go b/internal/oauth2_strategy.go index 7122455a..a047d904 100644 --- a/internal/oauth2_strategy.go +++ b/internal/oauth2_strategy.go @@ -1,3 +1,6 @@ +// Copyright © 2024 Ory Corp +// SPDX-License-Identifier: Apache-2.0 + // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ory/fosite/handler/oauth2 (interfaces: CoreStrategy) diff --git a/internal/openid_id_token_storage.go b/internal/openid_id_token_storage.go index 62452b08..93db53a8 100644 --- a/internal/openid_id_token_storage.go +++ b/internal/openid_id_token_storage.go @@ -1,3 +1,6 @@ +// Copyright © 2024 Ory Corp +// SPDX-License-Identifier: Apache-2.0 + // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ory/fosite/handler/openid (interfaces: OpenIDConnectRequestStorage) diff --git a/internal/pkce_storage_strategy.go b/internal/pkce_storage_strategy.go index 4a2fc270..dbbf87b3 100644 --- a/internal/pkce_storage_strategy.go +++ b/internal/pkce_storage_strategy.go @@ -1,3 +1,6 @@ +// Copyright © 2024 Ory Corp +// SPDX-License-Identifier: Apache-2.0 + // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ory/fosite/handler/pkce (interfaces: PKCERequestStorage) diff --git a/internal/refresh_token_strategy.go b/internal/refresh_token_strategy.go index 17fd4959..8fe3c24c 100644 --- a/internal/refresh_token_strategy.go +++ b/internal/refresh_token_strategy.go @@ -1,3 +1,6 @@ +// Copyright © 2024 Ory Corp +// SPDX-License-Identifier: Apache-2.0 + // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ory/fosite/handler/oauth2 (interfaces: RefreshTokenStrategy) diff --git a/internal/request.go b/internal/request.go index 50d7bba2..50df1499 100644 --- a/internal/request.go +++ b/internal/request.go @@ -1,3 +1,6 @@ +// Copyright © 2024 Ory Corp +// SPDX-License-Identifier: Apache-2.0 + // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ory/fosite (interfaces: Requester) diff --git a/internal/revoke_handler.go b/internal/revoke_handler.go index ad0ed281..8080989a 100644 --- a/internal/revoke_handler.go +++ b/internal/revoke_handler.go @@ -1,3 +1,6 @@ +// Copyright © 2024 Ory Corp +// SPDX-License-Identifier: Apache-2.0 + // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ory/fosite (interfaces: RevocationHandler) diff --git a/internal/storage.go b/internal/storage.go index c64288b4..b2e50e31 100644 --- a/internal/storage.go +++ b/internal/storage.go @@ -1,3 +1,6 @@ +// Copyright © 2024 Ory Corp +// SPDX-License-Identifier: Apache-2.0 + // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ory/fosite (interfaces: Storage) diff --git a/internal/token_handler.go b/internal/token_handler.go index 97bfcaa2..780823e8 100644 --- a/internal/token_handler.go +++ b/internal/token_handler.go @@ -1,3 +1,6 @@ +// Copyright © 2024 Ory Corp +// SPDX-License-Identifier: Apache-2.0 + // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ory/fosite (interfaces: TokenEndpointHandler) diff --git a/internal/transactional.go b/internal/transactional.go index fab46f66..74a002d9 100644 --- a/internal/transactional.go +++ b/internal/transactional.go @@ -1,3 +1,6 @@ +// Copyright © 2024 Ory Corp +// SPDX-License-Identifier: Apache-2.0 + // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ory/fosite/storage (interfaces: Transactional) From b03cc94f78e14cd255c7ce21877b0519e8107be5 Mon Sep 17 00:00:00 2001 From: aeneasr <3372410+aeneasr@users.noreply.github.com> Date: Tue, 7 May 2024 14:05:50 +0200 Subject: [PATCH 4/4] chore: synchronize workspaces --- storage/transactional.go | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/storage/transactional.go b/storage/transactional.go index 87d57d9e..e06ba19a 100644 --- a/storage/transactional.go +++ b/storage/transactional.go @@ -5,15 +5,34 @@ package storage import "context" -// A storage provider that has support for transactions should implement this -// interface to ensure atomicity for certain flows that require transactional -// semantics. When atomicity is required, Fosite will group calls to the storage -// provider in a function and passes that to Transaction. Implementations are +// Transactional should be implemented by storage providers that support +// transactions to ensure atomicity for certain flows that require transactional +// semantics. When atomicity is required, Ory Fosite will group calls to the storage +// provider in a function and passes that to Transaction. Implementations are // expected to execute these calls in a transactional manner. Typically, a // handle to the transaction will be stored in the context. // // Implementations should rollback (or retry) the transaction if the callback // returns an error. +// +// function Transcation(ctx context.Context, f func(context.Context) error) error { +// tx, err := storage.BeginTx(ctx) +// if err != nil { +// return err +// } +// +// defer function() { +// if err != nil { +// tx.Rollback() +// } +// }() +// +// if err := f(tx); err != nil { +// return err +// } +// +// return tx.Commit() +// } type Transactional interface { Transaction(context.Context, func(context.Context) error) error }