octodns / octodns-gandi

Gandi v5 API provider for octoDNS
MIT License
6 stars 1 forks source link

support for TLSA record type #35

Closed onny closed 8 months ago

onny commented 9 months ago

According to https://docs.gandi.net/en/domain_names/faq/dns_records.html#what-dns-record-types-does-gandi-s-livedns-support TLSA records are supported but via LiveDNS rest api

Currently it fails with

    raise SupportsException(f'{self.id}: {msg}')
octodns.provider.SupportsException: gandi: TLSA records not supported for _25._tcp.mx1.turbotux.de.

config:

"_25._tcp.mx1":
  - type: TLSA
    certificate_usage: 3
    selector: 1
    matching_type: 1
    certificate_association_data: 'da11449b024adc44810b2112aca75aa21a35e6409b2e4012571343211d605b89'
ross commented 9 months ago

PRs welcome. I don't have access to the provider so can't look into it myself.

onny commented 9 months ago

i could give you a PAT if you line :)

ross commented 9 months ago

i could give you a PAT if you line :)

Heh. That's a path I'd rather not go down :grin:

yzguy commented 9 months ago

@onny Can you create a TSLA record via the UI as you'd expect (your provided config example would be fine), then run

curl -X GET \
  https://api.gandi.net/v5/livedns/domains/$DOMAIN/records \
  -H 'authorization: Bearer ${GANDI_PAT_TOKEN}'

We'd need just the block for the TSLA record like this one

  {
    "rrset_name": "www",
    "rrset_ttl": 10800,
    "rrset_type": "CNAME",
    "rrset_values": [
      "www.example.net."
    ],
    "rrset_href": "https://api.test/v5/livedns/domains/example.com/records/www/CNAME"
  }
onny commented 8 months ago

@yzguy

[
[...]
  {
    rrset_name: "_25._tcp.mx1",
    rrset_type: "TLSA",
    rrset_ttl: 10800,
    rrset_values: [
      "3 1 1 da11449b024adc44810b2112aca75aa21a35e6409b2e4012571343211d605b89",
    ],
    rrset_href:
      "https://api.gandi.net/v5/livedns/domains/project-insanity.org/records/_25._tcp.mx1/TLSA",
  },
[...]
];
yzguy commented 8 months ago

@onny v0.0.3 with TLSA support is available on PyPi -- https://pypi.org/project/octodns-gandi/0.0.3/

onny commented 8 months ago

thank you so much this is great :)