You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@allura.apache.org by Dave Brondsema <da...@brondsema.net> on 2015/07/09 19:29:02 UTC

[allura:tickets] #7916 Error when handling user-profile URLs of users with invalid names.



---

** [tickets:#7916] Error when handling user-profile URLs of users with invalid names.**

**Status:** in-progress
**Milestone:** unreleased
**Labels:** sf-current sf-2 
**Created:** Thu Jul 09, 2015 05:28 PM UTC by Dave Brondsema
**Last Updated:** Thu Jul 09, 2015 05:28 PM UTC
**Owner:** Dave Brondsema

Some users have usernames that aren't valid as project shortnames (old historical usernames probably).  For these users, the Auth Provider can provide an alternate user-project name for that user.  When this happens, and you go to the URL using the invalid name like `/u/foo_bar/` then you can get errors like this:

~~~~
File '/allura/Allura/allura/controllers/project.py', line 111 in _lookup
  user=user, user_project=True)
File '/allura/Allura/allura/model/neighborhood.py', line 129 in register_project
  self, shortname, project_name, user or getattr(c, 'user', None), user_project, private_project, apps)
File '/allura/Allura/allura/lib/plugin.py', line 785 in register_project
  project_name, user, user_project, private_project)
File '/allura/Allura/allura/lib/plugin.py', line 828 in validate_project
  '%s already exists in nbhd %s' % (shortname, neighborhood._id))
ProjectConflict: u/foo-bar already exists in nbhd 559d5efa5421060005224016
~~~~


---

Sent from forge-allura.apache.org because dev@allura.apache.org is subscribed to https://forge-allura.apache.org/p/allura/tickets/

To unsubscribe from further messages, a project admin can change settings at https://forge-allura.apache.org/p/allura/admin/tickets/options.  Or, if this is a mailing list, you can unsubscribe from the mailing list.

[allura:tickets] #7916 Error when handling user-profile URLs of users with invalid names.

Posted by Igor Bondarenko <je...@gmail.com>.
- **Reviewer**: Igor Bondarenko



---

** [tickets:#7916] Error when handling user-profile URLs of users with invalid names.**

**Status:** review
**Milestone:** unreleased
**Labels:** sf-current sf-2 
**Created:** Thu Jul 09, 2015 05:28 PM UTC by Dave Brondsema
**Last Updated:** Thu Jul 09, 2015 07:23 PM UTC
**Owner:** Dave Brondsema

Some users have usernames that aren't valid as project shortnames (old historical usernames probably).  For these users, the Auth Provider can provide an alternate user-project name for that user.  When this happens, and you go to the URL using the invalid name like `/u/foo_bar/` then you can get errors like this:

~~~~
File '/allura/Allura/allura/controllers/project.py', line 111 in _lookup
  user=user, user_project=True)
File '/allura/Allura/allura/model/neighborhood.py', line 129 in register_project
  self, shortname, project_name, user or getattr(c, 'user', None), user_project, private_project, apps)
File '/allura/Allura/allura/lib/plugin.py', line 785 in register_project
  project_name, user, user_project, private_project)
File '/allura/Allura/allura/lib/plugin.py', line 828 in validate_project
  '%s already exists in nbhd %s' % (shortname, neighborhood._id))
ProjectConflict: u/foo-bar already exists in nbhd 559d5efa5421060005224016
~~~~


---

Sent from forge-allura.apache.org because dev@allura.apache.org is subscribed to https://forge-allura.apache.org/p/allura/tickets/

To unsubscribe from further messages, a project admin can change settings at https://forge-allura.apache.org/p/allura/admin/tickets/options.  Or, if this is a mailing list, you can unsubscribe from the mailing list.

[allura:tickets] #7916 Error when handling user-profile URLs of users with invalid names.

Posted by Dave Brondsema <da...@brondsema.net>.
- **status**: in-progress --> review
- **Comment**:

db/7916

To test with local provider:

* add `_` to a valid char in `re_project_name` in `helpers.py`
* register a user with `_` in username
* change `re_project_name` back
* log in
* go to `/u/user_name` and see that it redirs to `/u/user-name`
    * (that ends up 404ing, see explanation in test code)

Similar test can be done with SF's provider and the final result works.



---

** [tickets:#7916] Error when handling user-profile URLs of users with invalid names.**

**Status:** review
**Milestone:** unreleased
**Labels:** sf-current sf-2 
**Created:** Thu Jul 09, 2015 05:28 PM UTC by Dave Brondsema
**Last Updated:** Thu Jul 09, 2015 05:29 PM UTC
**Owner:** Dave Brondsema

Some users have usernames that aren't valid as project shortnames (old historical usernames probably).  For these users, the Auth Provider can provide an alternate user-project name for that user.  When this happens, and you go to the URL using the invalid name like `/u/foo_bar/` then you can get errors like this:

~~~~
File '/allura/Allura/allura/controllers/project.py', line 111 in _lookup
  user=user, user_project=True)
File '/allura/Allura/allura/model/neighborhood.py', line 129 in register_project
  self, shortname, project_name, user or getattr(c, 'user', None), user_project, private_project, apps)
File '/allura/Allura/allura/lib/plugin.py', line 785 in register_project
  project_name, user, user_project, private_project)
File '/allura/Allura/allura/lib/plugin.py', line 828 in validate_project
  '%s already exists in nbhd %s' % (shortname, neighborhood._id))
ProjectConflict: u/foo-bar already exists in nbhd 559d5efa5421060005224016
~~~~


---

Sent from forge-allura.apache.org because dev@allura.apache.org is subscribed to https://forge-allura.apache.org/p/allura/tickets/

To unsubscribe from further messages, a project admin can change settings at https://forge-allura.apache.org/p/allura/admin/tickets/options.  Or, if this is a mailing list, you can unsubscribe from the mailing list.

[allura:tickets] #7916 Error when handling user-profile URLs of users with invalid names.

Posted by Igor Bondarenko <je...@gmail.com>.
- **status**: review --> closed
- **Comment**:

Tested with both providers and it works good! SF's provider even does not 404 :) Merged.



---

** [tickets:#7916] Error when handling user-profile URLs of users with invalid names.**

**Status:** closed
**Milestone:** unreleased
**Labels:** sf-current sf-2 
**Created:** Thu Jul 09, 2015 05:28 PM UTC by Dave Brondsema
**Last Updated:** Fri Jul 10, 2015 11:13 AM UTC
**Owner:** Dave Brondsema

Some users have usernames that aren't valid as project shortnames (old historical usernames probably).  For these users, the Auth Provider can provide an alternate user-project name for that user.  When this happens, and you go to the URL using the invalid name like `/u/foo_bar/` then you can get errors like this:

~~~~
File '/allura/Allura/allura/controllers/project.py', line 111 in _lookup
  user=user, user_project=True)
File '/allura/Allura/allura/model/neighborhood.py', line 129 in register_project
  self, shortname, project_name, user or getattr(c, 'user', None), user_project, private_project, apps)
File '/allura/Allura/allura/lib/plugin.py', line 785 in register_project
  project_name, user, user_project, private_project)
File '/allura/Allura/allura/lib/plugin.py', line 828 in validate_project
  '%s already exists in nbhd %s' % (shortname, neighborhood._id))
ProjectConflict: u/foo-bar already exists in nbhd 559d5efa5421060005224016
~~~~


---

Sent from forge-allura.apache.org because dev@allura.apache.org is subscribed to https://forge-allura.apache.org/p/allura/tickets/

To unsubscribe from further messages, a project admin can change settings at https://forge-allura.apache.org/p/allura/admin/tickets/options.  Or, if this is a mailing list, you can unsubscribe from the mailing list.

[allura:tickets] #7916 Error when handling user-profile URLs of users with invalid names.

Posted by Dave Brondsema <da...@brondsema.net>.
- **labels**: sf-current, sf-2 --> sf-2



---

** [tickets:#7916] Error when handling user-profile URLs of users with invalid names.**

**Status:** closed
**Milestone:** unreleased
**Labels:** sf-2 
**Created:** Thu Jul 09, 2015 05:28 PM UTC by Dave Brondsema
**Last Updated:** Fri Jul 10, 2015 11:53 AM UTC
**Owner:** Dave Brondsema

Some users have usernames that aren't valid as project shortnames (old historical usernames probably).  For these users, the Auth Provider can provide an alternate user-project name for that user.  When this happens, and you go to the URL using the invalid name like `/u/foo_bar/` then you can get errors like this:

~~~~
File '/allura/Allura/allura/controllers/project.py', line 111 in _lookup
  user=user, user_project=True)
File '/allura/Allura/allura/model/neighborhood.py', line 129 in register_project
  self, shortname, project_name, user or getattr(c, 'user', None), user_project, private_project, apps)
File '/allura/Allura/allura/lib/plugin.py', line 785 in register_project
  project_name, user, user_project, private_project)
File '/allura/Allura/allura/lib/plugin.py', line 828 in validate_project
  '%s already exists in nbhd %s' % (shortname, neighborhood._id))
ProjectConflict: u/foo-bar already exists in nbhd 559d5efa5421060005224016
~~~~


---

Sent from forge-allura.apache.org because dev@allura.apache.org is subscribed to https://forge-allura.apache.org/p/allura/tickets/

To unsubscribe from further messages, a project admin can change settings at https://forge-allura.apache.org/p/allura/admin/tickets/options.  Or, if this is a mailing list, you can unsubscribe from the mailing list.