Files
ocis/vendor/github.com/go-chi/httprate/limit_key.go
Roman Perekhod c66464cab6 fix: [OCISDEV-825] Rate-limit the exportPersonalData endpoint (#12519)
* fix: Rate-limit the exportPersonalData endpoint

* fix: the RequreSelfUserID validation middleware added
2026-07-08 14:57:44 +02:00

16 lines
245 B
Go

package httprate
import (
"strconv"
"time"
"github.com/zeebo/xxh3"
)
func LimitCounterKey(key string, window time.Time) uint64 {
h := xxh3.New()
h.WriteString(key)
h.WriteString(strconv.FormatInt(window.Unix(), 10))
return h.Sum64()
}