brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Graeme-Miller <...@git.apache.org>
Subject [GitHub] brooklyn-client pull request #42: Improve login handling.
Date Thu, 25 May 2017 10:26:27 GMT
Github user Graeme-Miller commented on a diff in the pull request:

    https://github.com/apache/brooklyn-client/pull/42#discussion_r118458766
  
    --- Diff: cli/br/brooklyn.go ---
    @@ -30,27 +30,14 @@ import (
     	"path/filepath"
     )
     
    -func getNetworkCredentialsFromConfig(yamlMap map[string]interface{}) (string, string,
string, bool) {
    -	var target, username, password string
    -	var skipSslChecks bool
    -	target, found := yamlMap["target"].(string)
    -	if found {
    -		auth, found := yamlMap["auth"].(map[string]interface{})
    -		if found {
    -			creds := auth[target].(map[string]interface{})
    -			username, found = creds["username"].(string)
    -			if found {
    -				password, found = creds["password"].(string)
    -			}
    -		}
    -		skipSslChecks, _ = yamlMap["skipSslChecks"].(bool)
    -	}
    -	return target, username, password, skipSslChecks
    -}
    -
     func main() {
     	config := io.GetConfig()
    -	target, username, password, skipSslChecks := getNetworkCredentialsFromConfig(config.Map)
    +	skipSslChecks := config.GetSkipSslChecks()
    +	target, username, password, err := config.GetNetworkCredentials()
    +	if err != nil && !isLogin(os.Args) {
    --- End diff --
    
    A nice to have: if the user hasn't previously called login we will error here. However,
we could change the command to login here and continue. They would be prompted for a username
and password.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message