diff options
author | Rigel Kent <sendmemail@rigelk.eu> | 2021-06-04 09:16:23 +0200 |
---|---|---|
committer | Rigel Kent <sendmemail@rigelk.eu> | 2021-06-04 09:21:46 +0200 |
commit | 1333ab1f2d4ec495084c5368df25610683582ae3 (patch) | |
tree | 4d2b6f5b36d2acfacd5e5f6c3a9d35a9c7101658 /server/controllers/api/users | |
parent | 1c627fd8d2e60d4d790353886006485343d70084 (diff) | |
download | PeerTube-1333ab1f2d4ec495084c5368df25610683582ae3.tar.gz PeerTube-1333ab1f2d4ec495084c5368df25610683582ae3.tar.zst PeerTube-1333ab1f2d4ec495084c5368df25610683582ae3.zip |
add operationId doc middleware to so API endpoints
Diffstat (limited to 'server/controllers/api/users')
-rw-r--r-- | server/controllers/api/users/token.ts | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/server/controllers/api/users/token.ts b/server/controllers/api/users/token.ts index 863a3d74c..e636f44f6 100644 --- a/server/controllers/api/users/token.ts +++ b/server/controllers/api/users/token.ts | |||
@@ -7,7 +7,7 @@ import { getAuthNameFromRefreshGrant, getBypassFromExternalAuth, getBypassFromPa | |||
7 | import { handleOAuthToken } from '@server/lib/auth/oauth' | 7 | import { handleOAuthToken } from '@server/lib/auth/oauth' |
8 | import { BypassLogin, revokeToken } from '@server/lib/auth/oauth-model' | 8 | import { BypassLogin, revokeToken } from '@server/lib/auth/oauth-model' |
9 | import { Hooks } from '@server/lib/plugins/hooks' | 9 | import { Hooks } from '@server/lib/plugins/hooks' |
10 | import { asyncMiddleware, authenticate } from '@server/middlewares' | 10 | import { asyncMiddleware, authenticate, openapiOperationDoc } from '@server/middlewares' |
11 | import { ScopedToken } from '@shared/models/users/user-scoped-token' | 11 | import { ScopedToken } from '@shared/models/users/user-scoped-token' |
12 | 12 | ||
13 | const tokensRouter = express.Router() | 13 | const tokensRouter = express.Router() |
@@ -19,10 +19,12 @@ const loginRateLimiter = RateLimit({ | |||
19 | 19 | ||
20 | tokensRouter.post('/token', | 20 | tokensRouter.post('/token', |
21 | loginRateLimiter, | 21 | loginRateLimiter, |
22 | openapiOperationDoc({ operationId: 'getOAuthToken' }), | ||
22 | asyncMiddleware(handleToken) | 23 | asyncMiddleware(handleToken) |
23 | ) | 24 | ) |
24 | 25 | ||
25 | tokensRouter.post('/revoke-token', | 26 | tokensRouter.post('/revoke-token', |
27 | openapiOperationDoc({ operationId: 'revokeOAuthToken' }), | ||
26 | authenticate, | 28 | authenticate, |
27 | asyncMiddleware(handleTokenRevocation) | 29 | asyncMiddleware(handleTokenRevocation) |
28 | ) | 30 | ) |