From 02898d14f978ebea7099193bca6e0778b464a11d Mon Sep 17 00:00:00 2001 From: Ankit Nayan Date: Mon, 26 Dec 2022 15:42:08 +0530 Subject: [PATCH] fix: removes password validations other than length (#1909) --- pkg/query-service/auth/rbac.go | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/pkg/query-service/auth/rbac.go b/pkg/query-service/auth/rbac.go index b07fbde5f7..d387a30779 100644 --- a/pkg/query-service/auth/rbac.go +++ b/pkg/query-service/auth/rbac.go @@ -2,9 +2,7 @@ package auth import ( "context" - "fmt" "net/http" - "regexp" "github.com/pkg/errors" "go.signoz.io/signoz/pkg/query-service/constants" @@ -74,21 +72,21 @@ func ValidatePassword(password string) error { return errors.Errorf("Password should be atleast %d characters.", minimumPasswordLength) } - num := `[0-9]{1}` - lower := `[a-z]{1}` - upper := `[A-Z]{1}` - symbol := `[!@#$&*]{1}` - if b, err := regexp.MatchString(num, password); !b || err != nil { - return fmt.Errorf("password should have atleast one number") - } - if b, err := regexp.MatchString(lower, password); !b || err != nil { - return fmt.Errorf("password should have atleast one lower case letter") - } - if b, err := regexp.MatchString(upper, password); !b || err != nil { - return fmt.Errorf("password should have atleast one upper case letter") - } - if b, err := regexp.MatchString(symbol, password); !b || err != nil { - return fmt.Errorf("password should have atleast one special character from !@#$&* ") - } + // num := `[0-9]{1}` + // lower := `[a-z]{1}` + // upper := `[A-Z]{1}` + // symbol := `[!@#$&*]{1}` + // if b, err := regexp.MatchString(num, password); !b || err != nil { + // return fmt.Errorf("password should have atleast one number") + // } + // if b, err := regexp.MatchString(lower, password); !b || err != nil { + // return fmt.Errorf("password should have atleast one lower case letter") + // } + // if b, err := regexp.MatchString(upper, password); !b || err != nil { + // return fmt.Errorf("password should have atleast one upper case letter") + // } + // if b, err := regexp.MatchString(symbol, password); !b || err != nil { + // return fmt.Errorf("password should have atleast one special character from !@#$&* ") + // } return nil }