Class ValidGotoUrlExtractor

  • All Implemented Interfaces:
    ValidDomainExtractor<String>

    public class ValidGotoUrlExtractor
    extends Object
    implements ValidDomainExtractor<String>
    Extracts the valid goto URL domains from the Authentication service configuration and caches the result. If the configuration changes, a service listener should clear the corresponding cache entry resulting in a config reload.

    Per ValidDomainExtractor.extractValidDomains(Object) an empty collection means the realm was read and has no resources in its Validation Service - what a fresh installation looks like - while null means the configuration store could not be reached, so nothing is known about what the realm allows.

    • Method Detail

      • extractValidDomains

        public Collection<String> extractValidDomains​(String realm)
        Description copied from interface: ValidDomainExtractor
        Extracts the Valid goto URL domains based on the provided configuration details.

        An empty collection and null are two different answers, and FailSafeRedirectUrlValidator tells them apart:

        • an empty collection means the configuration was read and holds no URL patterns, which is what a realm or entity that was never configured looks like;
        • null means the configuration could not be read at all - the store is unreachable, or the caller did not say which configuration to read - so nothing is known about the patterns. Callers that fail safe refuse to redirect off this server in that case, whatever they make of an empty list.

        RedirectUrlValidator, which fails open, treats the two the same.

        Specified by:
        extractValidDomains in interface ValidDomainExtractor<String>
        Parameters:
        realm - The necessary information to retrieve the correct configuration.
        Returns:
        The collection of valid goto URL domains based on the provided configuration information. Empty when none are configured, null when they could not be read.