Files
zitadel/backend/v3/domain/mock/user_repo.go
T
022bf74060 feat(session): Passkey Check API with relation tables (#11858)
# Which Problems Are Solved

As part of #11035 , this PR implements the Passkey check logic for
session validation

# How the Problems Are Solved

  - Refactor webauth FinishLogin to support new domain model
  - Add webauth config to defaults
  - Implement passkey check logic and tests
- Manual transaction management to avoid stalling the DB while
FinishLogin callback is executed
- Update passkey Type condition to allow passing a text operation
(equal, contains, etc..)

# Additional Context

This is a cherry-picked PR + minor changes, coming from
https://github.com/zitadel/zitadel/pull/11164
- Relates to #11035

---------

Co-authored-by: Fabienne Bühler <[email protected]>
Co-authored-by: Gayathri Vijayan <[email protected]>
2026-03-27 12:38:40 +01:00

56 lines
1.6 KiB
Go

package domainmock
import (
context "context"
gomock "go.uber.org/mock/gomock"
domain "github.com/zitadel/zitadel/backend/v3/domain"
database "github.com/zitadel/zitadel/backend/v3/storage/database"
"github.com/zitadel/zitadel/backend/v3/storage/database/repository"
)
func NewUserRepo(ctrl *gomock.Controller) *UserRepo {
return &UserRepo{
mock: NewMockUserRepository(ctrl),
UserRepository: repository.UserRepository(),
}
}
type UserRepo struct {
domain.UserRepository
mock *MockUserRepository
}
func (u *UserRepo) EXPECT() *MockUserRepositoryMockRecorder {
return u.mock.EXPECT()
}
func (u *UserRepo) Get(ctx context.Context, client database.QueryExecutor, opts ...database.QueryOption) (*domain.User, error) {
return u.mock.Get(ctx, client, opts...)
}
func (u *UserRepo) List(ctx context.Context, client database.QueryExecutor, opts ...database.QueryOption) ([]*domain.User, error) {
return u.mock.List(ctx, client, opts...)
}
func (u *UserRepo) Create(ctx context.Context, client database.QueryExecutor, user *domain.User) error {
return u.mock.Create(ctx, client, user)
}
func (u *UserRepo) Update(ctx context.Context, client database.QueryExecutor, condition database.Condition, changes ...database.Change) (int64, error) {
return u.mock.Update(ctx, client, condition, changes...)
}
func (u *UserRepo) Delete(ctx context.Context, client database.QueryExecutor, condition database.Condition) (int64, error) {
return u.mock.Delete(ctx, client, condition)
}
func (u *UserRepo) Human() domain.HumanUserRepository {
return u.mock.Human()
}
func (u *UserRepo) Machine() domain.MachineUserRepository {
return u.mock.Machine()
}