Repository navigation
fix: address review findings in selfupdate, secret, cobrax, live and pick - #8
Merged
Merged
Conversation
…pick - selfupdate: drop the credential header on redirects that leave the origin of the first request. Go's HTTP client strips Authorization on its own but forwards PRIVATE-TOKEN, JOB-TOKEN and DEPLOY-TOKEN, so a package download redirected to object storage leaked the GitLab token. The header stays off when a later redirect returns to the origin, and a caller's CheckRedirect still applies. - secret: Fallback.Get wraps ErrNotFound when the secondary store has no secret, also when the primary failed, so Resolve goes on to prompt. - secret: read a piped secret up to the first newline only, so a pipe that stays open does not block and the rest of stdin stays unread. - cobrax: JoinSpacedBoolValues joins a flag only when the command the arguments select has that flag marked, so an unmarked flag of the same name on another command keeps its meaning. - live: keep a copy of the drawn lines, so a caller reusing its slice does not change how far the next draw moves up. - pick: fit checklists and toggles to the terminal height with a row window that follows the cursor. - pick: keep the selected key through the first load of a lazy view. - pick: apply View.Title to group-filtered views too. Co-Authored-By: Claude Opus 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.
Fixes the findings of a code review of v0.2.1. Every fix has a test that fails without it.
Security
Authorizationand cookies itself.PRIVATE-TOKEN,JOB-TOKENandDEPLOY-TOKENtherefore reached whatever host a GitLab package download redirected to, such as object storage. The credential header is now dropped as soon as a redirect leaves the origin (scheme, host and port) of the first request, and stays off if a later redirect returns there. A caller'sCheckRedirectstill applies. Affects v0.1.0 to v0.2.1 when downloading from GitLab with a token.Fixes
Fallbackwith an unavailable keyring and an empty file store (P2).Getreturned only the keyring failure, whichResolvetreats as fatal, so it never prompted. The error now wrapsErrNotFoundas well as the keyring failure.Resolveread up toMaxLenor EOF before looking for the newline, so a pipe that stayed open blocked it. It now reads up to the first newline only and leaves the rest of stdin unread.a --stablealso rewroteb --stable false.JoinSpacedBoolValuesnow resolves the selected command the way cobra does and joins only flags that command has marked, its own or inherited.Drawkept the caller's slice; reusing it for the next frame changed how far the next draw moved up. It now keeps a copy.Loaddropped the selected key and landed on the first row. The key is now kept until the rows are loaded.View.Titlewas applied only to views with their own rows. Group-filtered views now use it too.Behavior changes
JoinSpacedBoolValuesno longer joins a flag the selected command does not have.Fallback.Getreturns an error matchingErrNotFoundwhere it returned only the primary's failure.Verification
go test -race ./...go mod tidy -diff, cross-builds for linux, darwin, windows and freebsd🤖 Generated with Claude Code