Skip to content

Commit e8be20b

Browse files
authored
Merge pull request #6413 from thaJeztah/28.x_backport_deprecate_OauthLoginEscapeHatchEnvVar
[28.x backport] cli/command/registry: deprecate OauthLoginEscapeHatchEnvVar
2 parents f2cd197 + 991d942 commit e8be20b

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
@@ -184,10 +184,15 @@ func loginWithStoredCredentials(ctx context.Context, dockerCLI command.Cli, auth
184184
return response.Status, err
185185
}
186186

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

192+
const oauthLoginEscapeHatchEnvVar = "DOCKER_CLI_DISABLE_OAUTH_LOGIN"
193+
189194
func isOauthLoginDisabled() bool {
190-
if v := os.Getenv(OauthLoginEscapeHatchEnvVar); v != "" {
195+
if v := os.Getenv(oauthLoginEscapeHatchEnvVar); v != "" {
191196
enabled, err := strconv.ParseBool(v)
192197
if err != nil {
193198
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)