Skip to content

Conversation

@whoAbhishekSah
Copy link
Member

@whoAbhishekSah whoAbhishekSah commented Nov 21, 2025

Summary

Refactor checkout RPCs to automatically infer billing_id from org_id, removing redundant parameters and improving API security.

Changes

Proto (Proton):

  • Mark billing_id as deprecated in CreateCheckout, ListCheckouts, GetCheckout, DelegatedCheckout
  • Mark org_id as deprecated in GetCheckout (can fetch by checkout ID alone)

Backend (Frontier):

  • CreateCheckout, ListCheckouts, DelegatedCheckout: Infer billing_id from org_id
  • GetCheckout: Remove org_id requirement, infer from checkout_id
  • Add GetOrgIDFromCheckoutID() helper function
  • Simplify authorization interceptors to remove ensureBillingAccountBelongToOrg checks
  • GetCheckout authorization now infers org_id from checkout_id

Backward Compatibility

✅ No breaking changes - All existing clients continue to work:

  • Deprecated fields remain in proto schema
  • Backend ignores deprecated parameters and uses inferred values
  • Gradual migration supported

Security Improvement

Clients can no longer pass arbitrary billing_id values, preventing potential unauthorized access to other organizations' billing data.

Related

Update PROTON_COMMIT to 60d2868d31c9f3696e80eed12e8dc9d38c4a027f

This picks up the proto changes that mark billing_id as deprecated in:
- CreateCheckoutRequest
- ListCheckoutsRequest
- GetCheckoutRequest
- DelegatedCheckoutRequest (admin)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@vercel
Copy link

vercel bot commented Nov 21, 2025

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

Project Deployment Preview Comments Updated (UTC)
frontier Ready Ready Preview Comment Nov 21, 2025 7:55am

@coveralls
Copy link

Pull Request Test Coverage Report for Build 19561878789

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 37.603%

Totals Coverage Status
Change from base Build 19528138208: 0.0%
Covered Lines: 15636
Relevant Lines: 41582

💛 - Coveralls

- Update CreateCheckout, ListCheckouts, DelegatedCheckout handlers to infer billing_id from org_id
- Update GetCheckout to not require org_id (infers from checkout_id)
- Add GetOrgIDFromCheckoutID helper function
- Remove ensureBillingAccountBelongToOrg checks from authorization interceptors
- Update GetCheckout interceptor to infer org_id from checkout_id for authorization
- Regenerate protos with deprecated fields

Security improvement: Clients can no longer pass arbitrary billing_id values.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Function is no longer used after refactoring GetCheckout authorization
to infer org_id from checkout_id.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
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