-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Issue: 2926 whitelist by hostname #2953
Conversation
dgraph/cmd/alpha/run.go
Outdated
rangeHi := make(net.IP, len(rangeLo)) | ||
copy(rangeHi, rangeLo) | ||
for i := 1; i <= maskLen; i++ { | ||
rangeHi[addrLen - i] |= ^network.Mask[maskLen - i] |
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.
File is not goimports
-ed (from goimports
)
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.
Reviewed 2 of 2 files at r2.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @codexnull, @golangcibot, and @srfrog)
dgraph/cmd/alpha/run.go, line 231 at r2 (raw file):
rangeLo := net.ParseIP(tuple[0]) rangeHi := net.ParseIP(tuple[1]) if rangeLo == nil {
@srfrog would do a switch case here. Looks nicer as well.
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.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @golangcibot and @manishrjain)
dgraph/cmd/alpha/run.go, line 231 at r2 (raw file):
Previously, manishrjain (Manish R Jain) wrote…
@srfrog would do a switch case here. Looks nicer as well.
yes, if more than one else
case, i'd use a switch.
https://golang.org/doc/effective_go.html#switch
Changes: * Add support for whitelisting by * hostname * single IP address * CIDR block * IPv6 * Add IP string parsing test.
Fixes #2926. In addition to addrLo:addrHi ranges, support whitelisting by
This change is