fix: add missing PCE parameter to GenerateTokenPair calls in test files
The JWT GenerateTokenPair functions were updated to require a PCE (Password Changed Epoch) parameter for token invalidation. This commit updates test files in concurrent and performance packages to include this parameter. - internal/concurrent/concurrent_test.go: 2 call sites fixed - internal/performance/benchmark_test.go: 3 call sites fixed - internal/performance/performance_test.go: 4 call sites fixed
This commit is contained in:
@@ -68,13 +68,13 @@ func BenchmarkJWTGenerateToken(b *testing.B) {
|
||||
|
||||
b.ResetTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
_, _, _ = jwtManager.GenerateTokenPair(int64(i), "testuser")
|
||||
_, _, _ = jwtManager.GenerateTokenPair(int64(i), "testuser", 0)
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkJWTValidateToken(b *testing.B) {
|
||||
jwtManager := auth.NewJWT("benchmark-secret-key-32bytes!", 2*time.Hour, 7*24*time.Hour)
|
||||
token, _, _ := jwtManager.GenerateTokenPair(1, "testuser")
|
||||
token, _, _ := jwtManager.GenerateTokenPair(1, "testuser", 0)
|
||||
|
||||
b.ResetTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
@@ -87,7 +87,7 @@ func BenchmarkJWTGenerateAndValidate(b *testing.B) {
|
||||
|
||||
b.ResetTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
token, _, _ := jwtManager.GenerateTokenPair(int64(i), "testuser")
|
||||
token, _, _ := jwtManager.GenerateTokenPair(int64(i), "testuser", 0)
|
||||
jwtManager.ValidateAccessToken(token)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user