aboutsummaryrefslogtreecommitdiffstats
path: root/jrt/src/com/yahoo/jrt/RequestAccessFilter.java
blob: 6701436d6cec0765a30a880eb9c320995ed36110 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.jrt;

/**
 * Request access filter is invoked before any call to {@link Method#invoke(Request)}.
 * If {@link #allow(Request)} returns false, the method is not invoked, and the request is failed with error
 * {@link ErrorCode#PERMISSION_DENIED}.
 *
 * @author bjorncs
 */
public interface RequestAccessFilter {

    RequestAccessFilter ALLOW_ALL = __ -> true;

    boolean allow(Request r);

}