-
Notifications
You must be signed in to change notification settings - Fork 311
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
Remove remaining Echo usages #4921
Conversation
fb46a59
to
c869669
Compare
56db800
to
c39dc93
Compare
8a0cf8b
to
a6d4e22
Compare
4a5159e
to
e39e618
Compare
e39e618
to
f005f6d
Compare
pkg/web/oauthclient/token.go
Outdated
w.Header().Set("Content-Type", "application/json") | ||
if err := json.NewEncoder(w).Encode(struct { |
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.
Is it not necessary to do w.WriteHeader(http.StatusOK)
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.
Write
automatically does StatusOK
if no WriteHeader
has been done before. And encode calls Write
.
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.
Code-owned files LGTM with some small comments
pkg/oauth/server.go
Outdated
if _, err := w.Write(b); err != nil { | ||
webhandlers.Error(w, r, err) | ||
} |
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.
If we error on writing to w
, we won't be able to write the error either.
pkg/web/oauthclient/logout.go
Outdated
w.Header().Set("Content-Type", "application/json") | ||
if err := json.NewEncoder(w).Encode(struct { | ||
OpLogoutURI string `json:"op_logout_uri"` | ||
}{ | ||
OpLogoutURI: u.String(), | ||
}) | ||
}); err != nil { | ||
webhandlers.Error(w, r, err) | ||
return | ||
} |
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.
Perhaps we should write a webhandlers.JSON
func?
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.
LGTM and indeed, end-to-end tests would catch any critical thing.
Summary
Closes #2627
Changes
Testing
CI.
Regressions
This is tricky and touches lots of components. But if CI passes we are good to go.
Notes for Reviewers
@htdvisser main reviewer
@bafonins / @kschiffer please throw a quick eye if I accidentally broke existing behavior for the UI, albeit I expect the end to end tests to cover this
@johanstokking / @michalborkowski96 no need to review.
Checklist
README.md
for the chosen target branch.CHANGELOG.md
.CONTRIBUTING.md
, there are no fixup commits left.