Title: fix(execute): derive credential actor from auth type, not body isClientSession by waleedlatif1 · Pull Request #9771 · simstudioai/sim · GitHub
Open Graph Title: fix(execute): derive credential actor from auth type, not body isClientSession by waleedlatif1 · Pull Request #9771 · simstudioai/sim
X Title: fix(execute): derive credential actor from auth type, not body isClientSession by waleedlatif1 · Pull Request #9771 · simstudioai/sim
Description: Summary POST /api/workflows/[id]/execute picked the credential actor from the body's isClientSession. A session caller that omitted it ran as the workspace billing account: OAuth tokens resolved as that account (a derived admin of every shared credential) and personal env vars came from the workflow owner, while the run still executed the caller-editable draft A write member could get tokens for shared credentials they aren't a member of by running their own draft without the flag. The logs Retry button already hit this path, since it doesn't send isClientSession Actor now follows the auth type: session, personal API key, and trusted MCP bridge run as the authenticated user. Workspace API key, public API, and internal JWT keep the billing-account actor (no change) isClientSession stays for streaming/live-trace/Copilot binding only The write-access check now uses the effective draft decision. A session run with no useDraftState runs the draft by default, so it now needs write like other draft runs (matches workflows.manual.execute minimumRole). The Retry UI is already gated on canEdit, so UI users see no change Type of Change Bug fix (security) Testing New route tests: actor + enforceCredentialAccess for all five caller types, and write-vs-read authorization for draft vs deployed session runs Red on pre-fix code: exactly the session-actor and draft-write cases fail, and the other caller cases pass (pins their behavior). Green after the fix app/api/workflows/ vitest: 11 files, 118 tests pass biome, check:test-patterns, check:comment-hygiene locally; full type-check/audits/test in CI Checklist Code follows project style guidelines Self-reviewed my changes Tests added/updated and passing (new tests pass the test-audit authoring gate) No new warnings introduced I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA) 🤖 Generated with Claude Code
Open Graph Description: Summary POST /api/workflows/[id]/execute picked the credential actor from the body's isClientSession. A session caller that omitted it ran as the workspace billing account: OAuth tokens resolv...
X Description: Summary POST /api/workflows/[id]/execute picked the credential actor from the body's isClientSession. A session caller that omitted it ran as the workspace billing account: OAuth tokens re...
Opengraph URL: https://github.com/simstudioai/sim/pull/9771
X: @github
Domain: github.com
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:c6204c2a-4c60-4d1b-00e1-2ff2701eb19c |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | D0DA:1D33A1:1B5C2BC:252F3E4:6AFB90C3 |
| html-safe-nonce | eb91853f08c3bab0b043fd6fff39df85ca46793b927e056ec74771e8ede4892a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMERBOjFEMzNBMToxQjVDMkJDOjI1MkYzRTQ6NkFGQjkwQzMiLCJ2aXNpdG9yX2lkIjoiMzUyNjk2ODA2Nzk5NDkxNTAxMSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | d899cce104d334c99cfdc41d772c384793b7d41c9d40a88967c592b0030c79cd |
| hovercard-subject-tag | pull_request:5205277228 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/simstudioai/sim/pull/9771/files |
| twitter:image | https://avatars.githubusercontent.com/u/40672544?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/40672544?s=400&v=4 |
| og:image:alt | Summary POST /api/workflows/[id]/execute picked the credential actor from the body's isClientSession. A session caller that omitted it ran as the workspace billing account: OAuth tokens resolv... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4f01efe06174a5ba6342fd58e42d02295e0675bedbb465d6bef2dbaec8e46556 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/simstudioai/sim git https://github.com/simstudioai/sim.git |
| octolytics-dimension-user_id | 199344406 |
| octolytics-dimension-user_login | simstudioai |
| octolytics-dimension-repository_id | 912559512 |
| octolytics-dimension-repository_nwo | simstudioai/sim |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 912559512 |
| octolytics-dimension-repository_network_root_nwo | simstudioai/sim |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | a52db8866b6543b4e83730cd6a6b1360f1a9e4dc |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width