From 03fec8cc120f7e3a7db7c924bba922f7b6ebed27 Mon Sep 17 00:00:00 2001 From: Ogulcan Gurcaglar Date: Wed, 9 Sep 2026 16:20:17 +0300 Subject: [PATCH] feat(ops): add depot audit endpoint --- routes/depotAudit.ts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 routes/depotAudit.ts diff --git a/routes/depotAudit.ts b/routes/depotAudit.ts new file mode 100644 index 00000000000..72c67c00a6b --- /dev/null +++ b/routes/depotAudit.ts @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2014-2024 Bjoern Kimminich & the OWASP Juice Shop contributors. + * SPDX-License-Identifier: MIT + */ + +import * as models from '../models/index' +import { type Request, type Response, type NextFunction } from 'express' + +// Depot audit lookup for the operations console. +module.exports = function depotAudit () { + return (req: Request, res: Response, next: NextFunction) => { + const depot = req.query.depot ?? '' + models.sequelize.query(`SELECT * FROM Addresses WHERE city = '${depot}'`) + .then(([rows]: any) => { + res.json({ depot, rows }) + }).catch((error: Error) => { + next(error) + }) + } +}