aboutsummaryrefslogtreecommitdiff
path: root/packages/web-util/src/context/challenger-api.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/web-util/src/context/challenger-api.ts')
-rw-r--r--packages/web-util/src/context/challenger-api.ts14
1 files changed, 9 insertions, 5 deletions
diff --git a/packages/web-util/src/context/challenger-api.ts b/packages/web-util/src/context/challenger-api.ts
index 960f1db0d..8748f5f69 100644
--- a/packages/web-util/src/context/challenger-api.ts
+++ b/packages/web-util/src/context/challenger-api.ts
@@ -15,7 +15,9 @@
*/
import {
+ CacheEvictor,
ChallengerApi,
+ ChallengerCacheEviction,
ChallengerHttpClient,
LibtoolVersion,
ObservabilityEvent,
@@ -63,7 +65,9 @@ enum VersionHint {
NONE,
}
-type Evictors = Record<string, never>;
+type Evictors = {
+ challenger?: CacheEvictor<ChallengerCacheEviction>;
+}
type ConfigResult<T> =
| undefined
@@ -174,10 +178,10 @@ function buildChallengerApiClient(
},
});
- const bank = new ChallengerHttpClient(url.href, httpLib);
+ const challenger = new ChallengerHttpClient(url.href, httpLib, evictors.challenger);
async function getRemoteConfig(): Promise<ChallengerApi.ChallengerTermsOfServiceResponse> {
- const resp = await bank.getConfig();
+ const resp = await challenger.getConfig();
if (resp.type === "fail") {
throw TalerError.fromUncheckedDetail(resp.detail);
}
@@ -186,9 +190,9 @@ function buildChallengerApiClient(
return {
getRemoteConfig,
- VERSION: bank.PROTOCOL_VERSION,
+ VERSION: challenger.PROTOCOL_VERSION,
lib: {
- bank,
+ challenger,
},
onActivity: tracker.subscribe,
cancelRequest: httpLib.cancelRequest,