mirror of https://github.com/status-im/consul.git
api: fix up some comments and rename IssuedCert to LeafCert
This commit is contained in:
parent
4689d8373a
commit
9638466b88
|
@ -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
|
// 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).
|
// 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 := a.c.newRequest("GET", "/v1/agent/connect/ca/leaf/"+serviceID)
|
||||||
r.setQueryOptions(q)
|
r.setQueryOptions(q)
|
||||||
rtt, resp, err := requireOK(a.c.doRequest(r))
|
rtt, resp, err := requireOK(a.c.doRequest(r))
|
||||||
|
@ -580,7 +580,7 @@ func (a *Agent) ConnectCALeaf(serviceID string, q *QueryOptions) (*IssuedCert, *
|
||||||
parseQueryMeta(resp, qm)
|
parseQueryMeta(resp, qm)
|
||||||
qm.RequestTime = rtt
|
qm.RequestTime = rtt
|
||||||
|
|
||||||
var out IssuedCert
|
var out LeafCert
|
||||||
if err := decodeBody(resp, &out); err != nil {
|
if err := decodeBody(resp, &out); err != nil {
|
||||||
return nil, nil, err
|
return nil, nil, err
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,7 @@ type Connect struct {
|
||||||
c *Client
|
c *Client
|
||||||
}
|
}
|
||||||
|
|
||||||
// Health returns a handle to the health endpoints
|
// Connect returns a handle to the connect-related endpoints
|
||||||
func (c *Client) Connect() *Connect {
|
func (c *Client) Connect() *Connect {
|
||||||
return &Connect{c}
|
return &Connect{c}
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,8 +19,8 @@ type CARoot struct {
|
||||||
// opaque to Consul and is not used for anything internally.
|
// opaque to Consul and is not used for anything internally.
|
||||||
Name string
|
Name string
|
||||||
|
|
||||||
// RootCert is the PEM-encoded public certificate.
|
// RootCertPEM is the PEM-encoded public certificate.
|
||||||
RootCert string
|
RootCertPEM string `json:"RootCert"`
|
||||||
|
|
||||||
// Active is true if this is the current active CA. This must only
|
// 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
|
// be true for exactly one CA. For any method that modifies roots in the
|
||||||
|
@ -32,8 +32,8 @@ type CARoot struct {
|
||||||
ModifyIndex uint64
|
ModifyIndex uint64
|
||||||
}
|
}
|
||||||
|
|
||||||
// IssuedCert is a certificate that has been issued by a Connect CA.
|
// LeafCert is a certificate that has been issued by a Connect CA.
|
||||||
type IssuedCert struct {
|
type LeafCert struct {
|
||||||
// SerialNumber is the unique serial number for this certificate.
|
// SerialNumber is the unique serial number for this certificate.
|
||||||
// This is encoded in standard hex separated by :.
|
// This is encoded in standard hex separated by :.
|
||||||
SerialNumber string
|
SerialNumber string
|
||||||
|
|
Loading…
Reference in New Issue