Class AuthorizationObservationContext<T>
java.lang.Object
io.micrometer.observation.Observation.Context
org.springframework.security.authorization.AuthorizationObservationContext<T>
- All Implemented Interfaces:
io.micrometer.observation.Observation.ContextView
public class AuthorizationObservationContext<T>
extends io.micrometer.observation.Observation.Context
An
Observation.Context used during authorizations- Since:
- 6.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the observedAuthenticationfor this authorizationGet the observedAuthorizationDecisionGet the object for which access was requestedvoidsetAuthentication(Authentication authentication) Set the observedAuthenticationfor this authorizationvoidsetDecision(AuthorizationDecision decision) Set the observedAuthorizationDecisionMethods inherited from class io.micrometer.observation.Observation.Context
addHighCardinalityKeyValue, addHighCardinalityKeyValues, addLowCardinalityKeyValue, addLowCardinalityKeyValues, clear, computeIfAbsent, containsKey, get, getAllKeyValues, getContextualName, getError, getHighCardinalityKeyValues, getLowCardinalityKeyValues, getName, getOrDefault, getParentObservation, getRequired, put, remove, setContextualName, setError, setName, setParentObservation, toString
-
Constructor Details
-
AuthorizationObservationContext
-
-
Method Details
-
getAuthentication
Get the observedAuthenticationfor this authorizationNote that if the authorization did not require inspecting the
Authentication, this will returnnull.- Returns:
- any observed
Authentication,nullotherwise
-
setAuthentication
Set the observedAuthenticationfor this authorization- Parameters:
authentication- the observedAuthentication
-
getObject
Get the object for which access was requested- Returns:
- the requested object
-
getDecision
Get the observedAuthorizationDecision- Returns:
- the observed
AuthorizationDecision
-
setDecision
Set the observedAuthorizationDecision- Parameters:
decision- the observedAuthorizationDecision
-