-
Notifications
You must be signed in to change notification settings - Fork 62
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
Fix url encoding handling for code parameter. #206
Conversation
Signed-off-by: Jianfei Hu <hujianfei258@gmail.com>
@incfly: GitHub didn't allow me to request PR reviews from the following users: vikaschoudhary16. Note that only istio-ecosystem members and repo collaborators can review this PR, and authors cannot review their own PRs. In response to this: Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
// https://developers.google.com/identity/protocols/oauth2/openid-connect#sendauthrequest | ||
// [2] https://datatracker.ietf.org/doc/html/rfc6749#appendix-A.11. | ||
// [3] https://www.rfc-editor.org/rfc/rfc3986#page-12 | ||
bool IsOIDCCodeSafeCharacter(const char character) { |
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.
I think that http.cc
should be independent from filter implementation. It seems this rule is OIDC specific. Thus we should move this to oidc_filter.cc
or new file such as oidc_query_decoder.cc
and pass it to Http::DecodeQueryData
. For example, I prefer to implement that as follows:
class UrlQueryDecoder {
virtual absl::string_view decode(absl::string_view) = 0;
};
class OidcUrlQueryDecoder : public UrlQueryDecoder {
// implement...
};
But, we should prioritize to fix this problem, Therefore we should postpone this refactor as TODO.
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.
Add a TODO.
I think putting out of http lib is fine (this is not filter lib, but http, btw). but I'm not sure if we have to setup class/inheritance, especially if there's only one method, without actual state to maintain.
Pure util function seems work well and clear.
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.
ping, is that sufficient for now? @Shikugawa
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.
Yes. SGTM.
Accommodating just one character, |
Signed-off-by: Jianfei Hu <hujianfei258@gmail.com>
There's actually only a few char to be considred. |
sounds good! |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: incfly, Shikugawa The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Signed-off-by: Jianfei Hu hujianfei258@gmail.com
Fix #205