Skip to content

Commit

Permalink
GANDI: Bump go-gandi/go-gandi v0.0.0-20211124085723 => v0.1.0 (#1439)
Browse files Browse the repository at this point in the history
* GANDI: Bump go-gandi/go-gandi v0.0.0-20211124085723-a737785a1af0 => v0.1.0

* Use new NewDomainClient signature

* go mod tidy
  • Loading branch information
tlimoncelli committed Mar 26, 2022
1 parent 96cb158 commit f439495
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 11 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ require (
github.com/exoscale/egoscale v0.59.0
github.com/fatih/color v1.13.0 // indirect
github.com/go-acme/lego v2.7.2+incompatible
github.com/go-gandi/go-gandi v0.0.0-20211124085723-a737785a1af0
github.com/go-gandi/go-gandi v0.1.0
github.com/gobwas/glob v0.2.4-0.20181002190808-e7a84e9525fe
github.com/gofrs/uuid v4.0.0+incompatible // indirect
github.com/google/go-github/v35 v35.3.0
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,6 @@ github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMn
github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag=
github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/cloudflare/cloudflare-go v0.33.0 h1:5qiAeIHZsgno8WBpiybUNQUKLR1Wwm0U8paKowtwPL8=
github.com/cloudflare/cloudflare-go v0.33.0/go.mod h1:JeaZN2TH2OKmiDDd9+34/kJrazqPliSdj+D0y8DpkIw=
github.com/cloudflare/cloudflare-go v0.34.0 h1:FsZUCUABkSSyO329gxQRd9DT4/KPGuL3uRYLkjTDlPM=
github.com/cloudflare/cloudflare-go v0.34.0/go.mod h1:JeaZN2TH2OKmiDDd9+34/kJrazqPliSdj+D0y8DpkIw=
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
Expand Down Expand Up @@ -223,8 +221,8 @@ github.com/go-acme/lego v2.7.2+incompatible h1:ThhpPBgf6oa9X/vRd0kEmWOsX7+vmYdck
github.com/go-acme/lego v2.7.2+incompatible/go.mod h1:yzMNe9CasVUhkquNvti5nAtPmG94USbYxYrZfTkIn0M=
github.com/go-asn1-ber/asn1-ber v1.3.1/go.mod h1:hEBeB/ic+5LoWskz+yKT7vGhhPYkProFKoKdwZRWMe0=
github.com/go-chi/chi/v5 v5.0.0/go.mod h1:BBug9lr0cqtdAhsu6R4AAdvufI0/XBzAQSsUqJpoZOs=
github.com/go-gandi/go-gandi v0.0.0-20211124085723-a737785a1af0 h1:CTHqxY6uf+bk3VIINZQsm3gXPDv0P6RzlL7z2Ac3U5U=
github.com/go-gandi/go-gandi v0.0.0-20211124085723-a737785a1af0/go.mod h1:9rLNAOw2K3hRxNa3iNY+C7yHTiIr8n3x7/KaMiHnGAo=
github.com/go-gandi/go-gandi v0.1.0 h1:lYPNy6LUJtR76C25pAcwXuos8WbPg+hX6R2ZPm/jf+8=
github.com/go-gandi/go-gandi v0.1.0/go.mod h1:9NoYyfWCjFosClPiWjkbbRK5UViaZ4ctpT8/pKSSFlw=
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
Expand Down Expand Up @@ -536,6 +534,8 @@ github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0Mw
github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc=
github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ=
github.com/peterhellberg/link v1.1.0 h1:s2+RH8EGuI/mI4QwrWGSYQCRz7uNgip9BaM04HKu5kc=
github.com/peterhellberg/link v1.1.0/go.mod h1:gtSlOT4jmkY8P47hbTc8PTgiDDWpdPbFYl75keYyBB8=
github.com/philhug/opensrs-go v0.0.0-20171126225031-9dfa7433020d h1:nf4+lHs8TQeIGFYZMcNg4iQOnZndLfYxnQaKEdqHVA4=
github.com/philhug/opensrs-go v0.0.0-20171126225031-9dfa7433020d/go.mod h1:VDIGNBy0tHXMDAu4gxHFQJDq3NuwqUxw2Kok7wi+6ck=
github.com/pierrec/lz4 v2.5.2+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
Expand Down
35 changes: 29 additions & 6 deletions providers/gandiv5/gandi_v5Provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ import (
"strconv"
"strings"

gandi "github.com/go-gandi/go-gandi"
//gandi "github.com/go-gandi/go-gandi"
"github.com/go-gandi/go-gandi"
"github.com/go-gandi/go-gandi/config"

"github.com/miekg/dns/dnsutil"

"github.com/StackExchange/dnscontrol/v3/models"
Expand Down Expand Up @@ -101,7 +104,11 @@ func newHelper(m map[string]string, metadata json.RawMessage) (*gandiv5Provider,

// ListZones lists the zones on this account.
func (client *gandiv5Provider) ListZones() ([]string, error) {
g := gandi.NewLiveDNSClient(client.apikey, gandi.Config{SharingID: client.sharingid, Debug: client.debug})
g := gandi.NewLiveDNSClient(config.Config{
APIKey: client.apikey,
SharingID: client.sharingid,
Debug: client.debug,
})

listResp, err := g.ListDomains()
if err != nil {
Expand Down Expand Up @@ -141,7 +148,11 @@ func (client *gandiv5Provider) GetDomainCorrections(dc *models.DomainConfig) ([]
// GetZoneRecords gathers the DNS records and converts them to
// dnscontrol's format.
func (client *gandiv5Provider) GetZoneRecords(domain string) (models.Records, error) {
g := gandi.NewLiveDNSClient(client.apikey, gandi.Config{SharingID: client.sharingid, Debug: client.debug})
g := gandi.NewLiveDNSClient(config.Config{
APIKey: client.apikey,
SharingID: client.sharingid,
Debug: client.debug,
})

// Get all the existing records:
records, err := g.GetDomainRecords(domain)
Expand Down Expand Up @@ -236,7 +247,11 @@ func (client *gandiv5Provider) GenerateDomainCorrections(dc *models.DomainConfig
_, desiredRecords := dc.Records.GroupedByFQDN()
doesLabelExist := existing.FQDNMap()

g := gandi.NewLiveDNSClient(client.apikey, gandi.Config{SharingID: client.sharingid, Debug: client.debug})
g := gandi.NewLiveDNSClient(config.Config{
APIKey: client.apikey,
SharingID: client.sharingid,
Debug: client.debug,
})

// For any key with an update, delete or replace those records.
for label := range affectedLabels {
Expand Down Expand Up @@ -346,7 +361,11 @@ func gatherAffectedLabels(groups map[models.RecordKey][]string) (labels map[stri

// GetNameservers returns a list of nameservers for domain.
func (client *gandiv5Provider) GetNameservers(domain string) ([]*models.Nameserver, error) {
g := gandi.NewLiveDNSClient(client.apikey, gandi.Config{SharingID: client.sharingid, Debug: client.debug})
g := gandi.NewLiveDNSClient(config.Config{
APIKey: client.apikey,
SharingID: client.sharingid,
Debug: client.debug,
})
nameservers, err := g.GetDomainNS(domain)
if err != nil {
return nil, err
Expand All @@ -356,7 +375,11 @@ func (client *gandiv5Provider) GetNameservers(domain string) ([]*models.Nameserv

// GetRegistrarCorrections returns a list of corrections for this registrar.
func (client *gandiv5Provider) GetRegistrarCorrections(dc *models.DomainConfig) ([]*models.Correction, error) {
gd := gandi.NewDomainClient(client.apikey, gandi.Config{SharingID: client.sharingid, Debug: client.debug})
gd := gandi.NewDomainClient(config.Config{
APIKey: client.apikey,
SharingID: client.sharingid,
Debug: client.debug,
})

existingNs, err := gd.GetNameServers(dc.Name)
if err != nil {
Expand Down

0 comments on commit f439495

Please # to comment.