UNPKG

firebase-auth-cloudflare-workers

Version:

Zero-dependencies firebase auth library for Cloudflare Workers.

20 lines (19 loc) 513 B
/** * Class to get or store fetched public keys from a client certificates URL. */ export class WorkersKVStore { cacheKey; cfKVNamespace; constructor(cacheKey, cfKVNamespace) { this.cacheKey = cacheKey; this.cfKVNamespace = cfKVNamespace; } async get() { return await this.cfKVNamespace.get(this.cacheKey, 'json'); } async put(value, expirationTtl) { await this.cfKVNamespace.put(this.cacheKey, value, { expirationTtl, }); } }