summaryrefslogtreecommitdiffstats
path: root/cadi/core/src
diff options
context:
space:
mode:
authorInstrumental <jonathan.gathman@att.com>2018-07-02 09:40:49 -0500
committerInstrumental <jonathan.gathman@att.com>2018-07-02 09:41:03 -0500
commitc060284812fbbc18fcf22eb628c47c251505fe50 (patch)
tree6f8b8bc7d58667fd711dc913c2fa4a9d111a75ba /cadi/core/src
parent2c0dd5c5136e249f63f1d3296063795cde30c399 (diff)
Update CM to us Local Intermediate Certs
Issue-ID: AAF-384 Change-Id: Iefd36c5b9ab8011ac696cb85e74c54edb63cb40a Signed-off-by: Instrumental <jonathan.gathman@att.com>
Diffstat (limited to 'cadi/core/src')
-rw-r--r--cadi/core/src/main/java/org/onap/aaf/cadi/Symm.java2
-rw-r--r--cadi/core/src/main/java/org/onap/aaf/cadi/config/Config.java8
-rw-r--r--cadi/core/src/main/java/org/onap/aaf/cadi/config/SecurityInfoC.java8
-rw-r--r--cadi/core/src/main/java/org/onap/aaf/cadi/filter/CadiFilter.java3
-rw-r--r--cadi/core/src/main/java/org/onap/aaf/cadi/filter/CadiHTTPManip.java3
5 files changed, 16 insertions, 8 deletions
diff --git a/cadi/core/src/main/java/org/onap/aaf/cadi/Symm.java b/cadi/core/src/main/java/org/onap/aaf/cadi/Symm.java
index ea3891f9..5a3fe825 100644
--- a/cadi/core/src/main/java/org/onap/aaf/cadi/Symm.java
+++ b/cadi/core/src/main/java/org/onap/aaf/cadi/Symm.java
@@ -450,9 +450,11 @@ public class Symm {
this.range = range;
}
public int convert(int read) throws IOException {
+ // System.out.print((char)read);
switch(read) {
case -1:
case '=':
+ case ' ':
case '\n':
case '\r':
return -1;
diff --git a/cadi/core/src/main/java/org/onap/aaf/cadi/config/Config.java b/cadi/core/src/main/java/org/onap/aaf/cadi/config/Config.java
index c79c5cce..9a0a53cf 100644
--- a/cadi/core/src/main/java/org/onap/aaf/cadi/config/Config.java
+++ b/cadi/core/src/main/java/org/onap/aaf/cadi/config/Config.java
@@ -43,6 +43,7 @@ import org.onap.aaf.cadi.CadiException;
import org.onap.aaf.cadi.Connector;
import org.onap.aaf.cadi.CredVal;
import org.onap.aaf.cadi.Locator;
+import org.onap.aaf.cadi.LocatorException;
import org.onap.aaf.cadi.Lur;
import org.onap.aaf.cadi.PropAccess;
import org.onap.aaf.cadi.Symm;
@@ -225,7 +226,7 @@ public class Config {
}
}
- public static HttpTaf configHttpTaf(Connector con, SecurityInfoC<HttpURLConnection> si, TrustChecker tc, CredVal up, Lur lur, Object ... additionalTafLurs) throws CadiException {
+ public static HttpTaf configHttpTaf(Connector con, SecurityInfoC<HttpURLConnection> si, TrustChecker tc, CredVal up, Lur lur, Object ... additionalTafLurs) throws CadiException, LocatorException {
Access access = si.access;
/////////////////////////////////////////////////////
// Setup AAFCon for any following
@@ -712,7 +713,7 @@ public class Config {
@SuppressWarnings("unchecked")
- public static Locator<URI> loadLocator(SecurityInfoC<HttpURLConnection> si, final String _url) {
+ public static Locator<URI> loadLocator(SecurityInfoC<HttpURLConnection> si, final String _url) throws LocatorException {
Access access = si.access;
Locator<URI> locator = null;
if(_url==null) {
@@ -753,6 +754,9 @@ public class Config {
access.log(Level.INFO, "AAFLocator enabled using preloaded " + locator.getClass().getSimpleName());
}
} catch (InvocationTargetException e) {
+ if(e.getTargetException() instanceof LocatorException) {
+ throw (LocatorException)e.getTargetException();
+ }
access.log(Level.INIT,e.getTargetException().getMessage(),"AAFLocator for",url,"could not be created.",e);
} catch (Exception e) {
access.log(Level.INIT,"AAFLocator for",url,"could not be created.",e);
diff --git a/cadi/core/src/main/java/org/onap/aaf/cadi/config/SecurityInfoC.java b/cadi/core/src/main/java/org/onap/aaf/cadi/config/SecurityInfoC.java
index 33aef6c9..cc366c27 100644
--- a/cadi/core/src/main/java/org/onap/aaf/cadi/config/SecurityInfoC.java
+++ b/cadi/core/src/main/java/org/onap/aaf/cadi/config/SecurityInfoC.java
@@ -34,7 +34,7 @@ public class SecurityInfoC<CLIENT> extends SecurityInfo {
private static Map<Class<?>,SecurityInfoC<?>> sicMap = new HashMap<Class<?>,SecurityInfoC<?>>();
public SecuritySetter<CLIENT> defSS;
- private SecurityInfoC(Access access) throws CadiException {
+ public SecurityInfoC(Access access) throws CadiException {
super(access);
defSS = new SecuritySetter<CLIENT>() {
@Override
@@ -54,14 +54,14 @@ public class SecurityInfoC<CLIENT> extends SecurityInfo {
};
}
- @SuppressWarnings("unchecked")
public static synchronized <CLIENT> SecurityInfoC<CLIENT> instance(Access access, Class<CLIENT> cls) throws CadiException {
- SecurityInfoC<?> sic = sicMap.get(cls);
+ @SuppressWarnings("unchecked")
+ SecurityInfoC<CLIENT> sic = (SecurityInfoC<CLIENT>) sicMap.get(cls);
if(sic==null) {
sic = new SecurityInfoC<CLIENT>(access);
sicMap.put(cls, sic);
}
- return (SecurityInfoC<CLIENT>)sic;
+ return sic;
}
public SecurityInfoC<CLIENT> set(SecuritySetter<CLIENT> defSS) {
diff --git a/cadi/core/src/main/java/org/onap/aaf/cadi/filter/CadiFilter.java b/cadi/core/src/main/java/org/onap/aaf/cadi/filter/CadiFilter.java
index 8577d55c..1f302c64 100644
--- a/cadi/core/src/main/java/org/onap/aaf/cadi/filter/CadiFilter.java
+++ b/cadi/core/src/main/java/org/onap/aaf/cadi/filter/CadiFilter.java
@@ -38,6 +38,7 @@ import javax.servlet.http.HttpServletResponse;
import org.onap.aaf.cadi.Access;
import org.onap.aaf.cadi.CadiException;
import org.onap.aaf.cadi.CadiWrap;
+import org.onap.aaf.cadi.LocatorException;
import org.onap.aaf.cadi.Lur;
import org.onap.aaf.cadi.PropAccess;
import org.onap.aaf.cadi.ServletContextAccess;
@@ -188,7 +189,7 @@ public class CadiFilter implements Filter {
}
try {
httpChecker = new CadiHTTPManip(access,null /*reuseable Con*/,tc, additionalTafLurs);
- } catch (CadiException e1) {
+ } catch (CadiException | LocatorException e1) {
throw new ServletException(e1);
}
} else if(access==null) {
diff --git a/cadi/core/src/main/java/org/onap/aaf/cadi/filter/CadiHTTPManip.java b/cadi/core/src/main/java/org/onap/aaf/cadi/filter/CadiHTTPManip.java
index 006d6b4e..0cc52203 100644
--- a/cadi/core/src/main/java/org/onap/aaf/cadi/filter/CadiHTTPManip.java
+++ b/cadi/core/src/main/java/org/onap/aaf/cadi/filter/CadiHTTPManip.java
@@ -32,6 +32,7 @@ import org.onap.aaf.cadi.CadiException;
import org.onap.aaf.cadi.CadiWrap;
import org.onap.aaf.cadi.Connector;
import org.onap.aaf.cadi.CredVal;
+import org.onap.aaf.cadi.LocatorException;
import org.onap.aaf.cadi.Lur;
import org.onap.aaf.cadi.Taf;
import org.onap.aaf.cadi.TrustChecker;
@@ -70,7 +71,7 @@ public class CadiHTTPManip {
public static final Object[] noAdditional = new Object[0]; // CadiFilter can be created each call in some systems
- public CadiHTTPManip(Access access, Connector con, TrustChecker tc, Object ... additionalTafLurs) throws CadiException {
+ public CadiHTTPManip(Access access, Connector con, TrustChecker tc, Object ... additionalTafLurs) throws CadiException, LocatorException {
synchronized(LOCK) {
this.access = access;
// Get getter = new AccessGetter(access);