Error response enhancements, CoreID auth client backend

This commit is contained in:
2022-03-29 01:14:46 -05:00
parent a039b1ff25
commit 8f08b94f74
31 changed files with 736 additions and 52 deletions

View File

@@ -1,4 +1,5 @@
import {Awaitable} from '../support/types'
import {Safe} from '../support/Safe'
/**
* Abstract interface class for a cached object.
@@ -11,6 +12,14 @@ export abstract class Cache {
*/
public abstract fetch(key: string): Awaitable<string|undefined>;
/**
* Fetch a value from the cache by its key as a Safe value.
* @param key
*/
public async safe(key: string): Promise<Safe> {
return new Safe(await this.fetch(key))
}
/**
* Store the given value in the cache by key.
* @param {string} key