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

[Feature]: 新建模板时就对项目名称校验规则 #372

Open
zhuzhuyule opened this issue Dec 2, 2024 · 2 comments
Open

[Feature]: 新建模板时就对项目名称校验规则 #372

zhuzhuyule opened this issue Dec 2, 2024 · 2 comments

Comments

@zhuzhuyule
Copy link
Contributor

Why you want this Feature?

https://community.arcblock.io/discussions/4ff89e58-a309-4c94-b322-5880acf85d28

https://community.arcblock.io/discussions/b379d1cd-035e-4475-810f-f9209ac2a101

image

Describe the solution you'd like

No response

Additional context

No response

@zhuzhuyule
Copy link
Contributor Author

@wangshijun 关于找个修复应该适用哪个规则呢?

  1. 放宽校验规则,支持项目名称 包含:a-zA-Z0-9 - _ . (推荐)
  2. 前置校验使用 统一的检验规则。仅支持:a-zA-Z0-8 _

@wangshijun
Copy link
Collaborator

链的校验规则是 1,这个需要保持不变。用户输入的内容需要按照如下变换:

urlPathFriendly(slugify(appName)).toLowerCase()

然后看是否满足规则1,如果不满足,直接抛错。参考 core/auth/lib/server.js#L419

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