Skip to content

Commit 18cdc25

Browse files
committed
cli/command/registry: deprecate OauthLoginEscapeHatchEnvVar
This const was added in 846ecf5, but only used internally. This patch deprecates the const, to be removed in the next release. Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent 8987498 commit 18cdc25

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

‎cli/command/registry/login.go‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,10 +183,15 @@ func loginWithStoredCredentials(ctx context.Context, dockerCLI command.Cli, auth
183183
return response.Status, err
184184
}
185185

186+
// OauthLoginEscapeHatchEnvVar disables the browser-based OAuth login workflow.
187+
//
188+
// Deprecated: this const was only used internally and will be removed in the next release.
186189
const OauthLoginEscapeHatchEnvVar = "DOCKER_CLI_DISABLE_OAUTH_LOGIN"
187190

191+
const oauthLoginEscapeHatchEnvVar = "DOCKER_CLI_DISABLE_OAUTH_LOGIN"
192+
188193
func isOauthLoginDisabled() bool {
189-
if v := os.Getenv(OauthLoginEscapeHatchEnvVar); v != "" {
194+
if v := os.Getenv(oauthLoginEscapeHatchEnvVar); v != "" {
190195
enabled, err := strconv.ParseBool(v)
191196
if err != nil {
192197
return false

‎cli/command/registry/login_test.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ func TestIsOauthLoginDisabled(t *testing.T) {
533533
}
534534

535535
for _, tc := range testCases {
536-
t.Setenv(OauthLoginEscapeHatchEnvVar, tc.envVar)
536+
t.Setenv(oauthLoginEscapeHatchEnvVar, tc.envVar)
537537

538538
disabled := isOauthLoginDisabled()
539539

0 commit comments

Comments
 (0)