Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate login command #2310

Merged
merged 1 commit into from
Jul 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading