Bug 1188413 - Roles cannot have single-character names
Summary: Roles cannot have single-character names
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Users & Roles
Version: Nightly
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: Unspecified
Assignee: satellite6-bugs
QA Contact: Katello QA List
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-02-02 19:34 UTC by jaudet
Modified: 2017-02-23 20:35 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-02-06 16:33:33 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description jaudet 2015-02-02 19:34:52 UTC
Description of problem:
It is impossible to create a role with a name that is one character long. Roles must be at least two characters long.

Version-Release number of selected component (if applicable):
Tested against deployments of Satellite Version 6.0.7 on both RHEL 6.6 and RHEL 7.0. The RHEL 6.6 system has these packages installed, among others:

* apr-util-ldap-1.3.9-3.el6_0.1.x86_64
* candlepin-0.9.23.1-1.el6.noarch
* candlepin-common-1.0.1-1.el6_5.noarch
* candlepin-scl-1-5.el6_4.noarch
* candlepin-scl-quartz-2.1.5-5.el6_4.noarch
* candlepin-scl-rhino-1.7R3-1.el6_4.noarch
* candlepin-scl-runtime-1-5.el6_4.noarch
* candlepin-selinux-0.9.23.1-1.el6.noarch
* candlepin-tomcat6-0.9.23.1-1.el6.noarch
* elasticsearch-0.90.10-6.el6sat.noarch
* foreman-1.6.0.52-1.el6sat.noarch
* foreman-compute-1.6.0.52-1.el6sat.noarch
* foreman-gce-1.6.0.52-1.el6sat.noarch
* foreman-libvirt-1.6.0.52-1.el6sat.noarch
* foreman-ovirt-1.6.0.52-1.el6sat.noarch
* foreman-postgresql-1.6.0.52-1.el6sat.noarch
* foreman-proxy-1.6.0.33-1.el6sat.noarch
* foreman-selinux-1.6.0.15-1.el6sat.noarch
* foreman-vmware-1.6.0.52-1.el6sat.noarch
* katello-1.5.0-30.el6sat.noarch
* katello-certs-tools-1.5.6-1.el6sat.noarch
* katello-default-ca-1.0-1.noarch
* katello-installer-0.0.67-1.el6sat.noarch
* katello-server-ca-1.0-1.noarch
* openldap-2.4.39-8.el6.x86_64
* pulp-katello-0.3-4.el6sat.noarch
* pulp-nodes-common-2.4.4-1.el6sat.noarch
* pulp-nodes-parent-2.4.4-1.el6sat.noarch
* pulp-puppet-plugins-2.4.4-1.el6sat.noarch
* pulp-puppet-tools-2.4.4-1.el6sat.noarch
* pulp-rpm-plugins-2.4.4-1.1.el6sat.noarch
* pulp-selinux-2.4.4-1.el6sat.noarch
* pulp-server-2.4.4-1.el6sat.noarch
* python-ldap-2.3.10-1.el6.x86_64
* ruby193-rubygem-net-ldap-0.3.1-3.el6sat.noarch
* ruby193-rubygem-runcible-1.1.0-2.el6sat.noarch

The RHEL 7.0 system has these packages installed, among others:

* candlepin-0.9.23.1-1.el7.noarch
* candlepin-common-1.0.1-1.el7.noarch
* candlepin-guice-3.0-2_redhat_1.el7.noarch
* candlepin-scl-1-5.el7.noarch
* candlepin-scl-quartz-2.1.5-6.el7.noarch
* candlepin-scl-rhino-1.7R3-3.el7.noarch
* candlepin-scl-runtime-1-5.el7.noarch
* candlepin-selinux-0.9.23.1-1.el7.noarch
* candlepin-tomcat-0.9.23.1-1.el7.noarch
* elasticsearch-0.90.10-6.el7sat.noarch
* foreman-1.6.0.52-1.el7sat.noarch
* foreman-compute-1.6.0.52-1.el7sat.noarch
* foreman-gce-1.6.0.52-1.el7sat.noarch
* foreman-libvirt-1.6.0.52-1.el7sat.noarch
* foreman-ovirt-1.6.0.52-1.el7sat.noarch
* foreman-postgresql-1.6.0.52-1.el7sat.noarch
* foreman-proxy-1.6.0.33-1.el7sat.noarch
* foreman-selinux-1.6.0.15-1.el7sat.noarch
* foreman-vmware-1.6.0.52-1.el7sat.noarch
* katello-1.5.0-30.el7sat.noarch
* katello-certs-tools-1.5.6-1.el7sat.noarch
* katello-default-ca-1.0-1.noarch
* katello-installer-0.0.67-1.el7sat.noarch
* katello-server-ca-1.0-1.noarch
* openldap-2.4.39-3.el7.x86_64
* pulp-katello-0.3-4.el7sat.noarch
* pulp-nodes-common-2.4.4-1.el7sat.noarch
* pulp-nodes-parent-2.4.4-1.el7sat.noarch
* pulp-puppet-plugins-2.4.4-1.el7sat.noarch
* pulp-puppet-tools-2.4.4-1.el7sat.noarch
* pulp-rpm-plugins-2.4.4-1.1.el7sat.noarch
* pulp-selinux-2.4.4-1.el7sat.noarch
* pulp-server-2.4.4-1.el7sat.noarch
* python-ldap-2.4.6-6.el7.x86_64
* ruby193-rubygem-net-ldap-0.3.1-3.el7sat.noarch
* ruby193-rubygem-runcible-1.1.0-2.el7sat.noarch

How reproducible:
100%

Steps to Reproduce:
1. Attempt to create a role. You can do this by any mechanism: UI, API or CLI.

Actual results:
No role is created. An error message is returned stating "Name is invalid."

Expected results:
A role is created.

Additional info:
* The model definition does not mention any restriction on name length: https://github.com/theforeman/foreman/blob/develop/app/models/role.rb#L51
* The API documentation does not mention any restrictions on name length: http://theforeman.org/api/apidoc/v2/roles.html#description-create
* The documentation does not mention any restrictions on name length:
http://theforeman.org/api/apidoc/v2/roles/create.html
* Possibly related to this bug: https://bugzilla.redhat.com/show_bug.cgi?id=1007659

Comment 1 RHEL Program Management 2015-02-02 19:43:13 UTC
Since this issue was entered in Red Hat Bugzilla, the release flag has been
set to ? to ensure that it is properly evaluated for this release.

Comment 3 Corey Welton 2015-02-06 16:30:21 UTC
This may be more of an issue for multibyte users, where a character, i.e., '北' has significant meaning ("north"), and is not just a single letter.

It might be more likely that these users would use single-character names.  That said, I don't offhand know if single multibyte characters trigger the same error.

Comment 5 jaudet 2015-02-06 16:40:48 UTC
As it turns out, this is not an issue for multi-byte users:

    >>> from robottelo import entities
    >>> entities.Role(name='北').create_raw().status_code
    200

And if you look at the underlying character encoding, it's obvious why:

    \u5317

That's at least two bytes of data.

Whether to support single-character role names or not is a judgment call that I'm not in a position to make. That's up to the devs. But regardless of the outcome, the application's limitations should be noted. If the constraints on name length can be noted in the documentation and API docs, then I think we can close this bug.


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