Record Class KdfResourceBudget
java.lang.Object
java.lang.Record
com.svenruppert.jsentinel.credential.password.limiter.KdfResourceBudget
- Record Components:
maxConcurrent- cap on parallel KDF invocationsmaxWait- how long a caller blocks waiting for a permit before the limiter rejects
Resource budget for the
KdfExecutionLimiter.
Phase 1a only spends the maxConcurrent and maxWait
fields; memory-hard providers (Phase 1b) consume the same budget to
enforce process-wide concurrency limits for Argon2id / scrypt.
-
Constructor Summary
ConstructorsConstructorDescriptionKdfResourceBudget(int maxConcurrent, Duration maxWait) Creates an instance of aKdfResourceBudgetrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic KdfResourceBudgetdefaults()Sensible default for Phase 1a: 16 concurrent verifications, with up to 250 ms blocking on a permit before the limiter rejects.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intReturns the value of themaxConcurrentrecord component.maxWait()Returns the value of themaxWaitrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
KdfResourceBudget
Creates an instance of aKdfResourceBudgetrecord class.- Parameters:
maxConcurrent- the value for themaxConcurrentrecord componentmaxWait- the value for themaxWaitrecord component
-
-
Method Details
-
defaults
Sensible default for Phase 1a: 16 concurrent verifications, with up to 250 ms blocking on a permit before the limiter rejects. -
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
maxConcurrent
public int maxConcurrent()Returns the value of themaxConcurrentrecord component.- Returns:
- the value of the
maxConcurrentrecord component
-
maxWait
-