- Notifications
You must be signed in to change notification settings - Fork927
fix: don't allow "new" or "create" as url-friendly names#13596
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Good catch!
Unfortunately the actual error text will be quite cryptic.
field: name detail: Validation failed for tag "template_name" with value: "new"
This is an issue with thevalidate
library. It's no worse than the current name validation.
Uh oh!
There was an error while loading.Please reload this page.
boo. unfortunate that it just throws the actual error text away. 🙃 |
e987ad1
intomainUh oh!
There was an error while loading.Please reload this page.
Currently, you can create a template named "new", which you'll be unable to view in the dashboard because of a routing conflict. /templates/new is the route of the
CreateTemplatePage
component.Groups, on the other hand, currently use /groups/create as the route for the
CreateGroupPage
. It's also technically not an issue right now, because groups are routed by UUID on the frontend instead of by name, but we don't do that anywhere else in the app and should probably fix that later. As such, we should make sure that any groups created won't conflict when we fix that down the road.Organizations will soon be similar, when I add the /organizations/new page soon.
It would also be nice to consolidate on just /new or just /create as the route that these sorts of pages should live at, (ie. change groups to /groups/new). In the mean time, let's disallow using either as a name, regardless of the resource type.
Given all this, and for consistency, no resource which has a "url-friendly name" should allow "new" or "create" as that name. If we consolidate all of the routes to just one of these options down the road, we can loosen the restriction.