Skip to content

Commit

Permalink
added '#' as valid Password Character (#4833)
Browse files Browse the repository at this point in the history
Signed-off-by: JanhaviAlekar <[email protected]>
Co-authored-by: Namkyu Park <[email protected]>
  • Loading branch information
JanhaviAlekar and namkyu1999 authored Sep 6, 2024
1 parent 804a4e9 commit e7c18ba
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions chaoscenter/authentication/pkg/utils/sanitizers.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func SanitizeString(input string) string {
/*
ValidateStrictPassword represents and checks for the following patterns:
- Input is at least 8 characters long and at most 16 characters long
- Input contains at least one special character of these @$!%*?_&
- Input contains at least one special character of these @$!%*?_&#
- Input contains at least one digit
- Input contains at least one uppercase alphabet
- Input contains at least one lowercase alphabet
Expand All @@ -33,7 +33,7 @@ func ValidateStrictPassword(input string) error {
digits := `[0-9]{1}`
lowerAlphabets := `[a-z]{1}`
capitalAlphabets := `[A-Z]{1}`
specialCharacters := `[@$!%*?_&]{1}`
specialCharacters := `[@$!%*?_&#]{1}`
if b, err := regexp.MatchString(digits, input); !b || err != nil {
return fmt.Errorf("password does not contain digits")
}
Expand Down
6 changes: 3 additions & 3 deletions chaoscenter/web/src/constants/validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const USERNAME_REGEX = /^[a-zA-Z][a-zA-Z0-9_-]{2,15}$/;
// ^(?=.*[a-z]) # At least one lowercase letter
// (?=.*[A-Z]) # At least one uppercase letter
// (?=.*\d) # At least one digit
// (?=.*[@$!%*?_&]) # At least one special character @$!%*?_&
// [A-Za-z\d@$!%*?_&] # Allowed characters: letters, digits, special characters @$!%*?_&
// (?=.*[@$!%*?_&#]) # At least one special character @$!%*?_&#
// [A-Za-z\d@$!%*?_&#] # Allowed characters: letters, digits, special characters @$!%*?_&#
// {8,16}$ # Length between 8 to 16 characters
export const PASSWORD_REGEX = /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?_&])[A-Za-z\d@$!%*?_&]{8,16}$/;
export const PASSWORD_REGEX = /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?_&#])[A-Za-z\d@$!%*?_&#]{8,16}$/;

0 comments on commit e7c18ba

Please sign in to comment.