fix: bad settings file errors and config list showing api key#19
Open
mooncitydev wants to merge 1 commit intojup-ag:mainfrom
Open
fix: bad settings file errors and config list showing api key#19mooncitydev wants to merge 1 commit intojup-ag:mainfrom
mooncitydev wants to merge 1 commit intojup-ag:mainfrom
Conversation
hey jup team, mooncitydev here, did a pass on the config path and found two things worth fixing first is settings.json: if the file is corrupt or only half edited, JSON.parse threw a raw SyntaxError and every subcommand failed with a stack dump and no file path, so it was not obvious to delete the file and reset. load() now wraps parse in try/catch and throws a short message with the real path and option to remove the file for defaults second is jup config list: it printed the full portal api key in both table and json, which is easy to leak in screen shares, logs, or when pasting output. the key is still in ~/.config/jup/settings.json for tools that need it, but list now shows a token is set using the literal <set> instead of the real string adds config.test for the parse failure and a couple edge cases. cheers Made-with: Cursor
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.
hey jup team, its mooncitydev, looked at the config path for a bit and had two things that felt worth a pr
bad settings.json
if the file is corrupt or only half edited, JSON.parse was throwing a raw SyntaxError and every jup subcommand would die with a stack and no file path, so it wasnt obvious you could just delete the file and get defaults again. load() now catches parse errors and throws a short message with the real path and that you can remove the file to reset
jup config list and the portal api key
config list was printing the full jup api key in both table and json, which is rough for screen shares, logs, or when pasting output somewhere. the key is still in ~/.config/jup/settings.json for anything that needs to read the file, but the list output now uses the string when a key is present so the secret does not get echoed
also added src/lib/Config.test.ts for the parse failure and a root json edge case. cheers