refacor: improvement of rate limiting

This commit is contained in:
Jonas Kaninda
2024-11-24 15:59:47 +01:00
parent 3b2889e002
commit 6258b07c82
8 changed files with 57 additions and 30 deletions

View File

@@ -80,13 +80,11 @@ type OauthEndpoint struct {
TokenURL string `yaml:"tokenUrl"`
UserInfoURL string `yaml:"userInfoUrl"`
}
type RateLimiter struct {
// ipBased, tokenBased
Type string `yaml:"type"`
Rate float64 `yaml:"rate"`
Rule int `yaml:"rule"`
}
type RateLimitRuleMiddleware struct {
Unit string `yaml:"unit"`
RequestsPerUnit int `yaml:"requestsPerUnit"`
}
type AccessRuleMiddleware struct {
ResponseCode int `yaml:"responseCode"` // HTTP Response code
}