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(io.quarkus.security.spi.runtime.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 voidaddEndUserAttributes(io.quarkus.security.spi.runtime.AuthenticationSuccessEvent event) If there is already valid recordingSpan, attributes describing authenticated user are added to it.static voidaddEvent(io.quarkus.security.spi.runtime.AuthenticationFailureEvent event) AddsAuthenticationFailureEventas Span event.static voidaddEvent(io.quarkus.security.spi.runtime.AuthenticationSuccessEvent event) AddsAuthenticationSuccessEventas Span event.static voidaddEvent(io.quarkus.security.spi.runtime.AuthorizationFailureEvent event) AddsAuthorizationFailureEventas Span event.static voidaddEvent(io.quarkus.security.spi.runtime.AuthorizationSuccessEvent event) AddsAuthorizationSuccessEventas Span event.static voidaddEvent(io.quarkus.security.spi.runtime.SecurityEvent event) AddsSecurityEventas Span event that is not authN/authZ success/failure.static voidupdateEndUserAttributes(io.quarkus.security.spi.runtime.AuthorizationFailureEvent event) Updates authenticated user Span attributes if theSecurityIdentitygot augmented during authorization.static voidupdateEndUserAttributes(io.quarkus.security.spi.runtime.AuthorizationSuccessEvent event) Updates 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
public static void updateEndUserAttributes(io.quarkus.security.spi.runtime.AuthorizationFailureEvent event) 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
public static void updateEndUserAttributes(io.quarkus.security.spi.runtime.AuthorizationSuccessEvent event) 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
public static void addEndUserAttributes(io.quarkus.security.spi.runtime.AuthenticationSuccessEvent event) 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
public static void addAllEvents(io.quarkus.security.spi.runtime.SecurityEvent event) AddsSecurityEventas Span event. WARNING: This method is called from synthetic method observer. Any renaming must be reflected in the TracerProcessor. -
addEvent
public static void addEvent(io.quarkus.security.spi.runtime.AuthenticationSuccessEvent event) AddsAuthenticationSuccessEventas Span event. WARNING: This method is called from synthetic method observer. Any renaming must be reflected in the TracerProcessor. -
addEvent
public static void addEvent(io.quarkus.security.spi.runtime.AuthenticationFailureEvent event) AddsAuthenticationFailureEventas Span event. WARNING: This method is called from synthetic method observer. Any renaming must be reflected in the TracerProcessor. -
addEvent
public static void addEvent(io.quarkus.security.spi.runtime.AuthorizationSuccessEvent event) AddsAuthorizationSuccessEventas Span event. WARNING: This method is called from synthetic method observer. Any renaming must be reflected in the TracerProcessor. -
addEvent
public static void addEvent(io.quarkus.security.spi.runtime.AuthorizationFailureEvent event) AddsAuthorizationFailureEventas Span event. WARNING: This method is called from synthetic method observer. Any renaming must be reflected in the TracerProcessor. -
addEvent
public static void addEvent(io.quarkus.security.spi.runtime.SecurityEvent event) 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.
-