@Override
    public boolean isAllowedProxyCallbackUrl(final RegisteredService registeredService, final URL pgtUrl) {
        var patternToUse = this.useServiceId ? registeredService.getServiceId() : this.pattern;
        if (!RegexUtils.isValidRegex(patternToUse)) {
            LOGGER.warn("Pattern specified [{}] is not a valid regular expression", patternToUse);
            return false;
        }
        if (exactMatch) {
            LOGGER.debug("Pattern [{}] is compared against URL [{}] for exact equality", patternToUse, pgtUrl.toExternalForm());
            return patternToUse.equals(pgtUrl.toExternalForm());
        }
        LOGGER.debug("Using pattern [{}] to authorize proxy policy for URL [{}]", patternToUse, pgtUrl.toExternalForm());
        return RegexUtils.find(patternToUse, pgtUrl.toExternalForm());
    }
A proxy policy that only allows proxying to pgt urls
that match the specified regex pattern.

@author Misagh Moayyed
@since 4.1.0
core/cas-server-core-services-api/src/main/java/org/apereo/cas/services/RegexMatchingRegisteredServiceProxyPolicy.java