Skip to content

Commit

Permalink
api: fix up some comments and rename IssuedCert to LeafCert
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchellh committed Jun 14, 2018
1 parent 4689d83 commit 9638466
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions api/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion api/connect.go
Original file line number Diff line number Diff line change
Expand Up @@ -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}
}
8 changes: 4 additions & 4 deletions api/connect_ca.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 9638466

Please sign in to comment.