public class ReactiveSecurityDataFetcherExceptionResolver extends Object implements DataFetcherExceptionResolver
DataFetcherExceptionResolver
for Spring Security exceptions. For use in applications with a reactive
transport (e.g. WebFlux HTTP endpoint).| Constructor and Description |
|---|
ReactiveSecurityDataFetcherExceptionResolver() |
| Modifier and Type | Method and Description |
|---|---|
reactor.core.publisher.Mono<List<GraphQLError>> |
resolveException(Throwable ex,
DataFetchingEnvironment environment)
Resolve the given exception and return the error(s) to add to the response.
|
void |
setAuthenticationTrustResolver(org.springframework.security.authentication.AuthenticationTrustResolver trustResolver)
Set the resolver to use to check if an authentication is anonymous that
in turn determines whether
AccessDeniedException is classified
as "unauthorized" or "forbidden". |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforSingleErrorpublic ReactiveSecurityDataFetcherExceptionResolver()
public void setAuthenticationTrustResolver(org.springframework.security.authentication.AuthenticationTrustResolver trustResolver)
AccessDeniedException is classified
as "unauthorized" or "forbidden".trustResolver - the resolver to usepublic reactor.core.publisher.Mono<List<GraphQLError>> resolveException(Throwable ex, DataFetchingEnvironment environment)
DataFetcherExceptionResolverImplementations can use
GraphqlErrorBuilder.newError(DataFetchingEnvironment) to
create an error with the coordinates of the target field, and use
ErrorType to specify a category for the error.
resolveException in interface DataFetcherExceptionResolverex - the exception to resolveenvironment - the environment for the invoked DataFetcherMono with errors to add to the GraphQL response;
if the Mono completes with an empty List, the exception is resolved
without any errors added to the response; if the Mono completes
empty, without emitting a List, the exception remains unresolved and that
allows other resolvers to resolve it.