diff options
Diffstat (limited to 'server/controllers/api/runners/registration-tokens.ts')
-rw-r--r-- | server/controllers/api/runners/registration-tokens.ts | 6 |
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 @@ | |||
1 | import express from 'express' | 1 | import express from 'express' |
2 | import { logger, loggerTagsFactory } from '@server/helpers/logger' | ||
2 | import { generateRunnerRegistrationToken } from '@server/helpers/token-generator' | 3 | import { generateRunnerRegistrationToken } from '@server/helpers/token-generator' |
3 | import { | 4 | import { |
5 | apiRateLimiter, | ||
4 | asyncMiddleware, | 6 | asyncMiddleware, |
5 | authenticate, | 7 | authenticate, |
6 | ensureUserHasRight, | 8 | ensureUserHasRight, |
@@ -12,19 +14,20 @@ import { | |||
12 | import { deleteRegistrationTokenValidator } from '@server/middlewares/validators/runners' | 14 | import { deleteRegistrationTokenValidator } from '@server/middlewares/validators/runners' |
13 | import { RunnerRegistrationTokenModel } from '@server/models/runner/runner-registration-token' | 15 | import { RunnerRegistrationTokenModel } from '@server/models/runner/runner-registration-token' |
14 | import { HttpStatusCode, ListRunnerRegistrationTokensQuery, UserRight } from '@shared/models' | 16 | import { HttpStatusCode, ListRunnerRegistrationTokensQuery, UserRight } from '@shared/models' |
15 | import { logger, loggerTagsFactory } from '@server/helpers/logger' | ||
16 | 17 | ||
17 | const lTags = loggerTagsFactory('api', 'runner') | 18 | const lTags = loggerTagsFactory('api', 'runner') |
18 | 19 | ||
19 | const runnerRegistrationTokensRouter = express.Router() | 20 | const runnerRegistrationTokensRouter = express.Router() |
20 | 21 | ||
21 | runnerRegistrationTokensRouter.post('/registration-tokens/generate', | 22 | runnerRegistrationTokensRouter.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 | ||
27 | runnerRegistrationTokensRouter.delete('/registration-tokens/:id', | 29 | runnerRegistrationTokensRouter.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 | ||
34 | runnerRegistrationTokensRouter.get('/registration-tokens', | 37 | runnerRegistrationTokensRouter.get('/registration-tokens', |
38 | apiRateLimiter, | ||
35 | authenticate, | 39 | authenticate, |
36 | ensureUserHasRight(UserRight.MANAGE_RUNNERS), | 40 | ensureUserHasRight(UserRight.MANAGE_RUNNERS), |
37 | paginationValidator, | 41 | paginationValidator, |