Skip to content

Commit f3e652f

Browse files
committed
Add middleware for fetching all keystore configs.
1 parent 6183435 commit f3e652f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

lib/middleware.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,16 @@ export function createGetKeystoreConfig({routes}) {
4343
});
4444
}
4545

46+
// creates middleware to get all the keystore configs for root controller
47+
export function createGetAllKeystoreConfigs() {
48+
return asyncHandler(async (req, _, next) => {
49+
const controller = req.query.controller;
50+
const results = await storage.getAll({req, controller});
51+
req.keystores = results.map(r => r.config);
52+
next();
53+
});
54+
}
55+
4656
// creates middleware for handling KMS operations
4757
export function createKmsOperationMiddleware() {
4858
const {kmsOperationOptions} = config['kms-http'];

0 commit comments

Comments
 (0)