-
Notifications
You must be signed in to change notification settings - Fork 0
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
Adds a local service for decorating IPs with annotations. #23
Conversation
Does not (yet) hook it up to main.
Pull Request Test Coverage Report for Build 160
💛 - Coveralls |
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 3 of 8 files at r1.
Reviewable status: complete! 1 of 1 approvals obtained (waiting on @pboothe and @stephen-soltesz)
ipservice/ipservice.go, line 8 at r1 (raw file):
// SocketFilename is a flag to allow both clients and servers to use the same command-line flag. var SocketFilename = flag.String( "ipservice.SocketFilename",
Why mixed case?
How about? -annotator.sock
?
ipservice/server.go, line 38 at r1 (raw file):
a := &annotator.ClientAnnotations{} if h.asn != nil { a.Network = h.asn.AnnotateIP(ipstring) // Should this error be ignored?
What error?
ipservice/server.go, line 41 at r1 (raw file):
} if h.geo != nil { h.geo.AnnotateIP(ip, &a.Geo) // Should this error be ignored?
Maybe just logging it for now?
ipservice/server.go, line 100 at r1 (raw file):
mux := http.NewServeMux() mux.Handle("/ip", h)
Please add a version prefix to the path. i.e. /v1/annotate
-- I suggest a different resource name so that the HTTP requests look like: /v1/annotate?ip=1.2.3.4
.
Also, all external methods now respect locking in asnannotator and geoannotator.
TODO: consider moving these methods to a wider scope if we need them elsewhere.
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: complete! 1 of 1 approvals obtained (waiting on @stephen-soltesz)
ipservice/ipservice.go, line 8 at r1 (raw file):
Previously, stephen-soltesz (Stephen Soltesz) wrote…
Why mixed case?
How about?
-annotator.sock
?
It should be named after the package. ipservice.sock
is good, though.
ipservice/server.go, line 38 at r1 (raw file):
Previously, stephen-soltesz (Stephen Soltesz) wrote…
What error?
This returns nil
on error.
ipservice/server.go, line 41 at r1 (raw file):
Previously, stephen-soltesz (Stephen Soltesz) wrote…
Maybe just logging it for now?
Will add a log.
ipservice/server.go, line 100 at r1 (raw file):
Previously, stephen-soltesz (Stephen Soltesz) wrote…
Please add a version prefix to the path. i.e.
/v1/annotate
-- I suggest a different resource name so that the HTTP requests look like:/v1/annotate?ip=1.2.3.4
.
Changed to:
/v1/annotate/ip?ip=1.2.3.4
I think the type of annotation desired should be in the URL, not simply an argument.
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.
Still -- thank you for the Geo.Missing field.
Reviewable status: complete! 1 of 1 approvals obtained
ipservice/server.go, line 100 at r1 (raw file):
Previously, pboothe (Peter Boothe) wrote…
Changed to:
/v1/annotate/ip?ip=1.2.3.4
I think the type of annotation desired should be in the URL, not simply an argument.
My thinking is that "ip" is not the annotation type. The type of object returned is a client annotation. IP is the input to generating that object. I'm satisfied with the version prefix.
|
Does not (yet) hook it up to main.
This change is