@nocobase/logger 1.3.38-beta → 1.4.0-alpha
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/request-logger.js +7 -1
- package/package.json +2 -2
package/lib/request-logger.js
CHANGED
|
@@ -42,6 +42,12 @@ const defaultRequestWhitelist = [
|
|
|
42
42
|
"referer"
|
|
43
43
|
];
|
|
44
44
|
const defaultResponseWhitelist = ["status"];
|
|
45
|
+
const defaultActionBlackList = [
|
|
46
|
+
"params.values.password",
|
|
47
|
+
"params.values.confirmPassword",
|
|
48
|
+
"params.values.oldPassword",
|
|
49
|
+
"params.values.newPassword"
|
|
50
|
+
];
|
|
45
51
|
const requestLogger = /* @__PURE__ */ __name((appName, requestLogger2, options) => {
|
|
46
52
|
return async (ctx, next) => {
|
|
47
53
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
@@ -74,7 +80,7 @@ const requestLogger = /* @__PURE__ */ __name((appName, requestLogger2, options)
|
|
|
74
80
|
message: `response ${ctx.url}`,
|
|
75
81
|
...requestInfo,
|
|
76
82
|
res: (0, import_lodash.pick)(ctx.response.toJSON(), (options == null ? void 0 : options.responseWhitelist) || defaultResponseWhitelist),
|
|
77
|
-
action: (_d = (_c = ctx.action) == null ? void 0 : _c.toJSON) == null ? void 0 : _d.call(_c),
|
|
83
|
+
action: (0, import_lodash.omit)((_d = (_c = ctx.action) == null ? void 0 : _c.toJSON) == null ? void 0 : _d.call(_c), defaultActionBlackList),
|
|
78
84
|
userId: (_f = (_e = ctx.auth) == null ? void 0 : _e.user) == null ? void 0 : _f.id,
|
|
79
85
|
status: ctx.status,
|
|
80
86
|
cost,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/logger",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0-alpha",
|
|
4
4
|
"description": "nocobase logging library",
|
|
5
5
|
"license": "AGPL-3.0",
|
|
6
6
|
"main": "./lib/index.js",
|
|
@@ -18,5 +18,5 @@
|
|
|
18
18
|
"winston-daily-rotate-file": "^5.0.0",
|
|
19
19
|
"winston-transport": "^4.7.0"
|
|
20
20
|
},
|
|
21
|
-
"gitHead": "
|
|
21
|
+
"gitHead": "f097a2bddec152522b5645bd5d451f4c866d2060"
|
|
22
22
|
}
|