From 6fb72f4d71d112f0b93020e3790ada870e8bfece Mon Sep 17 00:00:00 2001 From: Jonathan Chang Date: Thu, 1 Oct 2020 17:12:52 +1000 Subject: [PATCH] Deprecate GitHub basic authentication. This API authentication path will be disabled on Nov 13 2020. --- Library/Homebrew/cmd/gist-logs.rb | 1 + Library/Homebrew/env_config.rb | 4 ++-- Library/Homebrew/utils/github.rb | 2 ++ docs/Manpage.md | 4 ++-- manpages/brew.1 | 6 +++--- 5 files changed, 10 insertions(+), 7 deletions(-) diff --git a/Library/Homebrew/cmd/gist-logs.rb b/Library/Homebrew/cmd/gist-logs.rb index 5a8f5f0d32..b40b299af2 100644 --- a/Library/Homebrew/cmd/gist-logs.rb +++ b/Library/Homebrew/cmd/gist-logs.rb @@ -60,6 +60,7 @@ module Homebrew #{Utils::Shell.set_variable_in_profile("HOMEBREW_GITHUB_API_TOKEN", "your_token_here")} EOS + odeprecated "`brew gist-logs` with a password", "HOMEBREW_GITHUB_API_TOKEN" login! end diff --git a/Library/Homebrew/env_config.rb b/Library/Homebrew/env_config.rb index 74953301f2..842305e312 100644 --- a/Library/Homebrew/env_config.rb +++ b/Library/Homebrew/env_config.rb @@ -148,7 +148,7 @@ module Homebrew }, HOMEBREW_GITHUB_API_PASSWORD: { description: "Use this password for authentication with the GitHub API, for features " \ - "such as `brew search`. We strongly recommend using `HOMEBREW_GITHUB_API_TOKEN` instead.", + "such as `brew search`. This is deprecated in favour of using `HOMEBREW_GITHUB_API_TOKEN`.", }, HOMEBREW_GITHUB_API_TOKEN: { description: "Use this personal access token for the GitHub API, for features such as " \ @@ -160,7 +160,7 @@ module Homebrew }, HOMEBREW_GITHUB_API_USERNAME: { description: "Use this username for authentication with the GitHub API, for features " \ - "such as `brew search`. We strongly recommend using `HOMEBREW_GITHUB_API_TOKEN` instead.", + "such as `brew search`. This is deprecated in favour of using `HOMEBREW_GITHUB_API_TOKEN`.", }, HOMEBREW_GIT_EMAIL: { description: "Set the Git author and committer name to this value.", diff --git a/Library/Homebrew/utils/github.rb b/Library/Homebrew/utils/github.rb index ab34ee32d7..f9605c0708 100644 --- a/Library/Homebrew/utils/github.rb +++ b/Library/Homebrew/utils/github.rb @@ -91,6 +91,8 @@ module GitHub return unless Homebrew::EnvConfig.github_api_username return unless Homebrew::EnvConfig.github_api_password + odeprecated "the GitHub API with HOMEBREW_GITHUB_API_PASSWORD", "HOMEBREW_GITHUB_API_TOKEN" + [Homebrew::EnvConfig.github_api_password, Homebrew::EnvConfig.github_api_username] end diff --git a/docs/Manpage.md b/docs/Manpage.md index 1559d7d25b..88ec6e5faa 100644 --- a/docs/Manpage.md +++ b/docs/Manpage.md @@ -1672,7 +1672,7 @@ For example, you might add something like the following to your ~/.profile, ~/.b If set, always use Homebrew's vendored, relocatable Ruby version even if the system version of Ruby is new enough. * `HOMEBREW_GITHUB_API_PASSWORD`: - Use this password for authentication with the GitHub API, for features such as `brew search`. We strongly recommend using `HOMEBREW_GITHUB_API_TOKEN` instead. + Use this password for authentication with the GitHub API, for features such as `brew search`. This is deprecated in favour of using `HOMEBREW_GITHUB_API_TOKEN`. * `HOMEBREW_GITHUB_API_TOKEN`: Use this personal access token for the GitHub API, for features such as `brew search`. You can create one at . If set, GitHub will allow you a greater number of API requests. For more information, see: . @@ -1680,7 +1680,7 @@ For example, you might add something like the following to your ~/.profile, ~/.b *Note:* Homebrew doesn't require permissions for any of the scopes, but some developer commands may require additional permissions. * `HOMEBREW_GITHUB_API_USERNAME`: - Use this username for authentication with the GitHub API, for features such as `brew search`. We strongly recommend using `HOMEBREW_GITHUB_API_TOKEN` instead. + Use this username for authentication with the GitHub API, for features such as `brew search`. This is deprecated in favour of using `HOMEBREW_GITHUB_API_TOKEN`. * `HOMEBREW_GIT_EMAIL`: Set the Git author and committer name to this value. diff --git a/manpages/brew.1 b/manpages/brew.1 index 273d890837..6203447fd5 100644 --- a/manpages/brew.1 +++ b/manpages/brew.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "BREW" "1" "September 2020" "Homebrew" "brew" +.TH "BREW" "1" "October 2020" "Homebrew" "brew" . .SH "NAME" \fBbrew\fR \- The Missing Package Manager for macOS @@ -2336,7 +2336,7 @@ If set, always use Homebrew\'s vendored, relocatable Ruby version even if the sy . .TP \fBHOMEBREW_GITHUB_API_PASSWORD\fR -Use this password for authentication with the GitHub API, for features such as \fBbrew search\fR\. We strongly recommend using \fBHOMEBREW_GITHUB_API_TOKEN\fR instead\. +Use this password for authentication with the GitHub API, for features such as \fBbrew search\fR\. This is deprecated in favour of using \fBHOMEBREW_GITHUB_API_TOKEN\fR\. . .TP \fBHOMEBREW_GITHUB_API_TOKEN\fR @@ -2347,7 +2347,7 @@ Use this personal access token for the GitHub API, for features such as \fBbrew . .TP \fBHOMEBREW_GITHUB_API_USERNAME\fR -Use this username for authentication with the GitHub API, for features such as \fBbrew search\fR\. We strongly recommend using \fBHOMEBREW_GITHUB_API_TOKEN\fR instead\. +Use this username for authentication with the GitHub API, for features such as \fBbrew search\fR\. This is deprecated in favour of using \fBHOMEBREW_GITHUB_API_TOKEN\fR\. . .TP \fBHOMEBREW_GIT_EMAIL\fR