forked from TrueCloudLab/lego
Fix a couple of misspelled words and lint errors.
This commit is contained in:
parent
416a63120e
commit
a4d8c0e6b9
3 changed files with 13 additions and 11 deletions
|
@ -316,7 +316,7 @@ func (c *Client) RenewCertificate(cert CertificateResource, bundle bool) (Certif
|
||||||
links := parseLinks(resp.Header["Link"])
|
links := parseLinks(resp.Header["Link"])
|
||||||
issuerCert, err := c.getIssuerCertificate(links["up"])
|
issuerCert, err := c.getIssuerCertificate(links["up"])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// If we fail to aquire the issuer cert, return the issued certificate - do not fail.
|
// If we fail to acquire the issuer cert, return the issued certificate - do not fail.
|
||||||
logf("[ERROR][%s] acme: Could not bundle issuer certificate: %v", cert.Domain, err)
|
logf("[ERROR][%s] acme: Could not bundle issuer certificate: %v", cert.Domain, err)
|
||||||
} else {
|
} else {
|
||||||
// Success - append the issuer cert to the issued cert.
|
// Success - append the issuer cert to the issued cert.
|
||||||
|
@ -518,7 +518,7 @@ func (c *Client) requestCertificate(authz []authorizationResource, bundle bool,
|
||||||
links := parseLinks(resp.Header["Link"])
|
links := parseLinks(resp.Header["Link"])
|
||||||
issuerCert, err := c.getIssuerCertificate(links["up"])
|
issuerCert, err := c.getIssuerCertificate(links["up"])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// If we fail to aquire the issuer cert, return the issued certificate - do not fail.
|
// If we fail to acquire the issuer cert, return the issued certificate - do not fail.
|
||||||
logf("[WARNING][%s] acme: Could not bundle issuer certificate: %v", commonName.Domain, err)
|
logf("[WARNING][%s] acme: Could not bundle issuer certificate: %v", commonName.Domain, err)
|
||||||
} else {
|
} else {
|
||||||
// Success - append the issuer cert to the issued cert.
|
// Success - append the issuer cert to the issued cert.
|
||||||
|
|
|
@ -11,7 +11,9 @@ import (
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
const CloudFlareApiURL = "https://api.cloudflare.com/client/v4"
|
// CloudFlareAPIURL represents the API endpoint to call.
|
||||||
|
// TODO: Unexport?
|
||||||
|
const CloudFlareAPIURL = "https://api.cloudflare.com/client/v4"
|
||||||
|
|
||||||
// DNSProviderCloudFlare is an implementation of the DNSProvider interface
|
// DNSProviderCloudFlare is an implementation of the DNSProvider interface
|
||||||
type DNSProviderCloudFlare struct {
|
type DNSProviderCloudFlare struct {
|
||||||
|
@ -141,20 +143,20 @@ func (c *DNSProviderCloudFlare) findTxtRecord(fqdn string) (*cloudFlareRecord, e
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *DNSProviderCloudFlare) makeRequest(method, uri string, body io.Reader) (json.RawMessage, error) {
|
func (c *DNSProviderCloudFlare) makeRequest(method, uri string, body io.Reader) (json.RawMessage, error) {
|
||||||
// ApiError contains error details for failed requests
|
// APIError contains error details for failed requests
|
||||||
type ApiError struct {
|
type APIError struct {
|
||||||
Code int `json:"code,omitempty"`
|
Code int `json:"code,omitempty"`
|
||||||
Message string `json:"message,omitempty"`
|
Message string `json:"message,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// ApiResponse represents a response from CloudFlare API
|
// APIResponse represents a response from CloudFlare API
|
||||||
type ApiResponse struct {
|
type APIResponse struct {
|
||||||
Success bool `json:"success"`
|
Success bool `json:"success"`
|
||||||
Errors []*ApiError `json:"errors"`
|
Errors []*APIError `json:"errors"`
|
||||||
Result json.RawMessage `json:"result"`
|
Result json.RawMessage `json:"result"`
|
||||||
}
|
}
|
||||||
|
|
||||||
req, err := http.NewRequest(method, fmt.Sprintf("%s%s", CloudFlareApiURL, uri), body)
|
req, err := http.NewRequest(method, fmt.Sprintf("%s%s", CloudFlareAPIURL, uri), body)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
@ -171,7 +173,7 @@ func (c *DNSProviderCloudFlare) makeRequest(method, uri string, body io.Reader)
|
||||||
|
|
||||||
defer resp.Body.Close()
|
defer resp.Body.Close()
|
||||||
|
|
||||||
var r ApiResponse
|
var r APIResponse
|
||||||
err = json.NewDecoder(resp.Body).Decode(&r)
|
err = json.NewDecoder(resp.Body).Decode(&r)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
|
@ -16,7 +16,7 @@ type DNSProviderRoute53 struct {
|
||||||
|
|
||||||
// NewDNSProviderRoute53 returns a DNSProviderRoute53 instance with a configured route53 client.
|
// NewDNSProviderRoute53 returns a DNSProviderRoute53 instance with a configured route53 client.
|
||||||
// Authentication is either done using the passed credentials or - when empty - falling back to
|
// Authentication is either done using the passed credentials or - when empty - falling back to
|
||||||
// the customary AWS credential mechanisms, including the file refernced by $AWS_CREDENTIAL_FILE
|
// the customary AWS credential mechanisms, including the file referenced by $AWS_CREDENTIAL_FILE
|
||||||
// (defaulting to $HOME/.aws/credentials) optionally scoped to $AWS_PROFILE, credentials
|
// (defaulting to $HOME/.aws/credentials) optionally scoped to $AWS_PROFILE, credentials
|
||||||
// supplied by the environment variables AWS_ACCESS_KEY_ID + AWS_SECRET_ACCESS_KEY [ + AWS_SECURITY_TOKEN ],
|
// supplied by the environment variables AWS_ACCESS_KEY_ID + AWS_SECRET_ACCESS_KEY [ + AWS_SECURITY_TOKEN ],
|
||||||
// and finally credentials available via the EC2 instance metadata service.
|
// and finally credentials available via the EC2 instance metadata service.
|
||||||
|
|
Loading…
Reference in a new issue