Skip to content

feat: add user id when providing tokens without checkout and make sur… #1083

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 30, 2025

Conversation

rohilsurana
Copy link
Member

…e their name

Copy link

vercel bot commented Jul 28, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
frontier ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 28, 2025 3:08pm

@rohilsurana rohilsurana requested a review from Copilot July 28, 2025 15:08
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds user ID tracking when providing credits without checkout and implements super user filtering. The changes ensure proper user identification in credit transactions and filter out super users from transaction listings.

  • Adds user ID to credit transactions when applying checkout
  • Implements super user checking functionality to filter transactions
  • Adds permission check helper for verifying super user status by user ID

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
pkg/server/interceptors/enrich.go Adds super user filtering to exclude super users from transaction listings
internal/api/v1beta1/permission_check.go Adds helper method to check if a user ID belongs to a super user
billing/checkout/service.go Retrieves current principal and adds user ID to credit transactions
Comments suppressed due to low confidence (1)

pkg/server/interceptors/enrich.go:302

  • Extra closing brace - the code structure appears to have an additional closing brace that doesn't match the opening braces in the visible diff.
			}

@coveralls
Copy link

Pull Request Test Coverage Report for Build 16572759909

Details

  • 0 of 12 (0.0%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.01%) to 31.273%

Changes Missing Coverage Covered Lines Changed/Added Lines %
internal/api/v1beta1/permission_check.go 0 3 0.0%
pkg/server/interceptors/enrich.go 0 4 0.0%
billing/checkout/service.go 0 5 0.0%
Totals Coverage Status
Change from base Build 16491593990: -0.01%
Covered Lines: 10073
Relevant Lines: 32210

💛 - Coveralls

@rohilsurana rohilsurana merged commit b646699 into main Jul 30, 2025
7 checks passed
@rohilsurana rohilsurana deleted the user-id-awarded-tokens branch July 30, 2025 09:03
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