mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-16 08:14:06 +00:00
Complete v1 loop for bot-based integrations
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import express from 'express';
|
||||
const router = express.Router();
|
||||
import { body } from 'express-validator';
|
||||
import { body, param } from 'express-validator';
|
||||
import {
|
||||
requireAuth,
|
||||
requireBotAuth,
|
||||
@@ -11,14 +11,13 @@ import { botController } from '../controllers';
|
||||
import { ADMIN, MEMBER, COMPLETED, GRANTED } from '../variables';
|
||||
|
||||
router.get(
|
||||
'/',
|
||||
'/:workspaceId',
|
||||
requireAuth,
|
||||
requireWorkspaceAuth({
|
||||
acceptedRoles: [ADMIN, MEMBER],
|
||||
acceptedStatuses: [COMPLETED, GRANTED],
|
||||
location: 'body'
|
||||
acceptedStatuses: [COMPLETED, GRANTED]
|
||||
}),
|
||||
body('workspaceId').exists().trim().notEmpty(),
|
||||
param('workspaceId').exists().trim().notEmpty(),
|
||||
validateRequest,
|
||||
botController.getBotByWorkspaceId
|
||||
);
|
||||
|
||||
@@ -10,7 +10,7 @@ import {
|
||||
import { ADMIN, MEMBER, GRANTED } from '../variables';
|
||||
import { integrationAuthController } from '../controllers';
|
||||
|
||||
router.post( // semi-ok
|
||||
router.post(
|
||||
'/oauth-token',
|
||||
requireAuth,
|
||||
requireWorkspaceAuth({
|
||||
@@ -25,7 +25,7 @@ router.post( // semi-ok
|
||||
integrationAuthController.oAuthExchange
|
||||
);
|
||||
|
||||
router.get( // not-ok
|
||||
router.get(
|
||||
'/:integrationAuthId/apps',
|
||||
requireAuth,
|
||||
requireIntegrationAuthorizationAuth({
|
||||
@@ -37,7 +37,7 @@ router.get( // not-ok
|
||||
integrationAuthController.getIntegrationAuthApps
|
||||
);
|
||||
|
||||
router.delete( // not-ok
|
||||
router.delete(
|
||||
'/:integrationAuthId',
|
||||
requireAuth,
|
||||
requireIntegrationAuthorizationAuth({
|
||||
|
||||
Reference in New Issue
Block a user