Class ObservationAuthorizationManager<T>
java.lang.Object
org.springframework.security.authorization.ObservationAuthorizationManager<T>
- All Implemented Interfaces:
- org.springframework.beans.factory.Aware,- org.springframework.context.MessageSourceAware,- AuthorizationManager<T>,- MethodAuthorizationDeniedHandler
public final class ObservationAuthorizationManager<T>
extends Object
implements AuthorizationManager<T>, org.springframework.context.MessageSourceAware, MethodAuthorizationDeniedHandler
An 
AuthorizationManager that observes the authorization- Since:
- 6.0
- 
Constructor SummaryConstructorsConstructorDescriptionObservationAuthorizationManager(io.micrometer.observation.ObservationRegistry registry, AuthorizationManager<T> delegate) 
- 
Method SummaryModifier and TypeMethodDescriptioncheck(Supplier<Authentication> authentication, T object) Deprecated.handleDeniedInvocation(org.aopalliance.intercept.MethodInvocation methodInvocation, AuthorizationResult authorizationResult) Handle denied method invocations, implementations might either throw anAuthorizationDeniedExceptionor a replacement result instead of invoking the method, e.g.handleDeniedInvocationResult(MethodInvocationResult methodInvocationResult, AuthorizationResult authorizationResult) Handle denied method invocations, implementations might either throw anAuthorizationDeniedExceptionor a replacement result instead of invoking the method, e.g.voidsetMessageSource(org.springframework.context.MessageSource messageSource) Set the MessageSource that this object runs in.voidsetObservationConvention(io.micrometer.observation.ObservationConvention<AuthorizationObservationContext<?>> convention) Use the provided convention for reporting observation dataMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.security.authorization.AuthorizationManagerauthorize, verify
- 
Constructor Details- 
ObservationAuthorizationManagerpublic ObservationAuthorizationManager(io.micrometer.observation.ObservationRegistry registry, AuthorizationManager<T> delegate) 
 
- 
- 
Method Details- 
checkDeprecated.please useAuthorizationManager.authorize(Supplier, Object)insteadDescription copied from interface:AuthorizationManagerDetermines if access is granted for a specific authentication and object.- Specified by:
- checkin interface- AuthorizationManager<T>
- Parameters:
- authentication- the- Supplierof the- Authenticationto check
- object- the- AuthorizationManagerobject to check
- Returns:
- an AuthorizationDecisionor null if no decision could be made
 
- 
setObservationConventionpublic void setObservationConvention(io.micrometer.observation.ObservationConvention<AuthorizationObservationContext<?>> convention) Use the provided convention for reporting observation data- Parameters:
- convention- The provided convention
- Since:
- 6.1
 
- 
setMessageSourcepublic void setMessageSource(org.springframework.context.MessageSource messageSource) Set the MessageSource that this object runs in.- Specified by:
- setMessageSourcein interface- org.springframework.context.MessageSourceAware
- Parameters:
- messageSource- The message source to be used by this object
- Since:
- 6.2
 
- 
handleDeniedInvocationpublic Object handleDeniedInvocation(org.aopalliance.intercept.MethodInvocation methodInvocation, AuthorizationResult authorizationResult) Description copied from interface:MethodAuthorizationDeniedHandlerHandle denied method invocations, implementations might either throw anAuthorizationDeniedExceptionor a replacement result instead of invoking the method, e.g. a masked value.- Specified by:
- handleDeniedInvocationin interface- MethodAuthorizationDeniedHandler
- Parameters:
- methodInvocation- the- MethodInvocationrelated to the authorization denied
- authorizationResult- the authorization denied result
- Returns:
- a replacement result for the denied method invocation, or null, or a
 Monofor reactive applications
 
- 
handleDeniedInvocationResultpublic Object handleDeniedInvocationResult(MethodInvocationResult methodInvocationResult, AuthorizationResult authorizationResult) Description copied from interface:MethodAuthorizationDeniedHandlerHandle denied method invocations, implementations might either throw anAuthorizationDeniedExceptionor a replacement result instead of invoking the method, e.g. a masked value. By default, this method invokesMethodAuthorizationDeniedHandler.handleDeniedInvocation(MethodInvocation, AuthorizationResult).- Specified by:
- handleDeniedInvocationResultin interface- MethodAuthorizationDeniedHandler
- Parameters:
- methodInvocationResult- the object containing the- MethodInvocationand the result produced
- authorizationResult- the authorization denied result
- Returns:
- a replacement result for the denied method invocation, or null, or a
 Monofor reactive applications
 
 
- 
AuthorizationManager.authorize(Supplier, Object)instead