Class ReactiveSecurityDataFetcherExceptionResolver
java.lang.Object
org.springframework.graphql.execution.ReactiveSecurityDataFetcherExceptionResolver
- All Implemented Interfaces:
- DataFetcherExceptionResolver
public class ReactiveSecurityDataFetcherExceptionResolver
extends Object
implements DataFetcherExceptionResolver
Reactive
 
DataFetcherExceptionResolver
 for Spring Security exceptions. For use in applications with a reactive
 transport (e.g. WebFlux HTTP endpoint).- Since:
- 1.0.0
- Author:
- Rob Winch, Rossen Stoyanchev
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionreactor.core.publisher.Mono<List<graphql.GraphQLError>> resolveException(Throwable ex, graphql.schema.DataFetchingEnvironment environment) Resolve the given exception and return the error(s) to add to the response.voidsetAuthenticationTrustResolver(org.springframework.security.authentication.AuthenticationTrustResolver trustResolver) Set the resolver to use to check if an authentication is anonymous that in turn determines whetherAccessDeniedExceptionis classified as "unauthorized" or "forbidden".
- 
Constructor Details- 
ReactiveSecurityDataFetcherExceptionResolverpublic ReactiveSecurityDataFetcherExceptionResolver()
 
- 
- 
Method Details- 
setAuthenticationTrustResolverpublic void setAuthenticationTrustResolver(org.springframework.security.authentication.AuthenticationTrustResolver trustResolver) Set the resolver to use to check if an authentication is anonymous that in turn determines whetherAccessDeniedExceptionis classified as "unauthorized" or "forbidden".- Parameters:
- trustResolver- the resolver to use
 
- 
resolveExceptionpublic reactor.core.publisher.Mono<List<graphql.GraphQLError>> resolveException(Throwable ex, graphql.schema.DataFetchingEnvironment environment) Description copied from interface:DataFetcherExceptionResolverResolve the given exception and return the error(s) to add to the response.Implementations can use GraphqlErrorBuilder.newError(DataFetchingEnvironment)to create an error with the coordinates of the target field, and useErrorTypeto specify a category for the error.- Specified by:
- resolveExceptionin interface- DataFetcherExceptionResolver
- Parameters:
- ex- the exception to resolve
- environment- the environment for the invoked- DataFetcher
- Returns:
- a Monowith errors to add to the GraphQL response; if theMonocompletes with an empty List, the exception is resolved without any errors added to the response; if theMonocompletes empty, without emitting a List, the exception remains unresolved and that allows other resolvers to resolve it.
 
 
-