From d3b35fb2da51afc1426d527361e11d004719b35d Mon Sep 17 00:00:00 2001 From: Wenhao Zhou <34303854+zhou1203@users.noreply.github.com> Date: Fri, 10 Feb 2023 20:45:18 +0800 Subject: [PATCH] Update the password minimum length to 8 (#5516) Signed-off-by: wenhaozhou --- config/ks-core/crds/iam.kubesphere.io_federatedusers.yaml | 2 +- config/ks-core/crds/iam.kubesphere.io_users.yaml | 2 +- staging/src/kubesphere.io/api/iam/v1alpha2/types.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/config/ks-core/crds/iam.kubesphere.io_federatedusers.yaml b/config/ks-core/crds/iam.kubesphere.io_federatedusers.yaml index 378ebb22a..81fd34317 100644 --- a/config/ks-core/crds/iam.kubesphere.io_federatedusers.yaml +++ b/config/ks-core/crds/iam.kubesphere.io_federatedusers.yaml @@ -96,7 +96,7 @@ spec: ... Last but not least, the bcrypt string is also included to match the encrypted password. ^(\$2[ayb]\$.{56})$' maxLength: 64 - minLength: 6 + minLength: 8 pattern: ^(.*[a-z].*[A-Z].*[0-9].*)$|^(.*[a-z].*[0-9].*[A-Z].*)$|^(.*[A-Z].*[a-z].*[0-9].*)$|^(.*[A-Z].*[0-9].*[a-z].*)$|^(.*[0-9].*[a-z].*[A-Z].*)$|^(.*[0-9].*[A-Z].*[a-z].*)$|^(\$2[ayb]\$.{56})$ type: string required: diff --git a/config/ks-core/crds/iam.kubesphere.io_users.yaml b/config/ks-core/crds/iam.kubesphere.io_users.yaml index 03074c6bf..4d9e19d16 100644 --- a/config/ks-core/crds/iam.kubesphere.io_users.yaml +++ b/config/ks-core/crds/iam.kubesphere.io_users.yaml @@ -78,7 +78,7 @@ spec: ... Last but not least, the bcrypt string is also included to match the encrypted password. ^(\$2[ayb]\$.{56})$' maxLength: 64 - minLength: 6 + minLength: 8 pattern: ^(.*[a-z].*[A-Z].*[0-9].*)$|^(.*[a-z].*[0-9].*[A-Z].*)$|^(.*[A-Z].*[a-z].*[0-9].*)$|^(.*[A-Z].*[0-9].*[a-z].*)$|^(.*[0-9].*[a-z].*[A-Z].*)$|^(.*[0-9].*[A-Z].*[a-z].*)$|^(\$2[ayb]\$.{56})$ type: string required: diff --git a/staging/src/kubesphere.io/api/iam/v1alpha2/types.go b/staging/src/kubesphere.io/api/iam/v1alpha2/types.go index 5a6243cdf..520a77b83 100644 --- a/staging/src/kubesphere.io/api/iam/v1alpha2/types.go +++ b/staging/src/kubesphere.io/api/iam/v1alpha2/types.go @@ -127,7 +127,7 @@ type UserSpec struct { Groups []string `json:"groups,omitempty"` // password will be encrypted by mutating admission webhook - // +kubebuilder:validation:MinLength=6 + // +kubebuilder:validation:MinLength=8 // +kubebuilder:validation:MaxLength=64 // +kubebuilder:validation:Pattern=`^(.*[a-z].*[A-Z].*[0-9].*)$|^(.*[a-z].*[0-9].*[A-Z].*)$|^(.*[A-Z].*[a-z].*[0-9].*)$|^(.*[A-Z].*[0-9].*[a-z].*)$|^(.*[0-9].*[a-z].*[A-Z].*)$|^(.*[0-9].*[A-Z].*[a-z].*)$|^(\$2[ayb]\$.{56})$` // Password pattern is tricky here.