fix: further cleanup

This commit is contained in:
Daniel Hougaard
2025-04-25 04:53:00 +04:00
parent 6088ae09ab
commit f5fa57d6c5
5 changed files with 34 additions and 70 deletions

View File

@@ -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<void> {
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<void> {
export async function down(knex: Knex): Promise<void> {
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");
}
});
}

View File

@@ -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,

View File

@@ -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;
}

View File

@@ -7,8 +7,7 @@ export enum WorkflowIntegration {
export enum WorkflowIntegrationStatus {
PENDING = "pending",
INSTALLED = "installed",
FAILED = "failed"
INSTALLED = "installed"
}
export type TGetWorkflowIntegrationsByOrg = Omit<TOrgPermission, "orgId">;

View File

@@ -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"
]
}