By default CRL is managed using MongoDB database. If you don't want to use MongoDB, you can write your own CRL management system.
Create your CRL manager somewhere in your code (e.g. crlmanager/index.js
)
following this interface.
class MyCRLManager {
async setUp() {
// Setup your database
}
async storeRevokedUVCI(revokedUvci = [], deletedRevokedUvci = []) {
// Store `revokedUvci` elements and remove `deletedRevokedUvci` elements
}
async isUVCIRevoked(uvci) {
// Return `true` if `uvci` is present (UVCI revoked), false otherwise
}
async clean() {
// Remove all data from db
}
async tearDown() {
// Close your db, clean resources ...
}
}
Then export an instance as singleton.
const crlManager = new MyCRLManager();
module.exports = crlManager;
In order to make SDK using your custom CRL manager.
const { Service } = require('verificac19-sdk');
const crlManager = require('./crlmanager');
await Service.updateAll(crlManager);
👉🏻 You can also set CRL manager using Service.setUp
method,
see examples/crlmanager.js.