diff options
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/org/onap/clamp/clds/filter/ClampCadiFilter.java | 7 | ||||
-rw-r--r-- | src/main/java/org/onap/clamp/loop/components/external/PolicyComponent.java | 4 |
2 files changed, 9 insertions, 2 deletions
diff --git a/src/main/java/org/onap/clamp/clds/filter/ClampCadiFilter.java b/src/main/java/org/onap/clamp/clds/filter/ClampCadiFilter.java index cd141ae7..68544de6 100644 --- a/src/main/java/org/onap/clamp/clds/filter/ClampCadiFilter.java +++ b/src/main/java/org/onap/clamp/clds/filter/ClampCadiFilter.java @@ -46,6 +46,7 @@ import javax.servlet.http.HttpServletRequest; import org.onap.aaf.cadi.config.Config; import org.onap.aaf.cadi.filter.CadiFilter; +import org.onap.clamp.clds.util.ResourceFileUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.ApplicationContext; @@ -150,13 +151,17 @@ public class ClampCadiFilter extends CadiFilter { X509Certificate cert = (X509Certificate) certificateFactory .generateCertificate(new ByteArrayInputStream( URLDecoder.decode(certHeader, StandardCharsets.UTF_8.toString()).getBytes())); + X509Certificate caCert = (X509Certificate) certificateFactory + .generateCertificate(new ByteArrayInputStream(ResourceFileUtil.getResourceAsString("clds/aaf/ssl/ca-certs.pem").getBytes())); + X509Certificate[] certifArray = ((X509Certificate[]) request .getAttribute("javax.servlet.request.X509Certificate")); if (certifArray == null) { - certifArray = new X509Certificate[] { cert }; + certifArray = new X509Certificate[] { cert, caCert }; request.setAttribute("javax.servlet.request.X509Certificate", certifArray); } else { certifArray[0] = cert; + certifArray[1] = caCert; } } diff --git a/src/main/java/org/onap/clamp/loop/components/external/PolicyComponent.java b/src/main/java/org/onap/clamp/loop/components/external/PolicyComponent.java index 9321423a..44ee5226 100644 --- a/src/main/java/org/onap/clamp/loop/components/external/PolicyComponent.java +++ b/src/main/java/org/onap/clamp/loop/components/external/PolicyComponent.java @@ -52,6 +52,8 @@ public class PolicyComponent extends ExternalComponent { "The policies defined have been created but NOT deployed on the policy engine", 50); public static final ExternalComponentState SENT_AND_DEPLOYED = new ExternalComponentState("SENT_AND_DEPLOYED", "The policies defined have been created and deployed on the policy engine", 10); + public static final ExternalComponentState UNKNOWN = new ExternalComponentState("UNKNOWN", + "The current status is not clear. Need to regresh the status to get the current status.", 0); /** * Default constructor. @@ -62,7 +64,7 @@ public class PolicyComponent extends ExternalComponent { * on by one, each time we increase the level we can't decrease it anymore. * That's why it starts with the lowest one SENT_AND_DEPLOYED. */ - super(SENT_AND_DEPLOYED); + super(UNKNOWN); } @Override |