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_r289195954
##########
File path: cli/io/config.go
##########
@@ -253,24 +244,19 @@ func (config *Config) SetSkipSslChecks(skipSslChecks
bool) {
config.Map[skipSslChecksKey] = skipSslChecks
}
-func (config *Config) GetUserHeaders() (headerMap map[string]interface{}){
- headerMap, _ = config.Map[headersKey].(map[string]interface{})
- return
-}
-func (config *Config) SetUserHeaders(headerMap map[string]interface{}) {
- config.Map[headersKey] = headerMap
-}
-
-func (config *Config) GetCredentialsRequired() bool {
- if config.Map == nil {
- config.Map = make(map[string]interface{})
+func (config *Config) GetAuthType(target string) (authType string, err error){
+ authTypeMap, found := config.Map[authTypeKey].(map[string]interface{})
+ if found{
+ authType, found = authTypeMap[target].(string)
}
- credentialsRequired, found := config.Map[credentialsRequiredKey].(bool)
- if !found{
- credentialsRequired=true
+ // default behaviour
+ if! found{
Review comment:
need space after `if`. I suggest running `gofmt` on the files.
----------------------------------------------------------------
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