Class InMemoryDPoPSingleUseChecker
java.lang.Object
com.nimbusds.oauth2.sdk.dpop.verifiers.InMemoryDPoPSingleUseChecker
- All Implemented Interfaces:
SingleUseChecker<DPoPProofUse>
@ThreadSafe
public class InMemoryDPoPSingleUseChecker
extends Object
implements SingleUseChecker<DPoPProofUse>
In-memory DPoP proof JWT single use checker. Caches a hash of the checked
DPoP JWT "jti" (JWT ID) claims for a given DPoP issuer.
Shut down
the checker when no longer in use.-
Constructor Summary
ConstructorsConstructorDescriptionInMemoryDPoPSingleUseChecker
(long lifetimeSeconds, long purgeIntervalSeconds) Creates a new DPoP proof JWT single use checker. -
Method Summary
Modifier and TypeMethodDescriptionint
Returns the number of cached items.void
markAsUsed
(DPoPProofUse dPoPProofUse) Marks the specified object as used.void
shutdown()
Shuts down this checker and frees any associated resources.
-
Constructor Details
-
InMemoryDPoPSingleUseChecker
Creates a new DPoP proof JWT single use checker.- Parameters:
lifetimeSeconds
- The lifetime of cached DPoP proof "jti" (JWT ID) claims, in seconds.purgeIntervalSeconds
- The interval in seconds for purging the cached "jti" (JWT ID) claims of checked DPoP proofs.
-
-
Method Details
-
markAsUsed
Description copied from interface:SingleUseChecker
Marks the specified object as used.- Specified by:
markAsUsed
in interfaceSingleUseChecker<DPoPProofUse>
- Parameters:
dPoPProofUse
- The object to mark as used. Must not benull
.- Throws:
AlreadyUsedException
- If the object was already marked as used.
-
getCacheSize
Returns the number of cached items.- Returns:
- The cached items, zero if none.
-
shutdown
Shuts down this checker and frees any associated resources.
-