Skip to content
This repository has been archived by the owner on Jul 23, 2020. It is now read-only.

Can't see any space if username contains "+" #1001

Closed
alexeykazakov opened this issue Sep 21, 2017 · 8 comments · Fixed by fabric8-ui/fabric8-ui#2803
Closed

Can't see any space if username contains "+" #1001

alexeykazakov opened this issue Sep 21, 2017 · 8 comments · Fixed by fabric8-ui/fabric8-ui#2803

Comments

@alexeykazakov
Copy link
Member

If username contains some characters that have to be encoded to be used in URL then UI is just failing apart.
For example if username is something like username+1@gmail.com then you can't even see the user's spaces. Profile page fails too. Some old accounts can have + in gmail usernames. Plus new users may have username+N@redhat.com too.
The problem is that UI doesn't encode usernames when calling backend. For example it calls https://api.openshift.io/api/namedspaces/username+1@redhat.com instead of https://api.openshift.io/api/namedspaces/username%2B1%40redhat.com

@alexeykazakov
Copy link
Member Author

Removed auth area because it's not really auth. There is nothing wrong with the username. It's matter of correct using of usernames in URLs.

@dgutride
Copy link
Collaborator

dgutride commented Dec 1, 2017

Created a new account with dgutride+1 and this is not reproducible. Moving to closed.

@dgutride dgutride closed this as completed Dec 1, 2017
@alexeykazakov
Copy link
Member Author

I updated the test account so now it has + in the name for real this time :) Reopening for re-testing.

@stooke
Copy link
Collaborator

stooke commented Mar 28, 2018

The real solution would have been to pass the user UUID everywhere, and only use the user name for display. The same holds for space names, app names, etc. (this approach also gets rids of issues like length limitations on k8s space names).

As far as I can tell, encodeURIComponent is used very sparingly throughout fabric8-ui, so it's highly probable this issue still exists.

@joshuawilson
Copy link
Member

What is the status on this?

@stooke
Copy link
Collaborator

stooke commented Apr 25, 2018

We've made some fixes in the UI* to properly URL encode usernames - actually, it should be part of a larger reqork to do that same for any user-entered name (space names, etc). There are almost certainly places where the UI doesn't encode names.

*There is a PR in the UI fabric8-ui/ngx-fabric8-wit#174 awaiting a second review from @joshuawilson. It will not fix all the issues.

@joshuawilson
Copy link
Member

@stooke I've merged that PR. Once that change makes it to Prod do you think we can downgrade this issue?

@stooke
Copy link
Collaborator

stooke commented Apr 25, 2018

Absolutely. The real fix is an architectural change - OSIO keeps being bit by it (space names too long, weird characters, no internationalization, etc), but the band-aid (which this is) is only required if OpenShift names have '+' in them, which I think is not currently allowed any more. We might want to revisit this even for a more complete band-aid later.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants