public interface TokenHolder
TokenService and its relevant subclass(es)| Modifier and Type | Method and Description |
|---|---|
String |
createMasterTokenIfAbsent(String sessionKey,
Supplier<String> valueSupplier)
Creates and returns a new master token bound to the provided session key if there wasn't any or returns the existing value.
|
String |
createPageTokenIfAbsent(String sessionKey,
String resourceUri,
Supplier<String> valueSupplier)
Creates and returns a new page token bound to the provided resource URI and mapped to the session key if there wasn't any or returns the existing value.
|
String |
getPageToken(String sessionKey,
String resourceUri)
Returns the page token based on the desired HTTP resource URI and logical session key
|
Map<String,String> |
getPageTokens(String sessionKey)
Returns all page tokens associated to the provided logical session key
|
Token |
getToken(String sessionKey)
Returns the master and page tokens associated to a logical session key
|
void |
regenerateUsedPageToken(String sessionKey,
String tokenFromRequest,
Supplier<String> tokenValueSupplier)
Re-generates the value of a used page token
|
void |
remove(String sessionKey)
Removes all tokens related to a specific logical session key
|
void |
rotateAllPageTokens(String sessionKey,
Supplier<String> tokenValueSupplier)
Re-generates all existing tokens associated to the provided logical session key
|
void |
setMasterToken(String sessionKey,
String value)
Sets or overwrites the master token bound to a specific session key.
|
void |
setPageToken(String sessionKey,
String resourceUri,
String value)
Sets the value of a page token based on the desired HTTP resource URI and logical session key
|
void |
setPageTokens(String sessionKey,
Map<String,String> pageTokens)
Sets/overwrites the page tokens with the provided values
|
void setMasterToken(String sessionKey, String value)
sessionKey - identifies the current logical session uniquelyvalue - the value to be used as master tokenString createMasterTokenIfAbsent(String sessionKey, Supplier<String> valueSupplier)
sessionKey - identifies the current logical session uniquelyvalueSupplier - produces a new master token value lazily/on demandString createPageTokenIfAbsent(String sessionKey, String resourceUri, Supplier<String> valueSupplier)
sessionKey - identifies the current logical session uniquelyresourceUri - the URI of the desired HTTP resourcevalueSupplier - produces a new page token value lazily/on demandToken getToken(String sessionKey)
sessionKey - identifies the current logical session uniquelyString getPageToken(String sessionKey, String resourceUri)
sessionKey - identifies the current logical session uniquelyresourceUri - the URI of the desired HTTP resourcevoid setPageToken(String sessionKey, String resourceUri, String value)
sessionKey - identifies the current logical session uniquelyresourceUri - the URI of the desired HTTP resourcevalue - the value to be used as token for the pagevoid setPageTokens(String sessionKey, Map<String,String> pageTokens)
sessionKey - identifies the current logical session uniquelypageTokens - page tokens mapped to their resource URIsMap<String,String> getPageTokens(String sessionKey)
sessionKey - identifies the current logical session uniquelyvoid remove(String sessionKey)
sessionKey - identifies the current logical session uniquelyvoid rotateAllPageTokens(String sessionKey, Supplier<String> tokenValueSupplier)
sessionKey - identifies the current logical session uniquelytokenValueSupplier - produces a new page token value lazily/on demandvoid regenerateUsedPageToken(String sessionKey, String tokenFromRequest, Supplier<String> tokenValueSupplier)
sessionKey - identifies the current logical session uniquelytokenFromRequest - the token extracted from the requesttokenValueSupplier - produces a new page token value lazily/on demandCopyright © 2025 OWASP. All rights reserved.