Initial version for Gerrit 2.14

This plugin allows to enforce rate limits in Gerrit. Rate limits define
the maximum request rate for users in a given group.

This plugin is a fork of rate limits feature of the quota plugin
introduced in [1]. One of the reasons for forking/extracting the rate
limits out of the quota was to be able to use rate limits without the
overhead of quota which is calculating size on disk even if no quota are
set.

Another reason for forking was the way the rate limits were working. One
major difference between this implementation and the original one is the
way the limiter is implemented. Original implementation is using Guava's
RateLimiter and this one is not and implemented its own simplified
RateLimiter which only support hourly rate limits without bursts.

The reason for that simplification is Guava rate limiter unit is seconds
and this caused confusion for blocked users when limit is set using
another unit than seconds. For example, if 60 fetches per hour are
allowed, the user will in fact be allowed 1 fetch per 60 seconds and if
he fetched twice in the same minute, he would have received an error
message saying that he did more that 60 fetches in the last hour.

[1]https://gerrit-review.googlesource.com/c/plugins/quota/+/106976

Change-Id: I00f4c3af55ae540d644e2ca021b5d9758c98b829
47 files changed