X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=auth%2Fauth-service%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Faaf%2Fauth%2Fservice%2Fvalidation%2FServiceValidator.java;h=1c0c4aabdfa7b319895168d2295ec2e553aed90e;hb=1296352d8eafee57f982a4342ad79ada4aa56d28;hp=56785fee06f9bf2241890a0b189279e4c7d0e6aa;hpb=bdce7667a6e272e2fa32e298d957a0d9090c5bc9;p=aaf%2Fauthz.git diff --git a/auth/auth-service/src/main/java/org/onap/aaf/auth/service/validation/ServiceValidator.java b/auth/auth-service/src/main/java/org/onap/aaf/auth/service/validation/ServiceValidator.java index 56785fee..1c0c4aab 100644 --- a/auth/auth-service/src/main/java/org/onap/aaf/auth/service/validation/ServiceValidator.java +++ b/auth/auth-service/src/main/java/org/onap/aaf/auth/service/validation/ServiceValidator.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. @@ -36,9 +36,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 * */ @@ -57,13 +57,13 @@ public class ServiceValidator extends Validator { if (pd==null) { msg("Perm Data is null."); } else { - if(!pd.ns.contains("@")) { + if(!pd.ns.contains("@")) { ns(pd.ns); } permType(pd.type,pd.ns); permInstance(pd.instance); permAction(pd.action); - if (pd.roles!=null) { + if (pd.roles!=null) { for (String role : pd.roles) { role(role); } @@ -86,7 +86,7 @@ public class ServiceValidator extends Validator { } return this; } - + public ServiceValidator role(RoleDAO.Data pd) { if (pd==null) { msg("Role Data is null."); @@ -151,14 +151,14 @@ public class ServiceValidator extends Validator { if (idx>0) { str = str.substring(0,idx); } - + if (org.supportsRealm(cd.id)) { String resp = org.isValidID(trans, str); if (isNew && (resp!=null && resp.length()>0)) { msg(cd.id,str); } } - + if (cd.type==null) { msg("Credential Type must be set"); } else { @@ -193,17 +193,17 @@ public class ServiceValidator extends Validator { ns(ns.name); for (String s : ns.admin) { if (nob(s,ID_CHARS)) { - msg("Admin [" + s + "] is invalid."); + msg("Admin [" + s + "] is invalid."); } - + } for (String s : ns.owner) { if (nob(s,ID_CHARS)) { - msg("Responsible [" + s + "] is invalid."); + msg("Responsible [" + s + "] is invalid."); } - + } - + if (ns.attrib!=null) { for (Pair at : ns.attrib) { if (nob(at.x,NAME_CHARS)) { @@ -221,14 +221,14 @@ public class ServiceValidator extends Validator { public ServiceValidator user_role(String user, UserRoleDAO.Data urdd) { role(user,urdd.role); - if(!urdd.role.startsWith(user)) { + if(!urdd.role.startsWith(user)) { nullOrBlank("UserRole.ns",urdd.ns); nullOrBlank("UserRole.rname",urdd.rname); } return this; } - + public ServiceValidator user_role(UserRoleDAO.Data urdd) { if (urdd==null) { msg("UserRole is null");