Skip to content

Migrate 'keysystems' protocol from LegacyProtocol to Protocol (fix 'last' bug + IPv4/IPv6 support) #956

Description

@beadon

Summary

The keysystems protocol (for Key-Systems / RRPproxy) is currently a LegacyProtocol, using the deprecated wantip key and legacy recap fields. It also contains a last bug that terminates the entire host loop on HTTP failure instead of skipping just the current host. This is a prerequisite for closing #172.

Current behaviour

nic_keysystems_update reads delete $config{$h}{'wantip'}. The request is:

GET <server>/update.php?hostname=<h>&password=<password>&ip=<ip>

(no scheme prefix is added — geturl handles it). Success is detected by /code = 200/ in the response body. Results are stored in recap{$h}{'ip'}, recap{$h}{'mtime'}, recap{$h}{'status'}.

Bug: On !header_ok($reply), the code uses last instead of next, causing the entire for my $h loop to exit when any host's HTTP request fails. Remaining hosts in the same run are silently skipped.

Migration requirements

  • Convert to Protocol->new (replacing LegacyProtocol->new).
  • Fix the lastnext bug on !header_ok($reply).
  • Read wantipv4 and wantipv6 instead of wantip; investigate whether the Key-Systems DynDNS endpoint supports IPv6; if so, handle both families.
  • Store results in recap{$h}{'ipv4'} / recap{$h}{'status-ipv4'} and recap{$h}{'ipv6'} / recap{$h}{'status-ipv6'}.
  • Add t/protocol_keysystems.pl with test coverage for: success, code = 200 parsing, HTTP error (verifying next not last behavior), no-op.

References

Metadata

Metadata

Assignees

Labels

IPv6Issues or pull request related to ipv6bugSomething isn't workingenhancementNew feature or requestproviderAdds, fixes or removes a provider

Type

No type

Fields

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