Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 9 additions & 11 deletions apps/api/src/cloud-security/cloud-security-query.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Injectable } from '@nestjs/common';
import { db } from '@db';
import { getManifest } from '@trycompai/integration-platform';

const CLOUD_PROVIDER_CATEGORY = 'Cloud';
const CLOUD_PROVIDER_SLUGS = ['aws', 'gcp', 'azure'] as const;
Comment thread
tofikwest marked this conversation as resolved.

/** Scan window for filtering legacy results to latest scan only */
const SCAN_WINDOW_MS = 10 * 60 * 1000; // 10 minutes
Expand Down Expand Up @@ -88,7 +88,7 @@ export class CloudSecurityQueryService {
where: {
organizationId,
status: 'active',
provider: { category: CLOUD_PROVIDER_CATEGORY },
provider: { slug: { in: [...CLOUD_PROVIDER_SLUGS] } },
},
include: { provider: true },
});
Expand All @@ -98,10 +98,9 @@ export class CloudSecurityQueryService {
where: { organizationId },
});

const activeLegacy = legacyIntegrations.filter((i) => {
const manifest = getManifest(i.integrationId);
return manifest?.category === CLOUD_PROVIDER_CATEGORY;
});
const activeLegacy = legacyIntegrations.filter((i) =>
(CLOUD_PROVIDER_SLUGS as readonly string[]).includes(i.integrationId),
);

// Map new connections
const newProviders: CloudProvider[] = newConnections.map((conn) => {
Expand Down Expand Up @@ -207,7 +206,7 @@ export class CloudSecurityQueryService {
where: {
organizationId,
status: 'active',
provider: { category: CLOUD_PROVIDER_CATEGORY },
provider: { slug: { in: [...CLOUD_PROVIDER_SLUGS] } },
},
include: { provider: true },
});
Expand Down Expand Up @@ -303,10 +302,9 @@ export class CloudSecurityQueryService {
where: { organizationId },
});

const activeLegacy = legacyIntegrations.filter((i) => {
const manifest = getManifest(i.integrationId);
return manifest?.category === CLOUD_PROVIDER_CATEGORY;
});
const activeLegacy = legacyIntegrations.filter((i) =>
(CLOUD_PROVIDER_SLUGS as readonly string[]).includes(i.integrationId),
);

const legacyIds = activeLegacy.map((i) => i.id);
if (legacyIds.length === 0) return [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -659,12 +659,6 @@ export function PlatformIntegrations({ className, taskTemplates }: PlatformInteg
{provider.description}
</CardDescription>

{provider.category === 'Cloud' && (
<p className="text-xs text-muted-foreground italic">
This integration is used exclusively for Cloud Security Tests.
</p>
)}

{/* Mapped tasks */}
{provider.mappedTasks && provider.mappedTasks.length > 0 && (
<div className="flex flex-wrap gap-1.5">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -555,11 +555,6 @@ export function ConnectIntegrationDialog({
<p className="whitespace-pre-wrap text-xs break-words">{provider.setupInstructions}</p>
</div>
)}
{provider?.category === 'Cloud' && !provider?.setupScript && (
<div className="text-xs text-muted-foreground bg-muted/50 p-3 rounded-md">
This integration will only be used for Cloud Security Tests. Your credentials are encrypted and used exclusively to run read-only security scans.
</div>
)}
{allFields
.filter((field) => {
if (!provider?.setupScript) return true;
Expand Down
Loading