Package org.keycloak.services.validation
Class Validation
java.lang.Object
org.keycloak.services.validation.Validation
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanCheck if string contains control characters (Unicode general category Cc), e.g.static List<FormMessage>static booleanCheck if string is blank (null or lenght is 0 or contains only white characters)static booleanisEmailValid(String email) static booleanCheck if string is empty (null or lenght is 0)static booleanisUsernameValid(String username)
-
Field Details
-
FIELD_PASSWORD_CONFIRM
- See Also:
-
FIELD_EMAIL
- See Also:
-
FIELD_PASSWORD
- See Also:
-
FIELD_USERNAME
- See Also:
-
FIELD_OTP_CODE
- See Also:
-
FIELD_OTP_LABEL
- See Also:
-
MAX_USERNAME_LENGTH
public static final int MAX_USERNAME_LENGTH- See Also:
-
-
Constructor Details
-
Validation
public Validation()
-
-
Method Details
-
isEmpty
Check if string is empty (null or lenght is 0)- Parameters:
s- to check- Returns:
- true if string is empty
-
isBlank
Check if string is blank (null or lenght is 0 or contains only white characters)- Parameters:
s- to check- Returns:
- true if string is blank
-
containsControlCharacters
Check if string contains control characters (Unicode general category Cc), e.g. NUL (U+0000), DEL (U+007F) or the C1 controls (U+0080-U+009F). Such characters are not printable, can break storage engines (for example, PostgreSQL does not allow NUL bytes in text values) and are significant for exact string comparisons, which can silently break matching and authorization logic.- Parameters:
s- to check- Returns:
- true if the string contains at least one control character
-
isEmailValid
-
isUsernameValid
-
getFormErrorsFromValidation
-