Skip to content

SCAL-295232 Add Liveboard schedule webhook example - #70

Open
prathum-pandey-ts wants to merge 3 commits into
mainfrom
SCAL-295232-webhook-examples
Open

prathum-pandey-ts wants to merge 3 commits into
mainfrom
SCAL-295232-webhook-examples

Conversation

@prathum-pandey-ts

Copy link
Copy Markdown
Collaborator

Adds rest-api/liveboard-schedule-webhook: a receiver for ThoughtSpot LIVEBOARD_SCHEDULE webhooks that uploads the exported files to Google Drive. Follows the KPI monitor webhook example in starters/kpi-monitor.

  • src/main.ts: Express receiver for direct (multipart) and S3 storage deliveries; bearer token check, ack within 5 s, dedupe on msgUniqueId, upload to Drive (or ./out)
  • src/setup.ts: storage-config, create-webhook, route-schedules and validate via @thoughtspot/rest-api-sdk
  • src/demo.ts: npm run dev (StackBlitz demo) and npm test (smoke run) using sample deliveries from the payload docs
  • package-lock.json resolves to the public npm registry

Adds rest-api/liveboard-schedule-webhook: a receiver for ThoughtSpot
LIVEBOARD_SCHEDULE webhooks that uploads the exported files to Google
Drive. Follows the KPI monitor webhook example in starters/kpi-monitor.

- src/main.ts: Express receiver for direct (multipart) and S3 storage
  deliveries; bearer token check, ack within 5 s, dedupe on
  msgUniqueId, upload to Drive (or ./out)
- src/setup.ts: storage-config, create-webhook, route-schedules and
  validate via @thoughtspot/rest-api-sdk
- src/demo.ts: npm run dev (StackBlitz demo) and npm test (smoke run)
  using sample deliveries from the payload docs
- package-lock.json resolves to the public npm registry

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@snyk-io

snyk-io Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

⛔ Snyk checks have failed. 3 issues have been found so far.

Status Scan Engine Critical High Medium Low Total (3)
✅ Open Source Security 0 0 0 0 0 issues
✅ Licenses 0 0 0 0 0 issues
⛔ Code Security 0 3 0 0 3 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

Comment thread rest-api/liveboard-schedule-webhook/src/main.ts Outdated
Comment thread rest-api/liveboard-schedule-webhook/src/main.ts Outdated
Comment thread rest-api/liveboard-schedule-webhook/src/main.ts Outdated
prathum-pandey-ts and others added 2 commits September 25, 2026 14:59
Snyk flagged path traversal (CWE-23) where attachments and S3 objects
are written to temp files. Those temp paths were already safe
(basename + prefix), but the same data reached two real traversals in
local-output mode (DRIVE_FOLDER_ID unset):

- a storage-manifest filename like ../../x.pdf was copied outside out/
- msgUniqueId like ../../z picked the out/ subfolder

Temp files are now named by index only, and filenames and msgUniqueId
go through one whitelist (safeName) before touching the file system.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Snyk's taint tracking still reached the three file sinks through the
delivery objects that carry the (now sanitized) filenames. Add a
tempFile() guard at the attachment write, S3 write and Drive read so
only paths inside the delivery's own mkdtemp dir can touch the disk.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant