Repository navigation
Accept GITCREDS_PAT_* alongside GITHUB_PAT_* - #77
Merged
Merged
Conversation
This was referenced Sep 17, 2026
Groundwork for the prefix change in r-lib#56, with no behavior change yet. Reads accept either name, the new one first. Writes still go to GITHUB_PAT_*, and gitcreds_cache_envvar() still returns that name. The FAIL sentinel is only honored under the canonical prefix, the one this copy of the file writes. A copy of git-auth.R vendored into another package writes FAIL under the prefix it was built with, and honoring a sentinel from a prefix we no longer write would let that package suppress a credential that is present. gitcreds_delete_cache() now clears every accepted name. Clearing only one leaves a stale value that the read chain returns on the next call, so gitcreds_set() would appear to ignore a rotated token. The bare GITHUB_PAT and GITHUB_TOKEN names are still github.com only, and are now consulted after every prefixed name rather than during the first one, so a prefixed value keeps winning over a bare one. gitcreds_cache_envvars() derives its names from gitcreds_cache_envvar() rather than sharing a slug helper, so an invalid URL is still reported against the public function the caller named. Refs r-lib#56
SokolovAnatoliy
force-pushed
the
pr2-accept-both-names
branch
from
September 17, 2026 20:17
7a93316 to
d5bfb86
Compare
Member
|
Great, thank you! |
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.
Groundwork for the rename in #56, with no behavior change. Reads accept either name, new one
first. Writes still go to
GITHUB_PAT_*, andgitcreds_cache_envvar()still returns the legacyname, so nothing moves for existing users. Early adopters can start setting the new name now.
Two details worth a look.
The
FAILsentinel is only honored under the canonical name. A vendored older copy ofgit-auth.RwritesFAILto the legacy name (pkgdepends does this ingit_creds_for_url()), andhonoring that through the fallback would let one package suppress a credential that is present.
Reprex in r-lib/pkgdepends#484.
gitcreds_delete_cache()now unsets both names. With a fallback in place, unsetting only oneleaves a stale legacy value that the fallback then returns, so
gitcreds_set()would look like itignored a rotated token.
Also widens the
^GITHUB_PATscrub intests/testthat/helper.R, so tests stay isolated from thedeveloper's own environment.
Refs #56