geomacy commented on a change in pull request #77: Allow sent user defined
headers and omit credentials if not needed
URL: https://github.com/apache/brooklyn-client/pull/77#discussion_r289195682
##########
File path: cli/commands/login.go
##########
@@ -143,20 +176,25 @@ func (cmd *Login) Run(scope scope.Scope, c *cli.Context)
{
cmd.network.BrooklynUrl = cmd.network.BrooklynUrl[0 :
len(cmd.network.BrooklynUrl)-1]
}
- if cmd.network.BrooklynUrl != "" && cmd.network.BrooklynUser == "" &&
cmd.network.CredentialsRequired {
+ if cmd.network.BrooklynUrl != "" && cmd.brooklynUser == "" &&
c.String(authorizationParam)==""{
// if only target supplied at command line see if it already
exists in the config file
- if username, password, err :=
config.GetNetworkCredentialsForTarget(cmd.network.BrooklynUrl); err == nil {
- cmd.network.BrooklynUser = username
- cmd.network.BrooklynPass = password
+ if credentials, err :=
config.GetNetworkCredentialsForTarget(cmd.network.BrooklynUrl); err == nil {
+ cmd.network.Credentials = credentials
+ }
+ if authorizationType, err :=
config.GetAuthType(cmd.network.BrooklynUrl); err == nil{
+ // TODO remove
Review comment:
this can be removed
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services