api: fix up some comments and rename IssuedCert to LeafCert

This commit is contained in:
Mitchell Hashimoto 2018-03-28 14:16:41 -07:00
parent c0894f0f50
commit 9de861d722
No known key found for this signature in database
GPG Key ID: 744E147AA52F5B0A
3 changed files with 7 additions and 7 deletions

View File

@ -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
}

View File

@ -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}
}

View File

@ -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