fix: ApiKey.owner type missing user variant and organizationId#1650
Merged
Conversation
Contributor
Greptile SummaryThis PR updates API key owner handling for user-owned keys. The main changes are:
Confidence Score: 5/5Safe to merge with minimal risk. The change is narrow, preserves the existing organization-owner shape, and adds targeted coverage for the new user-owner response. No files require special attention.
What T-Rex did
Important Files Changed
|
Contributor
|
T-Rex pricing update — T-Rex was free through June 2026. Effective July 1, 2026, T-Rex adds 2 credits on top of the standard 1-credit review (3 total). T-Rex settings |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
ApiKey.ownerwas typed as{ type: 'organization'; id: string }only, but the API can return auserowner with{ type: 'user'; id: string; organization_id: string }ApiKeyandSerializedApiKeyinterfaces to use a discriminated union covering both variantsdeserializeApiKeyto convertorganization_id→organizationIdfor user ownersTest plan
npx jest src/api-keys/api-keys.spec.ts— all 12 tests passReported by customer in T-9253.