René's URL Explorer Experiment


Title: fix(billing): withhold the payer credit and storage pools from callers who cannot manage billing by waleedlatif1 · Pull Request #6567 · simstudioai/sim · GitHub

Open Graph Title: fix(billing): withhold the payer credit and storage pools from callers who cannot manage billing by waleedlatif1 · Pull Request #6567 · simstudioai/sim

X Title: fix(billing): withhold the payer credit and storage pools from callers who cannot manage billing by waleedlatif1 · Pull Request #6567 · simstudioai/sim

Description: Stacked on #6565 → #6560. Review only this PR's own commits; merge after its parents. GET /api/v2/billing/status returned the resolved payer's pooled credits (used/limit/remaining) and storage to any caller holding only read on the workspace. On an org-hosted workspace resolveStorageBillingContext resolves the payer entity, so storage is organization-wide across every workspace that org funds — not workspace-scoped. Baseline note v2 billing does not exist on origin/main, so "main gated this route" is literally false. But main's analogous surface deliberately gated the same data: workspaces/[id]/credit-availability passes canViewPayerPool: canManageWorkspaceBilling(...) into getWorkspaceCreditAvailability, which substitutes a member-scoped or null figure otherwise. No route on main ever returned a payer's pool to a non-billing-manager. plan, period, status, and workspaceId were not newly exposed — workspaces/[id]/host-context already surfaces the payer's rolled-up plan to every workspace viewer. Those stay. Why concealment rather than a role gate Billing authority is not a workspace role: it is billedAccountUserId === userId, or org admin. defineWorkspaceOperation caps workspace API keys at write, and a workspace admin is deliberately not a billing manager, so no minimumRole expresses the policy. The endpoint stays at read; the use case projects the two pool objects only to an authorized caller. The route is untouched — no role check moved into the adapter. Workspace API keys are excluded An actor-less workspace_api_key has no user to evaluate, and POST /api/workspaces/[id]/api-keys requires only workspace admin — a freely grantable collaborator permission. Treating such keys as billing managers would let a non-billing-manager admin mint a key and read the org-wide pool. Attributing the key to its creator is ruled out by CLAUDE.md: "Never substitute a billing owner, uploader, creator, or API-key owner for the acting principal" — and is independently unsound, since the creator's authority can be revoked while the key keeps working. Keys keep plan, period, status, workspaceId, which covers limit_exceeded / billing_blocked alerting. No in-repo consumer reads credits/storage (checked packages/ts-sdk, all of apps, docs). Also The org-wide storage query now runs only after disclosure is authorized; previously it executed for every caller and the result was discarded. credits and storage are now .nullable() in the contract with descriptions stating why; OpenAPI regenerated. One existing test asserted the old leak and was corrected. Reverting the guard turns 6 tests red across both the human and workspace-key paths. type-check · biome · 553 tests · check:api-validation · check:openapi — all pass.

Open Graph Description: Stacked on #6565 → #6560. Review only this PR's own commits; merge after its parents. GET /api/v2/billing/status returned the resolved payer's pooled credits (used/limit/remaining) and stor...

X Description: Stacked on #6565 → #6560. Review only this PR's own commits; merge after its parents. GET /api/v2/billing/status returned the resolved payer's pooled credits (used/limit/remaining) ...

Opengraph URL: https://github.com/simstudioai/sim/pull/6567

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,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-controllerpull_requests
route-actionfiles
fetch-noncev2:8263e099-068f-b6ef-00ad-1d810170abe0
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id9588:5A439:8539:BE4E:6AFB47A9
html-safe-nonceff4e65d9d1d2c84ea4b2a6540ae0af24e7744552c92d0f73df03186076fe32b1
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NTg4OjVBNDM5Ojg1Mzk6QkU0RTo2QUZCNDdBOSIsInZpc2l0b3JfaWQiOiI1MTQzMDI0NTgwNTUzMjk1Nzg1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmacb048eb8f40bac21ae8b07571250c8ad33344cc3c2dd219cbbb844b704e908b15
hovercard-subject-tagpull_request:4257630539
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/simstudioai/sim/pull/6567/files
twitter:imagehttps://avatars.githubusercontent.com/u/40672544?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/40672544?s=400&v=4
og:image:altStacked on #6565 → #6560. Review only this PR's own commits; merge after its parents. GET /api/v2/billing/status returned the resolved payer's pooled credits (used/limit/remaining) and stor...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Noneacf7616d06cc051644705b379878c9bb13dc5e70ecf4ffd9b34140f8ac01d7e1
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/simstudioai/sim git https://github.com/simstudioai/sim.git
octolytics-dimension-user_id199344406
octolytics-dimension-user_loginsimstudioai
octolytics-dimension-repository_id912559512
octolytics-dimension-repository_nwosimstudioai/sim
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id912559512
octolytics-dimension-repository_network_root_nwosimstudioai/sim
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release26504db649b58525278f77a52b80ba5f10d5f4de
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/simstudioai/sim/pull/6567/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim%2Fpull%2F6567%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim%2Fpull%2F6567%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=simstudioai%2Fsim
Reloadhttps://github.com/simstudioai/sim/pull/6567/files
Reloadhttps://github.com/simstudioai/sim/pull/6567/files
Reloadhttps://github.com/simstudioai/sim/pull/6567/files
simstudioaihttps://github.com/simstudioai
simhttps://github.com/simstudioai/sim
Codehttps://github.com/simstudioai/sim
Issues129 (129)https://github.com/simstudioai/sim/issues
Pull requests199 (199)https://github.com/simstudioai/sim/pulls
Actionshttps://github.com/simstudioai/sim/actions
Projectshttps://github.com/simstudioai/sim/projects
Security and qualityhttps://github.com/simstudioai/sim/security
Insightshttps://github.com/simstudioai/sim/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fsimstudioai%2Fsim%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fsimstudioai%2Fsim%2Fissues%2Fnew%2Fchoose
waleedlatif1https://github.com/waleedlatif1
improvement/v2-route-standardizationhttps://github.com/simstudioai/sim/tree/improvement/v2-route-standardization
fix/v2-billing-status-authzhttps://github.com/simstudioai/sim/tree/fix/v2-billing-status-authz
Conversation 5 https://github.com/simstudioai/sim/pull/6567
Commits 3 https://github.com/simstudioai/sim/pull/6567/commits
Checks 5 https://github.com/simstudioai/sim/pull/6567/checks
Files changed https://github.com/simstudioai/sim/pull/6567/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/6567/files
fix(billing): withhold the payer credit and storage pools from callers who cannot manage billing https://github.com/simstudioai/sim/pull/6567/files#top
Show all changes 3 commits https://github.com/simstudioai/sim/pull/6567/files
9ef805a fix(billing): withhold the payer credit pool from v2 status readers waleedlatif1 Aug 11, 2026 https://github.com/simstudioai/sim/pull/6567/commits/9ef805a3ad849b29dbcada498bc046d9e460dc29
8ff822e fix(billing): deny the payer pool to actor-less workspace API keys waleedlatif1 Aug 11, 2026 https://github.com/simstudioai/sim/pull/6567/commits/8ff822ee5675ad7ee5104be5f1f1f32d299e1592
79a3486 chore(billing): tidy payer-pool concealment cleanup waleedlatif1 Aug 11, 2026 https://github.com/simstudioai/sim/pull/6567/commits/79a3486a364b6a34cb1a31350c9a5b07780f7fdb
Clear filters https://github.com/simstudioai/sim/pull/6567/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/6567/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/6567/files
openapi-v2-billing.json https://github.com/simstudioai/sim/pull/6567/files#diff-d1a7579e3381b5f6f39f2f304f56201fbf944a23caa31b5ecc165988a85a6eb4
route.test.ts https://github.com/simstudioai/sim/pull/6567/files#diff-626588ea316544590dcb07b2415fc85e980ace2a3e2072c6efa2b3e6cf860c83
billing.ts https://github.com/simstudioai/sim/pull/6567/files#diff-021a8b87fe67b3a3b2b672c1efd3bc8aac5e028d1f4c8c2b636a0a3506dbd3c2
billing.ts https://github.com/simstudioai/sim/pull/6567/files#diff-4f1e77fc2e4f614029f5b66d17ef36832d2606642356be7859b1376980ea7bc1
billing-use-cases.test.ts https://github.com/simstudioai/sim/pull/6567/files#diff-b6e0fd38562104b13ea532452fc3c3ea8f17e5719b302b1f646a51cdeeb3b8cc
get-billing-status.ts https://github.com/simstudioai/sim/pull/6567/files#diff-b5d2fe0b0b21d943f57186d7441af96e61b6bddcf333869bb4f19553d9475357
workspace-billing-authority.test.ts https://github.com/simstudioai/sim/pull/6567/files#diff-01fcb2900d3b31bcfc9442317c3b2726f5fc4a124e69c4c6067ea7fa895c1df1
workspace-billing-authority.ts https://github.com/simstudioai/sim/pull/6567/files#diff-c12c4f0be5e764f25206233f6d3573352e485f8a0a07c193fd7ade2b69064b41
generator.test.ts https://github.com/simstudioai/sim/pull/6567/files#diff-fd10e1dc96de98645f35307f3fb23503c2ec9fb871886b82c8841339555b675c
apps/docs/openapi-v2-billing.jsonhttps://github.com/simstudioai/sim/pull/6567/files#diff-d1a7579e3381b5f6f39f2f304f56201fbf944a23caa31b5ecc165988a85a6eb4
View file https://github.com/simstudioai/sim/blob/79a3486a364b6a34cb1a31350c9a5b07780f7fdb/apps/docs/openapi-v2-billing.json
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/6567/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/6567/files#diff-d1a7579e3381b5f6f39f2f304f56201fbf944a23caa31b5ecc165988a85a6eb4
https://github.com/simstudioai/sim/pull/6567/files#diff-d1a7579e3381b5f6f39f2f304f56201fbf944a23caa31b5ecc165988a85a6eb4
https://github.com/simstudioai/sim/pull/6567/files#diff-d1a7579e3381b5f6f39f2f304f56201fbf944a23caa31b5ecc165988a85a6eb4
https://github.com/simstudioai/sim/pull/6567/files#diff-d1a7579e3381b5f6f39f2f304f56201fbf944a23caa31b5ecc165988a85a6eb4
apps/sim/app/api/v2/billing/status/route.test.tshttps://github.com/simstudioai/sim/pull/6567/files#diff-626588ea316544590dcb07b2415fc85e980ace2a3e2072c6efa2b3e6cf860c83
View file https://github.com/simstudioai/sim/blob/79a3486a364b6a34cb1a31350c9a5b07780f7fdb/apps/sim/app/api/v2/billing/status/route.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/6567/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/6567/files#diff-626588ea316544590dcb07b2415fc85e980ace2a3e2072c6efa2b3e6cf860c83
https://github.com/simstudioai/sim/pull/6567/files#diff-626588ea316544590dcb07b2415fc85e980ace2a3e2072c6efa2b3e6cf860c83
apps/sim/lib/api/contracts/v2/billing.tshttps://github.com/simstudioai/sim/pull/6567/files#diff-021a8b87fe67b3a3b2b672c1efd3bc8aac5e028d1f4c8c2b636a0a3506dbd3c2
View file https://github.com/simstudioai/sim/blob/79a3486a364b6a34cb1a31350c9a5b07780f7fdb/apps/sim/lib/api/contracts/v2/billing.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/6567/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/6567/files#diff-021a8b87fe67b3a3b2b672c1efd3bc8aac5e028d1f4c8c2b636a0a3506dbd3c2
https://github.com/simstudioai/sim/pull/6567/files#diff-021a8b87fe67b3a3b2b672c1efd3bc8aac5e028d1f4c8c2b636a0a3506dbd3c2
https://github.com/simstudioai/sim/pull/6567/files#diff-021a8b87fe67b3a3b2b672c1efd3bc8aac5e028d1f4c8c2b636a0a3506dbd3c2
https://github.com/simstudioai/sim/pull/6567/files#diff-021a8b87fe67b3a3b2b672c1efd3bc8aac5e028d1f4c8c2b636a0a3506dbd3c2
apps/sim/lib/api/contracts/v2/openapi/billing.tshttps://github.com/simstudioai/sim/pull/6567/files#diff-4f1e77fc2e4f614029f5b66d17ef36832d2606642356be7859b1376980ea7bc1
View file https://github.com/simstudioai/sim/blob/79a3486a364b6a34cb1a31350c9a5b07780f7fdb/apps/sim/lib/api/contracts/v2/openapi/billing.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/6567/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/6567/files#diff-4f1e77fc2e4f614029f5b66d17ef36832d2606642356be7859b1376980ea7bc1
https://github.com/simstudioai/sim/pull/6567/files#diff-4f1e77fc2e4f614029f5b66d17ef36832d2606642356be7859b1376980ea7bc1
apps/sim/lib/billing/application/billing-use-cases.test.tshttps://github.com/simstudioai/sim/pull/6567/files#diff-b6e0fd38562104b13ea532452fc3c3ea8f17e5719b302b1f646a51cdeeb3b8cc
View file https://github.com/simstudioai/sim/blob/79a3486a364b6a34cb1a31350c9a5b07780f7fdb/apps/sim/lib/billing/application/billing-use-cases.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/6567/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/6567/files#diff-b6e0fd38562104b13ea532452fc3c3ea8f17e5719b302b1f646a51cdeeb3b8cc
https://github.com/simstudioai/sim/pull/6567/files#diff-b6e0fd38562104b13ea532452fc3c3ea8f17e5719b302b1f646a51cdeeb3b8cc
https://github.com/simstudioai/sim/pull/6567/files#diff-b6e0fd38562104b13ea532452fc3c3ea8f17e5719b302b1f646a51cdeeb3b8cc
https://github.com/simstudioai/sim/pull/6567/files#diff-b6e0fd38562104b13ea532452fc3c3ea8f17e5719b302b1f646a51cdeeb3b8cc
https://github.com/simstudioai/sim/pull/6567/files#diff-b6e0fd38562104b13ea532452fc3c3ea8f17e5719b302b1f646a51cdeeb3b8cc
https://github.com/simstudioai/sim/pull/6567/files#diff-b6e0fd38562104b13ea532452fc3c3ea8f17e5719b302b1f646a51cdeeb3b8cc
Please reload this pagehttps://github.com/simstudioai/sim/pull/6567/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/6567/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.