aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api/runners/registration-tokens.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/controllers/api/runners/registration-tokens.ts')
-rw-r--r--server/controllers/api/runners/registration-tokens.ts6
1 files changed, 5 insertions, 1 deletions
diff --git a/server/controllers/api/runners/registration-tokens.ts b/server/controllers/api/runners/registration-tokens.ts
index 5ac3773fe..117ff271b 100644
--- a/server/controllers/api/runners/registration-tokens.ts
+++ b/server/controllers/api/runners/registration-tokens.ts
@@ -1,6 +1,8 @@
1import express from 'express' 1import express from 'express'
2import { logger, loggerTagsFactory } from '@server/helpers/logger'
2import { generateRunnerRegistrationToken } from '@server/helpers/token-generator' 3import { generateRunnerRegistrationToken } from '@server/helpers/token-generator'
3import { 4import {
5 apiRateLimiter,
4 asyncMiddleware, 6 asyncMiddleware,
5 authenticate, 7 authenticate,
6 ensureUserHasRight, 8 ensureUserHasRight,
@@ -12,19 +14,20 @@ import {
12import { deleteRegistrationTokenValidator } from '@server/middlewares/validators/runners' 14import { deleteRegistrationTokenValidator } from '@server/middlewares/validators/runners'
13import { RunnerRegistrationTokenModel } from '@server/models/runner/runner-registration-token' 15import { RunnerRegistrationTokenModel } from '@server/models/runner/runner-registration-token'
14import { HttpStatusCode, ListRunnerRegistrationTokensQuery, UserRight } from '@shared/models' 16import { HttpStatusCode, ListRunnerRegistrationTokensQuery, UserRight } from '@shared/models'
15import { logger, loggerTagsFactory } from '@server/helpers/logger'
16 17
17const lTags = loggerTagsFactory('api', 'runner') 18const lTags = loggerTagsFactory('api', 'runner')
18 19
19const runnerRegistrationTokensRouter = express.Router() 20const runnerRegistrationTokensRouter = express.Router()
20 21
21runnerRegistrationTokensRouter.post('/registration-tokens/generate', 22runnerRegistrationTokensRouter.post('/registration-tokens/generate',
23 apiRateLimiter,
22 authenticate, 24 authenticate,
23 ensureUserHasRight(UserRight.MANAGE_RUNNERS), 25 ensureUserHasRight(UserRight.MANAGE_RUNNERS),
24 asyncMiddleware(generateRegistrationToken) 26 asyncMiddleware(generateRegistrationToken)
25) 27)
26 28
27runnerRegistrationTokensRouter.delete('/registration-tokens/:id', 29runnerRegistrationTokensRouter.delete('/registration-tokens/:id',
30 apiRateLimiter,
28 authenticate, 31 authenticate,
29 ensureUserHasRight(UserRight.MANAGE_RUNNERS), 32 ensureUserHasRight(UserRight.MANAGE_RUNNERS),
30 asyncMiddleware(deleteRegistrationTokenValidator), 33 asyncMiddleware(deleteRegistrationTokenValidator),
@@ -32,6 +35,7 @@ runnerRegistrationTokensRouter.delete('/registration-tokens/:id',
32) 35)
33 36
34runnerRegistrationTokensRouter.get('/registration-tokens', 37runnerRegistrationTokensRouter.get('/registration-tokens',
38 apiRateLimiter,
35 authenticate, 39 authenticate,
36 ensureUserHasRight(UserRight.MANAGE_RUNNERS), 40 ensureUserHasRight(UserRight.MANAGE_RUNNERS),
37 paginationValidator, 41 paginationValidator,