
org.cloudfoundry.identity.uaa.zone.ConsentValidator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of cloudfoundry-identity-server
Show all versions of cloudfoundry-identity-server
Cloud Foundry User Account and Authentication
package org.cloudfoundry.identity.uaa.zone;
import org.cloudfoundry.identity.uaa.util.UaaUrlUtils;
import org.springframework.util.StringUtils;
public class ConsentValidator {
public static void validate(Consent consent) throws InvalidIdentityZoneConfigurationException {
if (consent != null) {
if (StringUtils.isEmpty(consent.getText())) {
throw new InvalidIdentityZoneConfigurationException("Consent text must be set if configuring consent");
}
if (StringUtils.hasText(consent.getLink())) {
if (!UaaUrlUtils.isUrl(consent.getLink())) {
throw new InvalidIdentityZoneConfigurationException("Invalid consent link: " + consent.getLink() + ". Must be a properly formatted URI beginning with http:// or https://", null);
}
}
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy