lucee.Componentmodels.jwt.storages.DBTokenStorage
Copyright since 2016 by Ortus Solutions, Corp www.ortussolutions.com --- A Database based token storage. Properties - table : the table to use - schema : the schema to use (if db support it) - dsn : the dsn to use, no dsn, we use the global one - autoCreate : if true, then we will create the table. Defaults to true The columns needed in the table are - id : db identifier - cacheKey : varchar 255 - token : text - expiration : (unix timestamp) - issued : (unix timestamp) - subject : varchar 255
Property Summary | ||||
---|---|---|---|---|
type | property | default | serializable | required |
any
|
cache
The linked cache provider.
|
true
|
false
|
|
any
|
cachebox
|
true
|
false
|
|
any
|
jwtService
|
true
|
false
|
|
any
|
keyPrefix
The configured key prefix for the storage.
|
true
|
false
|
|
any
|
log
|
true
|
false
|
|
any
|
properties
Storage properties.
|
true
|
false
|
|
any
|
scheduler
|
true
|
false
|
|
any
|
settings
|
true
|
false
|
|
any
|
wirebox
|
true
|
false
|
Constructor Summary | |
---|---|
init()
Constructor. |
Method Summary | |
---|---|
any
|
clear(any key)
Invalidate/delete one or more keys from the storage. |
any
|
clearAll()
Clear all the keys in the storage. |
any
|
configure(any properties)
Configure the storage by passing in the properties. |
any
|
doRotation()
Do the rotation. |
private any
|
ensureTable()
Verify or create the logging table. |
boolean
|
exists(any key)
Verify if the passed in token key exists and is valid. |
struct
|
get(any key, [struct defaultValue])
Retrieve the token via the cache key, if the key doesn't exist a TokenNotFoundException will be thrown. |
string
|
getCache()
|
string
|
getCachebox()
|
private any
|
getDateTimeColumnType()
Get db specific text column type. |
private string
|
getDefaultDatasource()
Get the default application datasource. |
string
|
getJwtService()
|
string
|
getKeyPrefix()
|
string
|
getLog()
|
string
|
getProperties()
|
string
|
getScheduler()
|
string
|
getSettings()
|
private any
|
getTable()
Return the table name with the appropriate schema included if found. |
private any
|
getTextColumnType()
Get db specific text column type. |
string
|
getWirebox()
|
array
|
keys()
Retrieve all the jwt keys stored in the storage. |
any
|
set(any key, any token, any expiration, any payload)
Set a token in the storage. |
any
|
setCache(any cache)
|
any
|
setCachebox(any cachebox)
|
any
|
setJwtService(any jwtService)
|
any
|
setKeyPrefix(any keyPrefix)
|
any
|
setLog(any log)
|
any
|
setProperties(any properties)
|
any
|
setScheduler(any scheduler)
|
any
|
setSettings(any settings)
|
any
|
setWirebox(any wirebox)
|
numeric
|
size()
The size of the storage. |
Methods inherited from class lucee.Component |
---|
None |
Constructor Detail |
---|
Constructor
Property Detail |
---|
The linked cache provider
access
- publicrequired
- falsereturntype
- anyserializable
- trueaccess
- publicrequired
- falsereturntype
- anyinject
- cacheboxserializable
- trueaccess
- publicrequired
- falsereturntype
- anyinject
- JwtService@cbSecurityserializable
- trueThe configured key prefix for the storage
access
- publicrequired
- falsereturntype
- anyserializable
- trueaccess
- publicrequired
- falsereturntype
- anyinject
- logbox:logger:{this}serializable
- trueStorage properties
access
- publicrequired
- falsereturntype
- anyserializable
- trueaccess
- publicrequired
- falsereturntype
- anyinject
- executor:coldbox-tasksserializable
- trueaccess
- publicrequired
- falsereturntype
- anyinject
- coldbox:moduleSettings:cbSecurityserializable
- trueaccess
- publicrequired
- falsereturntype
- anyinject
- wireboxserializable
- trueMethod Detail |
---|
Invalidate/delete one or more keys from the storage
key
- A cache key or an array of keys to clearClear all the keys in the storage
Configure the storage by passing in the properties
properties
- The storage propertiesDo the rotation
Verify or create the logging table
Verify if the passed in token key exists and is valid.
key
- The cache keyRetrieve the token via the cache key, if the key doesn't exist a TokenNotFoundException will be thrown
key
- The cache keydefaultValue
- If not found, return a default valueGet db specific text column type
Get the default application datasource
Return the table name with the appropriate schema included if found.
Get db specific text column type
Retrieve all the jwt keys stored in the storage
Set a token in the storage
key
- The cache keytoken
- The token to storeexpiration
- The token expirationpayload
- The payloadcache
cachebox
jwtService
keyPrefix
log
properties
scheduler
settings
wirebox
The size of the storage