Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do Asset ID's *need* to be sanatized? #82

Open
akinnane opened this issue Jun 13, 2024 · 1 comment
Open

Do Asset ID's *need* to be sanatized? #82

akinnane opened this issue Jun 13, 2024 · 1 comment

Comments

@akinnane
Copy link

This function rejects asset IDs that conform to our own resource naming conventions. Is there a good reason why this check exists, and why I shouldn't disable this code for our assets?

func checkIdSyntax(id string) error {
validIdSyntax := regexp.MustCompile(`^[a-zA-Z0-9\-]+$`)
if !validIdSyntax.MatchString(id) {
return fmt.Errorf("invalid id syntax used (only letters, numbers, and hyphen allowed): %v", id)
}
return nil
}

@ezavgorodniy
Copy link
Collaborator

I don't know the original idea @cschneider4711 had when this code was added but I'd say "id is id" and currently tool is providing a way to add non sanitized and more human friendly into name and description, while id is used in many places for references purpose.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants