Sign in

Type: ICache

Cache adapter for storing validated access token claims.

Implement this interface to persist validated claims in an external store such as Redis, Memcached, or an in-memory cache.

delete()

delete(key: string): Promise<void>

Removes an entry from the cache.

Parameters

ParameterTypeDescription
keystringThe cache key to delete.

Returns

Promise<void>


get()

get(key: string): Promise<AccessTokenClaims | null | undefined>

Retrieves cached claims by key.

Parameters

ParameterTypeDescription
keystringThe cache key.

Returns

Promise<AccessTokenClaims | null | undefined>

The cached claims, or null/undefined if the entry does not exist or has expired.


set()

set(key: string, claims: AccessTokenClaims, expiresAt: number): Promise<void>

Stores validated claims in the cache.

Parameters

ParameterTypeDescription
keystringThe cache key (access token).
claimsAccessTokenClaimsThe validated access token claims to cache.
expiresAtnumberThe token's expiration time as a Unix epoch timestamp (seconds).

Returns

Promise<void>

© 2024 MonoCloud. All rights reserved.