-
Notifications
You must be signed in to change notification settings - Fork 141
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 special characters in MIQ_GROUP header #287
Conversation
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.
Would like @abellotti to review
After discussion with @AllenBW and @imtayadeway - we think that the SUI does not need this header at all, because they now are able to change the current group via |
@jntullo Based on your comment, do you think we still need this change to the API? |
@gtanzillo I am not sure. If we decide to keep this header available in the API as a way to authenticate against a different group than the user's However, I'm not sure that this header is even needed anymore. Users are now able to change their current group ("action": "set_current_group"), and it seems to make more sense that they are authenticated against their current group, not the one specified in the headers. I'll start a discussion in the API gitter room. I will remove the BZ reference from the commit, though, as I believe the SUI approach is the better solution to that particular bug. |
Yes, we still need to fix this and keep supporting the header. |
@abellotti pushed up another commit that may be a better approach. Perhaps we should require that the header be properly encoded. I tested by properly escaping the header like so:
and it works as expected. cc: @imtayadeway |
Agree. If we must keep compatibility with the current behavior, we shouldn't be trying to work around clients sending non-ASCII characters. |
Thanks @jntullo for fixing this. Will merge when 🍏 |
With the MIQ_GROUP header properly escaped, special characters in group descriptions will now be able to be specified. unescape the group name
Checked commit jntullo@2fcc33b with ruby 2.3.3, rubocop 0.52.0, haml-lint 0.20.0, and yamllint 1.10.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.
🎉 Thanks @jntullo !
Fix special characters in MIQ_GROUP header (cherry picked from commit e89fc56) https://bugzilla.redhat.com/show_bug.cgi?id=1536047
Gaprindashvili backport details:
|
Non-ASCII characters are not permitted in headers. In our case, we have an
X_MIQ_GROUP
header that specifies the group description. Our group descriptions allow special characters (as in the caseSR-APP-EPM-Membre-équipe
, which poses an interesting dilemma.Headers with special characters get encoded incorrectly (ie,
SR-APP-EPM-Membre-\xE9quipe
), causing the following error, which does not allow the SUI to proceed with login if the user's current group contains a special character:Gif to demonstrate before behavior (pretty uneventful):

This fix properly encodes it back into UTF8, however, I am on the fence on whether we should allow this, or if group description validation should be changed to not allow special characters (although, may be difficult because groups already exist with special characters).
The following gif demonstrates login working successfully with a user that belongs to a group with a special character:
Thoughts? @imtayadeway @abellotti @gtanzillo
cc: @AllenBW @yrudman
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1531626#c9
@miq-bot add_label bug, blocker, gaprindashvili/yes