Package org.keycloak.validate.validators
Class UriValidator
java.lang.Object
org.keycloak.validate.validators.UriValidator
- All Implemented Interfaces:
ConfiguredProvider,Provider,ProviderFactory<Validator>,SimpleValidator,Validator,ValidatorFactory
URI validation - accepts
URI, URL and single String. Null input is valid, use other validators (like
NotBlankValidator or NotEmptyValidator to force field as required.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetId()validate(Object input, String inputHint, ValidationContext context, ValidatorConfig config) Validates the giveninputwith an additionalinputHintandconfig.booleanvalidateUri(URI uri, String inputHint, ValidationContext context, Set<String> allowedSchemes, boolean allowFragment, boolean requireValidUrl) booleanvalidateUri(URI uri, Set<String> allowedSchemes, boolean allowFragment, boolean requireValidUrl) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.keycloak.provider.ConfiguredProvider
getConfigMethods inherited from interface org.keycloak.provider.ProviderFactory
getConfigMetadata, orderMethods inherited from interface org.keycloak.validate.SimpleValidator
close, create, init, postInitMethods inherited from interface org.keycloak.validate.Validator
validate, validate, validate, validate, validateMethods inherited from interface org.keycloak.validate.ValidatorFactory
validateConfig
-
Field Details
-
INSTANCE
-
KEY_ALLOWED_SCHEMES
- See Also:
-
KEY_ALLOW_FRAGMENT
- See Also:
-
KEY_REQUIRE_VALID_URL
- See Also:
-
DEFAULT_ALLOWED_SCHEMES
-
MESSAGE_INVALID_URI
- See Also:
-
MESSAGE_INVALID_SCHEME
- See Also:
-
MESSAGE_INVALID_FRAGMENT
- See Also:
-
DEFAULT_ALLOW_FRAGMENT
public static boolean DEFAULT_ALLOW_FRAGMENT -
DEFAULT_REQUIRE_VALID_URL
public static boolean DEFAULT_REQUIRE_VALID_URL -
ID
- See Also:
-
-
Constructor Details
-
UriValidator
public UriValidator()
-
-
Method Details
-
getId
- Specified by:
getIdin interfaceProviderFactory<Validator>
-
validate
public ValidationContext validate(Object input, String inputHint, ValidationContext context, ValidatorConfig config) Description copied from interface:ValidatorValidates the giveninputwith an additionalinputHintandconfig. -
validateUri
-
validateUri
public boolean validateUri(URI uri, String inputHint, ValidationContext context, Set<String> allowedSchemes, boolean allowFragment, boolean requireValidUrl) throws MalformedURLException - Throws:
MalformedURLException
-
getHelpText
- Specified by:
getHelpTextin interfaceConfiguredProvider
-
getConfigProperties
- Specified by:
getConfigPropertiesin interfaceConfiguredProvider
-