Bug 669397 - Enforce ID restrictions
Summary: Enforce ID restrictions
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Pulp
Classification: Retired
Component: z_other
Version: unspecified
Hardware: Unspecified
OS: Unspecified
low
medium
Target Milestone: ---
: Sprint 23
Assignee: Sayli Karmarkar
QA Contact: Preethi Thomas
URL:
Whiteboard:
Depends On:
Blocks: verified-to-close
TreeView+ depends on / blocked
 
Reported: 2011-01-13 15:10 UTC by Jay Dobies
Modified: 2015-03-23 01:10 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-08-16 12:07:13 UTC
Embargoed:


Attachments (Terms of Use)

Description Jay Dobies 2011-01-13 15:10:27 UTC
Since we treat ID values (repo ID, consumer ID, consumer group ID, consumer/repo group names, etc) as programmatic references, we really should define and enforce a format that will be able to safely be used.

For instance, the ID is often used as a value in REST URLs. For compatibility and simplicity, we should restrict the values to easy to process characters.

Comment 1 Jay Dobies 2011-01-13 15:11:59 UTC
I suggest we only allow the following in IDs:

 * Letters
 * Numbers
 * dash (-)
 * underscore (_)
 * period (.)

We can define a regex to match these and add it to our create methods down near the database layer.

Comment 2 Sayli Karmarkar 2011-05-09 06:30:11 UTC
$ sudo pulp-admin repo create --id=abc$%%%

error: operation failed: PulpException: 'Given ID is invalid. ID may contain numbers(0-9), upper and lower case letters(A-Z, a-z), hyphens(-), underscore(_) and periods(.)'

$ sudo pulp-admin repo create --id=abc_xyz
Successfully created repository [ abc_xyz ]

Comment 3 Jeff Ortel 2011-05-09 22:25:17 UTC
build 0.174

Comment 4 Preethi Thomas 2011-05-31 19:37:28 UTC
verified

[root@preethi ~]# rpm -q pulp
pulp-0.0.181-1.fc14.noarch
[root@preethi ~]# pulp-admin repo create --id=abc$%%%
error: operation failed: PulpException: 'Given ID is invalid. ID may contain numbers(0-9), upper and lower case letters(A-Z, a-z), hyphens(-), underscore(_) and periods(.)'
[root@preethi ~]# 
[root@preethi ~]# pulp-admin repo create --id=abc**
error: operation failed: PulpException: 'Given ID is invalid. ID may contain numbers(0-9), upper and lower case letters(A-Z, a-z), hyphens(-), underscore(_) and periods(.)'
[root@preethi ~]# pulp-admin repo create --id=abc_12_AD
Successfully created repository [ abc_12_AD ]

Comment 5 Preethi Thomas 2011-08-16 12:07:13 UTC
Closing with Community Release 15

pulp-0.0.223-4.

Comment 6 Preethi Thomas 2011-08-16 12:20:56 UTC
Closing with Community Release 15

pulp-0.0.223-4.


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