trafficcontrol
trafficcontrol copied to clipboard
Can update a user's username to contain spaces
I'm submitting a ...
- [X] bug report
- [ ] new feature / enhancement request
- [ ] improvement request (usability, performance, tech debt, etc.)
- [ ] other
Traffic Control components affected ...
- [ ] CDN in a Box
- [ ] Documentation
- [ ] Grove
- [ ] Traffic Control Client
- [ ] Traffic Monitor
- [ ] Traffic Ops
- [ ] Traffic Ops ORT
- [x] Traffic Portal
- [ ] Traffic Router
- [ ] Traffic Stats
- [ ] Traffic Vault
- [ ] unknown
Current behavior:
When making a PUT
request to /user/current
with the following request body:
{
"user": {
"username": "space test"
}
}
The response returned is:
HTTP/1.1 200 OK
{
"alerts": [
{
"text": "User profile was successfully updated",
"level": "success"
}
],
"response": {
"username": "space test",
.
.
}
}
Expected / new behavior:
Should not be allowed to update a username that contains spaces. Should return:
HTTP/1.1 400 Bad Request
{
"alerts": [
{
"text": "Couldn't parse request: username: cannot contain spaces",
"level": "error"
}
]
}
Minimal reproduction of the problem with instructions:
Anything else:
trying to think if a username with spaces would cause problems. is it weird? yes. does it cause real problems? not sure. so not sure whether to mark this as a bug or improvement or "works as designed".
I think you can also create a user having a username with spaces, though the TP form doesn't like it. In any case I think changing this would break compatibility with the Perl; that is, if memory serves. I can check in a day or two to be sure.
Yeah, the Perl would let you do that and you can also create users with spaces in their username. I think this is so far "works as designed".
@ocket8888 - maybe rather than closing this, it should be reopened and the "fix" is to make TP and the TO API consistent. Meaning that TP should allow spaces as well. Thoughts?
Yeah, that sounds appropriate to me.
Whoops, that PR referenced the wrong Issue. This is still open.
@ocket8888 @mitchell852 - I've included a fix for this issue in my PR #6895
Could you please review it?