Skip to content
This repository has been archived by the owner on Jan 21, 2024. It is now read-only.

perf: improve the validation rules for username #868

Merged
merged 8 commits into from
Feb 23, 2023

Conversation

ruibaby
Copy link
Member

@ruibaby ruibaby commented Feb 20, 2023

What type of PR is this?

/kind improvement

What this PR does / why we need it:

优化用户名的校验规则,目前采用 DNS 名称的规则,即:必须以字母(a-z或A-Z)开头,并包含字母数字字符(a-z,A-Z,0-9)和连字符(-)。每一段名称以字母结尾(a-z或A-Z)。名称以点(.)分隔

Which issue(s) this PR fixes:

Fixes halo-dev/halo#3239

Screenshots:

Special notes for your reviewer:

测试方式:

  1. 新建用户,检查用户名输入规则是否符合预期。

Does this PR introduce a user-facing change?

优化 Console 端新建用户时,用户名的校验规则。

@vercel
Copy link

vercel bot commented Feb 20, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
ui ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Feb 22, 2023 at 4:10PM (UTC)

@f2c-ci-robot f2c-ci-robot bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/improvement Categorizes issue or PR as related to a improvement. labels Feb 20, 2023
@f2c-ci-robot f2c-ci-robot bot requested review from Aanko and guqing February 20, 2023 06:49
ruibaby and others added 2 commits February 21, 2023 12:00
Co-authored-by: guqing <38999863+guqing@users.noreply.github.com>
Copy link
Member

@guqing guqing left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@f2c-ci-robot f2c-ci-robot bot added the lgtm Indicates that a PR is ready to be merged. label Feb 21, 2023
@f2c-ci-robot f2c-ci-robot bot removed the lgtm Indicates that a PR is ready to be merged. label Feb 21, 2023
@lan-yonghui
Copy link

特殊字符目前只支持连字符(-)和点(.)?是否考虑增加适配邮箱的特殊字符?或者考虑登录时可以使用邮箱进行登陆?

@JohnNiang
Copy link
Member

特殊字符目前只支持连字符(-)和点(.)?是否考虑增加适配邮箱的特殊字符?或者考虑登录时可以使用邮箱进行登陆?

metadata.name 是系统级别的,和业务无关。同时,限制 username 并不影响邮箱登录,每个用户可能会关联多个邮箱。

@guqing
Copy link
Member

guqing commented Feb 23, 2023

/lgtm

@f2c-ci-robot f2c-ci-robot bot added the lgtm Indicates that a PR is ready to be merged. label Feb 23, 2023
@ruibaby
Copy link
Member Author

ruibaby commented Feb 23, 2023

ping @halo-dev/sig-halo-console

@guqing
Copy link
Member

guqing commented Feb 23, 2023

/approve

@f2c-ci-robot
Copy link

f2c-ci-robot bot commented Feb 23, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: guqing

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@f2c-ci-robot f2c-ci-robot bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 23, 2023
@f2c-ci-robot f2c-ci-robot bot merged commit 43c5eff into halo-dev:main Feb 23, 2023
@ruibaby ruibaby deleted the perf/username-validation branch February 23, 2023 08:15
JohnNiang pushed a commit to JohnNiang/halo that referenced this pull request Mar 2, 2023
#### What type of PR is this?

/kind improvement

#### What this PR does / why we need it:

优化用户名的校验规则,目前采用 DNS 名称的规则,即:必须以字母(a-z或A-Z)开头,并包含字母数字字符(a-z,A-Z,0-9)和连字符(-)。每一段名称以字母结尾(a-z或A-Z)。名称以点(.)分隔

#### Which issue(s) this PR fixes:

Fixes halo-dev#3239

#### Screenshots:

#### Special notes for your reviewer:

测试方式:

1. 新建用户,检查用户名输入规则是否符合预期。

#### Does this PR introduce a user-facing change?

```release-note
优化 Console 端新建用户时,用户名的校验规则。
```
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/improvement Categorizes issue or PR as related to a improvement. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

期望管理端创建用户时用户名支持特殊字符
4 participants