Class RateLimitService

java.lang.Object
io.jans.as.server.rate.RateLimitService

@ApplicationScoped public class RateLimitService extends Object
Author:
Yuriy Z
  • Field Details

    • KEY_LENGTH_LIMIT_FOR_DIGEST

      public static final int KEY_LENGTH_LIMIT_FOR_DIGEST
      See Also:
  • Constructor Details

    • RateLimitService

      public RateLimitService()
  • Method Details

    • validateRateLimit

      public jakarta.servlet.http.HttpServletRequest validateRateLimit(jakarta.servlet.http.HttpServletRequest httpRequest) throws RateLimitedException, IOException
      Throws:
      RateLimitedException
      IOException
    • saveSpaceIfNeeded

      @NotNull public static @NotNull String saveSpaceIfNeeded(String key)
    • buildKey

      public String buildKey(RateLimitContext rateLimitContext, io.jans.as.model.configuration.rate.RateLimitRule rule) throws IOException
      Throws:
      IOException
    • extractKey

      protected String extractKey(io.jans.as.model.configuration.rate.KeyExtractor keyExtractor, RateLimitContext rateLimitContext) throws IOException
      Throws:
      IOException
    • matchRulesByPathAndMethod

      public List<io.jans.as.model.configuration.rate.RateLimitRule> matchRulesByPathAndMethod(String requestPath, String method)
    • parseBody

      public org.json.JSONObject parseBody(String body)
    • init

      @PostConstruct public void init()
    • updateConfiguration

      public void updateConfiguration(@Observes @ConfigurationUpdate io.jans.as.model.configuration.AppConfiguration appConfiguration)