refactor: call credits endpoint for key validation#3
Merged
Conversation
Turanic
commented
Jun 5, 2026
Contributor
Author
There was a problem hiding this comment.
Remark: Those checks are not needed anymore as the api key is now fully validated from the credits endpoint. See the new tests in credits.test.ts and auth-config.integration.test.ts
Turanic
commented
Jun 5, 2026
|
|
||
| const CONFIG_DIR_NAME = '.linkup'; | ||
| const KEY_PREFIX = 'api_key='; | ||
| const MIN_API_KEY_LENGTH = 10; |
Contributor
Author
There was a problem hiding this comment.
Remark: This length is now only used to print a masked api key. No normalisation is needed anymore, as the credits endpoint perform all the validation.
Shedna
approved these changes
Jun 5, 2026
|
🎉 This PR is included in version 1.0.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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.
What
Refactor the auth logic to call /credits endpoint to validate the api key, and print the current balance.
Why
Just fetching the linkup app did not validate the api key properly.
Testing strategy
Added unit-tests to validate the new auth logic and credits endpoint.
I also performed a manual verification running the auth locally.