Skip to content

Commit 991d942

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]> (cherry picked from commit 18cdc25) Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent 6cd42da commit 991d942

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)