-
Notifications
You must be signed in to change notification settings - Fork 81
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
Add support for PKCE #136
Add support for PKCE #136
Conversation
andyrzhao
commented
Jun 30, 2022
- Adds PKCE params to fetch code-path, using helper function from pkce.go.
- Updates go mod version to 1.16 since the latest version of oauth2 core lib has a dependency on 1.16 API. Update vendors.
- Ensure hostname is fully specified (i.e. localhost:8080 instead of :8080) in cli_test.go and loopback.go, to avoid a MacOS security pop-up.
@@ -309,10 +309,10 @@ func getListener(address string) (listener *net.Listener, serverAddress string, | |||
|
|||
if match == "" { // Case: No given port provided for localhost | |||
// Creating a listener on the next available port | |||
l, err = net.Listen("tcp", ":0") | |||
l, err = net.Listen("tcp", "localhost:0") |
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.
Good observation. From the documentation it looks like they do not recommend having a hostname. The documentation can be found here: https://pkg.go.dev/net#Listener. In short, this is what it says:
The address can use a host name, but this is not recommended, because it will create a listener for at most one of the host's IP addresses.
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.
Thanks for the suggestions. I reviewed the official documentation and feel like the recommendation does not explicitly discourage localhost, but rather discourage a hard-coded fqdn, which may vary depending on where the code is deployed. So this should not be an issue for our use-case.
} else { // Case: Port provided for localhost | ||
// Creating a listener on the provided port | ||
l, err = net.Listen("tcp", strings.Replace(match, "localhost", "", 1)) |
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.
Thanks for looking into this. Maybe the same (please see comment above) can be applied here.
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.
Hi Andy, thanks for making these many changes. I put a few comments for you to consider. Thanks again!
LGTM |