Skip to content

Commit

Permalink
fix(zimbra): update password policy (#14062)
Browse files Browse the repository at this point in the history
ref: MANAGER-16025

Signed-off-by: Tristan WAGNER <[email protected]>
Co-authored-by: CDS Translator Agent <[email protected]>
  • Loading branch information
tristanwagner and ovh-cds authored Nov 14, 2024
1 parent 1f57306 commit 76daafd
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"zimbra_account_add_input_password_label": "Passwort",
"zimbra_account_add_input_password_helper": "Ihr Passwort muss mindestens Folgendes enthalten:",
"zimbra_account_add_input_password_helper_rule_1": "10 Zeichen",
"zimbra_account_add_input_password_helper_rule_2": "1 Ziffer oder Sonderzeichen (,!, &amp; …)",
"zimbra_account_add_input_password_helper_rule_2": "1 Ziffer und 1 Sonderzeichen ($,!, &amp;,...)",
"zimbra_account_add_input_password_helper_rule_3": "1 Großbuchstabe",
"zimbra_account_add_input_mandatory": "Die mit einem Stern * gekennzeichneten Felder sind Pflichtfelder.",
"zimbra_account_add_button_save": "Speichern",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"zimbra_account_add_input_password_label": "Password",
"zimbra_account_add_input_password_helper": "Your password must contain at least:",
"zimbra_account_add_input_password_helper_rule_1": "10 characters",
"zimbra_account_add_input_password_helper_rule_2": "1 digit or special character (€, !, &amp;)",
"zimbra_account_add_input_password_helper_rule_2": "1 digit and 1 special character ($,!, &amp;,...)",
"zimbra_account_add_input_password_helper_rule_3": "1 uppercase letter",
"zimbra_account_add_input_mandatory": "Fields marked with an asterisk (*) are mandatory",
"zimbra_account_add_button_save": "Save",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"zimbra_account_add_input_password_label": "Contraseña",
"zimbra_account_add_input_password_helper": "La contraseña debe contener al menos:",
"zimbra_account_add_input_password_helper_rule_1": "10 caracteres",
"zimbra_account_add_input_password_helper_rule_2": "1 cifra o carácter especial (€, !, &amp;...)",
"zimbra_account_add_input_password_helper_rule_2": "1 número y 1 carácter especial ($,!, &amp;,...)",
"zimbra_account_add_input_password_helper_rule_3": "1 letra mayúscula",
"zimbra_account_add_input_mandatory": "Los campos marcados con un asterisco (*) son obligatorios.",
"zimbra_account_add_button_save": "Guardar",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"zimbra_account_add_input_password_label": "Mot de passe",
"zimbra_account_add_input_password_helper": "Votre mot de passe doit contenir au minimum :",
"zimbra_account_add_input_password_helper_rule_1": "10 caractères",
"zimbra_account_add_input_password_helper_rule_2": "1 chiffre ou caractère spécial (, !, &,…)",
"zimbra_account_add_input_password_helper_rule_2": "1 chiffre et 1 caractère spécial ($, !, &,…)",
"zimbra_account_add_input_password_helper_rule_3": "1 lettre majuscule",
"zimbra_account_add_input_mandatory": "Les champs mentionnés avec un astérisque * sont obligatoires",
"zimbra_account_add_button_save": "Enregistrer",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"zimbra_account_add_input_password_label": "Mot de passe",
"zimbra_account_add_input_password_helper": "Votre mot de passe doit contenir au minimum :",
"zimbra_account_add_input_password_helper_rule_1": "10 caractères",
"zimbra_account_add_input_password_helper_rule_2": "1 chiffre ou caractère spécial (, !, &,…)",
"zimbra_account_add_input_password_helper_rule_2": "1 chiffre et 1 caractère spécial ($, !, &,…)",
"zimbra_account_add_input_password_helper_rule_3": "1 lettre majuscule",
"zimbra_account_add_input_mandatory": "Les champs mentionnés avec un astérisque * sont obligatoires",
"zimbra_account_add_button_save": "Enregistrer",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"zimbra_account_add_input_password_label": "Password",
"zimbra_account_add_input_password_helper": "La tua password deve contenere almeno:",
"zimbra_account_add_input_password_helper_rule_1": "10 caratteri",
"zimbra_account_add_input_password_helper_rule_2": "1 cifra o carattere speciale (€, !, &amp;,)",
"zimbra_account_add_input_password_helper_rule_2": "1 cifra e 1 carattere speciale ($,!, &amp;,...)",
"zimbra_account_add_input_password_helper_rule_3": "1 lettera maiuscola",
"zimbra_account_add_input_mandatory": "I campi contrassegnati con un asterisco * sono obbligatori",
"zimbra_account_add_button_save": "Registra",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"zimbra_account_add_input_password_label": "Hasło",
"zimbra_account_add_input_password_helper": "Twoje hasło musi zawierać co najmniej:",
"zimbra_account_add_input_password_helper_rule_1": "10 znaków",
"zimbra_account_add_input_password_helper_rule_2": "1 cyfrę lub znak specjalny (, !, &amp;,etc.)",
"zimbra_account_add_input_password_helper_rule_2": "1 cyfra i 1 znak specjalny ($, !, &amp;,...)",
"zimbra_account_add_input_password_helper_rule_3": "1 dużą literę",
"zimbra_account_add_input_mandatory": "Pola oznaczone gwiazdką * są obowiązkowe",
"zimbra_account_add_button_save": "Zapisz",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"zimbra_account_add_input_password_label": "Palavra-passe",
"zimbra_account_add_input_password_helper": "A sua palavra-passe deve conter, no mínimo:",
"zimbra_account_add_input_password_helper_rule_1": "10 caracteres",
"zimbra_account_add_input_password_helper_rule_2": "1 algarismo ou caráter especial (€, !, &amp;,...)",
"zimbra_account_add_input_password_helper_rule_2": "1 número e 1 caráter especial ($,!, &amp;,...)",
"zimbra_account_add_input_password_helper_rule_3": "1 letra maiúscula",
"zimbra_account_add_input_mandatory": "Os campos marcados com um asterisco são de preenchimento obrigatório",
"zimbra_account_add_button_save": "Guardar ",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ describe('email account add and edit page', () => {
});
});

expect(inputPassword).toHaveAttribute('color', 'default');
expect(button).toBeEnabled();
expect(inputPassword).toHaveAttribute('color', 'error');
expect(button).toBeDisabled();

await act(() => {
// No uppercased + digit or special + 10 characters total
Expand All @@ -155,7 +155,7 @@ describe('email account add and edit page', () => {
});

expect(inputPassword).toHaveAttribute('color', 'error');
expect(button).not.toBeEnabled();
expect(button).toBeDisabled();

await act(() => {
// Uppercased + special + 10 characters total
Expand All @@ -165,8 +165,8 @@ describe('email account add and edit page', () => {
});
});

expect(inputPassword).toHaveAttribute('color', 'default');
expect(button).toBeEnabled();
expect(inputPassword).toHaveAttribute('color', 'error');
expect(button).toBeDisabled();

await act(() => {
// Uppercased + digit or special but 9 characters total
Expand All @@ -177,6 +177,17 @@ describe('email account add and edit page', () => {
});

expect(inputPassword).toHaveAttribute('color', 'error');
expect(button).not.toBeEnabled();
expect(button).toBeDisabled();

await act(() => {
// Uppercased + digit AND special + 10 characters total
inputPassword.odsValueChange.emit({
name: 'password',
value: 'Aaaaaaa1#a',
});
});

expect(inputPassword).toHaveAttribute('color', 'default');
expect(button).toBeEnabled();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ import { FormInputRegexInterface } from '@/utils';
export const formInputRegex: FormInputRegexInterface = {
alias: /^(?:[A-Za-z0-9]+(?:[-_][A-Za-z0-9]+)*)(?:(?:[.|+])(?:[A-Za-z0-9]+(?:[-_][A-Za-z0-9]+)*))*$/,
account: /^(?:[A-Za-z0-9]+(?:[-_][A-Za-z0-9]+)*)(?:(?:[.|+])(?:[A-Za-z0-9]+(?:[-_][A-Za-z0-9]+)*))*$/,
password: /^(?=.*[\d!@#$%^&*()\\[\]{}\-_+=~`|:;"'<>,./?])(?=.*[A-Z])(?=(.*)).{10,64}$/,
password: /^(?=.*[!@#$%^&*()\\[\]{}\-_+=~`|:;"'<>,./?])(?=.*\d)(?=.*[A-Z])(?=(.*)).{10,64}$/,
};

0 comments on commit 76daafd

Please sign in to comment.