Skip to content

Commit d897711

Browse files
Password policy changed
1 parent 11e30dc commit d897711

File tree

5 files changed

+10
-8
lines changed

5 files changed

+10
-8
lines changed

src/ApiBundle/Resources/config/config.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ fos_rest:
1818
routing_loader:
1919
default_format: json # All responses should be JSON formated
2020
include_format: false # We do not include format in request, so that all responses
21-
# exception:
22-
# enabled: true
23-
# exception_controller: 'ApiBundle\Controller\ApiExceptionController::showAction' # will eventually be JSON formated
21+
exception:
22+
enabled: true
23+
exception_controller: 'ApiBundle\Controller\ApiExceptionController::showAction' # will eventually be JSON formated
2424
versioning:
2525
enabled: true
2626
resolvers:

src/ApiBundle/Resources/config/validation.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ ApiBundle\Entity\User:
5757
api_error: 'api.show_error_password_policy'
5858
- Regex:
5959
groups: [profile_edit_password, Registration, Profile]
60-
pattern: '/^([a-zA-Z0-9@*#]{8,15})$/'
60+
# Password 6-20 characters, at least 1 Uppercase, 1 Lowercase, 1 Number and 1 Special Character
61+
pattern: '/^(?=.*[a-z])(?=.*[A-Z])(?=.*[\d])(?=.*([^\w]))[A-Za-z\d$@$!%*?&]{6,20}$/'
6162
match: true
6263
message: "user.show_error_password_policy"
6364
payload:
@@ -91,7 +92,8 @@ FOS\UserBundle\Form\Model\ChangePassword:
9192
payload:
9293
api_error: 'api.show_error_password_policy'
9394
- Regex:
94-
pattern: '/^([a-zA-Z0-9@*#]{8,15})$/'
95+
# Password 6-20 characters, at least 1 Uppercase, 1 Lowercase, 1 Number and 1 Special Character
96+
pattern: '/^(?=.*[a-z])(?=.*[A-Z])(?=.*[\d])(?=.*([^\w]))[A-Za-z\d$@$!%*?&]{6,20}$/'
9597
match: true
9698
message: "user.show_error_password_policy"
9799
payload:

src/ApiBundle/Resources/translations/messages.en.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,6 @@ api:
149149
show_error_password_reset: Sorry, You are not permitted to request for password reset!
150150
show_error_reset_req: Password reset request already received
151151
show_error_username_policy: Username should be 3-16 characters long with any lowercase letter (a-z), number (0-9), an underscore, or a hyphen
152-
show_error_password_policy: Password should be 8-15 characters long and must contain alphanumeric and @*# characters
152+
show_error_password_policy: Password 6-20 characters, at least 1 Uppercase, 1 Lowercase, 1 Number and 1 Special Character
153153
show_error_role: Sorry! Wrong Role!
154154
show_error_image: Sorry! Some problem with image uploading!

src/ApiBundle/Resources/translations/messages.fr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,6 @@ api:
138138
show_error_reset_req: Réinitialisation du mot de passe déjà reçue
139139
show_error_server_fault: Erreur du serveur! Veuillez réessayer après un certain temps !!
140140
show_error_username_policy: Le nom d'utilisateur doit comporter entre 3 et 16 caractères avec une lettre minuscule (a-z), un chiffre (0-9), un trait de soulignement ou un tiret
141-
show_error_password_policy: Le mot de passe doit comporter entre 8 et 15 caractères et contenir des caractères alphanumériques et @*#
141+
show_error_password_policy: Mot de passe 6 à 20 caractères, au moins 1 majuscule, 1 minuscule, 1 numéro et 1 caractère spécial
142142
show_error_role: Pardon! Mauvais rôle!
143143
show_error_image: Pardon! Quelque problème avec le téléchargement d'image!

src/ApiBundle/Resources/translations/messages.hi.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,6 @@ api:
138138
show_error_reset_req: पासवर्ड रीसेट अनुरोध पहले से ही प्राप्त
139139
show_error_server_fault: सर्वर त्रुटि! कुछ समय के बाद फिर से कोशिश करें !!
140140
show_error_username_policy: यूजर का नाम किसी भी छोटा अक्षर (a-z), संख्या (0-9), एक अंडरस्कोर, या एक हाइफन के साथ 3-16 अक्षर का होना चाहिए
141-
show_error_password_policy: पासवर्ड 8-15 अक्षर का होना चाहिए और अल्फान्यूमेरिक और शामिल होना चाहिए @#* अक्षर
141+
show_error_password_policy: पासवर्ड 6-20 अक्षर, कम से कम 1 अपरकेस, 1 लोअरकेस, 1 संख्या और 1 विशेष अक्षर
142142
show_error_role: माफ़ कीजिये! गलत भूमिका!
143143
show_error_image: माफ़ कीजिये! छवि अपलोड करने के साथ कुछ समस्या!

0 commit comments

Comments
 (0)