Class AllowedHostsValidator
java.lang.Object
com.microsoft.kiota.authentication.AllowedHostsValidator
Maintains a list of valid hosts and allows authentication providers to check whether a host is valid before authenticating a request
-
Constructor Summary
ConstructorsConstructorDescriptionAllowedHostsValidator(String... allowedHosts) Creates a new AllowedHostsValidator. -
Method Summary
Modifier and TypeMethodDescriptionGets the allowed hosts.booleanisUrlHostValid(URI uri) Checks if the provided host is allowed.voidsetAllowedHosts(Set<String> allowedHosts) Sets the allowed hosts.
-
Constructor Details
-
AllowedHostsValidator
Creates a new AllowedHostsValidator.- Parameters:
allowedHosts- The list of valid hosts.
-
-
Method Details
-
getAllowedHosts
Gets the allowed hosts. Read-only.- Returns:
- the allowed hosts.
-
setAllowedHosts
Sets the allowed hosts.- Parameters:
allowedHosts- the allowed hosts.
-
isUrlHostValid
Checks if the provided host is allowed.- Parameters:
uri- the uri to check the host for.- Returns:
- true if the host is allowed, false otherwise.
-