-
Notifications
You must be signed in to change notification settings - Fork 6
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
Prep for OSS #3
Prep for OSS #3
Conversation
Stage the code here assuming that we're going to move it to the Connect Github organization.
Amend the Makefile to automatically (re-)generate code as part of the build.
Clarify some GoDoc, removing a reference to the now-deleted Interceptor type.
We don't use these GHA in the Connect project.
As much as possible, focus the GoDoc examples on the actual authentication logic: lead with the AuthFunc, and factor as much of the TLS setup as possible into helper functions. Eventually, it would be nice to use memhttp here - especially if we bake in helpers for mTLS.
Add accessors for the standard library's cookie methods. IMO, there's not enough here to warrant testing - we'd just be exercising net/http.
In the README, make the AuthFunc even more prominent. Also, reformat to two spaces instead of tabs (so Github's UI is less likely to scroll horizontally).
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.
Looks good!
authn.go
Outdated
// wrapped handler without authentication. | ||
// arbitrary information about the authenticated identity to the context. Any | ||
// non-RPC requests (as determined by their Content-Type) are forwarded | ||
// directly to the wrapped handler without authentication. |
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.
We should maybe revisit this. It might be surprising to users that authentication is not invoked on non RPC methods and could be an attack vector if users can devise a way to fool the classifier for the authenticator but for connect-go to still accept it in the handler.
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.
Actually I think this will fail for all GET requests as Content-Type doesn't have to be present 😟
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.
Hm, that's a good point 😮 I'll change this!
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.
Ill fix up errorWriter to classify gets if the header or url string is present.
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.
Co-authored-by: Edward McFarlane <[email protected]>
Even in examples, use `crypto/subtle` to minimize attack surface. Along the way, fix the places where I confused the Aladdin and Ali Baba stories.
This PR prepares this repository for a move to the Connect Github organization
and a public release. Most of the commits are cleanups and preparation for the
move, but a few were more substantive (most importantly, we weren't generating
code as part of the build process).
Best reviewed commit-by-commit.