From f5fa57d6c586747a47ca39f6a189bb807bdd507d Mon Sep 17 00:00:00 2001 From: Daniel Hougaard Date: Fri, 25 Apr 2025 04:53:00 +0400 Subject: [PATCH] fix: further cleanup --- ...35_microsoft-teams-workflow-integration.ts | 56 ++++++++++--------- .../src/ee/services/license/license-fns.ts | 4 +- .../server/plugins/auth/inject-identity.ts | 1 + .../workflow-integration-types.ts | 3 +- manifest.json | 40 ------------- 5 files changed, 34 insertions(+), 70 deletions(-) delete mode 100644 manifest.json diff --git a/backend/src/db/migrations/20250422125635_microsoft-teams-workflow-integration.ts b/backend/src/db/migrations/20250422125635_microsoft-teams-workflow-integration.ts index 47782182d..0b3a55ad4 100644 --- a/backend/src/db/migrations/20250422125635_microsoft-teams-workflow-integration.ts +++ b/backend/src/db/migrations/20250422125635_microsoft-teams-workflow-integration.ts @@ -3,34 +3,34 @@ import { Knex } from "knex"; import { TableName } from "../schemas"; import { createOnUpdateTrigger, dropOnUpdateTrigger } from "../utils"; -const encryptedMicrosoftTeamsAppIdColumn = "encryptedMicrosoftTeamsAppId"; -const encryptedMicrosoftTeamsClientSecretColumn = "encryptedMicrosoftTeamsClientSecret"; -const encryptedMicrosoftTeamsBotIdColumn = "encryptedMicrosoftTeamsBotId"; - export async function up(knex: Knex): Promise { const superAdminHasEncryptedMicrosoftTeamsClientIdColumn = await knex.schema.hasColumn( TableName.SuperAdmin, - encryptedMicrosoftTeamsAppIdColumn + "encryptedMicrosoftTeamsAppId" ); - const superAdminHasEncryptedMicrosoftTeamsClientSecretColumn = await knex.schema.hasColumn( + const superAdminHasEncryptedMicrosoftTeamsClientSecret = await knex.schema.hasColumn( TableName.SuperAdmin, - encryptedMicrosoftTeamsClientSecretColumn + "encryptedMicrosoftTeamsClientSecret" ); - const superAdminHasEncryptedMicrosoftTeamsBotIdColumn = await knex.schema.hasColumn( + const superAdminHasEncryptedMicrosoftTeamsBotId = await knex.schema.hasColumn( TableName.SuperAdmin, - encryptedMicrosoftTeamsBotIdColumn + "encryptedMicrosoftTeamsBotId" ); - if (!superAdminHasEncryptedMicrosoftTeamsClientIdColumn || !superAdminHasEncryptedMicrosoftTeamsClientSecretColumn) { + if ( + !superAdminHasEncryptedMicrosoftTeamsClientIdColumn || + !superAdminHasEncryptedMicrosoftTeamsClientSecret || + !superAdminHasEncryptedMicrosoftTeamsBotId + ) { await knex.schema.alterTable(TableName.SuperAdmin, (table) => { if (!superAdminHasEncryptedMicrosoftTeamsClientIdColumn) { - table.binary(encryptedMicrosoftTeamsAppIdColumn).nullable(); + table.binary("encryptedMicrosoftTeamsAppId").nullable(); } - if (!superAdminHasEncryptedMicrosoftTeamsClientSecretColumn) { - table.binary(encryptedMicrosoftTeamsClientSecretColumn).nullable(); + if (!superAdminHasEncryptedMicrosoftTeamsClientSecret) { + table.binary("encryptedMicrosoftTeamsClientSecret").nullable(); } - if (!superAdminHasEncryptedMicrosoftTeamsBotIdColumn) { - table.binary(encryptedMicrosoftTeamsBotIdColumn).nullable(); + if (!superAdminHasEncryptedMicrosoftTeamsBotId) { + table.binary("encryptedMicrosoftTeamsBotId").nullable(); } }); } @@ -82,27 +82,31 @@ export async function up(knex: Knex): Promise { export async function down(knex: Knex): Promise { const hasEncryptedMicrosoftTeamsClientIdColumn = await knex.schema.hasColumn( TableName.SuperAdmin, - encryptedMicrosoftTeamsAppIdColumn + "encryptedMicrosoftTeamsAppId" ); - const hasEncryptedMicrosoftTeamsClientSecretColumn = await knex.schema.hasColumn( + const hasEncryptedMicrosoftTeamsClientSecret = await knex.schema.hasColumn( TableName.SuperAdmin, - encryptedMicrosoftTeamsClientSecretColumn + "encryptedMicrosoftTeamsClientSecret" ); - const hasEncryptedMicrosoftTeamsBotIdColumn = await knex.schema.hasColumn( + const hasEncryptedMicrosoftTeamsBotId = await knex.schema.hasColumn( TableName.SuperAdmin, - encryptedMicrosoftTeamsBotIdColumn + "encryptedMicrosoftTeamsBotId" ); - if (hasEncryptedMicrosoftTeamsClientIdColumn || hasEncryptedMicrosoftTeamsClientSecretColumn) { + if ( + hasEncryptedMicrosoftTeamsClientIdColumn || + hasEncryptedMicrosoftTeamsClientSecret || + hasEncryptedMicrosoftTeamsBotId + ) { await knex.schema.alterTable(TableName.SuperAdmin, (table) => { if (hasEncryptedMicrosoftTeamsClientIdColumn) { - table.dropColumn(encryptedMicrosoftTeamsAppIdColumn); + table.dropColumn("encryptedMicrosoftTeamsAppId"); } - if (hasEncryptedMicrosoftTeamsClientSecretColumn) { - table.dropColumn(encryptedMicrosoftTeamsClientSecretColumn); + if (hasEncryptedMicrosoftTeamsClientSecret) { + table.dropColumn("encryptedMicrosoftTeamsClientSecret"); } - if (hasEncryptedMicrosoftTeamsBotIdColumn) { - table.dropColumn(encryptedMicrosoftTeamsBotIdColumn); + if (hasEncryptedMicrosoftTeamsBotId) { + table.dropColumn("encryptedMicrosoftTeamsBotId"); } }); } diff --git a/backend/src/ee/services/license/license-fns.ts b/backend/src/ee/services/license/license-fns.ts index 180c89cd1..3f4af174b 100644 --- a/backend/src/ee/services/license/license-fns.ts +++ b/backend/src/ee/services/license/license-fns.ts @@ -29,7 +29,7 @@ export const getDefaultOnPremFeatures = (): TFeatureSet => ({ auditLogsRetentionDays: 0, auditLogStreams: false, auditLogStreamLimit: 3, - samlSSO: true, + samlSSO: false, hsm: false, oidcSSO: false, scim: false, @@ -38,7 +38,7 @@ export const getDefaultOnPremFeatures = (): TFeatureSet => ({ status: null, trial_end: null, has_used_trial: true, - secretApproval: true, + secretApproval: false, secretRotation: false, caCrl: false, instanceUserManagement: false, diff --git a/backend/src/server/plugins/auth/inject-identity.ts b/backend/src/server/plugins/auth/inject-identity.ts index fb076d8cb..57a1313c6 100644 --- a/backend/src/server/plugins/auth/inject-identity.ts +++ b/backend/src/server/plugins/auth/inject-identity.ts @@ -111,6 +111,7 @@ export const injectIdentity = fp(async (server: FastifyZodProvider) => { return; } + // Authentication is handled on a route-level here. if (req.url.includes("/api/v1/workflow-integrations/microsoft-teams/message-endpoint")) { return; } diff --git a/backend/src/services/workflow-integration/workflow-integration-types.ts b/backend/src/services/workflow-integration/workflow-integration-types.ts index e86dafc48..978b1e09e 100644 --- a/backend/src/services/workflow-integration/workflow-integration-types.ts +++ b/backend/src/services/workflow-integration/workflow-integration-types.ts @@ -7,8 +7,7 @@ export enum WorkflowIntegration { export enum WorkflowIntegrationStatus { PENDING = "pending", - INSTALLED = "installed", - FAILED = "failed" + INSTALLED = "installed" } export type TGetWorkflowIntegrationsByOrg = Omit; diff --git a/manifest.json b/manifest.json deleted file mode 100644 index da01a6729..000000000 --- a/manifest.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.11/MicrosoftTeams.schema.json", - "manifestVersion": "1.11", - "id": "78c44cc5-275f-468d-862d-4191485e5267", - "version": "1.0.0", - "name": { - "short": "Infisical", - "full": "Infisical" - }, - "description": { - "short": "Infisical", - "full": "Infisical" - }, - "icons": { - "outline": "outline.png", - "color": "color.png" - }, - "accentColor": "#FFFFFF", - "developer": { - "name": "Infisical Inc.", - "websiteUrl": "https://infisical.com", - "privacyUrl": "https://infisical.com/privacy", - "termsOfUseUrl": "https://infisical.com/terms" - }, - "webApplicationInfo": { - "id": "78c44cc5-275f-468d-862d-4191485e5267", - "resource": "api://78c44cc5-275f-468d-862d-4191485e5267" - }, - "bots": [ - { - "botId": "78c44cc5-275f-468d-862d-4191485e5267", - "scopes": ["team", "personal"], - "isNotificationOnly": true - } - ], - "validDomains": [ - "*.infisical.com", - "*danielinfisical.onmicrosoft.com" - ] -} \ No newline at end of file