Skip to content

Migrate 'yandex' protocol from LegacyProtocol to Protocol (add AAAA support) #954

@beadon

Description

@beadon

Summary

The yandex protocol (for Yandex DNS) is currently a LegacyProtocol, using the deprecated wantip key and legacy recap fields. The update logic only updates A records (type not checked in list response). This is a prerequisite for closing #172.

Current behaviour

nic_yandex_update reads delete $config{$host}{'wantip'} — a single IP regardless of family. The flow is two-step:

  1. GET https://<server>/api2/admin/dns/list?domain=<login> — list all DNS records, with PddToken: <password> header. Finds the record whose fqdn matches the host (regardless of type — A or AAAA).
  2. POST https://<server>/api2/admin/dns/edit — updates the found record with domain=<login>&record_id=<id>&content=<ip>.

There is no type filtering in the list step, so if both A and AAAA records exist for the host, only the first match is updated. Results are stored in recap{$host}{'ip'}, recap{$host}{'mtime'}, recap{$host}{'status'}.

Migration requirements

  • Convert to Protocol->new (replacing LegacyProtocol->new).
  • Read wantipv4 and wantipv6 instead of wantip.
  • In the list step, filter records by type == 'A' for IPv4 and type == 'AAAA' for IPv6.
  • Run two independent update passes (one per family) when both IPs are wanted.
  • Store results in recap{$host}{'ipv4'} / recap{$host}{'status-ipv4'} and recap{$host}{'ipv6'} / recap{$host}{'status-ipv6'}.
  • Remove the hardcoded https:// prefix from both URL constructions.
  • Add t/protocol_yandex.pl with test coverage for: IPv4 success, IPv6 success, record-not-found, JSON error response, HTTP error, no-op.

References

Metadata

Metadata

Assignees

Labels

IPv6Issues or pull request related to ipv6enhancementNew feature or requestproviderAdds, fixes or removes a provider

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions