Added test capability and tests for authentication middleware

This commit is contained in:
2025-02-12 21:23:13 +11:00
parent ca92d573ba
commit 2d52084fa7
12 changed files with 334 additions and 9 deletions

View File

@@ -21,12 +21,12 @@ func GetEnvDefault(key string, defaultValue string) string {
func GetEnvDur(key string, defaultValue time.Duration) time.Duration {
val, exists := os.LookupEnv(key)
if !exists {
return defaultValue
return time.Duration(defaultValue)
}
intVal, err := strconv.Atoi(val)
if err != nil {
return defaultValue
return time.Duration(defaultValue)
}
return time.Duration(intVal)