Skip to content

Commit 26ba146

Browse files
committed
fix(integrations): vanta review feedback - unique svg ids, mime type for base64 uploads, auth check consistency
1 parent 57e53c1 commit 26ba146

9 files changed

Lines changed: 49 additions & 32 deletions

File tree

apps/docs/components/icons.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7556,12 +7556,15 @@ export function OnePasswordIcon(props: SVGProps<SVGSVGElement>) {
75567556
}
75577557

75587558
export function VantaIcon(props: SVGProps<SVGSVGElement>) {
7559+
const id = useId()
7560+
const clipId = `vanta_clip_${id}`
7561+
const maskId = `vanta_mask_${id}`
75597562
return (
75607563
<svg {...props} viewBox='0 0 512 512' fill='none' xmlns='http://www.w3.org/2000/svg'>
7561-
<g clipPath='url(#vanta-icon-clip)'>
7564+
<g clipPath={`url(#${clipId})`}>
75627565
<circle cx='256' cy='256' r='256' fill='#AC55FF' />
75637566
<mask
7564-
id='vanta-icon-mask'
7567+
id={maskId}
75657568
style={{ maskType: 'alpha' }}
75667569
maskUnits='userSpaceOnUse'
75677570
x='0'
@@ -7571,7 +7574,7 @@ export function VantaIcon(props: SVGProps<SVGSVGElement>) {
75717574
>
75727575
<circle cx='256' cy='256' r='256' fill='#AC55FF' />
75737576
</mask>
7574-
<g mask='url(#vanta-icon-mask)'>
7577+
<g mask={`url(#${maskId})`}>
75757578
<path
75767579
d='M269.699 530.451C360.294 530.451 407.136 502.376 421.276 474.223C422.09 472.599 420.53 470.761 418.81 471.332C402.863 476.607 390.96 466.808 389.625 455.498C389.625 455.498 385.167 407.538 369.22 402.858C370.165 400.913 374.01 385.586 362.126 371.424C365.376 361.406 362.691 354.81 360.26 349.823C363.222 346.191 365.498 341.506 366.482 336.943C366.726 335.861 366.721 334.905 367.598 333.887C373.201 329.231 379.384 325.389 383.145 318.574C389.923 306.26 385.382 292.196 377.167 281.817C376.334 280.671 375.681 280.12 375.622 277.176C375.642 272.145 374.731 266.968 372.027 262.717C370.648 260.557 368.84 258.69 366.945 256.959C359.052 249.598 349.609 244.163 340.542 238.293C339.295 237.494 337.843 236.431 337.302 234.978C334.447 224.351 327.065 216.131 317.886 213.894C317.691 206.776 310.187 195.983 298.835 195.983C295.371 195.983 292.506 197.865 290.718 194.623C286.566 186.75 278.293 185.287 273.976 185.088C273.25 185.053 273.046 184.078 273.704 183.766C275.087 183.103 277.182 182.187 280.291 180.988C295.882 173.524 289.431 131.009 283.049 108.575C280.062 100.199 272.49 76.3803 253.942 74.8057C252.665 74.6985 251.359 74.7277 250.126 75.0836C246.555 76.1122 243.909 78.9738 242.048 82.9372C235.914 95.2709 234.379 128.562 232.123 142.797C228.922 163.096 226.023 184.873 215.913 193.799C211.606 182.436 205.374 177.171 201.969 177.37C199.001 178.068 203.016 183.835 201.306 192.341C200.117 197.236 197.408 201.804 192.794 201.804C179.273 201.804 167.098 134.173 163.463 93.5451C163.365 92.4824 163.263 91.4245 163.068 90.3715C161.285 80.5533 156.12 74.757 150.663 74.757C147.896 74.757 137.961 73.7478 126.584 91.639C118.764 105.591 113.795 120.177 113.312 147.341C113.322 174.714 125.532 193.019 130.477 202.023C150.688 235.266 153.387 246.741 149.562 267.007C145.674 286.653 157.533 297.7 157.533 297.7C155.857 300.298 153.645 307.259 153.134 314.899C152.807 319.764 153.801 328.49 156.125 333.891C151.024 344.885 151.146 353.621 151.146 359.129C151.146 371.892 145.577 377.089 138.336 379.36C140.29 386.322 153.275 390.051 160.788 382.612C158.571 404.476 154.473 424.171 148.753 448.546C145.197 465.233 145.796 474.583 148.49 482.5C149.703 486.069 151.604 489.355 153.928 492.319C181.637 527.667 233.629 530.451 269.699 530.451ZM269.655 482.739C259.671 481.116 250.331 476.139 243.515 468.602C225.351 474.618 206.466 459.33 212.205 439.147C213.121 436.505 217.058 437.475 216.668 440.229C216.103 443.783 216.756 447.42 218.281 450.55C222.34 459.827 234.438 462.323 241.853 455.859C244.596 453.441 248.562 454.362 250.424 457.36C266.663 479.4 300.355 475.266 311.654 450.525C313.311 447.069 314.392 443.408 315.021 439.615C315.464 436.924 319.498 437.178 319.61 439.898C320.522 466.525 295.6 486.902 269.65 482.744L269.655 482.739Z'
75777580
fill='#240642'
@@ -7595,7 +7598,7 @@ export function VantaIcon(props: SVGProps<SVGSVGElement>) {
75957598
</g>
75967599
</g>
75977600
<defs>
7598-
<clipPath id='vanta-icon-clip'>
7601+
<clipPath id={clipId}>
75997602
<rect width='512' height='512' fill='white' />
76007603
</clipPath>
76017604
</defs>

apps/docs/content/docs/en/integrations/vanta.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,7 @@ Upload an evidence file to a Vanta document. Requires credentials with the vanta
332332
| `file` | file | No | The evidence file to upload |
333333
| `fileContent` | string | No | Base64-encoded file content \(alternative to file\) |
334334
| `fileName` | string | No | Optional file name override |
335+
| `mimeType` | string | No | MIME type of the file \(e.g., application/pdf\); used when uploading base64 content, since uploaded files already carry their own type |
335336
| `description` | string | No | Description of the uploaded evidence \(e.g., "Q3 access review evidence"\) |
336337
| `effectiveAtDate` | string | No | ISO 8601 date indicating when the document is effective from |
337338

apps/sim/app/api/tools/vanta/download/route.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -75,18 +75,18 @@ function getFileNameFromContentDisposition(header: string | null): string | null
7575
export const POST = withRouteHandler(async (request: NextRequest) => {
7676
const requestId = generateRequestId()
7777

78-
const authResult = await checkInternalAuth(request, { requireWorkflowId: false })
79-
if (!authResult.success) {
80-
logger.warn(`[${requestId}] Unauthorized Vanta download attempt`, {
81-
error: authResult.error || 'Unauthorized',
82-
})
83-
return NextResponse.json(
84-
{ success: false, error: authResult.error || 'Unauthorized' },
85-
{ status: 401 }
86-
)
87-
}
88-
8978
try {
79+
const authResult = await checkInternalAuth(request, { requireWorkflowId: false })
80+
if (!authResult.success) {
81+
logger.warn(`[${requestId}] Unauthorized Vanta download attempt`, {
82+
error: authResult.error || 'Unauthorized',
83+
})
84+
return NextResponse.json(
85+
{ success: false, error: authResult.error || 'Unauthorized' },
86+
{ status: 401 }
87+
)
88+
}
89+
9090
const parsed = await parseRequest(vantaDownloadContract, request, {})
9191
if (!parsed.success) return parsed.response
9292
const params = parsed.data.body

apps/sim/app/api/tools/vanta/query/route.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -364,18 +364,18 @@ function buildVantaOutput(params: VantaQueryBody, data: unknown): Record<string,
364364
export const POST = withRouteHandler(async (request: NextRequest) => {
365365
const requestId = generateRequestId()
366366

367-
const authResult = await checkInternalAuth(request, { requireWorkflowId: false })
368-
if (!authResult.success) {
369-
logger.warn(`[${requestId}] Unauthorized Vanta query attempt`, {
370-
error: authResult.error || 'Unauthorized',
371-
})
372-
return NextResponse.json(
373-
{ success: false, error: authResult.error || 'Unauthorized' },
374-
{ status: 401 }
375-
)
376-
}
377-
378367
try {
368+
const authResult = await checkInternalAuth(request, { requireWorkflowId: false })
369+
if (!authResult.success) {
370+
logger.warn(`[${requestId}] Unauthorized Vanta query attempt`, {
371+
error: authResult.error || 'Unauthorized',
372+
})
373+
return NextResponse.json(
374+
{ success: false, error: authResult.error || 'Unauthorized' },
375+
{ status: 401 }
376+
)
377+
}
378+
379379
const parsed = await parseRequest(vantaQueryContract, request, {})
380380
if (!parsed.success) return parsed.response
381381
const params = parsed.data.body

apps/sim/app/api/tools/vanta/upload/route.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,11 @@ export const POST = withRouteHandler(async (request: NextRequest) => {
7272

7373
fileBuffer = await downloadFileFromStorage(userFile, requestId, logger)
7474
fileName = params.fileName || userFile.name
75-
mimeType = userFile.type || 'application/octet-stream'
75+
mimeType = userFile.type || params.mimeType || 'application/octet-stream'
7676
} else if (params.fileContent) {
7777
fileBuffer = Buffer.from(params.fileContent, 'base64')
7878
fileName = params.fileName || 'file'
79-
mimeType = 'application/octet-stream'
79+
mimeType = params.mimeType || 'application/octet-stream'
8080
} else {
8181
return NextResponse.json({ success: false, error: 'File is required' }, { status: 400 })
8282
}

apps/sim/components/icons.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7556,12 +7556,15 @@ export function OnePasswordIcon(props: SVGProps<SVGSVGElement>) {
75567556
}
75577557

75587558
export function VantaIcon(props: SVGProps<SVGSVGElement>) {
7559+
const id = useId()
7560+
const clipId = `vanta_clip_${id}`
7561+
const maskId = `vanta_mask_${id}`
75597562
return (
75607563
<svg {...props} viewBox='0 0 512 512' fill='none' xmlns='http://www.w3.org/2000/svg'>
7561-
<g clipPath='url(#vanta-icon-clip)'>
7564+
<g clipPath={`url(#${clipId})`}>
75627565
<circle cx='256' cy='256' r='256' fill='#AC55FF' />
75637566
<mask
7564-
id='vanta-icon-mask'
7567+
id={maskId}
75657568
style={{ maskType: 'alpha' }}
75667569
maskUnits='userSpaceOnUse'
75677570
x='0'
@@ -7571,7 +7574,7 @@ export function VantaIcon(props: SVGProps<SVGSVGElement>) {
75717574
>
75727575
<circle cx='256' cy='256' r='256' fill='#AC55FF' />
75737576
</mask>
7574-
<g mask='url(#vanta-icon-mask)'>
7577+
<g mask={`url(#${maskId})`}>
75757578
<path
75767579
d='M269.699 530.451C360.294 530.451 407.136 502.376 421.276 474.223C422.09 472.599 420.53 470.761 418.81 471.332C402.863 476.607 390.96 466.808 389.625 455.498C389.625 455.498 385.167 407.538 369.22 402.858C370.165 400.913 374.01 385.586 362.126 371.424C365.376 361.406 362.691 354.81 360.26 349.823C363.222 346.191 365.498 341.506 366.482 336.943C366.726 335.861 366.721 334.905 367.598 333.887C373.201 329.231 379.384 325.389 383.145 318.574C389.923 306.26 385.382 292.196 377.167 281.817C376.334 280.671 375.681 280.12 375.622 277.176C375.642 272.145 374.731 266.968 372.027 262.717C370.648 260.557 368.84 258.69 366.945 256.959C359.052 249.598 349.609 244.163 340.542 238.293C339.295 237.494 337.843 236.431 337.302 234.978C334.447 224.351 327.065 216.131 317.886 213.894C317.691 206.776 310.187 195.983 298.835 195.983C295.371 195.983 292.506 197.865 290.718 194.623C286.566 186.75 278.293 185.287 273.976 185.088C273.25 185.053 273.046 184.078 273.704 183.766C275.087 183.103 277.182 182.187 280.291 180.988C295.882 173.524 289.431 131.009 283.049 108.575C280.062 100.199 272.49 76.3803 253.942 74.8057C252.665 74.6985 251.359 74.7277 250.126 75.0836C246.555 76.1122 243.909 78.9738 242.048 82.9372C235.914 95.2709 234.379 128.562 232.123 142.797C228.922 163.096 226.023 184.873 215.913 193.799C211.606 182.436 205.374 177.171 201.969 177.37C199.001 178.068 203.016 183.835 201.306 192.341C200.117 197.236 197.408 201.804 192.794 201.804C179.273 201.804 167.098 134.173 163.463 93.5451C163.365 92.4824 163.263 91.4245 163.068 90.3715C161.285 80.5533 156.12 74.757 150.663 74.757C147.896 74.757 137.961 73.7478 126.584 91.639C118.764 105.591 113.795 120.177 113.312 147.341C113.322 174.714 125.532 193.019 130.477 202.023C150.688 235.266 153.387 246.741 149.562 267.007C145.674 286.653 157.533 297.7 157.533 297.7C155.857 300.298 153.645 307.259 153.134 314.899C152.807 319.764 153.801 328.49 156.125 333.891C151.024 344.885 151.146 353.621 151.146 359.129C151.146 371.892 145.577 377.089 138.336 379.36C140.29 386.322 153.275 390.051 160.788 382.612C158.571 404.476 154.473 424.171 148.753 448.546C145.197 465.233 145.796 474.583 148.49 482.5C149.703 486.069 151.604 489.355 153.928 492.319C181.637 527.667 233.629 530.451 269.699 530.451ZM269.655 482.739C259.671 481.116 250.331 476.139 243.515 468.602C225.351 474.618 206.466 459.33 212.205 439.147C213.121 436.505 217.058 437.475 216.668 440.229C216.103 443.783 216.756 447.42 218.281 450.55C222.34 459.827 234.438 462.323 241.853 455.859C244.596 453.441 248.562 454.362 250.424 457.36C266.663 479.4 300.355 475.266 311.654 450.525C313.311 447.069 314.392 443.408 315.021 439.615C315.464 436.924 319.498 437.178 319.61 439.898C320.522 466.525 295.6 486.902 269.65 482.744L269.655 482.739Z'
75777580
fill='#240642'
@@ -7595,7 +7598,7 @@ export function VantaIcon(props: SVGProps<SVGSVGElement>) {
75957598
</g>
75967599
</g>
75977600
<defs>
7598-
<clipPath id='vanta-icon-clip'>
7601+
<clipPath id={clipId}>
75997602
<rect width='512' height='512' fill='white' />
76007603
</clipPath>
76017604
</defs>

apps/sim/lib/api/contracts/tools/vanta.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -678,6 +678,7 @@ export const vantaUploadBodySchema = vantaBaseBodySchema.extend({
678678
file: FileInputSchema.optional().nullable(),
679679
fileContent: z.string().nullish(),
680680
fileName: z.string().nullish(),
681+
mimeType: z.string().nullish(),
681682
description: z.string().nullish(),
682683
effectiveAtDate: z.string().nullish(),
683684
})

apps/sim/tools/vanta/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ export interface VantaUploadDocumentFileParams extends VantaBaseParams {
7676
file?: unknown
7777
fileContent?: string
7878
fileName?: string
79+
mimeType?: string
7980
description?: string
8081
effectiveAtDate?: string
8182
}

apps/sim/tools/vanta/upload_document_file.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,13 @@ export const vantaUploadDocumentFileTool: ToolConfig<
5959
visibility: 'user-or-llm',
6060
description: 'Optional file name override',
6161
},
62+
mimeType: {
63+
type: 'string',
64+
required: false,
65+
visibility: 'user-or-llm',
66+
description:
67+
'MIME type of the file (e.g., application/pdf); used when uploading base64 content, since uploaded files already carry their own type',
68+
},
6269
description: {
6370
type: 'string',
6471
required: false,
@@ -85,6 +92,7 @@ export const vantaUploadDocumentFileTool: ToolConfig<
8592
file: params.file,
8693
fileContent: params.fileContent,
8794
fileName: params.fileName,
95+
mimeType: params.mimeType,
8896
description: params.description,
8997
effectiveAtDate: params.effectiveAtDate,
9098
}),

0 commit comments

Comments
 (0)