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
-
Method Summary
Modifier and TypeMethodDescriptionGet the observedAuthentication
for this authorizationGet the observedAuthorizationResult
Deprecated.Get the object for which access was requestedvoid
setAuthentication
(Authentication authentication) Set the observedAuthentication
for this authorizationvoid
setAuthorizationResult
(AuthorizationResult authorizationResult) Set the observedAuthorizationResult
void
setDecision
(AuthorizationDecision decision) Deprecated.please usesetAuthorizationResult(AuthorizationResult)
insteadMethods inherited from class io.micrometer.observation.Observation.Context
addHighCardinalityKeyValue, addHighCardinalityKeyValues, addLowCardinalityKeyValue, addLowCardinalityKeyValues, clear, computeIfAbsent, containsKey, get, getAllKeyValues, getContextualName, getError, getHighCardinalityKeyValue, getHighCardinalityKeyValues, getLowCardinalityKeyValue, getLowCardinalityKeyValues, getName, getOrDefault, getParentObservation, getRequired, put, remove, removeHighCardinalityKeyValue, removeHighCardinalityKeyValues, removeLowCardinalityKeyValue, removeLowCardinalityKeyValues, setContextualName, setError, setName, setParentObservation, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface io.micrometer.observation.Observation.ContextView
getOrDefault
-
Constructor Details
-
AuthorizationObservationContext
-
-
Method Details
-
getAuthentication
Get the observedAuthentication
for this authorizationNote that if the authorization did not require inspecting the
Authentication
, this will returnnull
.- Returns:
- any observed
Authentication
,null
otherwise
-
setAuthentication
Set the observedAuthentication
for this authorization- Parameters:
authentication
- the observedAuthentication
-
getObject
Get the object for which access was requested- Returns:
- the requested object
-
getDecision
Deprecated.please usegetAuthorizationResult()
insteadGet the observedAuthorizationDecision
- Returns:
- the observed
AuthorizationDecision
-
setDecision
Deprecated.please usesetAuthorizationResult(AuthorizationResult)
insteadSet the observedAuthorizationDecision
- Parameters:
decision
- the observedAuthorizationDecision
-
getAuthorizationResult
Get the observedAuthorizationResult
- Returns:
- the observed
AuthorizationResult
- Since:
- 6.4
-
setAuthorizationResult
Set the observedAuthorizationResult
- Parameters:
authorizationResult
- the observedAuthorizationResult
- Since:
- 6.4
-
getAuthorizationResult()
instead