Class IdRateLimitUserLoginService

java.lang.Object
com.io7m.idstore.server.service.ratelimit.IdRateLimitUserLoginService
All Implemented Interfaces:
IdRateLimitUserLoginServiceType, com.io7m.repetoir.core.RPServiceType

public final class IdRateLimitUserLoginService extends Object implements IdRateLimitUserLoginServiceType
A rate limiting service for logins.
  • Method Details

    • create

      public static IdRateLimitUserLoginServiceType create(IdServerTelemetryServiceType telemetry, long expiration, TimeUnit timeUnit)
      Create a rate limit service.
      Parameters:
      telemetry - The telemetry service
      expiration - The expiration for tokens
      timeUnit - The time unit for expirations
      Returns:
      A rate limiter
    • isAllowedByRateLimit

      public boolean isAllowedByRateLimit(String host)
      Specified by:
      isAllowedByRateLimit in interface IdRateLimitUserLoginServiceType
      Parameters:
      host - The host performing the action
      Returns:
      true if the given operation is allowed by rate limiting
    • description

      public String description()
      Specified by:
      description in interface com.io7m.repetoir.core.RPServiceType
    • toString

      public String toString()
      Overrides:
      toString in class Object