chore(deps): replace express-xml-bodyparser with body-parser-xml

`express-xml-bodyparser` was last updated 8 years ago
and currently depends on a version of `xml2js` which
contains a vulnerability.

This change will swap it out in favor of `body-parser-xml`
which is more maintained and depends on a more recent `xml2js`
version without the vulnerability.

Relates-to: #18083
Signed-off-by: Patrick Jungermann <Patrick.Jungermann@gmail.com>
This commit is contained in:
Patrick Jungermann
2023-08-25 19:46:33 +02:00
parent 65c7c64666
commit 91ccb56fb4
4 changed files with 46 additions and 26 deletions
@@ -17,7 +17,8 @@
import express from 'express';
import Router from 'express-promise-router';
import { Logger } from 'winston';
import xmlparser from 'express-xml-bodyparser';
import BodyParser from 'body-parser';
import bodyParserXml from 'body-parser-xml';
import { CatalogApi, CatalogClient } from '@backstage/catalog-client';
import {
errorHandler,
@@ -62,8 +63,9 @@ export const makeRouter = async (
options.catalogApi ?? new CatalogClient({ discoveryApi: discovery });
const scm = ScmIntegrations.fromConfig(config);
bodyParserXml(BodyParser);
const router = Router();
router.use(xmlparser());
router.use(BodyParser.xml());
router.use(express.json());
const utils = new CoverageUtils(scm, urlReader);