Module org.elasticsearch.xcore
Class NativeRealmValidationUtil
java.lang.Object
org.elasticsearch.xpack.core.security.support.NativeRealmValidationUtil
Provides utility methods for validating user and role names stored in the native realm.
Note: This class is a wrapper of the
Validation which allow names to have MAX_NAME_LENGTH.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intIn the native realm, the maximal user and role name lenght is influenced by the maximal document ID (seeIndexRequest.MAX_DOCUMENT_ID_LENGTH_IN_BYTES). -
Method Summary
Modifier and TypeMethodDescriptionstatic Validation.ErrorvalidateRoleName(String roleName, boolean allowReserved) static Validation.ErrorvalidateUsername(String username, boolean allowReserved, Settings settings)
-
Field Details
-
MAX_NAME_LENGTH
public static final int MAX_NAME_LENGTHIn the native realm, the maximal user and role name lenght is influenced by the maximal document ID (seeIndexRequest.MAX_DOCUMENT_ID_LENGTH_IN_BYTES). Because the document IDs are prefixed by eitheruser-orrole-, the actual possible max length is 507 chars. Note: If we choose (in the future) to allow more than 507 chars we should either consider increasing the max allowed size for document ID or consider hashing names longer than 507 in order to fit into document ID.- See Also:
-
-
Method Details
-
validateUsername
public static Validation.Error validateUsername(String username, boolean allowReserved, Settings settings) -
validateRoleName
-