Skip to content

Commit

Permalink
Deprecate login command (#2310)
Browse files Browse the repository at this point in the history
  • Loading branch information
nakulkar-msft authored Jul 25, 2023
1 parent a68d846 commit 6ac4559
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cmd/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ package cmd
import (
"context"
"errors"
"fmt"
"strings"

"github.com/Azure/azure-storage-azcopy/v10/common"
Expand All @@ -31,6 +32,10 @@ import (

var loginCmdArg = loginCmdArgs{tenantID: common.DefaultTenantID}

var loginNotice = "'azcopy %s' command will be deprecated starting release 10.22. " +
"Use auto-login instead. Visit %s to know more."
var autoLoginURL = "https://learn.microsoft.com/en-us/azure/storage/common/storage-use-azcopy-authorize-azure-active-directory#authorize-without-a-secret-store "

var lgCmd = &cobra.Command{
Use: "login",
SuggestFor: []string{"login"},
Expand All @@ -45,6 +50,7 @@ var lgCmd = &cobra.Command{
loginCmdArg.clientSecret = glcm.GetEnvironmentVariable(common.EEnvironmentVariable.ClientSecret())
loginCmdArg.persistToken = true

glcm.Info(fmt.Sprintf(loginNotice, "login", autoLoginURL))
if loginCmdArg.certPass != "" || loginCmdArg.clientSecret != "" {
glcm.Info(environmentVariableNotice)
}
Expand Down
1 change: 1 addition & 0 deletions cmd/logout.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ func init() {
type logoutCmdArgs struct{}

func (lca logoutCmdArgs) process() error {
glcm.Info(fmt.Sprintf(loginNotice, "logout", autoLoginURL))
uotm := GetUserOAuthTokenManagerInstance()
if err := uotm.RemoveCachedToken(); err != nil {
return err
Expand Down

0 comments on commit 6ac4559

Please sign in to comment.