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

Vanity name servers + specs #67

Merged
merged 9 commits into from
Dec 11, 2015
Merged

Vanity name servers + specs #67

merged 9 commits into from
Dec 11, 2015

Conversation

jcaudle
Copy link
Contributor

@jcaudle jcaudle commented Dec 10, 2015

This pull request supersedes and closes #63 by adding specs to the vanity name server client provided by @iseem. Thanks @iseem!

@jcaudle jcaudle self-assigned this Dec 10, 2015
@jcaudle jcaudle mentioned this pull request Dec 10, 2015
@weppos
Copy link
Member

weppos commented Dec 10, 2015

@jcaudle I just noticed that the feature was provided under a new Client service. We already have the NameServer service available, and I believe the vanity feature should be part of it as it will also reflects the current API documentation.

Can I ask you to include the VanityNameServers module within the NameServersService?
https://github.com/aetrion/dnsimple-ruby/blob/master/lib/dnsimple/client/clients.rb#L84-L86

You may need to rename enable and disable into enable_vanity_name_servers and disable_vanity_name_servers.


# Enable vanity name servers for a domain.
#
# @see https://developer.dnsimple.com/nameservers/vanity-nameservers/#enable
Copy link
Member

Choose a reason for hiding this comment

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

@jcaudle
Copy link
Contributor Author

jcaudle commented Dec 10, 2015

You may need to rename enable and disable into enable_vanity_name_servers and disable_vanity_name_servers.

There is no enable or disable method in Client::NameServers, but I think it makes sense to rename them anyway. Do you agree?

@weppos
Copy link
Member

weppos commented Dec 10, 2015

There is no enable or disable method in Client::NameServers, but I think it makes sense to rename them anyway. Do you agree?

Yes, I agree. I will give more context and will save us from future conflicts.

#
# @return [void]
# @raise [RequestError] When the request fails.
def enable_vanity_name_servers(domain, names)
Copy link
Member

Choose a reason for hiding this comment

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

I just noticed the method is missing the option = {} final parameter. See for example
https://github.com/aetrion/dnsimple-ruby/blob/master/lib/dnsimple/client/domains_privacy.rb#L13

The same applies to disable.

The reason it's there, is because it allows to pass custom headers and params to the client.
See eb452f9

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'd imagine we need to add a validation of at least ns1 being present too, correct? I'm thinking of https://github.com/aetrion/dnsimple-ruby/blob/master/lib/dnsimple/client/domains_records.rb#L33 as an example of this since there is a payload that will be required for this to work properly.

I'm also wondering if it'd be better to have the one using this client provide the server_source value, but I don't particularly understand the purpose of dnsimple as a value here.

Copy link
Member

Choose a reason for hiding this comment

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

Technically, as of today we allow blank NS and we skip the blanks on our side. I would not be too much worried about validation here.

Just make sure that the Hash you create inside the method has higher priority over any value provided in options.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've added the ability to pass options in with 7edb58e

weppos added a commit that referenced this pull request Dec 11, 2015
@weppos weppos merged commit 8cf9d02 into master Dec 11, 2015
@weppos weppos deleted the vanity-name-servers branch December 11, 2015 20:01
@weppos
Copy link
Member

weppos commented Dec 11, 2015

It's good to me. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants