chore: update in the scaffolder instead
Signed-off-by: blam <ben@blam.sh>
This commit is contained in:
@@ -96,6 +96,7 @@
|
||||
"p-queue": "^6.6.2",
|
||||
"prom-client": "^15.0.0",
|
||||
"tar": "^6.1.12",
|
||||
"triple-beam": "^1.4.1",
|
||||
"uuid": "^9.0.0",
|
||||
"winston": "^3.2.1",
|
||||
"winston-transport": "^4.7.0",
|
||||
@@ -108,7 +109,6 @@
|
||||
"@backstage/cli": "workspace:^",
|
||||
"@backstage/plugin-scaffolder-node-test-utils": "workspace:^",
|
||||
"@types/fs-extra": "^11.0.0",
|
||||
"@types/json-stringify-safe": "^5.0.3",
|
||||
"@types/nunjucks": "^3.1.4",
|
||||
"@types/supertest": "^2.0.8",
|
||||
"@types/zen-observable": "^0.8.0",
|
||||
|
||||
@@ -21,7 +21,7 @@ import { JsonObject } from '@backstage/types';
|
||||
import { Format, TransformableInfo } from 'logform';
|
||||
import Transport, { TransportStreamOptions } from 'winston-transport';
|
||||
import { Logger, format, createLogger, transports } from 'winston';
|
||||
import stringify from 'json-stringify-safe';
|
||||
import { MESSAGE } from 'triple-beam';
|
||||
|
||||
/**
|
||||
* Escapes a given string to be used inside a RegExp.
|
||||
@@ -108,26 +108,17 @@ export class WinstonLogger implements RootLoggerService {
|
||||
|
||||
let redactionPattern: RegExp | undefined = undefined;
|
||||
|
||||
const replace = (obj: TransformableInfo) => {
|
||||
if (!redactionPattern) {
|
||||
return obj;
|
||||
}
|
||||
|
||||
const stringifiedFields = stringify(obj);
|
||||
const redacted = JSON.parse(
|
||||
stringifiedFields.replace(redactionPattern, '[REDACTED]'),
|
||||
);
|
||||
|
||||
for (const key in redacted) {
|
||||
if (obj && Object.hasOwn(obj, key)) {
|
||||
obj[key] = redacted[key];
|
||||
}
|
||||
}
|
||||
|
||||
return obj;
|
||||
};
|
||||
return {
|
||||
format: format(replace)(),
|
||||
format: format((obj: TransformableInfo) => {
|
||||
if (!redactionPattern || !obj) {
|
||||
return obj;
|
||||
}
|
||||
|
||||
obj[MESSAGE] = obj[MESSAGE]?.replace?.(redactionPattern, '[REDACTED]');
|
||||
obj.message = obj.message?.replace?.(redactionPattern, '[REDACTED]');
|
||||
|
||||
return obj;
|
||||
})(),
|
||||
add(newRedactions) {
|
||||
let added = 0;
|
||||
for (const redactionToTrim of newRedactions) {
|
||||
|
||||
@@ -3304,7 +3304,6 @@ __metadata:
|
||||
"@types/express": ^4.17.6
|
||||
"@types/fs-extra": ^11.0.0
|
||||
"@types/http-errors": ^2.0.0
|
||||
"@types/json-stringify-safe": ^5.0.3
|
||||
"@types/minimist": ^1.2.0
|
||||
"@types/morgan": ^1.9.0
|
||||
"@types/node-forge": ^1.3.0
|
||||
@@ -3318,7 +3317,6 @@ __metadata:
|
||||
helmet: ^6.0.0
|
||||
http-errors: ^2.0.0
|
||||
jose: ^5.0.0
|
||||
json-stringify-safe: ^5.0.1
|
||||
knex: ^3.0.0
|
||||
lodash: ^4.17.21
|
||||
logform: ^2.3.2
|
||||
@@ -3332,6 +3330,7 @@ __metadata:
|
||||
selfsigned: ^2.0.0
|
||||
stoppable: ^1.1.0
|
||||
supertest: ^6.1.3
|
||||
triple-beam: ^1.4.1
|
||||
uuid: ^9.0.0
|
||||
winston: ^3.2.1
|
||||
winston-transport: ^4.5.0
|
||||
@@ -6663,7 +6662,6 @@ __metadata:
|
||||
"@backstage/types": "workspace:^"
|
||||
"@types/express": ^4.17.6
|
||||
"@types/fs-extra": ^11.0.0
|
||||
"@types/json-stringify-safe": ^5.0.3
|
||||
"@types/luxon": ^3.0.0
|
||||
"@types/nunjucks": ^3.1.4
|
||||
"@types/supertest": ^2.0.8
|
||||
@@ -6689,6 +6687,7 @@ __metadata:
|
||||
strip-ansi: ^7.1.0
|
||||
supertest: ^6.1.3
|
||||
tar: ^6.1.12
|
||||
triple-beam: ^1.4.1
|
||||
uuid: ^9.0.0
|
||||
wait-for-expect: ^3.0.2
|
||||
winston: ^3.2.1
|
||||
@@ -17316,13 +17315,6 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@types/json-stringify-safe@npm:^5.0.3":
|
||||
version: 5.0.3
|
||||
resolution: "@types/json-stringify-safe@npm:5.0.3"
|
||||
checksum: 66826a59b53ce5a5becc9c05cd0bdadb7e2032e02803a9dd13137de134a0882a6c67ae334371ccff07a20b1d2b2c23fa3a81b5e23f40b27cfcf553c7cce06e35
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@types/json5@npm:^0.0.29":
|
||||
version: 0.0.29
|
||||
resolution: "@types/json5@npm:0.0.29"
|
||||
@@ -41491,10 +41483,10 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"triple-beam@npm:^1.3.0":
|
||||
version: 1.3.0
|
||||
resolution: "triple-beam@npm:1.3.0"
|
||||
checksum: 7d7b77d8625fb252c126c24984a68de462b538a8fcd1de2abd0a26421629cf3527d48e23b3c2264f08f4a6c3bc40a478a722176f4d7b6a1acc154cb70c359f2b
|
||||
"triple-beam@npm:^1.3.0, triple-beam@npm:^1.4.1":
|
||||
version: 1.4.1
|
||||
resolution: "triple-beam@npm:1.4.1"
|
||||
checksum: 2e881a3e8e076b6f2b85b9ec9dd4a900d3f5016e6d21183ed98e78f9abcc0149e7d54d79a3f432b23afde46b0885bdcdcbff789f39bc75de796316961ec07f61
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
|
||||
Reference in New Issue
Block a user