aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api/config.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/controllers/api/config.ts')
-rw-r--r--server/controllers/api/config.ts13
1 files changed, 10 insertions, 3 deletions
diff --git a/server/controllers/api/config.ts b/server/controllers/api/config.ts
index 1f2a5f2da..9bd8c21c5 100644
--- a/server/controllers/api/config.ts
+++ b/server/controllers/api/config.ts
@@ -10,26 +10,32 @@ import { auditLoggerFactory, CustomConfigAuditView, getAuditIdFromRes } from '..
10import { objectConverter } from '../../helpers/core-utils' 10import { objectConverter } from '../../helpers/core-utils'
11import { CONFIG, reloadConfig } from '../../initializers/config' 11import { CONFIG, reloadConfig } from '../../initializers/config'
12import { ClientHtml } from '../../lib/client-html' 12import { ClientHtml } from '../../lib/client-html'
13import { asyncMiddleware, authenticate, ensureUserHasRight } from '../../middlewares' 13import { asyncMiddleware, authenticate, ensureUserHasRight, openapiOperationDoc } from '../../middlewares'
14import { customConfigUpdateValidator } from '../../middlewares/validators/config' 14import { customConfigUpdateValidator } from '../../middlewares/validators/config'
15 15
16const configRouter = express.Router() 16const configRouter = express.Router()
17 17
18const auditLogger = auditLoggerFactory('config') 18const auditLogger = auditLoggerFactory('config')
19 19
20configRouter.get('/about', getAbout)
21
22configRouter.get('/', 20configRouter.get('/',
21 openapiOperationDoc({ operationId: 'getConfig' }),
23 asyncMiddleware(getConfig) 22 asyncMiddleware(getConfig)
24) 23)
25 24
25configRouter.get('/about',
26 openapiOperationDoc({ operationId: 'getAbout' }),
27 getAbout
28)
29
26configRouter.get('/custom', 30configRouter.get('/custom',
31 openapiOperationDoc({ operationId: 'getCustomConfig' }),
27 authenticate, 32 authenticate,
28 ensureUserHasRight(UserRight.MANAGE_CONFIGURATION), 33 ensureUserHasRight(UserRight.MANAGE_CONFIGURATION),
29 getCustomConfig 34 getCustomConfig
30) 35)
31 36
32configRouter.put('/custom', 37configRouter.put('/custom',
38 openapiOperationDoc({ operationId: 'putCustomConfig' }),
33 authenticate, 39 authenticate,
34 ensureUserHasRight(UserRight.MANAGE_CONFIGURATION), 40 ensureUserHasRight(UserRight.MANAGE_CONFIGURATION),
35 customConfigUpdateValidator, 41 customConfigUpdateValidator,
@@ -37,6 +43,7 @@ configRouter.put('/custom',
37) 43)
38 44
39configRouter.delete('/custom', 45configRouter.delete('/custom',
46 openapiOperationDoc({ operationId: 'delCustomConfig' }),
40 authenticate, 47 authenticate,
41 ensureUserHasRight(UserRight.MANAGE_CONFIGURATION), 48 ensureUserHasRight(UserRight.MANAGE_CONFIGURATION),
42 asyncMiddleware(deleteCustomConfig) 49 asyncMiddleware(deleteCustomConfig)