@Singleton public class SensitiveEndpointRule extends java.lang.Object implements SecurityRule
Modifier and Type | Field and Description |
---|---|
protected java.util.Map<io.micronaut.inject.ExecutableMethod,java.lang.Boolean> |
endpointMethods
A map where the key represents the method of an endpoint
and the value represents the endpoints sensitivity.
|
static java.lang.Integer |
ORDER
The order of the rule.
|
DENY_ALL, IS_ANONYMOUS, IS_AUTHENTICATED
Constructor and Description |
---|
SensitiveEndpointRule(io.micronaut.management.endpoint.EndpointSensitivityProcessor endpointSensitivityProcessor)
Constructs the rule with the existing and default endpoint
configurations used to determine if a given endpoint is
sensitive.
|
Modifier and Type | Method and Description |
---|---|
protected org.reactivestreams.Publisher<SecurityRuleResult> |
check(io.micronaut.http.HttpRequest<?> request,
Authentication authentication,
io.micronaut.inject.ExecutableMethod<?,?> method)
Evaluate the Endpoint's method.
|
org.reactivestreams.Publisher<SecurityRuleResult> |
check(io.micronaut.http.HttpRequest<?> request,
io.micronaut.web.router.RouteMatch<?> routeMatch,
Authentication authentication)
Returns a publisher that is required to emit a single security result
based on any conditions.
|
protected org.reactivestreams.Publisher<SecurityRuleResult> |
checkNotSensitive(io.micronaut.http.HttpRequest<?> request,
Authentication authentication,
io.micronaut.inject.ExecutableMethod<?,?> method)
Evaluates a non sensitive endpoint.
|
protected org.reactivestreams.Publisher<SecurityRuleResult> |
checkSensitiveAnonymous(io.micronaut.http.HttpRequest<?> request,
io.micronaut.inject.ExecutableMethod<?,?> method)
Evaluates a sensitive endpoint for an anonymous user.
|
protected org.reactivestreams.Publisher<SecurityRuleResult> |
checkSensitiveAuthenticated(io.micronaut.http.HttpRequest<?> request,
Authentication authentication,
io.micronaut.inject.ExecutableMethod<?,?> method)
Evaluates a sensitive endpoint for an authenticated user.
|
protected java.lang.String |
endpointName(io.micronaut.inject.ExecutableMethod<?,?> method) |
int |
getOrder() |
public static final java.lang.Integer ORDER
protected final java.util.Map<io.micronaut.inject.ExecutableMethod,java.lang.Boolean> endpointMethods
public SensitiveEndpointRule(io.micronaut.management.endpoint.EndpointSensitivityProcessor endpointSensitivityProcessor)
endpointSensitivityProcessor
- The endpoint configurationspublic org.reactivestreams.Publisher<SecurityRuleResult> check(io.micronaut.http.HttpRequest<?> request, @Nullable io.micronaut.web.router.RouteMatch<?> routeMatch, @Nullable Authentication authentication)
SecurityRule
check
in interface SecurityRule
request
- The current requestrouteMatch
- The matched route or empty if no route was matched. e.g. static resource.authentication
- The user authentication. Null if not authenticatedSecurityRuleResult
@NonNull protected org.reactivestreams.Publisher<SecurityRuleResult> check(@NonNull io.micronaut.http.HttpRequest<?> request, @Nullable Authentication authentication, @NonNull io.micronaut.inject.ExecutableMethod<?,?> method)
request
- HTTP Requestauthentication
- The authentication, or null if none foundmethod
- Route methodpublic int getOrder()
getOrder
in interface io.micronaut.core.order.Ordered
@NonNull protected org.reactivestreams.Publisher<SecurityRuleResult> checkSensitiveAuthenticated(@NonNull io.micronaut.http.HttpRequest<?> request, @NonNull Authentication authentication, @NonNull io.micronaut.inject.ExecutableMethod<?,?> method)
request
- HTTP Requestauthentication
- The authentication, or null if none foundmethod
- Endpoint's method@NonNull protected org.reactivestreams.Publisher<SecurityRuleResult> checkSensitiveAnonymous(@NonNull io.micronaut.http.HttpRequest<?> request, @NonNull io.micronaut.inject.ExecutableMethod<?,?> method)
request
- HTTP Requestmethod
- Endpoint's method@NonNull protected org.reactivestreams.Publisher<SecurityRuleResult> checkNotSensitive(@NonNull io.micronaut.http.HttpRequest<?> request, @Nullable Authentication authentication, @NonNull io.micronaut.inject.ExecutableMethod<?,?> method)
request
- HTTP Requestauthentication
- The authentication, or null if none foundmethod
- Endpoint's method@NonNull protected java.lang.String endpointName(@NonNull io.micronaut.inject.ExecutableMethod<?,?> method)
method
- Endpoint's method