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

Allow internationalized domains and skip TLD check. #148

Merged
merged 3 commits into from
Feb 20, 2014

Conversation

augustohp
Copy link
Member

This is related to #33 and merged into develop by @nickl-.

  • Rebase agains master
  • Update README.md
  • More meaningful commit messages (with more details on the implementations and decisions).

loganville and others added 3 commits February 16, 2014 21:00
Fix phrase "given data is a file (that) was uploaded" on `uploaded`
validation rule.
Skipping TLD check allows for local domains like "machine.dev",
but the default behavior of the rule still the same: it validates
TLDs, so domains will only be valid (by default) if the TLD is a
valid one.

The signature of rule (using the builder) changes from:

    v::domain() // Still works, same behavior as before.

To:

    v::domain(false) // Skips TLD check.

Fix Respect#33.

The "Domain" rule now validates domains on "ASCII Compatible Encoding"
[ACE][1] for internationalized domain names (ICANN, 2003).

An excerpt from Wikipedia article:

> If given a label containing at least one non-ASCII character, ToASCII
> will apply the Nameprep algorithm, which converts the label to
> lowercase and performs other normalization, and will then translate the
> result to ASCII using [Punycode][16] before prepending the four-character
> string ["xn--"][17].

[1]: http://wikipedia.org/wiki/Internationalized_domain_name#ToASCII_and_ToUnicode
[16]: http://tools.ietf.org/html/rfc3492
[17]: http://www.atm.tut.fi/list-archive/ietf-announce/msg13572.html
@augustohp augustohp added this to the 0.6.0 milestone Feb 17, 2014
augustohp pushed a commit that referenced this pull request Feb 20, 2014
Allow internationalized domains and skip TLD check.
@augustohp augustohp merged commit 979c069 into Respect:master Feb 20, 2014
@nickl-
Copy link
Member

nickl- commented Mar 18, 2014

Nicely done!!

Can I throw a spanner in the mix... what about doing verification instead of validation. The whois protocol is very straight forward and you will know that the domain is registered and exist.

The same is true for e-mail and it is going to become more and more difficult to validate these when you should simply verify them, by sending a link to follow or a code which you should be supplied to allow the email to be pass as valid.

ICANN is talking about 1500 new gTLDs being released and even more to come. If you also consider that brands may simply use their brand name like http://apple or support@github without any second level names this becomes more difficult. We can't attempt to keep a list and validate them all... can we?

@augustohp
Copy link
Member Author

We can't attempt to keep a list and validate them all... can we?

By any means, do you have anything on your mind (concerning a sexy API) regarding this? Or you intend to just do verification instead of validation really?

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.

4 participants