X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=auth%2Fauth-core%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Faaf%2Fauth%2Fvalidation%2FValidator.java;h=052f21bf6616feec32e49a15e282e4565c6d3a43;hb=3d1706fcbe7f95830ff6fd23cf679ee55c6d0595;hp=6d519c6413745c76ca083883c19c7cc42d1db769;hpb=688cf884979c1a7d753baf6a1223c1a3a87c39f5;p=aaf%2Fauthz.git diff --git a/auth/auth-core/src/main/java/org/onap/aaf/auth/validation/Validator.java b/auth/auth-core/src/main/java/org/onap/aaf/auth/validation/Validator.java index 6d519c64..052f21bf 100644 --- a/auth/auth-core/src/main/java/org/onap/aaf/auth/validation/Validator.java +++ b/auth/auth-core/src/main/java/org/onap/aaf/auth/validation/Validator.java @@ -90,9 +90,9 @@ public class Validator { } protected final void match(String text, String str, Pattern p) { - if(str==null || !p.matcher(str).matches()) { - msg(text); - } + if(str==null || !p.matcher(str).matches()) { + msg(text); + } } protected final boolean nob(String str, Pattern p) { @@ -156,11 +156,11 @@ public class Validator { } else if (user==null) { msg("User is null"); } else { - if(!(type.startsWith(user) && type.endsWith(":id"))) { - if(nob(type,NAME_CHARS)) { - msg("Perm Type [" + type + "] is invalid."); - } - } + if(!(type.startsWith(user) && type.endsWith(":id"))) { + if(nob(type,NAME_CHARS)) { + msg("Perm Type [" + type + "] is invalid."); + } + } } return this; } @@ -177,7 +177,7 @@ public class Validator { } public final Validator permInstance(String instance) { - if(!"/".equals(instance) && nob(instance,instChars)) { + if(!"/".equals(instance) && nob(instance,instChars)) { msg("Perm Instance [" + instance + "] is invalid."); } return this; @@ -192,24 +192,24 @@ public class Validator { } public final Validator role(String user, String role) { - boolean quit = false; - if(role==null) { - msg("Role is null"); - quit = true; - } - if(user==null) { - msg("User is null"); - quit = true; - } - if(!quit) { - if(role.startsWith(user) && role.endsWith(":user")) { - if(!(role.length() == user.length() + 5)) { - msg("Role [" + role + "] is invalid."); - } - } else if (nob(role, NAME_CHARS)) { - msg("Role [" + role + "] is invalid."); - } - } + boolean quit = false; + if(role==null) { + msg("Role is null"); + quit = true; + } + if(user==null) { + msg("User is null"); + quit = true; + } + if(!quit) { + if(role.startsWith(user) && role.endsWith(":user")) { + if(!(role.length() == user.length() + 5)) { + msg("Role [" + role + "] is invalid."); + } + } else if (nob(role, NAME_CHARS)) { + msg("Role [" + role + "] is invalid."); + } + } return this; }