rsapi/auth.go
func (a *ssAuthenticator) SetHost(host string) {
	a.auther.SetHost(host)
	urlElems := strings.Split(host, ".")
	hostPrefix := urlElems[0]
	elems := strings.Split(hostPrefix, "-")

	if len(elems) == 1 && elems[0] == "cm" {
		// accommodates micromoo host inference, such as "cm.rightscale.local" => "selfservice.rightscale.local"
		elems[0] = "selfservice"
	} else if len(elems) < 2 {
		// don't know how to compute this ss host; use the cm host
		a.host = host
		return
	} else {
		elems[len(elems)-2] = "selfservice"
	}
	ssLoginHostPrefix := strings.Join(elems, "-")
	a.host = strings.Join(append([]string{ssLoginHostPrefix}, urlElems[1:]...), ".")
}
func (a *ssAuthenticator) SetHost(host string) {
	a.auther.SetHost(host)
	urlElems := strings.Split(host, ".")
	hostPrefix := urlElems[0]
	elems := strings.Split(hostPrefix, "-")

	if len(elems) == 1 && elems[0] == "cm" {
		// accommodates micromoo host inference, such as "cm.rightscale.local" => "selfservice.rightscale.local"
		elems[0] = "selfservice"
	} else if len(elems) < 2 {
		// don't know how to compute this ss host; use the cm host
		a.host = host
		return
	} else {
		elems[len(elems)-2] = "selfservice"
	}
	ssLoginHostPrefix := strings.Join(elems, "-")
	a.host = strings.Join(append([]string{ssLoginHostPrefix}, urlElems[1:]...), ".")
}
// SetHost sets the host used to create Self-Service session.
// Pass in the CM 1.5 host, this method computes the Self-Service host from it.