Bug 677405 - creation of a person consumer is failing when username contains a @ character
Summary: creation of a person consumer is failing when username contains a @ character
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Candlepin
Classification: Community
Component: candlepin
Version: 0.5
Hardware: Unspecified
OS: Unspecified
unspecified
urgent
Target Milestone: ---
: ---
Assignee: Bryan Kearney
QA Contact: John Sefler
URL:
Whiteboard:
Depends On:
Blocks: 568421
TreeView+ depends on / blocked
 
Reported: 2011-02-14 16:54 UTC by John Sefler
Modified: 2015-05-14 15:22 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2012-05-30 20:44:10 UTC
Embargoed:


Attachments (Terms of Use)

Description John Sefler 2011-02-14 16:54:58 UTC
Description of problem:
Caught this bug in production...
After creating a valid single sign-on username created at https://www.redhat.com/wapps/sso/login.html with a login of the form user, we navigated through the entitlement beta enrolment app and went to kingpin to "Create a person consumer".  Upon clicking the create person consumer we got a 500 error.  It appears that the 500 was caused by candlepin using the user's login (user) which contains an @ character that candlepin rejected.  Candlepin uses the login name as the value for --name when registering the person consumer.

Referencing https://bugzilla.redhat.com/show_bug.cgi?id=672233 which was implemented to restrict the acceptable name characters to Alphanumeric, period, dash, and underscore.

Also referencing: https://bugzilla.redhat.com/show_bug.cgi?id=661130

Important: it appears that this issue requires that candlepin must now tolerate at least all valid Red Hat login characters in register --name option.


Version-Release number of selected component (if applicable):
# curl -k  -u foo:bar --request GET https://subscription.rhn.redhat.com:443/subscription/status 
{"version":"0.1.35","result":true,"release":"1%{?dist}"}

How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 1 John Sefler 2011-02-14 16:59:59 UTC
Note from msechrest on login character restrictions in Red Hat login usernames:

<msechrest> zeus, jsefler, bkearney: Login cannot contain the following special characters (") ($) (^) (<) (>) (|) (+) (%) (/) (;) (:) (,) (\) (*) (=) (~)
<msechrest> Anything else is valid.

Comment 2 John Sefler 2011-02-15 15:22:36 UTC
Note to development... remember when increasing the space of tolerable name characters, you will also need to update the user feedback message:

# subscription-manager register --username=mylogin --name foo@#bar --password=redhat
System name must consist of only alphanumeric characters, periods, dashes and underscores.

^^^ That message must also reflect the new tolerable characters

Comment 3 Jesus M. Rodriguez 2011-02-16 16:00:36 UTC
What if I change the message to read:

System name cannot contain the following special characters (") ($) (^) (<) (>) (|) (+) (%) (/) (;) (:) (,) (\) (*) (=) (~).

thoughts?

Comment 4 Jesus M. Rodriguez 2011-02-16 16:13:17 UTC
message changed to: 
System name cannot contain most special characters.

Comment 5 John Sefler 2011-02-23 16:37:17 UTC
Testing against the candlepin master branch (0.2.X)....

[root@jsefler-onprem03 ~]# grep hostname /etc/rhsm/rhsm.conf
# Server hostname:
hostname=jsefler-f14-candlepin.usersys.redhat.com
proxy_hostname=
[root@jsefler-onprem03 ~]# curl -u foo:bar -k https://jsefler-f14-candlepin.usersys.redhat.com:8443/candlepin/status
{"version":"0.2.6","result":true,"release":"1%{?dist}"}

[root@jsefler-onprem03 ~]# subscription-manager register --username=testuser1 --password=password --force --name="shadowman-(){}[]9?"
fff154c7-c19c-449b-8f33-4eae189ca342 shadowman-(){}[]9?

^^^ PASSED... the @ character as well as some other new characters are now accepted name characters

[root@jsefler-onprem03 ~]# subscription-manager register --username=testuser1 --password=password --force --name='(") ($) (^) (<) (>) (|) (+) (%) (/) (;) (:) (,) (\) (*) (=) (~)'
The system with UUID 5919e514-5606-436b-be94-bb7792316857 has been unregistered
System name cannot contain most special characters.

^^^ PASSED... this generic message blocks me from using an invalid character, but which one(s)?

Comment 6 John Sefler 2011-02-23 16:39:00 UTC
Testing against the candlepin BETA branch (0.1.X)....

[root@jsefler-onprem01 ~]# grep hostname /etc/rhsm/rhsm.conf
# Server hostname:
hostname=jsefler-f12-candlepin.usersys.redhat.com
proxy_hostname=
[root@jsefler-onprem01 ~]# curl -u foo:bar -k https://jsefler-f12-candlepin.usersys.redhat.com:8443/candlepin/status 
{
  "version" : "0.1.38",
  "result" : true,
  "release" : "1%{?dist}"
}

[root@jsefler-onprem01 ~]# subscription-manager register --username=testuser1 --password=password --force --name="shadowman-(){}[]9?"
f1f8c750-5c3b-4b1d-ba03-c78314988e2c shadowman-(){}[]9?

^^^ PASSED... the @ character as well as some other new characters are now accepted name characters

[root@jsefler-onprem01 ~]# subscription-manager register --username=testuser1 --password=password --force --name='(") ($) (^) (<) (>) (|) (+) (%) (/) (;) (:) (,) (\) (*) (=) (~)'
The system with UUID bb28437f-d3bb-41d7-ab5f-818824ef9fc6 has been unregistered
System name must consist of only alphanumeric characters, periods, dashes and underscores.

^^^ FAILED...  looks like message from comment #4 was not yet updated on the BETA branch

Comment 7 John Sefler 2011-02-23 16:39:21 UTC
Moving bug back to ASSIGNED for comment #4 to be included in candlepin BETA branch

Comment 8 Bryan Kearney 2011-02-23 20:36:20 UTC
it is available in the tip of BETA now. commit bbef85fc641dd1ec1a6fcb3527ad20108fe802f3

Comment 9 John Sefler 2011-02-23 22:42:15 UTC
[root@jsefler-f12-candlepin candlepin]# git branch
  ALPHA
* BETA
  master
[root@jsefler-f12-candlepin candlepin]# git show-ref BETA
bbef85fc641dd1ec1a6fcb3527ad20108fe802f3 refs/heads/BETA
3b0042c82f8277ef3cc1e81771b0c19181721fa7 refs/remotes/origin/BETA

[root@jsefler-onprem01 ~]# curl -u foo:bar -k https://jsefler-f12-candlepin.usersys.redhat.com:8443/candlepin/status 
{
  "version" : "0.1.38",
  "result" : true,
  "release" : "1%{?dist}"
}

[root@jsefler-onprem01 ~]# subscription-manager register --username=testuser1 --password=password --force --name='(") ($) (^) (<) (>) (|) (+) (%) (/) (;) (:) (,) (\) (*) (=) (~)'
System name cannot contain most special characters.

^^^ PASSED... this generic message blocks me from using an invalid character,
but which one(s)?


Moving bug to VERIFIED

Comment 10 John Sefler 2011-05-04 14:41:05 UTC
Group move of VERIFIED Candlepin component bugs to RELEASE_PENDING


Note You need to log in before you can comment on or make changes to this bug.