Skip to content
This repository has been archived by the owner on Jul 23, 2020. It is now read-only.

Disallow leading digit or embedded spaces in application names #3516

Closed
stooke opened this issue May 8, 2018 · 5 comments
Closed

Disallow leading digit or embedded spaces in application names #3516

stooke opened this issue May 8, 2018 · 5 comments

Comments

@stooke
Copy link
Collaborator

stooke commented May 8, 2018

The current UI validates names via a regex that allows leading digits and embedded spaces.
I would like to remove both of those; leading digits cause issues with DNS in Kubernetes, and spaces may cause unknown problems at some point.

First, I would like to ask for the actual naming requirements; my proposed change is just a common-sense guess.

The "ideal" architecture disconnects the application name (or space name, etc.) from the code, and passes through an identifier such as a UUID or other short form. Again, this issue is just a bandaid ona deeper problem.

current regex:
const pattern = /^[a-zA-Z0-9][a-zA-Z0-9-_\s]{2,38}[a-zA-Z0-9]$/;

proposed regex:
const pattern = /^[a-zA-Z][a-zA-Z0-9-_]{2,38}[a-zA-Z0-9]$/;

@stooke
Copy link
Collaborator Author

stooke commented May 8, 2018

@joshuawilson
Copy link
Member

I'm guessing this is the Space name?

@stooke
Copy link
Collaborator Author

stooke commented May 22, 2018

Yes, the regex is very permissive. If we were passing UUIDs throughout, this would be fine, but we pass names, and not just names, names with extra strings tacked on - so it's hard to determine the exact limitations on any given identifier.

In particular, the existing pattern allows spaces, and there have been issues (resolved) around spaces. There may still be more undiscovered issues - it's not clear.

@joshuawilson joshuawilson added this to the Sprint 150 milestone May 29, 2018
@joshuawilson joshuawilson assigned jiekang and unassigned stooke Jun 12, 2018
@jiekang
Copy link
Collaborator

jiekang commented Jun 12, 2018

Related #3503

@jiekang
Copy link
Collaborator

jiekang commented Jun 20, 2018

Closing as fix has been merged.

@jiekang jiekang closed this as completed Jun 20, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants