Password validator

Password validation rules

Лицензия

Лицензия

Категории

Категории

Spring Boot Контейнер Микросервисы
Группа

Группа

nl.42
Идентификатор

Идентификатор

spring-boot-starter-password-validation
Последняя версия

Последняя версия

1.1.0
Дата

Дата

Тип

Тип

jar
Описание

Описание

Password validator
Password validation rules
Организация-разработчик

Организация-разработчик

42 BV
Система контроля версий

Система контроля версий

https://github.com/42BV/spring-boot-starter-password-validation

Скачать spring-boot-starter-password-validation

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/nl.42/spring-boot-starter-password-validation/ -->
<dependency>
    <groupId>nl.42</groupId>
    <artifactId>spring-boot-starter-password-validation</artifactId>
    <version>1.1.0</version>
</dependency>
// https://jarcasting.com/artifacts/nl.42/spring-boot-starter-password-validation/
implementation 'nl.42:spring-boot-starter-password-validation:1.1.0'
// https://jarcasting.com/artifacts/nl.42/spring-boot-starter-password-validation/
implementation ("nl.42:spring-boot-starter-password-validation:1.1.0")
'nl.42:spring-boot-starter-password-validation:jar:1.1.0'
<dependency org="nl.42" name="spring-boot-starter-password-validation" rev="1.1.0">
  <artifact name="spring-boot-starter-password-validation" type="jar" />
</dependency>
@Grapes(
@Grab(group='nl.42', module='spring-boot-starter-password-validation', version='1.1.0')
)
libraryDependencies += "nl.42" % "spring-boot-starter-password-validation" % "1.1.0"
[nl.42/spring-boot-starter-password-validation "1.1.0"]

Зависимости

compile (3)

Идентификатор библиотеки Тип Версия
org.springframework.boot : spring-boot-autoconfigure jar
org.springframework.boot : spring-boot-starter-security Необязательный jar
org.projectlombok : lombok jar

test (2)

Идентификатор библиотеки Тип Версия
org.springframework.boot : spring-boot-starter-test jar
org.springframework.security : spring-security-test jar

Модули Проекта

Данный проект не имеет модулей.

Spring Boot Starter Password Validation

This library makes validating new passwords easy.

Steps necessary to make this library work in your application:

  • Configure the validations you want. See the available configurations below.
  • Make your user (or equivalent) class implement the interface PasswordHolder. This provides the validators a way to retrieve the current (encoded) password. This is required for certain validators.
  • Autowire the PasswordValidator bean in your application. Use the PasswordValidator.validate(newPassword, passwordHolder) method to validate new passwords. An exception of type PasswordValidationFailedException is thrown when a validation fails. No exception? Your new password is valid for use.
  • If desired: you can add new validation rules by implementing the ValidationRule interface.

Configuration:

password:
  different-than-current-enabled
  minimum-length-enabled
  not-used-in-past-enabled
  strength-enabled
  minimum-length
  strength-regex

password.different-than-current-enabled

Default: false
Type: boolean
Enables the validation where the password is not allowed to be the password the user is currently using.

password.minimum-length-enabled

Default: false
Type: boolean
Enables the minimum length check. See also property: password.minimum-length.

password.not-used-in-past-enabled

Default: false
Type: boolean
Enables the validation where the password is not allowed to have been used in the past by the same user.
Requires you to provide a bean of OldPasswordRepository as a means to retrieve the old passwords.

password.strength-enabled

Default: false
Type: boolean
Enables the strength check. Meaning the password must be valid according to a specific regex expression. See also property: password.strength-regex.

password.minimum-length

Default: 8
Type: int
Only used when password.minimum-length-enabled is turned on. Defines the minimum length of passwords; shorter passwords will be denied.

password.strength-regex

Default: ^(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z])(?=.*[@#$%^&+=.,?!])(?=\S+$).*$
Type: String
Only used when password.strength-enabled is turned on. Defines the regex for the strength check. The default checks for at least one capital letter, one lower case letter, one number and one special character.

nl.42

Версии библиотеки

Версия
1.1.0
1.0.0