Record Class AbuseAttemptContext
java.lang.Object
java.lang.Record
com.svenruppert.jsentinel.credential.abuse.AbuseAttemptContext
- Record Components:
attemptType- what the caller is about to dousername- optional — login/password-change attempts always know it, an anonymous reset request might notclientAddress- optional — best-effort remote identifiertenant-TenantId.DEFAULTfor single-tenant deploymentsat- attempt timestamp; the service does not callInstant.now()on its own
public record AbuseAttemptContext(AbuseAttemptType attemptType, Optional<String> username, Optional<String> clientAddress, TenantId tenant, Instant at)
extends Record
Adapter-neutral attempt context passed into
AbuseDetectionService.evaluate(AbuseAttemptContext) and
AbuseDetectionService.recordOutcome(AbuseAttemptContext, AttemptOutcome).
Every field is structural: usernames are stored verbatim,
client addresses are opaque strings, the tenant defaults to
TenantId.DEFAULT. No password or token material ever
appears here (CWE-209 / CWE-522).
-
Constructor Summary
ConstructorsConstructorDescriptionAbuseAttemptContext(AbuseAttemptType attemptType, Optional<String> username, Optional<String> clientAddress, TenantId tenant, Instant at) Creates an instance of aAbuseAttemptContextrecord class. -
Method Summary
Modifier and TypeMethodDescriptionat()Returns the value of theatrecord component.Returns the value of theattemptTyperecord component.Returns the value of theclientAddressrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.tenant()Returns the value of thetenantrecord component.final StringtoString()Returns a string representation of this record class.username()Returns the value of theusernamerecord component.
-
Constructor Details
-
AbuseAttemptContext
public AbuseAttemptContext(AbuseAttemptType attemptType, Optional<String> username, Optional<String> clientAddress, TenantId tenant, Instant at) Creates an instance of aAbuseAttemptContextrecord class.- Parameters:
attemptType- the value for theattemptTyperecord componentusername- the value for theusernamerecord componentclientAddress- the value for theclientAddressrecord componenttenant- the value for thetenantrecord componentat- the value for theatrecord component
-
-
Method Details
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
attemptType
Returns the value of theattemptTyperecord component.- Returns:
- the value of the
attemptTyperecord component
-
username
-
clientAddress
Returns the value of theclientAddressrecord component.- Returns:
- the value of the
clientAddressrecord component
-
tenant
-
at
-