Skip to content

Commit

Permalink
prevent caching of status list credentials
Browse files Browse the repository at this point in the history
Signed-off-by: F-Node-Karlsruhe <[email protected]>
  • Loading branch information
F-Node-Karlsruhe committed Nov 15, 2023
1 parent 9230ab5 commit 0e279e6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ VC Verifier Changelog
WIP
---

- prevent caching of status credentials in document loader


1.7.6 (2023-11-15)
---
Expand Down
4 changes: 3 additions & 1 deletion api/src/services/documentLoader/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import { contexts } from './context/index.js';

const cache = contexts;

const uncachedStatusListCredentialTypes = ['RevocationList2020Credential', 'StatusList2021Credential']

const documentLoader: Promise<any> = jsonldSignatures.extendContextLoader(async (url: string) => {

// Fetch did documents
Expand Down Expand Up @@ -59,7 +61,7 @@ const documentLoader: Promise<any> = jsonldSignatures.extendContextLoader(async

}

cache.set(url, document);
if (!document.type || !Array.isArray(document.type) || !uncachedStatusListCredentialTypes.some((t: string) => document.type.includes(t))) cache.set(url, document);

}

Expand Down

0 comments on commit 0e279e6

Please sign in to comment.