Class SecurityEventUtil
java.lang.Object
io.quarkus.opentelemetry.runtime.tracing.security.SecurityEventUtil
Synthetic CDI observers for various
SecurityEvent types configured during the build time use this util class
to export the events as the OpenTelemetry Span events, or authenticated user Span attributes.-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddAllEvents(SecurityEvent event) AddsSecurityEventas Span event.(package private) static voidaddEndUserAttributes(io.opentelemetry.api.trace.Span span) Adds Span attributes describing authenticated user if the user is authenticated and CDI request context is active.static voidIf there is already valid recordingSpan, attributes describing authenticated user are added to it.static voidAddsAuthenticationFailureEventas Span event.static voidAddsAuthenticationSuccessEventas Span event.static voidAddsAuthorizationFailureEventas Span event.static voidAddsAuthorizationSuccessEventas Span event.static voidaddEvent(SecurityEvent event) AddsSecurityEventas Span event that is not authN/authZ success/failure.static voidUpdates authenticated user Span attributes if theSecurityIdentitygot augmented during authorization.static voidUpdates authenticated user Span attributes if theSecurityIdentitygot augmented during authorization.
-
Field Details
-
QUARKUS_SECURITY_NAMESPACE
- See Also:
-
AUTHN_SUCCESS_EVENT_NAME
- See Also:
-
AUTHN_FAILURE_EVENT_NAME
- See Also:
-
AUTHZ_SUCCESS_EVENT_NAME
- See Also:
-
AUTHZ_FAILURE_EVENT_NAME
- See Also:
-
OTHER_EVENT_NAME
- See Also:
-
SECURITY_IDENTITY_PRINCIPAL
- See Also:
-
SECURITY_IDENTITY_IS_ANONYMOUS
- See Also:
-
QUARKUS_SECURITY_OTHER_EVENTS_NAMESPACE
- See Also:
-
FAILURE_NAME
- See Also:
-
AUTHORIZATION_CONTEXT
- See Also:
-
-
Method Details
-
addEndUserAttributes
static void addEndUserAttributes(io.opentelemetry.api.trace.Span span) Adds Span attributes describing authenticated user if the user is authenticated and CDI request context is active. This will be true for example inside JAX-RS resources when the CDI request context is already setup and user code creates a new Span.- Parameters:
span- valid and recording Span; must not be null
-
updateEndUserAttributes
Updates authenticated user Span attributes if theSecurityIdentitygot augmented during authorization. WARNING: This method is called from synthetic method observer. Any renaming must be reflected in the TracerProcessor.- Parameters:
event-AuthorizationFailureEvent
-
updateEndUserAttributes
Updates authenticated user Span attributes if theSecurityIdentitygot augmented during authorization. WARNING: This method is called from synthetic method observer. Any renaming must be reflected in the TracerProcessor.- Parameters:
event-AuthorizationSuccessEvent
-
addEndUserAttributes
If there is already valid recordingSpan, attributes describing authenticated user are added to it. WARNING: This method is called from synthetic method observer. Any renaming must be reflected in the TracerProcessor.- Parameters:
event-AuthenticationSuccessEvent
-
addAllEvents
AddsSecurityEventas Span event. WARNING: This method is called from synthetic method observer. Any renaming must be reflected in the TracerProcessor. -
addEvent
AddsAuthenticationSuccessEventas Span event. WARNING: This method is called from synthetic method observer. Any renaming must be reflected in the TracerProcessor. -
addEvent
AddsAuthenticationFailureEventas Span event. WARNING: This method is called from synthetic method observer. Any renaming must be reflected in the TracerProcessor. -
addEvent
AddsAuthorizationSuccessEventas Span event. WARNING: This method is called from synthetic method observer. Any renaming must be reflected in the TracerProcessor. -
addEvent
AddsAuthorizationFailureEventas Span event. WARNING: This method is called from synthetic method observer. Any renaming must be reflected in the TracerProcessor. -
addEvent
AddsSecurityEventas Span event that is not authN/authZ success/failure. WARNING: This method is called from synthetic method observer. Any renaming must be reflected in the TracerProcessor.
-