Skip to content

Commit

Permalink
The review URL was no longer being defaulted
Browse files Browse the repository at this point in the history
  • Loading branch information
smarterclayton committed Jul 14, 2017
1 parent 898f99a commit afd3120
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
5 changes: 4 additions & 1 deletion oauthproxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,9 @@ func (p *OAuthProxy) redeemCode(host, code string) (s *providers.SessionState, e

if s.Email == "" {
s.Email, err = p.provider.GetEmailAddress(s)
if err != nil {
err = fmt.Errorf("unable to update email from user info: %v", err)
}
}
return
}
Expand Down Expand Up @@ -548,7 +551,7 @@ func (p *OAuthProxy) OAuthCallback(rw http.ResponseWriter, req *http.Request) {
p.ErrorPage(rw, 403, "Permission Denied", "Invalid Account")
return
}
log.Printf("%s error redeeming code %s", remoteAddr, err)
log.Printf("error redeeming code (client:%s): %s", remoteAddr, err)
p.ErrorPage(rw, 500, "Internal Error", "Internal Error")
return
}
Expand Down
11 changes: 11 additions & 0 deletions providers/openshift/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,17 @@ func parseResources(resources string) (recordsByPath, error) {

// Complete performs final setup on the provider or returns an error.
func (p *OpenShiftProvider) Complete(data *providers.ProviderData, reviewURL *url.URL) error {
if emptyURL(reviewURL) {
if emptyURL(data.LoginURL) {
return fmt.Errorf("--openshift-review-url must be specified")
}
reviewURL = &url.URL{
Scheme: data.LoginURL.Scheme,
Host: data.LoginURL.Host,
Path: "/apis/authorization.openshift.io/v1/subjectaccessreviews",
}
}

p.ProviderData = data
p.ReviewURL = reviewURL

Expand Down

0 comments on commit afd3120

Please sign in to comment.