All Downloads are FREE. Search and download functionalities are using the official Maven repository.

sirius.web.http.Firewall Maven / Gradle / Ivy

/*
 * Made with all the love in the world
 * by scireum in Remshalden, Germany
 *
 * Copyright by scireum GmbH
 * http://www.scireum.de - [email protected]
 */

package sirius.web.http;

/**
 * Permits an application to provide a firewall which can perform IP filtering and rate limiting.
 */
public interface Firewall {

    /**
     * Determines if the remote IP of the given request is blacklisted
     *
     * @param ctx the request to check
     * @return true if the remote IP is blacklisted, false otherwise
     */
    boolean isIPBlacklisted(WebContext ctx);

    /**
     * Performs rate limiting for the given request and realm.
     *
     * @param ctx   the request to check
     * @param realm the realm to use for rate limiting
     * @return true if the request was handled due to rate limiting, false otherwise
     * @see Limited
     * @see Unlimited
     */
    boolean handleRateLimiting(WebContext ctx, String realm);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy