Procházet zdrojové kódy

Testing: Include BatchRevoke for all tokens in the fake. (#17728)

Leonard Gram před 6 roky
rodič
revize
d71043609e
1 změnil soubory, kde provedl 8 přidání a 0 odebrání
  1. 8 0
      pkg/services/auth/testing.go

+ 8 - 0
pkg/services/auth/testing.go

@@ -15,6 +15,7 @@ type FakeUserAuthTokenService struct {
 	ActiveAuthTokenCount        func(ctx context.Context) (int64, error)
 	GetUserTokenProvider        func(ctx context.Context, userId, userTokenId int64) (*models.UserToken, error)
 	GetUserTokensProvider       func(ctx context.Context, userId int64) ([]*models.UserToken, error)
+	BatchRevokedTokenProvider   func(ctx context.Context, userIds []int64) error
 }
 
 func NewFakeUserAuthTokenService() *FakeUserAuthTokenService {
@@ -40,6 +41,9 @@ func NewFakeUserAuthTokenService() *FakeUserAuthTokenService {
 		RevokeAllUserTokensProvider: func(ctx context.Context, userId int64) error {
 			return nil
 		},
+		BatchRevokedTokenProvider: func(ctx context.Context, userIds []int64) error {
+			return nil
+		},
 		ActiveAuthTokenCount: func(ctx context.Context) (int64, error) {
 			return 10, nil
 		},
@@ -83,3 +87,7 @@ func (s *FakeUserAuthTokenService) GetUserToken(ctx context.Context, userId, use
 func (s *FakeUserAuthTokenService) GetUserTokens(ctx context.Context, userId int64) ([]*models.UserToken, error) {
 	return s.GetUserTokensProvider(context.Background(), userId)
 }
+
+func (s *FakeUserAuthTokenService) BatchRevokeAllUserTokens(ctx context.Context, userIds []int64) error {
+	return s.BatchRevokedTokenProvider(ctx, userIds)
+}