({
type: String,
required: true
},
+ autoCapitalization: {
+ type: Boolean,
+ default: true,
+ },
organization: {
type: Schema.Types.ObjectId,
ref: 'Organization',
diff --git a/backend/src/routes/v1/integration.ts b/backend/src/routes/v1/integration.ts
index d587bd2e5..72d818b61 100644
--- a/backend/src/routes/v1/integration.ts
+++ b/backend/src/routes/v1/integration.ts
@@ -10,7 +10,7 @@ import { ADMIN, MEMBER } from '../../variables';
import { body, param } from 'express-validator';
import { integrationController } from '../../controllers/v1';
-router.post( // new: add new integration
+router.post( // new: add new integration for integration auth
'/',
requireAuth({
acceptedAuthModes: ['jwt', 'apiKey']
@@ -19,7 +19,15 @@ router.post( // new: add new integration
acceptedRoles: [ADMIN, MEMBER],
location: 'body'
}),
- body('integrationAuthId').exists().trim(),
+ body('integrationAuthId').exists().isString().trim(),
+ body('app').trim(),
+ body('isActive').exists().isBoolean(),
+ body('appId').trim(),
+ body('sourceEnvironment').trim(),
+ body('targetEnvironment').trim(),
+ body('owner').trim(),
+ body('path').trim(),
+ body('region').trim(),
validateRequest,
integrationController.createIntegration
);
diff --git a/backend/src/routes/v1/integrationAuth.ts b/backend/src/routes/v1/integrationAuth.ts
index 3f88aa7e5..8d960e03c 100644
--- a/backend/src/routes/v1/integrationAuth.ts
+++ b/backend/src/routes/v1/integrationAuth.ts
@@ -18,6 +18,19 @@ router.get(
integrationAuthController.getIntegrationOptions
);
+router.get(
+ '/:integrationAuthId',
+ requireAuth({
+ acceptedAuthModes: ['jwt']
+ }),
+ requireIntegrationAuthorizationAuth({
+ acceptedRoles: [ADMIN, MEMBER]
+ }),
+ param('integrationAuthId'),
+ validateRequest,
+ integrationAuthController.getIntegrationAuth
+);
+
router.post(
'/oauth-token',
requireAuth({
@@ -44,6 +57,7 @@ router.post(
location: 'body'
}),
body('workspaceId').exists().trim().notEmpty(),
+ body('accessId').trim(),
body('accessToken').exists().trim().notEmpty(),
body('integration').exists().trim().notEmpty(),
validateRequest,
diff --git a/backend/src/routes/v1/membership.ts b/backend/src/routes/v1/membership.ts
index 4481b8843..aaacada74 100644
--- a/backend/src/routes/v1/membership.ts
+++ b/backend/src/routes/v1/membership.ts
@@ -3,14 +3,15 @@ const router = express.Router();
import { body, param } from 'express-validator';
import { requireAuth, validateRequest } from '../../middleware';
import { membershipController } from '../../controllers/v1';
+import { membershipController as EEMembershipControllers } from '../../ee/controllers/v1';
// note: ALL DEPRECIATED (moved to api/v2/workspace/:workspaceId/memberships/:membershipId)
router.get( // used for old CLI (deprecate)
'/:workspaceId/connect',
requireAuth({
- acceptedAuthModes: ['jwt']
- }),
+ acceptedAuthModes: ['jwt']
+ }),
param('workspaceId').exists().trim(),
validateRequest,
membershipController.validateMembership
@@ -19,8 +20,8 @@ router.get( // used for old CLI (deprecate)
router.delete(
'/:membershipId',
requireAuth({
- acceptedAuthModes: ['jwt']
- }),
+ acceptedAuthModes: ['jwt']
+ }),
param('membershipId').exists().trim(),
validateRequest,
membershipController.deleteMembership
@@ -29,11 +30,22 @@ router.delete(
router.post(
'/:membershipId/change-role',
requireAuth({
- acceptedAuthModes: ['jwt']
- }),
+ acceptedAuthModes: ['jwt']
+ }),
body('role').exists().trim(),
validateRequest,
membershipController.changeMembershipRole
);
+router.post(
+ '/:membershipId/deny-permissions',
+ requireAuth({
+ acceptedAuthModes: ['jwt']
+ }),
+ param('membershipId').isMongoId().exists().trim(),
+ body('permissions').isArray().exists(),
+ validateRequest,
+ EEMembershipControllers.denyMembershipPermissions
+);
+
export default router;
diff --git a/backend/src/routes/v2/environment.ts b/backend/src/routes/v2/environment.ts
index 924db18fc..11afa4f2e 100644
--- a/backend/src/routes/v2/environment.ts
+++ b/backend/src/routes/v2/environment.ts
@@ -54,4 +54,17 @@ router.delete(
environmentController.deleteWorkspaceEnvironment
);
+router.get(
+ '/:workspaceId/environments',
+ requireAuth({
+ acceptedAuthModes: ['jwt'],
+ }),
+ requireWorkspaceAuth({
+ acceptedRoles: [MEMBER, ADMIN],
+ }),
+ param('workspaceId').exists().trim(),
+ validateRequest,
+ environmentController.getAllAccessibleEnvironmentsOfWorkspace
+);
+
export default router;
diff --git a/backend/src/routes/v2/index.ts b/backend/src/routes/v2/index.ts
index cf0f9a22b..538ee4800 100644
--- a/backend/src/routes/v2/index.ts
+++ b/backend/src/routes/v2/index.ts
@@ -8,6 +8,7 @@ import secrets from './secrets';
import serviceTokenData from './serviceTokenData';
import apiKeyData from './apiKeyData';
import environment from "./environment"
+import tags from "./tags"
export {
auth,
@@ -19,5 +20,6 @@ export {
secrets,
serviceTokenData,
apiKeyData,
- environment
+ environment,
+ tags
}
\ No newline at end of file
diff --git a/backend/src/routes/v2/organizations.ts b/backend/src/routes/v2/organizations.ts
index 1362a7759..e1488e8a7 100644
--- a/backend/src/routes/v2/organizations.ts
+++ b/backend/src/routes/v2/organizations.ts
@@ -30,7 +30,7 @@ router.patch(
'/:organizationId/memberships/:membershipId',
param('organizationId').exists().trim(),
param('membershipId').exists().trim(),
- body('role').exists().isString().trim().isIn([ADMIN, MEMBER]),
+ body('role').exists().isString().trim().isIn([OWNER, ADMIN, MEMBER]),
validateRequest,
requireAuth({
acceptedAuthModes: ['jwt', 'apiKey']
diff --git a/backend/src/routes/v2/tags.ts b/backend/src/routes/v2/tags.ts
new file mode 100644
index 000000000..d78e1e0f1
--- /dev/null
+++ b/backend/src/routes/v2/tags.ts
@@ -0,0 +1,50 @@
+import express, { Response, Request } from 'express';
+const router = express.Router();
+import { body, param } from 'express-validator';
+import { tagController } from '../../controllers/v2';
+import {
+ requireAuth,
+ requireWorkspaceAuth,
+ validateRequest,
+} from '../../middleware';
+import { ADMIN, MEMBER } from '../../variables';
+
+router.get(
+ '/:workspaceId/tags',
+ requireAuth({
+ acceptedAuthModes: ['jwt'],
+ }),
+ requireWorkspaceAuth({
+ acceptedRoles: [MEMBER, ADMIN],
+ }),
+ param('workspaceId').exists().trim(),
+ validateRequest,
+ tagController.getWorkspaceTags
+);
+
+router.delete(
+ '/tags/:tagId',
+ requireAuth({
+ acceptedAuthModes: ['jwt'],
+ }),
+ param('tagId').exists().trim(),
+ validateRequest,
+ tagController.deleteWorkspaceTag
+);
+
+router.post(
+ '/:workspaceId/tags',
+ requireAuth({
+ acceptedAuthModes: ['jwt'],
+ }),
+ requireWorkspaceAuth({
+ acceptedRoles: [MEMBER, ADMIN],
+ }),
+ param('workspaceId').exists().trim(),
+ body('name').exists().trim(),
+ body('slug').exists().trim(),
+ validateRequest,
+ tagController.createWorkspaceTag
+);
+
+export default router;
diff --git a/backend/src/routes/v2/workspace.ts b/backend/src/routes/v2/workspace.ts
index 55299e575..9a753badd 100644
--- a/backend/src/routes/v2/workspace.ts
+++ b/backend/src/routes/v2/workspace.ts
@@ -118,4 +118,19 @@ router.delete( // TODO - rewire dashboard to this route
workspaceController.deleteWorkspaceMembership
);
+
+router.patch(
+ '/:workspaceId/auto-capitalization',
+ requireAuth({
+ acceptedAuthModes: ['jwt']
+ }),
+ requireWorkspaceAuth({
+ acceptedRoles: [ADMIN, MEMBER]
+ }),
+ param('workspaceId').exists().trim(),
+ body('autoCapitalization').exists().trim().notEmpty(),
+ validateRequest,
+ workspaceController.toggleAutoCapitalization
+);
+
export default router;
diff --git a/backend/src/services/IntegrationService.ts b/backend/src/services/IntegrationService.ts
index 4ee991cdd..d245c5663 100644
--- a/backend/src/services/IntegrationService.ts
+++ b/backend/src/services/IntegrationService.ts
@@ -1,7 +1,3 @@
-import * as Sentry from '@sentry/node';
-import {
- Integration
-} from '../models';
import {
handleOAuthExchangeHelper,
syncIntegrationsHelper,
@@ -10,7 +6,6 @@ import {
setIntegrationAuthRefreshHelper,
setIntegrationAuthAccessHelper,
} from '../helpers/integration';
-import { exchangeCode } from '../integrations';
// should sync stuff be here too? Probably.
// TODO: move bot functions to IntegrationService.
@@ -26,11 +21,12 @@ class IntegrationService {
* - Store integration access and refresh tokens returned from the OAuth2 code-token exchange
* - Add placeholder inactive integration
* - Create bot sequence for integration
- * @param {Object} obj
- * @param {String} obj.workspaceId - id of workspace
- * @param {String} obj.environment - workspace environment
- * @param {String} obj.integration - name of integration
- * @param {String} obj.code - code
+ * @param {Object} obj1
+ * @param {String} obj1.workspaceId - id of workspace
+ * @param {String} obj1.environment - workspace environment
+ * @param {String} obj1.integration - name of integration
+ * @param {String} obj1.code - code
+ * @returns {IntegrationAuth} integrationAuth - integration authorization after OAuth2 code-token exchange
*/
static async handleOAuthExchange({
workspaceId,
@@ -43,7 +39,7 @@ class IntegrationService {
code: string;
environment: string;
}) {
- await handleOAuthExchangeHelper({
+ return await handleOAuthExchangeHelper({
workspaceId,
integration,
code,
@@ -116,26 +112,30 @@ class IntegrationService {
}
/**
- * Encrypt access token [accessToken] using the bot's copy
- * of the workspace key for workspace belonging to integration auth
+ * Encrypt access token [accessToken] and (optionally) access id using the
+ * bot's copy of the workspace key for workspace belonging to integration auth
* with id [integrationAuthId]
* @param {Object} obj
* @param {String} obj.integrationAuthId - id of integration auth
+ * @param {String} obj.accessId - access id
* @param {String} obj.accessToken - access token
* @param {Date} obj.accessExpiresAt - expiration date of access token
* @returns {IntegrationAuth} - updated integration auth
*/
static async setIntegrationAuthAccess({
integrationAuthId,
+ accessId,
accessToken,
accessExpiresAt
}: {
integrationAuthId: string;
+ accessId: string | null;
accessToken: string;
accessExpiresAt: Date | undefined;
}) {
return await setIntegrationAuthAccessHelper({
integrationAuthId,
+ accessId,
accessToken,
accessExpiresAt
});
diff --git a/backend/src/templates/emailVerification.handlebars b/backend/src/templates/emailVerification.handlebars
index 14effa33e..ac8abb087 100644
--- a/backend/src/templates/emailVerification.handlebars
+++ b/backend/src/templates/emailVerification.handlebars
@@ -8,11 +8,9 @@
- Infisical
Confirm your email address
- Your confirmation code is below β enter it in the browser window where you've started signing up for Infisical.
-
- {{code}}
+ Your confirmation code is below β enter it in the browser window where you've started signing up for Infisical.
+ {{code}}
Questions about setting up Infisical? Email us at support@infisical.com
diff --git a/backend/src/templates/organizationInvitation.handlebars b/backend/src/templates/organizationInvitation.handlebars
index 49cc96f38..045a9602b 100644
--- a/backend/src/templates/organizationInvitation.handlebars
+++ b/backend/src/templates/organizationInvitation.handlebars
@@ -7,12 +7,10 @@
Organization Invitation
- Infisical
- Join your team on Infisical
- {{inviterFirstName}}({{inviterEmail}}) has invited you to their Infisical organization β {{organizationName}}
+ Join your organization on Infisical
+ {{inviterFirstName}} ({{inviterEmail}}) has invited you to their Infisical organization β {{organizationName}}
Join now
What is Infisical?
- Infisical is a simple end-to-end encrypted solution that enables teams to sync and manage their environment
- variables.
+ Infisical is an easy-to-use end-to-end encrypted tool that enables developers to sync and manage their secrets and configs.