mirror of
https://github.com/go-acme/lego.git
synced 2024-12-23 09:15:11 +02:00
cloudflare: update api client to v0.70.0 (#1931)
Co-authored-by: Fernandez Ludovic <ldez@users.noreply.github.com>
This commit is contained in:
parent
fdfcaabde6
commit
9d193056f7
2
go.mod
2
go.mod
@ -16,7 +16,7 @@ require (
|
|||||||
github.com/aws/aws-sdk-go v1.39.0
|
github.com/aws/aws-sdk-go v1.39.0
|
||||||
github.com/cenkalti/backoff/v4 v4.2.1
|
github.com/cenkalti/backoff/v4 v4.2.1
|
||||||
github.com/civo/civogo v0.3.11
|
github.com/civo/civogo v0.3.11
|
||||||
github.com/cloudflare/cloudflare-go v0.49.0
|
github.com/cloudflare/cloudflare-go v0.70.0
|
||||||
github.com/cpu/goacmedns v0.1.1
|
github.com/cpu/goacmedns v0.1.1
|
||||||
github.com/dnsimple/dnsimple-go v1.2.0
|
github.com/dnsimple/dnsimple-go v1.2.0
|
||||||
github.com/exoscale/egoscale v0.100.1
|
github.com/exoscale/egoscale v0.100.1
|
||||||
|
4
go.sum
4
go.sum
@ -82,8 +82,8 @@ github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMn
|
|||||||
github.com/civo/civogo v0.3.11 h1:mON/fyrV946Sbk6paRtOSGsN+asCgCmHCgArf5xmGxM=
|
github.com/civo/civogo v0.3.11 h1:mON/fyrV946Sbk6paRtOSGsN+asCgCmHCgArf5xmGxM=
|
||||||
github.com/civo/civogo v0.3.11/go.mod h1:7+GeeFwc4AYTULaEshpT2vIcl3Qq8HPoxA17viX3l6g=
|
github.com/civo/civogo v0.3.11/go.mod h1:7+GeeFwc4AYTULaEshpT2vIcl3Qq8HPoxA17viX3l6g=
|
||||||
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
|
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
|
||||||
github.com/cloudflare/cloudflare-go v0.49.0 h1:KqJYk/YQ5ZhmyYz1oa4kGDskfF1gVuZfqesaJ/XDLto=
|
github.com/cloudflare/cloudflare-go v0.70.0 h1:4opGbUygM8DjirUuaz23jn3akuAcnOCEx+0nQtQEcFo=
|
||||||
github.com/cloudflare/cloudflare-go v0.49.0/go.mod h1:h0QgcIZ3qEXwFiwfBO8sQxjVdYsLX+PfD7NFEnANaKg=
|
github.com/cloudflare/cloudflare-go v0.70.0/go.mod h1:VW6GuazkaZ4xEDkFt24lkXQUsE8q7BiGqDniC2s8WEM=
|
||||||
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
|
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
|
||||||
github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
|
github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
|
||||||
github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
|
github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
|
||||||
|
@ -134,7 +134,7 @@ func (d *DNSProvider) Present(domain, token, keyAuth string) error {
|
|||||||
return fmt.Errorf("cloudflare: failed to find zone %s: %w", authZone, err)
|
return fmt.Errorf("cloudflare: failed to find zone %s: %w", authZone, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
dnsRecord := cloudflare.DNSRecord{
|
dnsRecord := cloudflare.CreateDNSRecordParams{
|
||||||
Type: "TXT",
|
Type: "TXT",
|
||||||
Name: dns01.UnFqdn(info.EffectiveFQDN),
|
Name: dns01.UnFqdn(info.EffectiveFQDN),
|
||||||
Content: info.Value,
|
Content: info.Value,
|
||||||
@ -146,15 +146,11 @@ func (d *DNSProvider) Present(domain, token, keyAuth string) error {
|
|||||||
return fmt.Errorf("cloudflare: failed to create TXT record: %w", err)
|
return fmt.Errorf("cloudflare: failed to create TXT record: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if !response.Success {
|
|
||||||
return fmt.Errorf("cloudflare: failed to create TXT record: %+v %+v", response.Errors, response.Messages)
|
|
||||||
}
|
|
||||||
|
|
||||||
d.recordIDsMu.Lock()
|
d.recordIDsMu.Lock()
|
||||||
d.recordIDs[token] = response.Result.ID
|
d.recordIDs[token] = response.ID
|
||||||
d.recordIDsMu.Unlock()
|
d.recordIDsMu.Unlock()
|
||||||
|
|
||||||
log.Infof("cloudflare: new record for %s, ID %s", domain, response.Result.ID)
|
log.Infof("cloudflare: new record for %s, ID %s", domain, response.ID)
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -59,16 +59,16 @@ func newClient(config *Config) (*metaClient, error) {
|
|||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *metaClient) CreateDNSRecord(ctx context.Context, zoneID string, rr cloudflare.DNSRecord) (*cloudflare.DNSRecordResponse, error) {
|
func (m *metaClient) CreateDNSRecord(ctx context.Context, zoneID string, rr cloudflare.CreateDNSRecordParams) (cloudflare.DNSRecord, error) {
|
||||||
return m.clientEdit.CreateDNSRecord(ctx, zoneID, rr)
|
return m.clientEdit.CreateDNSRecord(ctx, cloudflare.ZoneIdentifier(zoneID), rr)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *metaClient) DNSRecords(ctx context.Context, zoneID string, rr cloudflare.DNSRecord) ([]cloudflare.DNSRecord, error) {
|
func (m *metaClient) DNSRecords(ctx context.Context, zoneID string, rr cloudflare.ListDNSRecordsParams) ([]cloudflare.DNSRecord, *cloudflare.ResultInfo, error) {
|
||||||
return m.clientEdit.DNSRecords(ctx, zoneID, rr)
|
return m.clientEdit.ListDNSRecords(ctx, cloudflare.ZoneIdentifier(zoneID), rr)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *metaClient) DeleteDNSRecord(ctx context.Context, zoneID, recordID string) error {
|
func (m *metaClient) DeleteDNSRecord(ctx context.Context, zoneID, recordID string) error {
|
||||||
return m.clientEdit.DeleteDNSRecord(ctx, zoneID, recordID)
|
return m.clientEdit.DeleteDNSRecord(ctx, cloudflare.ZoneIdentifier(zoneID), recordID)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *metaClient) ZoneIDByName(fdqn string) (string, error) {
|
func (m *metaClient) ZoneIDByName(fdqn string) (string, error) {
|
||||||
|
Loading…
Reference in New Issue
Block a user