feat: ignore secret or cors for client

This commit is contained in:
Carl-Gerhard Lindesvärd
2025-10-29 21:14:43 +01:00
parent a399209947
commit ddc99e9850
3 changed files with 8 additions and 0 deletions

View File

@@ -104,6 +104,10 @@ export async function validateSdkRequest(
throw createError('Ingestion: Profile id is blocked by project filter');
}
if (client.ignoreCorsAndSecret) {
return client;
}
if (client.project.cors) {
const domainAllowed = client.project.cors.find((domain) => {
const cleanedDomain = cleanDomain(domain);

View File

@@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE "public"."clients" ADD COLUMN "ignoreCorsAndSecret" BOOLEAN NOT NULL DEFAULT false;

View File

@@ -250,6 +250,8 @@ model Client {
organization Organization @relation(fields: [organizationId], references: [id], onDelete: Cascade)
organizationId String
ignoreCorsAndSecret Boolean @default(false)
createdAt DateTime @default(now())
updatedAt DateTime @default(now()) @updatedAt