bambou/session.go
func (s *Session) makeAuthorizationHeaders() (string, *Error) {

	if s.Username == "" {
		return "", NewBambouError("Invalid Credentials", "No username given")
	}

	if s.root == nil {
		return "", NewBambouError("Invalid Credentials", "No root user set")
	}

	key := s.root.APIKey()
	if s.Password == "" && key == "" {
		return "", NewBambouError("Invalid Credentials", "No password or authentication token given")
	}

	if key == "" {
		key = s.Password
	}

	return "XREST " + base64.StdEncoding.EncodeToString([]byte(s.Username+":"+key)), nil
}
func (s *Session) makeAuthorizationHeaders() (string, *Error) {

	if s.Username == "" {
		return "", NewBambouError("Invalid Credentials", "No username given")
	}

	if s.root == nil {
		return "", NewBambouError("Invalid Credentials", "No root user set")
	}

	key := s.root.APIKey()
	if s.Password == "" && key == "" {
		return "", NewBambouError("Invalid Credentials", "No password or authentication token given")
	}

	if key == "" {
		key = s.Password
	}

	return "XREST " + base64.StdEncoding.EncodeToString([]byte(s.Username+":"+key)), nil
}
// Used for user & password based authentication