ci(binaries): say what kind of value the token is - #67
Merged
Conversation
The guard reported that HOMEBREW_TAP_TOKEN is 55 characters and holds characters a GitHub token cannot, which rules the value out without saying what it is. A fine-grained PAT is about 93 characters and a classic one is 40, so 55 is neither. It now classifies the value by its prefix -- a published constant rather than entropy, so naming which kind it is reveals nothing -- and reports the length before and after trimming. Whitespace is absorbed rather than fatal, since that is the common accident and costs nothing to survive, with a warning so the secret gets repaired at the source rather than on every use. The trimmed value is registered with add-mask before being passed on, so it is redacted in the log exactly as the original is. Signed-off-by: Vyncint Ng <115854244+vyncint@users.noreply.github.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.
The guard from #66 did its job — it reported that
HOMEBREW_TAP_TOKENis 55 characters and holds characters a GitHub token cannot. That rules the value out without saying what it is.55 is a suggestive number: a fine-grained PAT is ~93 characters, a classic one is 40. It is neither.
So the check now classifies the value by its prefix, which is a published constant rather than entropy — naming which kind of token it is reveals nothing:
github_pat_…(86)ghp_…(40)ghs_…(40)https://github.com/settings/…(50)That last row is the shape a 55-character non-conforming value tends to have.
It also now absorbs surrounding whitespace rather than dying on it — that is the common accident and costs nothing to survive — with a warning so the secret gets repaired at source rather than on every use. The trimmed value goes through
::add-mask::before being handed to checkout, so it is redacted in the log exactly as the original is.Next run will name the problem outright.