Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add PTR record support #164

Merged
merged 20 commits into from Apr 16, 2020
Merged

Add PTR record support #164

merged 20 commits into from Apr 16, 2020

Conversation

ryandv
Copy link
Contributor

@ryandv ryandv commented Apr 16, 2020

Add support for reading/writing PTR records to both NS1 and DNSimple. Such records can already be read using the DynECT provider.

@ryandv ryandv changed the title Add ptr record support Add PTR record support Apr 16, 2020
Copy link
Contributor

@sbfaulkner sbfaulkner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good - a couple of questions in the review

Also wondering about GoogleCloudDNS and OracleCloudDNS providers. What's our stance on adding functionality, but not adding in all providers? Does it produce a reasonable error at least if we try to use there?

assert_equal(
'4e0ebbeac8d2e4e73af888b20e2243e5a2a08bad6476c832c985e54b21eff4a3',
matching_records.first.fingerprint
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems unrelated... a leak of something into this PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it's unrelated, but deliberately so. I thought I could sneak in some changes here to strengthen tests from the SSHFP pull request as I noticed they weren't really asserting that any records had been persisted.

I'm willing to just back this change out. The response is stored on cassette anyway so it's really only verifying a change took place on the remote server the very first time it's run.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine with the occasional drive-by :-)

mostly making sure I wasn't missing something, and can see the commit now

for future, maybe the commit comment could be more description for cases like this, or a note added to the PR description to call out the out-of-scope change -- ie. the comment "Assorted test cleanup" didn't clearly tell me what it was doing, and if I were looking at this and doing some archaeology in future it might be confusing

test/record_test.rb Show resolved Hide resolved
@ryandv
Copy link
Contributor Author

ryandv commented Apr 16, 2020

With respect to adding support in the GoogleCloudDNS and OracleCloudDNS providers, I would prefer to follow up with a separate PR for now, unless there are strong objections.

Providers must explicitly declare what record types they support. I have characterized the behaviour in some new tests. Otherwise the Zone will raise a "PTR is not a supported record type" validation error.

@ryandv
Copy link
Contributor Author

ryandv commented Apr 16, 2020

Just pushed up some additional validations for PTR FQDNs:

  • Must specify 1-4 octets
  • Octets must be within range 0-255
  • FQDN must be within the in-addr.arpa zone

@ryandv ryandv merged commit d59622b into master Apr 16, 2020
@sbfaulkner sbfaulkner deleted the ryandv/add-ptr-record-support branch April 16, 2020 19:24
@ryandv ryandv mentioned this pull request Apr 17, 2020
@sbfaulkner sbfaulkner temporarily deployed to production April 24, 2020 15:23 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants