// SSHFederation performs the get /ssh/federation request to the CA and returns
// the api.SSHRootsResponse struct.
SSHFederation performs the get /ssh/federation request to the CA and returns
the api.SSHRootsResponse struct.
// SSHFederation performs the get / ssh / federation request to the CA and returns // the api . SSHRootsResponse struct .
func (c *Client) SSHFederation() (*api.SSHRootsResponse, error) {
	var retried bool
	u := c.endpoint.ResolveReference(&url.URL{Path: "/ssh/federation"})
retry:
	resp, err := c.client.Get(u.String())
	if err != nil {
		return nil, errors.Wrapf(err, "client GET %s failed", u)
	}
	if resp.StatusCode >= 400 {
		if !retried && c.retryOnError(resp) {
			retried = true
			goto retry
		}
		return nil, readError(resp.Body)
	}
	var keys api.SSHRootsResponse
	if err := readJSON(resp.Body, &keys); err != nil {
		return nil, errors.Wrapf(err, "error reading %s", u)
	}
	return &keys, nil
}
func ( c * Client ) SSHFederation ( ) ( * api . SSHRootsResponse , error ) { var retried bool u := c . endpoint . ResolveReference ( & url . URL { Path : " " } ) retry : resp , err := c . client . Get ( u . String ( ) ) if err != nil { return nil , errors . Wrapf ( err , " " , u ) } if resp . StatusCode >= 400 { if ! retried && c . retryOnError ( resp ) { retried = true goto retry } return nil , readError ( resp . Body ) } var keys api . SSHRootsResponse if err := readJSON ( resp . Body , & keys ) ; err != nil { return nil , errors . Wrapf ( err , " " , u ) } return & keys , nil }
SSHFederation performs the get /ssh/federation request to the CA and returns
the api.SSHRootsResponse struct.
SSHFederation performs the get / ssh / federation request to the CA and returns the api . SSHRootsResponse struct .