models.jwt.storages

Class CacheTokenStorage

lucee.Component
    extended by models.jwt.storages.CacheTokenStorage

Copyright since 2016 by Ortus Solutions, Corp www.ortussolutions.com --- A CacheBox cache based token storage

Class Attributes:
  • threadsafe
  •  
  • singleton
  •  
  • synchronized : false
  •  
  • accessors : true
  •  
  • persistent : false
  •  
    Property Summary
    type property default serializable required
    any cache
          The linked cache provider.

    • access = public
    • returntype = any
    true false
    any cachebox


    • access = public
    • returntype = any
    • inject = cachebox
    true false
    any jwtService


    • access = public
    • returntype = any
    • inject = JwtService@cbSecurity
    true false
    any keyPrefix
          The configured key prefix for the storage.

    • access = public
    • returntype = any
    true false
    any properties
          Storage properties.

    • access = public
    • returntype = any
    true false
    any settings


    • access = public
    • returntype = any
    • inject = coldbox:moduleSettings:cbSecurity
    true false
    any wirebox


    • access = public
    • returntype = any
    • inject = wirebox
    true false
    Constructor Summary
    init()
          Constructor.
    Method Summary
    private any buildKey(any key)
         Build out a prefixed key.
    boolean 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.
    boolean exists(any key)
         Verify if the passed in token key exists.
    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()
    string getJwtService()
    string getKeyPrefix()
    string getProperties()
    string getSettings()
    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 setProperties(any properties)
    any setSettings(any settings)
    any setWirebox(any wirebox)
    numeric size()
         The size of the storage.
     
    Methods inherited from class lucee.Component
    None

    Constructor Detail

    init

    public init()

    Constructor


    Property Detail

    cache

    property any cache

    The linked cache provider

    Attributes:
    access - public
    required - false
    returntype - any
    serializable - true

    cachebox

    property any cachebox

    Attributes:
    access - public
    required - false
    returntype - any
    inject - cachebox
    serializable - true

    jwtService

    property any jwtService

    Attributes:
    access - public
    required - false
    returntype - any
    inject - JwtService@cbSecurity
    serializable - true

    keyPrefix

    property any keyPrefix

    The configured key prefix for the storage

    Attributes:
    access - public
    required - false
    returntype - any
    serializable - true

    properties

    property any properties

    Storage properties

    Attributes:
    access - public
    required - false
    returntype - any
    serializable - true

    settings

    property any settings

    Attributes:
    access - public
    required - false
    returntype - any
    inject - coldbox:moduleSettings:cbSecurity
    serializable - true

    wirebox

    property any wirebox

    Attributes:
    access - public
    required - false
    returntype - any
    inject - wirebox
    serializable - true

    Method Detail

    buildKey

    private any buildKey(any key)

    Build out a prefixed key

    Parameters:
    key

    clear

    public boolean clear(any key)

    Invalidate/delete one or more keys from the storage

    Parameters:
    key - A cache key or an array of keys to clear
    Returns:
    True, if deleted

    clearAll

    public any clearAll()

    Clear all the keys in the storage

    Returns:
    JWTStorage

    configure

    public any configure(any properties)

    Configure the storage by passing in the properties

    Parameters:
    properties - The storage properties
    Returns:
    JWTStorage

    exists

    public boolean exists(any key)

    Verify if the passed in token key exists

    Parameters:
    key - The cache key

    get

    public struct get(any key, [struct defaultValue])

    Retrieve the token via the cache key, if the key doesn't exist a TokenNotFoundException will be thrown

    Parameters:
    key - The cache key
    defaultValue - If not found, return a default value
    Throws:
    TokenNotFoundException

    getCache

    public string getCache()


    getCachebox

    public string getCachebox()


    getJwtService

    public string getJwtService()


    getKeyPrefix

    public string getKeyPrefix()


    getProperties

    public string getProperties()


    getSettings

    public string getSettings()


    getWirebox

    public string getWirebox()


    keys

    public array keys()

    Retrieve all the jwt keys stored in the storage


    set

    public any set(any key, any token, any expiration, any payload)

    Set a token in the storage

    Parameters:
    key - The cache key
    token - The token to store
    expiration - The token expiration
    payload - The payload
    Returns:
    JWTStorage

    setCache

    public any setCache(any cache)

    Parameters:
    cache

    setCachebox

    public any setCachebox(any cachebox)

    Parameters:
    cachebox

    setJwtService

    public any setJwtService(any jwtService)

    Parameters:
    jwtService

    setKeyPrefix

    public any setKeyPrefix(any keyPrefix)

    Parameters:
    keyPrefix

    setProperties

    public any setProperties(any properties)

    Parameters:
    properties

    setSettings

    public any setSettings(any settings)

    Parameters:
    settings

    setWirebox

    public any setWirebox(any wirebox)

    Parameters:
    wirebox

    size

    public numeric size()

    The size of the storage