Repository navigation
fix: sensapp generate-token --help prints the help (CLI parsed with clap) - #55
Merged
Merged
Conversation
… of making a token for the subject "--help" Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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
sensapp generate-token --helpused to take--helpas the token subject and print a valid token. The hand-rolled argument loop insrc/main.rsis replaced by a clap derive parser, so-h/--helpand--versionwork on the binary and on every subcommand, and typos in options are errors.sensapp servesubcommand: the explicit name of what plainsensappdoes. Plainsensappstill runs the server, so Docker and Helm are unaffected.clap4 (derive) is a new dependency.Why
A
--helpthat mints a token is a footgun, and parsing arguments by hand is how it happened.For the reviewer
SENSAPP_*env variables andsettings.tomlonly. No new settings or flags.generate-tokenoptions are unchanged and every example indocs/JWT_AUTH.mdstill parses.--sensors ""still means an empty allow list (allows nothing), not an unrestricted token.SENSAPP_JWT_SECRET.tests/integration/cli.rsruns the real binary (7 tests, no database needed). Unit tests andcargo clippy --testspass.sensapp servewas not run against a real database.🤖 Generated with Claude Code