Conversation
<!-- Make sure you've read the CONTRIBUTING.md guidelines: https://github.com/stack-auth/stack-auth/blob/dev/CONTRIBUTING.md --> <!-- ELLIPSIS_HIDDEN --> ---- > [!IMPORTANT] > Refactor and enhance API key management with new types, utility functions, and schema validation across the codebase. > > - **API Key Management**: > - Introduced `ApiKey` type with `user` and `team` variants in `api-keys/index.ts`. > - Added `apiKeyCreationOptionsToCrud` and `apiKeyUpdateOptionsToCrud` functions for CRUD operations. > - Updated `client-app-impl.ts` and `server-app-impl.ts` to use new API key types and functions. > - **Schema and Validation**: > - Added `yupValidate` function in `schema-fields.ts` for enhanced validation. > - Introduced `IfAndOnlyIf` type in `types.ts` for conditional type handling. > - **Utility Functions**: > - Added `toHexString`, `getBase32CharacterFromIndex`, and `getBase32IndexFromCharacter` in `bytes.tsx`. > - Updated `sha512` function in `hashes.tsx` to return `Uint8Array`. > - Introduced `filterUndefinedOrNull` in `objects.tsx` for filtering null and undefined values. > - **Code Refactoring**: > - Refactored API key handling in `client-app-impl.ts` and `server-app-impl.ts` to use new utility functions and types. > - Removed deprecated functions and streamlined API key operations across the codebase. > > <sup>This description was created by </sup>[<img alt="Ellipsis" src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=stack-auth%2Fstack-auth&utm_source=github&utm_medium=referral)<sup> for 2d1c66a. It will automatically update as commits are pushed.</sup> <!-- ELLIPSIS_HIDDEN -->
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
|
|
😱 Found 7 issues. Time to roll up your sleeves! 😱 🗒️ View all ignored comments in this repo
|
fomalhautb
reviewed
Apr 2, 2025
Contributor
fomalhautb
left a comment
There was a problem hiding this comment.
Did finish reviewing everything, but left some comments now
fomalhautb
reviewed
Apr 2, 2025
Contributor
fomalhautb
left a comment
There was a problem hiding this comment.
Can you add e2e tests for client library?
Contributor
Author
|
@fomalhautb can you think of any tests that are missing? |
N2D4
reviewed
Apr 3, 2025
N2D4
reviewed
Apr 4, 2025
N2D4
reviewed
Apr 4, 2025
N2D4
reviewed
Apr 4, 2025
N2D4
reviewed
Apr 4, 2025
N2D4
reviewed
Apr 4, 2025
N2D4
reviewed
Apr 4, 2025
N2D4
reviewed
Apr 4, 2025
N2D4
reviewed
Apr 4, 2025
N2D4
reviewed
Apr 4, 2025
N2D4
reviewed
Apr 4, 2025
N2D4
reviewed
Apr 4, 2025
N2D4
reviewed
Apr 4, 2025
N2D4
reviewed
Apr 4, 2025
Contributor
N2D4
left a comment
There was a problem hiding this comment.
I like about this PR that 2/3s of its LOC are tests
@fomalhautb waiting for your review too, but after fixing the comments here LGTM
fomalhautb
approved these changes
Apr 4, 2025
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.
Important
Introduces API key management for users and teams, integrating with existing project configurations and permissions, and adds comprehensive tests and examples.
ProjectApiKeymodel inschema.prismafor managing API keys.createApiKeyHandlersinhandlers.tsxto handle API key CRUD operations.allowUserApiKeysandallowTeamApiKeystoProjectConfiginschema.prisma.TeamSystemPermissionenum to includeMANAGE_API_KEYS.api-keys.test.tsto cover various API key scenarios.This description was created by
for 96f60c5. It will automatically update as commits are pushed.