firebase-auth-cloudflare-workers
Version:
Zero-dependencies firebase auth library for Cloudflare Workers.
24 lines (23 loc) • 657 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.WorkersKVStore = void 0;
/**
* Class to get or store fetched public keys from a client certificates URL.
*/
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,
});
}
}
exports.WorkersKVStore = WorkersKVStore;