aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/audit-logger.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-09-19 17:02:16 +0200
committerChocobozzz <me@florianbigard.com>2018-09-19 17:02:27 +0200
commit993cef4b6e000ee425087e5195dfe40cd0840243 (patch)
tree9bddf4a2f4fad0ac8cbb9d79445c1c1ec36bd305 /server/helpers/audit-logger.ts
parent606c946e74211c4123b16087288902226306198d (diff)
downloadPeerTube-993cef4b6e000ee425087e5195dfe40cd0840243.tar.gz
PeerTube-993cef4b6e000ee425087e5195dfe40cd0840243.tar.zst
PeerTube-993cef4b6e000ee425087e5195dfe40cd0840243.zip
Refractor audit user identifier
Diffstat (limited to 'server/helpers/audit-logger.ts')
-rw-r--r--server/helpers/audit-logger.ts8
1 files changed, 8 insertions, 0 deletions
diff --git a/server/helpers/audit-logger.ts b/server/helpers/audit-logger.ts
index 7db72b69c..00311fce1 100644
--- a/server/helpers/audit-logger.ts
+++ b/server/helpers/audit-logger.ts
@@ -1,4 +1,5 @@
1import * as path from 'path' 1import * as path from 'path'
2import * as express from 'express'
2import { diff } from 'deep-object-diff' 3import { diff } from 'deep-object-diff'
3import { chain } from 'lodash' 4import { chain } from 'lodash'
4import * as flatten from 'flat' 5import * as flatten from 'flat'
@@ -8,6 +9,11 @@ import { jsonLoggerFormat, labelFormatter } from './logger'
8import { VideoDetails, User, VideoChannel, VideoAbuse, VideoImport } from '../../shared' 9import { VideoDetails, User, VideoChannel, VideoAbuse, VideoImport } from '../../shared'
9import { VideoComment } from '../../shared/models/videos/video-comment.model' 10import { VideoComment } from '../../shared/models/videos/video-comment.model'
10import { CustomConfig } from '../../shared/models/server/custom-config.model' 11import { CustomConfig } from '../../shared/models/server/custom-config.model'
12import { UserModel } from '../models/account/user'
13
14function getAuditIdFromRes (res: express.Response) {
15 return (res.locals.oauth.token.User as UserModel).username
16}
11 17
12enum AUDIT_TYPE { 18enum AUDIT_TYPE {
13 CREATE = 'create', 19 CREATE = 'create',
@@ -255,6 +261,8 @@ class CustomConfigAuditView extends EntityAuditView {
255} 261}
256 262
257export { 263export {
264 getAuditIdFromRes,
265
258 auditLoggerFactory, 266 auditLoggerFactory,
259 VideoImportAuditView, 267 VideoImportAuditView,
260 VideoChannelAuditView, 268 VideoChannelAuditView,