cli/command/registry: deprecate OauthLoginEscapeHatchEnvVar

This const was added in 846ecf59ff, but
only used internally. This patch deprecates the const, to be removed
in the next release.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2025-09-01 17:43:39 +02:00
parent 89874983c8
commit 18cdc25bb4
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C
2 changed files with 7 additions and 2 deletions

View File

@ -183,10 +183,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

View File

@ -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()