Package io.micronaut.security.event
Class SecurityEvent
java.lang.Object
java.util.EventObject
io.micronaut.context.event.ApplicationEvent
io.micronaut.security.event.SecurityEvent
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
LoginFailedEvent,LoginSuccessfulEvent,LogoutEvent,TokenValidatedEvent
@Internal
public abstract class SecurityEvent
extends io.micronaut.context.event.ApplicationEvent
Base class for security events.
- Since:
- 4.7.0
- Author:
- Tim Yates
- See Also:
-
Field Summary
Fields inherited from class java.util.EventObject
source -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedSecurityEvent(Object source, @Nullable String host, Locale locale) -
Method Summary
Methods inherited from class java.util.EventObject
getSource
-
Constructor Details
-
SecurityEvent
- Parameters:
source- The source of the eventhost- The hostname from the request if availablelocale- The locale of the request
-
-
Method Details
-
getHost
- Returns:
- The hostname from the request if available
-
getLocale
- Returns:
- The locale of the request
-
toString
The string representation never includes the source. Micronaut logs every published event at DEBUG using its string representation, and the source may carry tokens or an authentication with sensitive attributes.- Overrides:
toStringin classEventObject- Returns:
- The string representation of the event with the source redacted.
- Since:
- 4.18.2
-