Cleanup tests.

This commit is contained in:
2025-07-23 17:56:52 +01:00
parent af22256c96
commit f6b3f9ecab
5 changed files with 1 additions and 136 deletions
+17
View File
@@ -0,0 +1,17 @@
package traefikoidc
import (
"crypto/rand"
"encoding/hex"
)
// generateRandomString generates a random string of the specified length
// This is used in tests to create unique identifiers
func generateRandomString(length int) string {
bytes := make([]byte, length/2)
if _, err := rand.Read(bytes); err != nil {
// In tests, fallback to a predictable string if random fails
return "random-string-fallback"
}
return hex.EncodeToString(bytes)
}