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

Switch the lib to A-labels by default #40

Merged
merged 11 commits into from
Nov 21, 2016
Merged

Switch the lib to A-labels by default #40

merged 11 commits into from
Nov 21, 2016

Conversation

weppos
Copy link
Owner

@weppos weppos commented Nov 20, 2016

Implements the changes described in #31.

The internal representation is now expected to be ASCII. The library will also automatically converts parsed lists from Unicode to ASCII, unless the developers knows the input being ASCII (in this case it's possible to disable the conversion to save processing time).

/cc @jsha @PatF @cpu I used the data you provided as test cases, and I should have covered all the needs. Do you mind to review?

It should be safe to run the test suite for letsencrypt/boulder#2278 around this branch. Once confirmed, I'll merge this branch to master and release.

@weppos weppos self-assigned this Nov 20, 2016
cpu pushed a commit to letsencrypt/boulder that referenced this pull request Nov 21, 2016
This commit bumps the publicsuffix-go dependency to the WIP branch from
weppos/publicsuffix-go#40 to support IDN TLDs.
Copy link

@cpu cpu left a comment

Choose a reason for hiding this comment

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

This is great! I flagged one small typo but otherwise no comments from me.

I've confirmed that Boulder's unit & integration tests pass in letsencrypt/boulder#2339. I also updated our unit tests to explicitly test that we support issuing for an IDN TLD with the updated dependency.

Once this PR lands in master I'll update letsencrypt/boulder#2339 and get the ball rolling on deployment. Thanks again @weppos - really appreciate it!!

@@ -150,23 +212,23 @@ blogspot.com
// ===END PRIVATE DOMAINS===
`

// FIXME
p1 := NewRule("blogspot.com")
// TODO(weppos): abiliuty to set type to a rule.
Copy link

Choose a reason for hiding this comment

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

tiny typo: "abiliuty" -> "ability"

@cpu
Copy link

cpu commented Nov 21, 2016

One other minor comment: it would be valuable to update README.md to briefly discuss the IDN support and the default A-label behaviour.

@weppos
Copy link
Owner Author

weppos commented Nov 21, 2016

Thanks for the review and confirmation @cpu. Also, ❤️ for the kind words.

One other minor comment: it would be valuable to update README.md to briefly discuss the IDN support and the default A-label behaviour.

That's a fair point. I'll work on it today, and update the branch. Feel free to provide a patch, if you have something specific in mind.

One quick question. As you see from d5b7003, I've been starting to provide fixed release as I do for other languages, although in Go this is less relevant.

The other main difference is that, while I don't sign each commit, I generally sign each single tag (see https://github.com/weppos/publicsuffix-go/releases/tag/v0.2.0).

Would it be something you may want to rely upon? Eg. pull in only fixed release version, instead of linking directly to master? I'm just checking, for the sake of my curiosity.

@cpu
Copy link

cpu commented Nov 21, 2016

That's a fair point. I'll work on it today, and update the branch. Feel free to provide a patch, if you have something specific in mind.

I don't have anything specific in mind, just thought it was a worthy feature to discuss. A small note on the default encoding would probably suffice.

Would it be something you may want to rely upon? Eg. pull in only fixed release version, instead of linking directly to master? I'm just checking, for the sake of my curiosity.

I would be in favour of switching to using tagged releases instead of master. I've been slowly cleaning up our dependencies with the goal of moving more towards tagged releases instead of commits. I think it makes reasoning about the dependencies easier overall.

@weppos
Copy link
Owner Author

weppos commented Nov 21, 2016

I would be in favour of switching to using tagged releases instead of master. I've been slowly cleaning up our dependencies with the goal of moving more towards tagged releases instead of commits. I think it makes reasoning about the dependencies easier overall.

I'm glad to see we are on the same track. I'll make sure to merge and prep a new release then.

Copy link
Contributor

@jsha jsha left a comment

Choose a reason for hiding this comment

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

Looks great, thanks!

@weppos
Copy link
Owner Author

weppos commented Nov 21, 2016

I added the requested notes in the README. I think it's ready to merge (feel free to let me know if there are any typo, as I'm not native 🇺🇸 speaker).

Thanks @jsha and @cpu for comments and review.


Although the PSL list has been traditionally U-label encoded, this library follows the common industry standards and stores the rules in their A-label form. Therefore, unless explicitly mentioned, any method call, comparison or internal representation is expected to be ASCII-compatible encoded (ACE).

Passing Unicode names to the library may either result is error or unexpected behaviors.
Copy link

Choose a reason for hiding this comment

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

"may either result is error or" -> "may either result in error or"

Copy link
Owner Author

Choose a reason for hiding this comment

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

✔️

Copy link
Contributor

@jsha jsha left a comment

Choose a reason for hiding this comment

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

Still looks good to me, go ahead and merge.

@weppos weppos merged commit a0d04ff into master Nov 21, 2016
@weppos weppos deleted the idna branch November 21, 2016 18:19
@weppos weppos mentioned this pull request Nov 21, 2016
rolandshoemaker pushed a commit to letsencrypt/boulder that referenced this pull request Nov 21, 2016
This pull request updates the publicsuffix-go dependency to version 0.3.0, most notably including weppos/publicsuffix-go#40 and support for IDN TLDs.

The PA's TestWillingToIssue unit test is updated to confirm that Boulder is WillingToIssue a well formed IDN domain with an IDN TLD. Prior to c5cc328 this causes the PA unit tests to fail as expected with urn:acme:error:malformed :: Name does not end in a public suffix. After
c5cc328 everything is 💯

Per CONTRIBUTING.md the unit tests are confirmed to pass:

daniel@XXXXXX:~/go/src/github.com/weppos/publicsuffix-go$ git show -s
commit 49fe4b0e8276b314e6703300ac26940d9c090a06
Author: Simone Carletti <weppos@weppos.net>
Date:   Mon Nov 21 19:26:37 2016 +0100

    Release 0.3.0

daniel@XXXXXX:~/go/src/github.com/weppos/publicsuffix-go$ go test ./...
?   	github.com/weppos/publicsuffix-go/cmd/gen	[no test files]
?   	github.com/weppos/publicsuffix-go/cmd/load	[no test files]
ok  	github.com/weppos/publicsuffix-go/net/publicsuffix	0.007s
ok  	github.com/weppos/publicsuffix-go/publicsuffix	0.042s
:heart: :beer: and :tada:'s to @weppos for the upstream work required for this fix. We truly appreciate your volunteer work on the PSL and the publicsuffix-go library. You're the best!

This resolves #2277.
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