diff --git a/api/agent.go b/api/agent.go index 860483671..7a810bcab 100644 --- a/api/agent.go +++ b/api/agent.go @@ -567,7 +567,7 @@ func (a *Agent) ConnectCARoots(q *QueryOptions) (*CARootList, *QueryMeta, error) // // TODO(mitchellh): we need to test this better once we have a way to // configure CAs from the API package (when the CA work is done). -func (a *Agent) ConnectCALeaf(serviceID string, q *QueryOptions) (*IssuedCert, *QueryMeta, error) { +func (a *Agent) ConnectCALeaf(serviceID string, q *QueryOptions) (*LeafCert, *QueryMeta, error) { r := a.c.newRequest("GET", "/v1/agent/connect/ca/leaf/"+serviceID) r.setQueryOptions(q) rtt, resp, err := requireOK(a.c.doRequest(r)) @@ -580,7 +580,7 @@ func (a *Agent) ConnectCALeaf(serviceID string, q *QueryOptions) (*IssuedCert, * parseQueryMeta(resp, qm) qm.RequestTime = rtt - var out IssuedCert + var out LeafCert if err := decodeBody(resp, &out); err != nil { return nil, nil, err } diff --git a/api/connect.go b/api/connect.go index 4b4e06900..a40d1e232 100644 --- a/api/connect.go +++ b/api/connect.go @@ -6,7 +6,7 @@ type Connect struct { c *Client } -// Health returns a handle to the health endpoints +// Connect returns a handle to the connect-related endpoints func (c *Client) Connect() *Connect { return &Connect{c} } diff --git a/api/connect_ca.go b/api/connect_ca.go index 19046c2ab..00951c75d 100644 --- a/api/connect_ca.go +++ b/api/connect_ca.go @@ -19,8 +19,8 @@ type CARoot struct { // opaque to Consul and is not used for anything internally. Name string - // RootCert is the PEM-encoded public certificate. - RootCert string + // RootCertPEM is the PEM-encoded public certificate. + RootCertPEM string `json:"RootCert"` // Active is true if this is the current active CA. This must only // be true for exactly one CA. For any method that modifies roots in the @@ -32,8 +32,8 @@ type CARoot struct { ModifyIndex uint64 } -// IssuedCert is a certificate that has been issued by a Connect CA. -type IssuedCert struct { +// LeafCert is a certificate that has been issued by a Connect CA. +type LeafCert struct { // SerialNumber is the unique serial number for this certificate. // This is encoded in standard hex separated by :. SerialNumber string