diff --git a/cli/command/registry/login.go b/cli/command/registry/login.go index a94a29e93a..09e997c800 100644 --- a/cli/command/registry/login.go +++ b/cli/command/registry/login.go @@ -184,10 +184,15 @@ func loginWithStoredCredentials(ctx context.Context, dockerCLI command.Cli, auth return response.Status, err } +// OauthLoginEscapeHatchEnvVar disables the browser-based OAuth login workflow. +// +// Deprecated: this const was only used internally and will be removed in the next release. const OauthLoginEscapeHatchEnvVar = "DOCKER_CLI_DISABLE_OAUTH_LOGIN" +const oauthLoginEscapeHatchEnvVar = "DOCKER_CLI_DISABLE_OAUTH_LOGIN" + func isOauthLoginDisabled() bool { - if v := os.Getenv(OauthLoginEscapeHatchEnvVar); v != "" { + if v := os.Getenv(oauthLoginEscapeHatchEnvVar); v != "" { enabled, err := strconv.ParseBool(v) if err != nil { return false diff --git a/cli/command/registry/login_test.go b/cli/command/registry/login_test.go index 7e6ca2ec1c..756da7d74f 100644 --- a/cli/command/registry/login_test.go +++ b/cli/command/registry/login_test.go @@ -533,7 +533,7 @@ func TestIsOauthLoginDisabled(t *testing.T) { } for _, tc := range testCases { - t.Setenv(OauthLoginEscapeHatchEnvVar, tc.envVar) + t.Setenv(oauthLoginEscapeHatchEnvVar, tc.envVar) disabled := isOauthLoginDisabled()