Skip to content

v0.6.68: atlassian service accounts, 30 day wait block, markdown rendering upgrades, data drains, security hardening, paginated dropdowns#4469

Merged
waleedlatif1 merged 15 commits intomainfrom
staging
May 6, 2026
Merged

v0.6.68: atlassian service accounts, 30 day wait block, markdown rendering upgrades, data drains, security hardening, paginated dropdowns#4469
waleedlatif1 merged 15 commits intomainfrom
staging

Conversation

@waleedlatif1
Copy link
Copy Markdown
Collaborator

@waleedlatif1 waleedlatif1 commented May 6, 2026

TheodoreSpeaks and others added 14 commits May 5, 2026 18:55
* v0.6.29: login improvements, posthog telemetry (#4026)

* feat(posthog): Add tracking on mothership abort (#4023)

Co-authored-by: Theodore Li <theo@sim.ai>

* fix(login): fix captcha headers for manual login  (#4025)

* fix(signup): fix turnstile key loading

* fix(login): fix captcha header passing

* Catch user already exists, remove login form captcha

* feat(credentials): add Atlassian service account credentials

* improvement(credentials): tighten Atlassian service account plumbing

- Collapse fetchOAuthTokenBundle into fetchOAuthToken (returns the bundle)
- Reuse serviceAccountJsonSchema in the JSON form instead of hand-rolled checks
- Use parseAtlassianErrorMessage for log details; drop one-line bearer helper
- Extract ATLASSIAN_SERVICE_ACCOUNT_PROVIDER_ID/_SECRET_TYPE constants
- Use Drizzle .returning() instead of post-insert SELECT
- Helper for the duplicated 401/403 + non-OK pattern in the validator

* docs(credentials): add Atlassian service account setup guide

- New /integrations/atlassian-service-account doc covers token creation,
  scope selection, and adding the credential to Sim
- Form's "View setup guide" link now points at the doc
- Fix the existing Google form link that pointed to the wrong path

Screenshot TODOs left inline as MDX comments for the docs team.

* docs(credentials): add Atlassian service account screenshots

- Auth type picker, Sim add-credential modal, Jira block credential dropdown
- Scope-picker screenshot still TODO

* docs(credentials): add Atlassian scope picker screenshot

* fix(credentials): address greptile feedback on Atlassian SA

- Drop stale 'email and API token' copy from the service description
  (we only collect a token + domain, no email field)
- Move duplicate display-name check inside the create transaction so
  concurrent POSTs can't both pass the check and insert duplicates

* fix(docs): move Atlassian screenshots to docs/public

Docs site serves /static/* from apps/docs/public, not apps/sim/public —
matches the existing google-service-account screenshot convention.

* fix(credentials): address review feedback on Atlassian SA

- SSRF: only accept *.atlassian.net / *.jira-dev.com hosts before fetching
  tenant_info, blocking probes against localhost/internal IPs
- Confluence spaces selector: pull cloudId from the SA secret instead of
  calling accessible-resources, which 401s for scoped service-account tokens
- Case-insensitive https?:// strip so HTTPS://team.atlassian.net normalizes
  correctly

* chore: merge staging and bump API validation route baseline to 727

* perf(credentials): single-resolve in confluence spaces selector

Atlassian SAs were hitting resolveOAuthAccountId twice (once via
refreshAccessTokenIfNeeded, once directly to read cloudId) and
decrypting the secret twice (via getAtlassianServiceAccountToken
inside refresh, then again via getAtlassianServiceAccountSecret).

Resolve once up front and branch the whole flow on the result —
SA path skips refresh entirely and pulls token+cloudId from a
single secret read.

* refactor(credentials): consolidate Atlassian SA creation into /api/credentials

Atlassian service-account creation lived in its own route, contract, and
mutation hook, copy-pasting ~140 lines of insert/membership/audit/posthog
boilerplate from /api/credentials. Two endpoints means two authz paths,
two audit shapes, two TOCTOU stories — they will drift.

Fold Atlassian into the existing service_account branch of /api/credentials,
dispatching by providerId. The Atlassian validator (tenant_info + Bearer
/myself, SSRF host allowlist, typed error codes) lives in
lib/credentials/atlassian-service-account.ts and is the only Atlassian-
specific piece left. AtlassianValidationError maps to a {code, error} 400
in the existing catch block; the rest of the flow (transaction, members,
audit, posthog, dup-check) is now shared with Google SA + env credentials.

Delete:
- /api/auth/atlassian-service-account route
- contracts/atlassian-service-account.ts + barrel export
- useCreateAtlassianServiceAccount hook
- API audit baseline 727 → 726

Both forms (Google JSON-key, Atlassian token+domain) now call
useCreateWorkspaceCredential with the appropriate body shape.

* fix(credentials): close TOCTOU and restore typed errors after consolidation

- Add inner duplicate-guard inside the create transaction (DuplicateCredentialError)
  to close the race that the outer findExistingCredentialBySource leaves open.
  service_account rows have no DB-level unique index on (workspaceId, providerId,
  displayName), so this is the actual safety net. Tx-internal check applies to
  Google + env_workspace too — race-safety win for all credential types.
- Re-emit {code: 'duplicate_display_name', error: ...} on conflict so the form's
  ERROR_MESSAGES.duplicate_display_name mapping is reachable again.
- Thread Atlassian-specific audit metadata (atlassianDomain, atlassianCloudId)
  back into recordAudit; consolidation had dropped them.
- Use ATLASSIAN_SERVICE_ACCOUNT_PROVIDER_ID constant in contract superRefine.
- Drop `error: any` in catch in favor of `error: unknown` + getPostgresErrorCode.

* chore(credentials): drop dead createWorkspaceCredentialBodySchema + updateWorkspaceCredentialBodySchema

Both shadowed the actually-used schemas (createCredentialBodySchema /
updateCredentialByIdBodySchema) and were missing the apiToken/domain
Atlassian fields. A future change could pick the wrong one and silently
drop those fields. Confirmed zero non-definition references in the repo
(grep across apps/, packages/, scripts/ minus build artifacts).

* fix(credentials): scope inner duplicate re-check to service_account

OAuth dedupes by accountId, env_* by envKey — both have DB-level partial
unique indexes that surface as 23505. The previous inner re-check fired
for all types and always threw DuplicateCredentialError, which mapped to
'duplicate_display_name' in the UI even when the real conflict was a
duplicate OAuth account or env key. Restrict the in-tx re-check to
service_account (the only type without a DB-level index) and let the
23505 handler emit a generic message for everything else.

---------

Co-authored-by: Waleed <walif6@gmail.com>
Co-authored-by: Siddharth Ganesan <33737564+Sg312@users.noreply.github.com>
Co-authored-by: Vikhyath Mondreti <vikhyathvikku@gmail.com>
…g-field error (#4455)

Tool params were named `personalApiKey` but the subBlock resolves to canonical
`apiKey`, so canonical-group resolution wrote the value to params.apiKey while
the validator looked up params.personalApiKey and reported it missing.

Renames `personalApiKey` -> `apiKey` in get_person, query, list_persons,
delete_person, and types.ts. Also tightens check-block-registry.ts so a
subBlock with canonicalParamId no longer satisfies a tool param lookup by its
raw id (the raw id is deleted during extraction).
* v0.6.29: login improvements, posthog telemetry (#4026)

* feat(posthog): Add tracking on mothership abort (#4023)

Co-authored-by: Theodore Li <theo@sim.ai>

* fix(login): fix captcha headers for manual login  (#4025)

* fix(signup): fix turnstile key loading

* fix(login): fix captcha header passing

* Catch user already exists, remove login form captcha

* feat(block): Allow wait block to wait up to 30 days

* restore ff

* Filter out waits from hitl endpoints

* Use correct count, filtering out wait blocks

* improvement(wait): tighten poll route and pause-manager helpers

- Parallelize per-row dispatch with Promise.all
- Add status='paused' guard on nextResumeAt rewrite to prevent clobbering concurrent resumes
- Extract computeEarliestResumeAt + PauseResumeManager.setNextResumeAt helpers
- Use canonical PausePoint type in poll route (drop StoredPausePoint)
- Narrow UNIT_TO_MS via as const + WaitUnit guard
- Bump LOCK_TTL_SECONDS above route maxDuration
- Clearer error when allowedPauseKinds rejects a resume

---------

Co-authored-by: Waleed <walif6@gmail.com>
Co-authored-by: Siddharth Ganesan <33737564+Sg312@users.noreply.github.com>
Co-authored-by: Vikhyath Mondreti <vikhyathvikku@gmail.com>
* fix(ui): Adjust tool opacity, failed tool wording

* fix(ui): scope opacity to subagent groups, lowercase fallback error label
* fix(md-render): fix markdown rendering in file viewer

* fix(md-render): use Children.map in pre handler for robustness

* fix(md-render): add not-italic to fallback code element

* fix(md-render): fix cloneElement type error and include tables improvements

- Fix TypeScript build error: type isValidElement<Record<string, unknown>> so cloneElement accepts data-block prop
- Column sidebar: use CSS min() for responsive width instead of fixed 400px
- Table: boolean cell toggle only fires when clicking the checkbox element directly (via data-boolean-cell-toggle), not anywhere on the cell
- Table: double-clicking a boolean cell no longer opens edit mode
- Table: move row-select mousedown to the <td> to widen the hit target
- Table: run/stop button prevents row-select on mousedown
- Table: SelectAllCheckbox made keyboard-accessible; checkbox is pointer-events-none
* chore(docs): upgrade fumadocs to latest minor versions

- fumadocs-core: 16.6.7 -> 16.8.5
- fumadocs-ui: 16.6.7 -> 16.8.5
- fumadocs-mdx: 14.2.8 -> 14.3.2
- fumadocs-openapi: 10.3.13 -> 10.8.1
- migrate deprecated sidebar.tabs to top-level tabs prop
- fix pre-existing typo (slots.paremeters) surfaced by stricter openapi types

* fix(docs): revert sidebar.tabs migration to keep deploy compat

The top-level tabs prop is only on fumadocs-ui 16.7+; deploy env was
still resolving an older type and failing typecheck. sidebar.tabs is
deprecated but still functional — keep it for now.
…ok (#4440)

* feat(enterprise): add data drains for continuous export to S3 / webhook

* chore(data-drains): regenerate migration on top of staging + bump route baseline

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* docs(data-drains): clarify retention pairing is user-coupled, not enforced

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* fix(data-drains): preserve explicit forcePathStyle=false + reserve x-sim-signature

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* test(data-drains): drift guard ensures every webhook header is reserved

Asserts that any header buildHeaders writes is rejected when reused as a
custom signatureHeader. Adding a new metadata header without mirroring it
into RESERVED_SIGNATURE_HEADER_NAMES now fails CI.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
…achine (#4450)

* fix(terminal): terminal console update for child spans"

* address comments

* fix hitl state machine

* address comments

* address greptile
…#4461)

* improvement(confluence): expand scopes, persist canonical mode toggle

* improvement(confluence): memoize persisted canonical modes parse

* fix(confluence): paginate space selector dropdown

Confluence v2 spaces endpoint caps at limit=250 per page. The selector
endpoint was making one request and silently dropping every space past
the first page, which is why some spaces only worked when entered as a
manual spaceKey. Now follows _links.next cursor up to 20 pages (5000
spaces).

* fix(confluence): include archived spaces in selector dropdown

Confluence v2 /spaces defaults to status=current and the status param
is a single-value enum, so archived spaces never surface. They synced
fine when entered manually as a spaceKey because the connector looks
up spaces via ?keys=<key> which ignores status. Now fetches current
and archived in parallel and tags archived ones in the dropdown label.

* improvement(confluence): stream paginated space selector results

Bake pagination support into the selector abstraction via an opt-in
fetchPage definition so dropdowns populate progressively instead of
blocking on a full page-walk. Confluence spaces now stream current
then archived in a single cursor sequence.
* fix(md): file streaming patch preview

* address comment
* fix(security): block IPv4-compatible IPv6 SSRF bypass

* fix(security): also block IPv4-compatible IPv6 with Class E embedded IPv4

* fix(security): correct RFC1918 test label for IPv4-compat IPv6
* fix(tables): decouple master checkbox from cell-range, add allRowsSelected flag

Master checkbox detached from gutter selection state when rows or columns
changed after Cmd+A: the predicate matched normalizedSelection bounds
exactly (endRow === rows.length-1, endCol === displayColumns.length-1),
so any post-selection growth flipped it false while the cell-range
overlay still painted every row checked.

Replace the structural two-branch predicate with an explicit
allRowsSelected flag plus a uniform set-membership check. handleSelectAllRows
sets the flag in O(1); handleRowToggle materializes checkedRows when
toggling out of "all" mode. Bulk-op read sites (delete, copy, cut,
selectedRowCount) honor the flag.

Decouple gutter checkbox from cell-range drag: dragging cells no longer
fills gutter checkboxes — they reflect explicit row-selection intent
only, matching Sheets/Airtable. Cell-range overlay still paints cells.

* refactor(tables): row selection as discriminated union

Collapse `checkedRows: Set<string>` + `allRowsSelected: boolean` into a
single `RowSelection = { kind: 'none' | 'some' | 'all' }`. Impossible
states (all + non-empty Set) become unrepresentable; predicates like
`rowSelectionIncludes` and `rowSelectionIsEmpty` replace ad-hoc checks at
every read site.

* fix(tables): clear row selection after context-menu delete

handleContextMenuDelete dispatched the delete but left rowSelection at
its prior 'all' or 'some' state. After rows clear and a new row arrives
(realtime, undo, append), rowSelectionIncludes returned true for it,
rendering it checked and flipping the master checkbox back on.

* chore(tables): address review nits on row selection refactor

- guard selectedRowCount 'all' branch on contextRow membership in rows
- restore blank line between row-selection helpers and constants

* chore(tables): rename rowSelectionChanged to cellRangeRowChanged

The helper compares NormalizedSelection (cell-range) state for a given
row, not RowSelection. The old name collided with the new row-selection
discriminated union and read ambiguously.

* fix(tables): guard context-menu delete on stale rows, preserve selection on cancel

- Guard the kind='all' branch on contextRow membership in currentRows
  (matches the same fix applied to selectedRowCount), so a context menu
  on a stale row no longer deletes the entire table.
- Drop the eager rowSelection clear at modal-open time. The modal's
  onSuccess already calls handleClearSelection after the mutation
  resolves, so the post-delete invariant still holds; if the user
  cancels, the selection is now preserved.
…ents (#4468)

* fix(mothership): enforce ownership check on workflow resource attachments

* fix(mothership): fix table and knowledgebase BOLA in resource attachment resolution

* fix(mothership): apply workspace scope to table in processContextsServer

* fix(mothership): verify workspace membership before resolving workspace branch

* fix(data-drains): use const for timeoutId in sleepUntilAborted

* fix(test): mock db.select and drizzle and for workspace permissions check

* fix(mothership): always derive workspace from workflow record in workflow branch
@vercel
Copy link
Copy Markdown

vercel Bot commented May 6, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped May 6, 2026 6:45am

Request Review

@cursor
Copy link
Copy Markdown

cursor Bot commented May 6, 2026

PR Summary

High Risk
Touches security- and reliability-critical paths: new service-account credential handling/token retrieval, plus substantial changes to workflow execution SSE buffering/reconnect and cancellation (including paused/HITL flows). Also introduces new background dispatch endpoints for enterprise data export, which could affect data movement if misconfigured.

Overview
Adds two major capabilities: Enterprise Data Drains (continuous export to S3/HTTPS destinations) with new org-scoped CRUD/run/test APIs, a cron dispatcher endpoint, settings UI wiring, and accompanying docs/navigation updates.

Introduces Atlassian service account credentials: new credential creation form + server-side validation/normalization, encrypted secret storage, token retrieval behavior (returns apiToken + cloudId/domain), and Confluence space selector updates to support service accounts and cursor-based pagination (including archived spaces).

Hardens execution streaming and cancellation: refactors SSE event buffering to durably publish terminal events, adds a reconnect stream route with strict replay/terminal-event guarantees and better “buffer unavailable/pruned” handling, and reworks cancellation to coordinate with paused-resume state (DB reservation/retry, queued resume blocking) with expanded tests. Also adds a cron poller endpoint to auto-resume time-based pauses.

Smaller UX/docs fixes include markdown/file-preview rendering tweaks, connector canonical-mode persistence in configs, minor UI styling changes, and fumadocs dependency bumps.

Reviewed by Cursor Bugbot for commit a24e851. Configure here.

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit a24e851. Configure here.

Comment thread apps/sim/app/api/organizations/[id]/data-drains/route.ts
…4471)

Catch Postgres 23505 on insert/update so concurrent name conflicts
return a clean 409 instead of a 500. The data_drains_org_name_unique
index already prevents duplicate rows; this just improves the UX.
@waleedlatif1 waleedlatif1 merged commit efcd51a into main May 6, 2026
20 checks passed
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.

3 participants