Skip to content

Commit 51cda46

Browse files
authored
Renamed CX_IAM_URL to CX_BASE_AUTH_URI. (#188)
1 parent 93db848 commit 51cda46

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

internal/commands/root.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ const (
5555
proxyFlag = "proxy"
5656
proxyFlagUsage = "Proxy server to send communication through"
5757
baseURIFlagUsage = "The base system URI"
58-
baseIAMURIFlag = "base-auth-uri"
59-
baseIAMURIFlagUsage = "The base system IAM URI"
58+
baseAuthURIFlag = "base-auth-uri"
59+
baseAuthURIFlagUsage = "The base system IAM URI"
6060
astTokenFlag = "token"
6161
astTokenUsage = "The token to login to AST with"
6262
repoURLFlag = "repo-url"
@@ -103,7 +103,7 @@ func NewAstCLI(
103103
rootCmd.PersistentFlags().Bool(insecureFlag, false, insecureFlagUsage)
104104
rootCmd.PersistentFlags().String(proxyFlag, "", proxyFlagUsage)
105105
rootCmd.PersistentFlags().String(baseURIFlag, params.BaseURI, baseURIFlagUsage)
106-
rootCmd.PersistentFlags().String(baseIAMURIFlag, params.BaseIAMURI, baseIAMURIFlagUsage)
106+
rootCmd.PersistentFlags().String(baseAuthURIFlag, params.BaseIAMURI, baseAuthURIFlagUsage)
107107
rootCmd.PersistentFlags().String(profileFlag, params.Profile, profileFlagUsage)
108108
rootCmd.PersistentFlags().String(astTokenFlag, params.BaseURI, astTokenUsage)
109109
rootCmd.PersistentFlags().String(agentFlag, params.AgentFlag, "hello")
@@ -116,7 +116,7 @@ func NewAstCLI(
116116
_ = viper.BindPFlag(params.AstAuthenticationPathConfigKey, rootCmd.PersistentFlags().Lookup(astAuthenticationPathFlag))
117117
_ = viper.BindPFlag(params.BaseURIKey, rootCmd.PersistentFlags().Lookup(baseURIFlag))
118118
_ = viper.BindPFlag(params.ProxyKey, rootCmd.PersistentFlags().Lookup(proxyFlag))
119-
_ = viper.BindPFlag(params.BaseIAMURIKey, rootCmd.PersistentFlags().Lookup(baseIAMURIFlag))
119+
_ = viper.BindPFlag(params.BaseAuthURIKey, rootCmd.PersistentFlags().Lookup(baseAuthURIFlag))
120120
_ = viper.BindPFlag(params.AstTokenKey, rootCmd.PersistentFlags().Lookup(astTokenFlag))
121121
// Key here is the actual flag since it doesn't use an environment variable
122122
_ = viper.BindPFlag(verboseFlag, rootCmd.PersistentFlags().Lookup(verboseFlag))

internal/params/binds.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ var EnvVarsBinds = []struct {
77
}{
88
{BaseURIKey, BaseURIEnv, "http://127.0.0.1:80"},
99
{ProxyKey, ProxyEnv, ""},
10-
{BaseIAMURIKey, BaseIAMURIEnv, ""},
10+
{BaseAuthURIKey, BaseAuthURIEnv, ""},
1111
{AstUsernameKey, AstUsernameEnv, ""},
1212
{AstPasswordKey, AstPasswordEnv, ""},
1313
{AstTokenKey, AstTokenEnv, ""},

internal/params/envs.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package params
33
const (
44
BaseURIEnv = "CX_BASE_URI"
55
ProxyEnv = "CX_HTTP_PROXY"
6-
BaseIAMURIEnv = "CX_BASE_IAM_URI"
6+
BaseAuthURIEnv = "CX_BASE_AUTH_URI"
77
AstUsernameEnv = "CX_AST_USERNAME"
88
AstPasswordEnv = "CX_AST_PASSWORD"
99
AstTokenEnv = "CX_TOKEN"

internal/params/keys.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import "strings"
55
var (
66
BaseURIKey = strings.ToLower(BaseURIEnv)
77
ProxyKey = strings.ToLower(ProxyEnv)
8-
BaseIAMURIKey = strings.ToLower(BaseIAMURIEnv)
8+
BaseAuthURIKey = strings.ToLower(BaseAuthURIEnv)
99
AstUsernameKey = strings.ToLower(AstUsernameEnv)
1010
AstPasswordKey = strings.ToLower(AstPasswordEnv)
1111
AstTokenKey = strings.ToLower(AstTokenEnv)

internal/wrappers/client.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,8 @@ func GetURL(path string) string {
122122
}
123123

124124
func GetAuthURL(path string) string {
125-
if viper.GetString(commonParams.BaseIAMURIKey) != "" {
126-
return fmt.Sprintf("%s/%s", viper.GetString(commonParams.BaseIAMURIKey), path)
125+
if viper.GetString(commonParams.BaseAuthURIKey) != "" {
126+
return fmt.Sprintf("%s/%s", viper.GetString(commonParams.BaseAuthURIKey), path)
127127
}
128128
return GetURL(path)
129129
}

0 commit comments

Comments
 (0)