summaryrefslogtreecommitdiffstats
path: root/auth/auth-certman/src/main
diff options
context:
space:
mode:
authorInstrumental <jonathan.gathman@att.com>2019-08-07 13:40:39 -0500
committerInstrumental <jonathan.gathman@att.com>2019-08-07 13:40:42 -0500
commit3d1706fcbe7f95830ff6fd23cf679ee55c6d0595 (patch)
treeff97f10380a44d9f81d536c066782af10f728687 /auth/auth-certman/src/main
parent321dce367d74092a0ba09930c3aa526abdbd5da8 (diff)
Remove Tabs, per Jococo
Issue-ID: AAF-932 Change-Id: I3ab0ebcc082048d2d1424a58a90ea479fb005ee6 Signed-off-by: Instrumental <jonathan.gathman@att.com>
Diffstat (limited to 'auth/auth-certman/src/main')
-rw-r--r--auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/AAF_CM.java26
-rw-r--r--auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/LocalCAImpl.java26
-rw-r--r--auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/ca/CA.java4
-rw-r--r--auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/mapper/Mapper1_0.java30
-rw-r--r--auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/mapper/Mapper2_0.java22
-rw-r--r--auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/service/CMService.java22
-rw-r--r--auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/validation/CertmanValidator.java18
7 files changed, 74 insertions, 74 deletions
diff --git a/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/AAF_CM.java b/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/AAF_CM.java
index aa5c1daf..cf912fa4 100644
--- a/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/AAF_CM.java
+++ b/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/AAF_CM.java
@@ -73,7 +73,7 @@ import com.datastax.driver.core.Cluster;
public class AAF_CM extends AbsService<AuthzEnv, AuthzTrans> {
private static final String USER_PERMS = "userPerms";
- private static final String CM_ALLOW_TMP = "cm_allow_tmp";
+ private static final String CM_ALLOW_TMP = "cm_allow_tmp";
private static final Map<String,CA> certAuths = new TreeMap<>();
public static Facade1_0 facade1_0; // this is the default Facade
public static Facade1_0 facade1_0_XML; // this is the XML Facade
@@ -87,7 +87,7 @@ public class AAF_CM extends AbsService<AuthzEnv, AuthzTrans> {
//Added for junits
public CMService getService() {
- return null;
+ return null;
}
/**
* Construct AuthzAPI with all the Context Supporting Routes that Authz needs
@@ -112,7 +112,7 @@ public class AAF_CM extends AbsService<AuthzEnv, AuthzTrans> {
// Check for allowing /tmp in Properties
String allowTmp = env.getProperty(CM_ALLOW_TMP);
if("true".equalsIgnoreCase(allowTmp)) {
- CertmanValidator.allowTmp();
+ CertmanValidator.allowTmp();
}
@@ -150,10 +150,10 @@ public class AAF_CM extends AbsService<AuthzEnv, AuthzTrans> {
pinst[2]= aafEnv;
pinst[3] = multiParams;
try {
- CA ca = cons.newInstance(pinst);
+ CA ca = cons.newInstance(pinst);
certAuths.put(ca.getName(),ca);
} catch (InvocationTargetException e) {
- access.log(e, "Loading", segs[0]);
+ access.log(e, "Loading", segs[0]);
}
}
}
@@ -165,7 +165,7 @@ public class AAF_CM extends AbsService<AuthzEnv, AuthzTrans> {
service = getService();
if(service == null) {
- service = new CMService(trans, this);
+ service = new CMService(trans, this);
}
// note: Service knows how to shutdown Cluster on Shutdown, etc. See Constructor
facade1_0 = FacadeFactory.v1_0(this,trans, service,Data.TYPE.JSON); // Default Facade
@@ -254,14 +254,14 @@ public class AAF_CM extends AbsService<AuthzEnv, AuthzTrans> {
Log4JLogIt logIt = new Log4JLogIt(args, "cm");
PropAccess propAccess = new PropAccess(logIt,args);
try {
- new JettyServiceStarter<AuthzEnv,AuthzTrans>(
- new AAF_CM(new AuthzEnv(propAccess)),true)
- .start();
- } catch (Exception e) {
- propAccess.log(e);
- }
+ new JettyServiceStarter<AuthzEnv,AuthzTrans>(
+ new AAF_CM(new AuthzEnv(propAccess)),true)
+ .start();
+ } catch (Exception e) {
+ propAccess.log(e);
+ }
} catch (APIException e) {
- e.printStackTrace(System.err);
+ e.printStackTrace(System.err);
}
}
}
diff --git a/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/LocalCAImpl.java b/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/LocalCAImpl.java
index 632e719e..d32b67a3 100644
--- a/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/LocalCAImpl.java
+++ b/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/LocalCAImpl.java
@@ -31,18 +31,18 @@ import org.onap.aaf.misc.env.Trans;
public class LocalCAImpl extends CA {
- protected LocalCAImpl(Access access, String caName, String env) throws IOException, CertException {
- super(access, caName, env);
- // TODO Auto-generated constructor stub
- }
-
- public LocalCAImpl(Access access, final String name, final String env, final String[][] params) throws IOException, CertException {
- super(access, name, env);
- }
+ protected LocalCAImpl(Access access, String caName, String env) throws IOException, CertException {
+ super(access, caName, env);
+ // TODO Auto-generated constructor stub
+ }
+
+ public LocalCAImpl(Access access, final String name, final String env, final String[][] params) throws IOException, CertException {
+ super(access, name, env);
+ }
- @Override
- public X509andChain sign(Trans trans, CSRMeta csrmeta) throws IOException, CertException {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public X509andChain sign(Trans trans, CSRMeta csrmeta) throws IOException, CertException {
+ // TODO Auto-generated method stub
+ return null;
+ }
} \ No newline at end of file
diff --git a/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/ca/CA.java b/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/ca/CA.java
index 26b4e2aa..ab304629 100644
--- a/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/ca/CA.java
+++ b/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/ca/CA.java
@@ -72,7 +72,7 @@ public abstract class CA {
this.name = caName;
this.env = env;
this.env_tag = env==null || env.isEmpty()?false:
- Boolean.parseBoolean(access.getProperty(CM_CA_ENV_TAG, Boolean.FALSE.toString()));
+ Boolean.parseBoolean(access.getProperty(CM_CA_ENV_TAG, Boolean.FALSE.toString()));
permNS=null;
String prefix = CM_CA_PREFIX + name;
permType = access.getProperty(prefix + ".perm_type",null);
@@ -195,7 +195,7 @@ public abstract class CA {
}
public boolean shouldAddEnvTag() {
- return env_tag;
+ return env_tag;
}
public String getEnv() {
diff --git a/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/mapper/Mapper1_0.java b/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/mapper/Mapper1_0.java
index 22243ae4..82639e21 100644
--- a/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/mapper/Mapper1_0.java
+++ b/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/mapper/Mapper1_0.java
@@ -223,10 +223,10 @@ public class Mapper1_0 implements Mapper<BaseRequest,CertInfo,Artifacts,Error> {
data.mechid = trim(arti.getMechid());
data.machine = trim(arti.getMachine());
if(arti.getType()!=null) {
- Set<String> ss = data.type(true);
- for(String t : arti.getType()) {
- ss.add(trim(t));
- }
+ Set<String> ss = data.type(true);
+ for(String t : arti.getType()) {
+ ss.add(trim(t));
+ }
}
data.ca = trim(arti.getCa());
data.dir = trim(arti.getDir());
@@ -240,9 +240,9 @@ public class Mapper1_0 implements Mapper<BaseRequest,CertInfo,Artifacts,Error> {
data.sponsor = (arti.getSponsor());
if(arti.getSans()!=null) {
Set<String> ls = data.sans(true);
- for(String t : arti.getSans()) {
- ls.add(trim(t));
- }
+ for(String t : arti.getSans()) {
+ ls.add(trim(t));
+ }
}
data.expires = null;
ladd.add(data);
@@ -266,13 +266,13 @@ public class Mapper1_0 implements Mapper<BaseRequest,CertInfo,Artifacts,Error> {
a.setCa(trim(arti.ca));
a.setDir(trim(arti.dir));
for(String t : arti.type(false)) {
- a.getType().add(trim(t));
+ a.getType().add(trim(t));
}
a.setOsUser(trim(arti.os_user));
a.setRenewDays(arti.renewDays);
a.setNotification(trim(arti.notify));
for(String t : arti.sans(false)) {
- a.getSans().add(trim(t));
+ a.getSans().add(trim(t));
}
artis.getArtifact().add(a);
}
@@ -285,10 +285,10 @@ public class Mapper1_0 implements Mapper<BaseRequest,CertInfo,Artifacts,Error> {
private String trim(String s) {
- if(s==null) {
- return s;
- } else {
- return s.trim();
- }
- }
+ if(s==null) {
+ return s;
+ } else {
+ return s.trim();
+ }
+ }
} \ No newline at end of file
diff --git a/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/mapper/Mapper2_0.java b/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/mapper/Mapper2_0.java
index 53388f67..283c828a 100644
--- a/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/mapper/Mapper2_0.java
+++ b/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/mapper/Mapper2_0.java
@@ -212,9 +212,9 @@ public class Mapper2_0 implements Mapper<BaseRequest,CertInfo,Artifacts,Error> {
data.machine = trim(arti.getMachine());
if(arti.getType()!=null) {
Set<String> ss = data.type(true);
- for(String t : arti.getType()) {
- ss.add(t.trim());
- }
+ for(String t : arti.getType()) {
+ ss.add(t.trim());
+ }
}
data.type(true).addAll(arti.getType());
data.ca = trim(arti.getCa());
@@ -231,7 +231,7 @@ public class Mapper2_0 implements Mapper<BaseRequest,CertInfo,Artifacts,Error> {
if(arti.getSans()!=null) {
Set<String> ss = data.sans(true);
for(String s : arti.getSans()) {
- ss.add(s.trim());
+ ss.add(s.trim());
}
}
ladd.add(data);
@@ -240,14 +240,14 @@ public class Mapper2_0 implements Mapper<BaseRequest,CertInfo,Artifacts,Error> {
}
private String trim(String s) {
- if(s==null) {
- return s;
- } else {
- return s.trim();
- }
- }
+ if(s==null) {
+ return s;
+ } else {
+ return s.trim();
+ }
+ }
- /* (non-Javadoc)
+ /* (non-Javadoc)
* @see org.onap.aaf.auth.cm.mapper.Mapper#fromArtifacts(org.onap.aaf.auth.layer.test.Result)
*/
@Override
diff --git a/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/service/CMService.java b/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/service/CMService.java
index 26b3a22a..48fe8d81 100644
--- a/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/service/CMService.java
+++ b/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/service/CMService.java
@@ -89,8 +89,8 @@ public class CMService {
private final CredDAO credDAO;
private final ArtiDAO artiDAO;
private AAF_CM certManager;
- private Boolean allowIgnoreIPs;
- private Boolean alwaysIgnoreIPs;
+ private Boolean allowIgnoreIPs;
+ private Boolean alwaysIgnoreIPs;
// @SuppressWarnings("unchecked")
public CMService(final AuthzTrans trans, AAF_CM certman) throws APIException, IOException {
@@ -113,12 +113,12 @@ public class CMService {
);
alwaysIgnoreIPs = Boolean.valueOf(certman.access.getProperty(Config.CM_ALWAYS_IGNORE_IPS, "false"));
if(alwaysIgnoreIPs) {
- trans.env().access().log(Level.INIT, "DNS Evaluation for Cert Creation is turned off with " + Config.CM_ALWAYS_IGNORE_IPS );
+ trans.env().access().log(Level.INIT, "DNS Evaluation for Cert Creation is turned off with " + Config.CM_ALWAYS_IGNORE_IPS );
} else {
- allowIgnoreIPs = Boolean.valueOf(certman.access.getProperty(Config.CM_ALLOW_IGNORE_IPS, "false"));
- if(allowIgnoreIPs) {
- trans.env().access().log(Level.INIT, "Allowing DNS Evaluation to be turned off with <ns>.certman|<ca name>|"+IGNORE_IPS);
- }
+ allowIgnoreIPs = Boolean.valueOf(certman.access.getProperty(Config.CM_ALLOW_IGNORE_IPS, "false"));
+ if(allowIgnoreIPs) {
+ trans.env().access().log(Level.INIT, "Allowing DNS Evaluation to be turned off with <ns>.certman|<ca name>|"+IGNORE_IPS);
+ }
}
}
@@ -147,11 +147,11 @@ public class CMService {
boolean ignoreIPs;
if(alwaysIgnoreIPs) {
- ignoreIPs=true;
+ ignoreIPs=true;
} else if(allowIgnoreIPs) {
- ignoreIPs = trans.fish(new AAFPermission(mechNS,CERTMAN, ca.getName(), IGNORE_IPS));
+ ignoreIPs = trans.fish(new AAFPermission(mechNS,CERTMAN, ca.getName(), IGNORE_IPS));
} else {
- ignoreIPs = false;
+ ignoreIPs = false;
}
@@ -185,7 +185,7 @@ public class CMService {
} else {
if (!ignoreIPs) {
- for (String cn : req.value.fqdns) {
+ for (String cn : req.value.fqdns) {
try {
InetAddress[] ias = InetAddress.getAllByName(cn);
Set<String> potentialSanNames = new HashSet<>();
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..cdd501ce 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
@@ -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<String> 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)");
}
}
}
@@ -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
}