GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(credentials): add Atlassian service account credentials by TheodoreSpeaks · Pull Request #4432 · simstudioai/sim

Conversation

@TheodoreSpeaks

@TheodoreSpeaks TheodoreSpeaks commented May 4, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add atlassian-service-account credential type backed by a scoped Atlassian API token, surfaced in Jira and Confluence credential dropdowns alongside OAuth
  • Validate via the gateway flow: _edge/tenant_info (unauth) to discover cloudId, then api.atlassian.com/ex/jira/{cloudId}/rest/api/3/myself with Bearer to verify the token works
  • Plumb cloudId from the token route through tools and selectors so blocks skip the runtime accessible-resources call (which 401s for scoped service-account tokens)
  • Extract reusable ServiceAccountForm (Google JSON-key paste/upload) and new AtlassianServiceAccountForm (token + domain) from integrations-manager; map typed server error codes to friendly inline copy
  • Lift code from error response bodies into ApiClientError.code so any form/hook can switch on it without re-parsing

Type of Change

  • New feature

Testing

Tested manually end-to-end (credential creation, project picker, runtime block call). bun run lint and bun run check:api-validation:strict both pass.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

greptile-apps[bot] reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
waleedlatif1 and others added 30 commits April 3, 2026 23:30
@waleedlatif1
v0.6.23: MCP fixes, remove local state in favor of server state, moth…
0b9019d
…ership workflow edits via sockets, ui improvements
@waleedlatif1
v0.6.24: copilot feedback wiring, captcha fixes
a54dcbe
@waleedlatif1
v0.6.25: cloudwatch, cloudformation, live kb sync, linear fixes, post…
28af223
…hog upgrade
@waleedlatif1
v0.6.26: ui improvements, multiple response blocks, docx previews, ol…
d889f32
…lama fix
@waleedlatif1
v0.6.27: new triggers, mothership improvements, files archive, queuei…
316bc8c
…ng improvements, posthog, secrets mutations
@waleedlatif1
v0.6.28: new docs, delete confirmation standardization, dagster integ…
3f508e4
…ration, signup method feature flags, SSO improvements
@TheodoreSpeaks
v0.6.29: login improvements, posthog telemetry (#4026)
d6ec115
* feat(posthog): Add tracking on mothership abort (#4023)

Co-authored-by: Theodore Li <[email protected]>

* 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
@waleedlatif1
v0.6.30: slack trigger enhancements, connectors performance improveme…
d7da35b
…nts, secrets performance, polling refactors, drag resources in mothership
@waleedlatif1
v0.6.31: elevenlabs voice, trigger.dev fixes, cloud whitelabeling for…
cf233bb
… enterprises
@waleedlatif1
v0.6.32: BYOK fixes, ui improvements, cloudwatch tools, jsm tools ext…
f8f3758
…ension
@waleedlatif1
v0.6.33: polling improvements, jsm forms tools, credentials reactquer…
3c8bb40
…y invalidation, HITL docs
@waleedlatif1
v0.6.34: trigger.dev fixes, CI speedup, atlassian error extractor
d33acf4
@waleedlatif1
v0.6.35: additional jira fields, HITL docs, logs cleanup efficiency
4f40c4c
@waleedlatif1
v0.6.36: new chunkers, sockets state machine, google sheets/drive/cal…
cbfab1c
…endar triggers, docs updates, integrations/models pages improvements
@waleedlatif1
v0.6.37: audit logs page, isolated-vm worker rotation, permission gro…
4309d06
…ups ui
@waleedlatif1
v0.6.38: models page
8b57476
@waleedlatif1
v0.6.39: billing fixes, tools audit, landing fix
e3d0e74
@waleedlatif1
v0.6.40: mothership tool loop, new skills, agiloft, STS, IAM integrat…
0ac0539
…ions, jira forms endpoints
@waleedlatif1
v0.6.41: webhooks fix, workers removal
3838b6e
@waleedlatif1
v0.6.42: mothership nested file reads, search modal improvements
fc07922
@waleedlatif1
v0.6.43: mothership billing idempotency, env var resolution fixes
3a1b1a8
@waleedlatif1
v0.6.44: streamdown, mothership intelligence, excel extension
46ffc49
@Sg312
v0.6.45: superagent, csp, brightdata integration, gemini response for…
010435c
…mat, logs performance improvements

fix(csp): add missing analytics domains, remove unsafe-eval, fix workspace CSP gap (#4179)
fix(landing): return 404 for invalid dynamic route slugs (#4182)
improvement(seo): optimize sitemaps, robots.txt, and core web vitals across sim and docs (#4170)
fix(gemini): support structured output with tools on Gemini 3 models (#4184)
feat(brightdata): add Bright Data integration with 8 tools (#4183)
fix(mothership): fix superagent credentials (#4185)
fix(logs): close sidebar when selected log disappears from filtered list; cleanup (#4186)
@icecrasher321
Merge pull request #4190 from simstudioai/staging
c0bc62c
v0.6.46: mothership streaming fixes, brightdata integration
@waleedlatif1
v0.6.46: mothership queueing, web vitals
387cc97
@waleedlatif1
v0.6.47: files focusing, documentation, opus 4.7
2dbc7fd
@waleedlatif1
v0.6.48: import csv into tables, subflow fixes, CSP updates
8a50f18
@waleedlatif1
v0.6.49: deploy sockets event, resolver, logs improvements, monday.co…
dcf3302
…m integration, atlassian triggers
@icecrasher321
v0.6.50: ppt/doc/pdf worker isolation, docs, chat, sidebar improvements
bc09865
@waleedlatif1
v0.6.51: tables improvements, billing fixes, 404 pages, code hygiene
5f56e46
@vercel
vercel Bot deployed to Preview May 4, 2026 23:40
View deployment
@TheodoreSpeaks
fix(credentials): address greptile feedback on Atlassian SA
cf33383
- 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
@vercel
vercel Bot temporarily deployed to Preview May 5, 2026 01:50 Inactive
@TheodoreSpeaks
fix(docs): move Atlassian screenshots to docs/public
9b143fa
Docs site serves /static/* from apps/docs/public, not apps/sim/public —
matches the existing google-service-account screenshot convention.
@vercel
vercel Bot deployed to Preview May 5, 2026 02:24
View deployment
TheodoreSpeaks added 2 commits May 4, 2026 19:24
@TheodoreSpeaks
Merge remote-tracking branch 'origin/main' into feat/atlassian-servic…
7ea0c43
…e-account

# Conflicts:
#	scripts/check-api-validation-contracts.ts
@TheodoreSpeaks
fix(credentials): address review feedback on Atlassian SA
a1e77ee
- 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
@gitguardian

gitguardian Bot commented May 5, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

⚠️ GitGuardian has uncovered 1 secret following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secret in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
29606901 Triggered Generic High Entropy Secret a54dcbe apps/sim/providers/utils.test.ts View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secret safely. Learn here the best practices.
  3. Revoke and rotate this secret.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider

  • following these best practices for managing and storing secrets including API keys and other credentials
  • install secret detection on pre-commit to catch secret before it leaves your machine and ease remediation.

🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vercel
vercel Bot deployed to Preview May 5, 2026 02:32
View deployment
TheodoreSpeaks added 2 commits May 4, 2026 20:05
@TheodoreSpeaks
Merge remote-tracking branch 'origin/staging' into feat/atlassian-ser…
8f1d4e7
…vice-account
@TheodoreSpeaks
chore: merge staging and bump API validation route baseline to 727
287dade
@vercel
vercel Bot deployed to Preview May 5, 2026 03:10
View deployment
cursor[bot]
cursor Bot reviewed May 5, 2026
View reviewed changes
Comment thread apps/sim/app/api/auth/atlassian-service-account/route.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/sim/app/api/tools/confluence/selector-spaces/route.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

@TheodoreSpeaks
perf(credentials): single-resolve in confluence spaces selector
02a993a
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.
@vercel
vercel Bot temporarily deployed to Preview May 5, 2026 17:17 Inactive
cursor[bot]
cursor Bot reviewed May 5, 2026
View reviewed changes
Comment thread apps/sim/app/api/tools/confluence/selector-spaces/route.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

@TheodoreSpeaks
refactor(credentials): consolidate Atlassian SA creation into /api/cr…
e017f19
…edentials

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.
@vercel
vercel Bot deployed to Preview May 5, 2026 17:44
View deployment
cursor[bot]
cursor Bot reviewed May 5, 2026
View reviewed changes
Comment thread .../workspace/[workspaceId]/settings/components/integrations/atlassian-service-account-form.tsx Resolved

Uh oh!

There was an error while loading. Please reload this page.

@TheodoreSpeaks
fix(credentials): close TOCTOU and restore typed errors after consoli…
d03fad0
…dation

- 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.
@vercel
vercel Bot temporarily deployed to Preview May 5, 2026 22:00 Inactive
cursor[bot]
cursor Bot reviewed May 5, 2026
View reviewed changes
Comment thread apps/sim/app/api/credentials/route.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/sim/lib/api/contracts/credentials.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

@TheodoreSpeaks
chore(credentials): drop dead createWorkspaceCredentialBodySchema + u…
40d7f8b
…pdateWorkspaceCredentialBodySchema

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).
@vercel
vercel Bot temporarily deployed to Preview May 5, 2026 22:22 Inactive
@TheodoreSpeaks
fix(credentials): scope inner duplicate re-check to service_account
0fa4f21
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.
@vercel
vercel Bot temporarily deployed to Preview May 5, 2026 22:25 Inactive
cursor[bot]
cursor Bot reviewed May 5, 2026
View reviewed changes

@cursor cursor Bot left a comment

Copy link
Copy Markdown

There was a problem hiding this 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 0fa4f21. Configure here.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread apps/sim/lib/credentials/atlassian-service-account.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

@TheodoreSpeaks
TheodoreSpeaks merged commit 0337ccd into staging May 5, 2026
13 of 14 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@TheodoreSpeaks
TheodoreSpeaks deleted the feat/atlassian-service-account branch May 5, 2026 22:55
@waleedlatif1 waleedlatif1 mentioned this pull request May 6, 2026
v0.6.68: atlassian service accounts, 30 day wait block, markdown rendering upgrades, data drains, security hardening, paginated dropdowns #4469
Merged

This branch was previously deployed

1 inactive deployment
Preview — 0fa4f211 Deployed May 5, 2026 by vercel[bot]
View deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@greptile-apps greptile-apps[bot] greptile-apps[bot] left review comments
@cursor cursor[bot] cursor[bot] left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@TheodoreSpeaks @waleedlatif1 @Sg312 @icecrasher321
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.