X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=auth%2Fauth-certman%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Faaf%2Fauth%2Fcm%2Fvalidation%2FCertmanValidator.java;h=eaee6dc51b5145ec83c785f90a5fb098922fda1a;hb=1296352d8eafee57f982a4342ad79ada4aa56d28;hp=5835b31f6bfbf3941f5a6b34398e6779537f63aa;hpb=cdf53cfe6903670884e983463375077ea7e8d470;p=aaf%2Fauthz.git diff --git a/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/validation/CertmanValidator.java b/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/validation/CertmanValidator.java index 5835b31f..eaee6dc5 100644 --- a/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/validation/CertmanValidator.java +++ b/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/validation/CertmanValidator.java @@ -7,9 +7,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -31,9 +31,9 @@ import org.onap.aaf.auth.validation.Validator; /** * Validator * Consistently apply content rules for content (incoming) - * - * Note: We restrict content for usability in URLs (because RESTful service), and avoid - * issues with Regular Expressions, and other enabling technologies. + * + * Note: We restrict content for usability in URLs (because RESTful service), and avoid + * issues with Regular Expressions, and other enabling technologies. * @author Jonathan * */ @@ -48,13 +48,13 @@ public class CertmanValidator extends Validator{ private static final String MUST_HAVE_AT_LEAST = " must have at least "; private static final String IS_NULL = " is null."; private static final String ARTIFACTS_MUST_HAVE_AT_LEAST = "Artifacts must have at least "; - private static final Pattern ALPHA_NUM = Pattern.compile("[a-zA-Z0-9]*"); - - private static boolean disallowTmp = true; - public static void allowTmp() { - disallowTmp=false; - } - + private static final Pattern ALPHA_NUM = Pattern.compile("[a-zA-Z0-9]*"); + + private static boolean disallowTmp = true; + public static void allowTmp() { + disallowTmp=false; + } + public CertmanValidator nullBlankMin(String name, List list, int min) { if (list==null) { msg(name + IS_NULL); @@ -80,7 +80,7 @@ public class CertmanValidator extends Validator{ for (ArtiDAO.Data a : list) { allRequired(a); if(disallowTmp && a.dir!=null && a.dir.startsWith("/tmp")) { - msg("Certificates may not be deployed into /tmp directory (they will be removed at a random time by O/S)"); + msg("Certificates may not be deployed into /tmp directory (they will be removed at a random time by O/S)"); } } } @@ -97,7 +97,7 @@ public class CertmanValidator extends Validator{ } return this; } - + private CertmanValidator allRequired(Data a) { if (a==null) { msg("Artifact is null."); @@ -106,7 +106,7 @@ public class CertmanValidator extends Validator{ nullOrBlank(MACHINE, a.machine); nullOrBlank("ca",a.ca); nullOrBlank("dir",a.dir); - match("NS must be dot separated AlphaNumeric",a.ns,NAME_CHARS); + match("NS must be dot separated AlphaNumeric",a.ns,NAME_CHARS); match("O/S User must be AlphaNumeric",a.os_user,ALPHA_NUM); // Note: AppName, Notify & Sponsor are currently not required }