Class SecurityEventUtil

java.lang.Object
io.quarkus.opentelemetry.runtime.tracing.security.SecurityEventUtil

public final class SecurityEventUtil extends Object
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 Details

  • 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(AuthorizationFailureEvent event)
      Updates authenticated user Span attributes if the SecurityIdentity got 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(AuthorizationSuccessEvent event)
      Updates authenticated user Span attributes if the SecurityIdentity got 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(AuthenticationSuccessEvent event)
      If there is already valid recording Span, 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(SecurityEvent event)
      Adds SecurityEvent as Span event. WARNING: This method is called from synthetic method observer. Any renaming must be reflected in the TracerProcessor.
    • addEvent

      public static void addEvent(AuthenticationSuccessEvent event)
      Adds AuthenticationSuccessEvent as Span event. WARNING: This method is called from synthetic method observer. Any renaming must be reflected in the TracerProcessor.
    • addEvent

      public static void addEvent(AuthenticationFailureEvent event)
      Adds AuthenticationFailureEvent as Span event. WARNING: This method is called from synthetic method observer. Any renaming must be reflected in the TracerProcessor.
    • addEvent

      public static void addEvent(AuthorizationSuccessEvent event)
      Adds AuthorizationSuccessEvent as Span event. WARNING: This method is called from synthetic method observer. Any renaming must be reflected in the TracerProcessor.
    • addEvent

      public static void addEvent(AuthorizationFailureEvent event)
      Adds AuthorizationFailureEvent as Span event. WARNING: This method is called from synthetic method observer. Any renaming must be reflected in the TracerProcessor.
    • addEvent

      public static void addEvent(SecurityEvent event)
      Adds SecurityEvent as 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.