1
0
mirror of https://github.com/imgproxy/imgproxy.git synced 2025-12-23 22:11:10 +02:00
Files
imgproxy/storage/common/lists.go
2025-10-30 14:34:18 +01:00

19 lines
396 B
Go

package common
import (
"slices"
)
// IsBucketAllowed checks if the provided bucket is allowed based on allowed and denied buckets lists.
func IsBucketAllowed(bucket string, allowedBuckets, deniedBuckets []string) bool {
if len(allowedBuckets) > 0 && !slices.Contains(allowedBuckets, bucket) {
return false
}
if slices.Contains(deniedBuckets, bucket) {
return false
}
return true
}