jerrypeng commented on a change in pull request #635:
URL: https://github.com/apache/pulsar-client-go/pull/635#discussion_r724459978
##########
File path: oauth2/oidc_endpoint_provider.go
##########
@@ -36,10 +36,16 @@ type OIDCWellKnownEndpoints struct {
// GetOIDCWellKnownEndpointsFromIssuerURL gets the well known endpoints for the
// passed in issuer url
func GetOIDCWellKnownEndpointsFromIssuerURL(issuerURL string)
(*OIDCWellKnownEndpoints, error) {
+ if issuerURL == "" {
+ return nil, errors.New("required: issuer url")
+ }
u, err := url.Parse(issuerURL)
if err != nil {
return nil, errors.Wrap(err, "could not parse issuer url to
build well known endpoints")
}
+ if !u.IsAbs() {
+ return nil, errors.New("invalid: issuer url")
Review comment:
I agree with @cckellogg. It would be easier to debug if the incorrect
url is logged. Logging the url in the error message also doesn't seem that
much additional work
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]