Package io.jans.as.server.rate
Class RateLimitService
java.lang.Object
io.jans.as.server.rate.RateLimitService
- Author:
- Yuriy Z
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuildKey(RateLimitContext rateLimitContext, io.jans.as.model.configuration.rate.RateLimitRule rule) protected StringextractKey(io.jans.as.model.configuration.rate.KeyExtractor keyExtractor, RateLimitContext rateLimitContext) voidinit()List<io.jans.as.model.configuration.rate.RateLimitRule>matchRulesByPathAndMethod(String requestPath, String method) org.json.JSONObjectstatic @NotNull StringsaveSpaceIfNeeded(String key) voidupdateConfiguration(io.jans.as.model.configuration.AppConfiguration appConfiguration) jakarta.servlet.http.HttpServletRequestvalidateRateLimit(jakarta.servlet.http.HttpServletRequest httpRequest)
-
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:
RateLimitedExceptionIOException
-
saveSpaceIfNeeded
-
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
-
parseBody
-
init
@PostConstruct public void init() -
updateConfiguration
public void updateConfiguration(@Observes @ConfigurationUpdate io.jans.as.model.configuration.AppConfiguration appConfiguration)
-