SCAL-295232 Add Liveboard schedule webhook example - #70
Open
prathum-pandey-ts wants to merge 3 commits into
Open
prathum-pandey-ts wants to merge 3 commits into
prathum-pandey-ts wants to merge 3 commits into
Conversation
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 checks have failed. 3 issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.