Description of problem: If you try to register a system with a consumer name that includes a ',' char or a '#' char, candlepin rejects the name, It looks like it is related to what is an acceptable name for the Altername section of the consumer cert. Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: 1. 2. 3. Actual results: Expected results: Additional info:
Consumer names are now limited to: alphanumeric, period, dash, underscore Names are also limited to 250 characters max.
Verifying candlepin version (0.1.32).... [root@jsefler-dev2-1 ~]# curl -k -u foo:bar --request GET https://candlepin1.devlab.phx1.redhat.com:443/candlepin/status | python -mjson.tool % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 56 0 56 0 0 103 0 --:--:-- --:--:-- --:--:-- 666 { "release": "1%{?dist}", "result": true, "version": "0.1.32" } [root@jsefler-dev2-1 ~]# subscription-manager register --username=xeops --password=redhat --force --name=periods.dashes-underscores_alphanumeric123 The system with UUID ba2c99e6-7a7e-4302-833a-77184ac95513 has been unregistered d9b00b6d-b668-47f9-a017-69a4c71b42f2 periods.dashes-underscores_alphanumeric123 [root@jsefler-dev2-1 ~]# subscription-manager identity Current identity is: d9b00b6d-b668-47f9-a017-69a4c71b42f2 name: periods.dashes-underscores_alphanumeric123 ^^^ VERIFIED SUCCESS AS EXPECTED [root@jsefler-dev2-1 ~]# subscription-manager register --username=xeops --password=redhat --force --name=a! System name must consist of only alphanumeric characters, periods, dashes and underscores. [root@jsefler-dev2-1 ~]# subscription-manager register --username=xeops --password=redhat --force --name=a@ System name must consist of only alphanumeric characters, periods, dashes and underscores. [root@jsefler-dev2-1 ~]# subscription-manager register --username=xeops --password=redhat --force --name=a# System name must consist of only alphanumeric characters, periods, dashes and underscores. [root@jsefler-dev2-1 ~]# subscription-manager register --username=xeops --password=redhat --force --name=a, System name must consist of only alphanumeric characters, periods, dashes and underscores. [root@jsefler-dev2-1 ~]# subscription-manager register --username=xeops --password=redhat --force --name=a* System name must consist of only alphanumeric characters, periods, dashes and underscores. [root@jsefler-dev2-1 ~]# subscription-manager register --username=xeops --password=redhat --force --name=a= System name must consist of only alphanumeric characters, periods, dashes and underscores. [root@jsefler-dev2-1 ~]# subscription-manager register --username=xeops --password=redhat --force --name="&" System name must consist of only alphanumeric characters, periods, dashes and underscores. [root@jsefler-dev2-1 ~]# subscription-manager register --username=xeops --password=redhat --force --name=? System name must consist of only alphanumeric characters, periods, dashes and underscores. [root@jsefler-dev2-1 ~]# subscription-manager register --username=xeops --password=redhat --force --name="|" System name must consist of only alphanumeric characters, periods, dashes and underscores. ^^^ REGISTER WITH INVALID CHARACTERS IN THE NAME WAS BLOCKED AS EXPECTED [root@jsefler-dev2-1 ~]# subscription-manager register --username=xeops --password=redhat --force --name=123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 97f41ef3-2036-4c9d-b7df-d78df8d9b05e 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 ^^^ REGISTER WITH A NAME OF 249 CHARACTERS WAS A SUCCESS AS EXPECTED [root@jsefler-dev2-1 ~]# subscription-manager register --username=xeops --password=redhat --force --name=1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 The system with UUID 97f41ef3-2036-4c9d-b7df-d78df8d9b05e has been unregistered Name of the consumer should be shorter than 250 characters ^^^ REGISTER WITH A NAME OF 250 CHARACTERS WAS BLOCKED AS EXPECTED moving to VERIFIED
Name of the consumer should be shorter than 250 characters ^ MISSING PERIOD
Created attachment 475882 [details] verified 250 char limit name test through the gui
Created attachment 475884 [details] verified invalid chars test through the gui
Period has been added. Was that the only issue so far?
Yes - your implementation for the character limitations for consumer names looks good. The tests in comment #2 all passed and I've already built some automated tests around this for our nightly test runs.
[root@jsefler-f12-candlepin candlepin]# git show-ref BETA 3b0042c82f8277ef3cc1e81771b0c19181721fa7 refs/heads/BETA d32f011d86b900370d80ddb5518f584689044b87 refs/remotes/origin/BETA [root@jsefler-onprem01 ~]# grep hostname= /etc/rhsm/rhsm.conf hostname=jsefler-f12-candlepin.usersys.redhat.com [root@jsefler-onprem01 ~]# subscription-manager register --username=testuser1 --password=password --force --name=1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 Name of the consumer should be shorter than 250 characters. ^ PERIOD WAS ADDED moving back to VERIFIED
Update... Names are now limited to 255 characters max due to the following: commit a0db7c35f8d7ee71daeabaf39788b3f47206e0e0 Author: William Poteat <wpoteat> Date: Wed Apr 9 14:34:20 2014 -0400 1065369: Use Hibernate Validation to supersede database error reporting. Current violations of 'not null' and size constraints result in runtime errors. Hibernate validation checks annotated fields prior to database interaction.