Open Arsnael opened 2 years ago
I'm not completely sure on this one so don't hesitate to discuss choices here
I'm not completely sure on this one so don't hesitate to discuss choices here
IMO one domain should only have a single rate limiting plan. It would make the job of the connector even easier (set the plan of the domain instread of add one, remove one).
Proposal:
curl -XPUT http://ip:port/domains/{domain}/rate-limit-plan
Returns:
{"rateLimitPlanName": "XYZ"}
WDYT?
You mean instead of adding first a plan, then binding it to a domain, there would be just one route that would add and bind it to the domain directly correct?
I'm ok with that.
Concerning then the rest:
we still need a route to revoke the plan of a domain correct?
Yes.
curl -XPOST http://ip:port/domains/{domain}/rate-limit-plan
{
"rateLimitingPlanName": "payingPlan"
}
Today the RateLimiting plan on TMail is assigned individually to each user.
We should refactor that so we can change it to apply a plan to a domain (that will apply for every user belonging to that domain)
For this, we need to :
RateLimitingPlanUserRepository
->RateLimitingPlanDomainRepository
EnforceRateLimitingPlan
mailet to take into account the rate limiting plans on domains.RateLimitPlanDomainRoutes
Attach a plan to a domain:
Get list of domains belonging to a plan:
Get plan belonging to a domain:
Revoke plan of a domain:
DoD: unit tests + one integration test to show the routes are correctly bound to TMail