-
Notifications
You must be signed in to change notification settings - Fork 40k
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 leading * in ingress hostname #29204
Allow leading * in ingress hostname #29204
Conversation
Can one of the admins verify that this patch is reasonable to test? If so, please reply "ok to test". This message may repeat a few times in short succession due to jenkinsci/ghprb-plugin#292. Sorry. Otherwise, if this message is too spammy, please complain to ixdy. |
4 similar comments
Can one of the admins verify that this patch is reasonable to test? If so, please reply "ok to test". This message may repeat a few times in short succession due to jenkinsci/ghprb-plugin#292. Sorry. Otherwise, if this message is too spammy, please complain to ixdy. |
Can one of the admins verify that this patch is reasonable to test? If so, please reply "ok to test". This message may repeat a few times in short succession due to jenkinsci/ghprb-plugin#292. Sorry. Otherwise, if this message is too spammy, please complain to ixdy. |
Can one of the admins verify that this patch is reasonable to test? If so, please reply "ok to test". This message may repeat a few times in short succession due to jenkinsci/ghprb-plugin#292. Sorry. Otherwise, if this message is too spammy, please complain to ixdy. |
Can one of the admins verify that this patch is reasonable to test? If so, please reply "ok to test". This message may repeat a few times in short succession due to jenkinsci/ghprb-plugin#292. Sorry. Otherwise, if this message is too spammy, please complain to ixdy. |
var wildcardDNS1123SubdomainRegexp = regexp.MustCompile("^\\*\\." + dns1123SubdomainFmt + "$") | ||
|
||
// IsWildcardDNS1123Subdomain tests for a string that conforms to the definition of a | ||
// wildcard subdomain in DNS (RFC 1034) and (RFC 1123). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does the rfc specific the exact regex we're using, or is it an approximation of what we translate the rfc to mean?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think is clear about the leading * https://tools.ietf.org/html/rfc1034#section-4.3.3
Looks good overall, just some nits |
b276b8f
to
77139c4
Compare
LGTM thanks |
ok to test |
77139c4
to
d5ec799
Compare
@@ -139,6 +139,24 @@ func IsDNS1035Label(value string) []string { | |||
return errs | |||
} | |||
|
|||
// wildcard definition - RFC 1034 section 4.3.3. | |||
const wildcardDNF1123SubdomainFmt = "\\*\\." + dns1123SubdomainFmt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you clarify this regex with some examples in the comment?
According to https://tools.ietf.org/html/rfc2818#section-3.1, f*.com matches foo.com but not bar.com
, but this regex will fail f*.com
right? Also https://tools.ietf.org/html/rfc6125#section-6.4.3 states that only the leftmost label will tolerate a *
, which I believe this regex handles. Users on slack noticed that the go library was recently modified to accomodate this (golang/go@e7fae68).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
I also added tests for IsWildcardDNS1123Subdomain
d5ec799
to
52073a5
Compare
// IsWildcardDNS1123Subdomain tests for a string that conforms to the definition of a | ||
// wildcard subdomain in DNS (RFC 1034 section 4.3.3). | ||
func IsWildcardDNS1123Subdomain(value string) []string { | ||
wildcardDNS1123SubdomainRegexp := regexp.MustCompile("^\\*\\." + dns1123SubdomainFmt + "$") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
did i miss your change? this will still reject "f*.com" right? https://play.golang.org/p/rVxw0LEFx1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes
validation_test.go:428: expected errors for "f*.com": [must match the regex \*\.[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)* (e.g. '*.example.com')]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
was looking at the wrong rfc, yeah f*.com is invalid.
Just the nit. Your test failure looks like a flake but repushing will force a retest. Suggesting reporting on an existing issue, if one is found:
|
52073a5
to
317874d
Compare
317874d
to
60f4fbf
Compare
GCE e2e build/test passed for commit 60f4fbf. |
Automatic merge from submit-queue |
fixes #29043