From 5f3be5915b8a96ee7732057bc727fc131a7bdcc8 Mon Sep 17 00:00:00 2001 From: Cyrus <24922493+cyrus-dev@users.noreply.github.com> Date: Thu, 30 Mar 2023 20:21:49 -0400 Subject: [PATCH 01/15] Added the AppraisalStatus message for a failure tagged into a Platform Certificate. It will display on the details page as a tool tip on a red component. However it is not refined. [no ci] --- .../SupplyChainValidationServiceImpl.java | 2 ++ .../util/CertificateStringMapBuilder.java | 1 + .../WEB-INF/jsp/certificate-details.jsp | 6 ++++- .../webapp/common/certificate_details.css | 27 +++++++++++++++++++ .../certificate/PlatformCredential.java | 18 +++++++++++++ 5 files changed, 53 insertions(+), 1 deletion(-) diff --git a/HIRS_AttestationCA/src/main/java/hirs/attestationca/service/SupplyChainValidationServiceImpl.java b/HIRS_AttestationCA/src/main/java/hirs/attestationca/service/SupplyChainValidationServiceImpl.java index fe7b544d..31a25e69 100644 --- a/HIRS_AttestationCA/src/main/java/hirs/attestationca/service/SupplyChainValidationServiceImpl.java +++ b/HIRS_AttestationCA/src/main/java/hirs/attestationca/service/SupplyChainValidationServiceImpl.java @@ -781,6 +781,7 @@ public class SupplyChainValidationServiceImpl implements SupplyChainValidationSe case FAIL: if (!result.getAdditionalInfo().isEmpty()) { pc.setComponentFailures(result.getAdditionalInfo()); + pc.setComponentFailureMessage(result.getMessage()); this.certificateManager.update(pc); } return buildValidationRecord(validationType, AppraisalStatus.Status.FAIL, @@ -817,6 +818,7 @@ public class SupplyChainValidationServiceImpl implements SupplyChainValidationSe case FAIL: if (!result.getAdditionalInfo().isEmpty()) { base.setComponentFailures(result.getAdditionalInfo()); + base.setComponentFailureMessage(result.getMessage()); this.certificateManager.update(base); } // we are adding things to componentFailures diff --git a/HIRS_AttestationCAPortal/src/main/java/hirs/attestationca/portal/util/CertificateStringMapBuilder.java b/HIRS_AttestationCAPortal/src/main/java/hirs/attestationca/portal/util/CertificateStringMapBuilder.java index ee8ea062..7fee416a 100644 --- a/HIRS_AttestationCAPortal/src/main/java/hirs/attestationca/portal/util/CertificateStringMapBuilder.java +++ b/HIRS_AttestationCAPortal/src/main/java/hirs/attestationca/portal/util/CertificateStringMapBuilder.java @@ -373,6 +373,7 @@ public final class CertificateStringMapBuilder { if (!certificate.getComponentFailures().isEmpty()) { data.put("failures", certificate.getComponentFailures()); + data.put("failureMessages", certificate.getComponentFailureMessage()); } //Get platform Configuration values and set map with it diff --git a/HIRS_AttestationCAPortal/src/main/webapp/WEB-INF/jsp/certificate-details.jsp b/HIRS_AttestationCAPortal/src/main/webapp/WEB-INF/jsp/certificate-details.jsp index 8b20649e..2490af27 100644 --- a/HIRS_AttestationCAPortal/src/main/webapp/WEB-INF/jsp/certificate-details.jsp +++ b/HIRS_AttestationCAPortal/src/main/webapp/WEB-INF/jsp/certificate-details.jsp @@ -619,7 +619,8 @@
-
+
+
@@ -633,6 +634,9 @@ Platform Components + + +
Manufacturer: diff --git a/HIRS_AttestationCAPortal/src/main/webapp/common/certificate_details.css b/HIRS_AttestationCAPortal/src/main/webapp/common/certificate_details.css index 5cafa466..40b707a7 100644 --- a/HIRS_AttestationCAPortal/src/main/webapp/common/certificate_details.css +++ b/HIRS_AttestationCAPortal/src/main/webapp/common/certificate_details.css @@ -63,4 +63,31 @@ margin: 4px 2px; cursor: pointer; border-radius: 2px; +} + +/* Tooltip container */ +.tooltip { + position: relative; + display: inline-block; + border-bottom: 1px dotted black; /* If you want dots under the hoverable text */ +} + +/* Tooltip text */ +.tooltip .tooltiptext { + visibility: hidden; + width: 120px; + background-color: black; + color: #fff; + text-align: center; + padding: 5px 0; + border-radius: 6px; + + /* Position the tooltip text - see examples below! */ + position: absolute; + z-index: 1; +} + +/* Show the tooltip text when you mouse over the tooltip container */ +.tooltip:hover .tooltiptext { + visibility: visible; } \ No newline at end of file diff --git a/HIRS_Utils/src/main/java/hirs/data/persist/certificate/PlatformCredential.java b/HIRS_Utils/src/main/java/hirs/data/persist/certificate/PlatformCredential.java index 9dd07a52..a639367d 100644 --- a/HIRS_Utils/src/main/java/hirs/data/persist/certificate/PlatformCredential.java +++ b/HIRS_Utils/src/main/java/hirs/data/persist/certificate/PlatformCredential.java @@ -255,6 +255,8 @@ public class PlatformCredential extends DeviceAssociatedCertificate { @Column(length = MAX_MESSAGE_LENGTH) private String componentFailures = Strings.EMPTY; + @Column(length = MAX_MESSAGE_LENGTH) + private String componentFailureMessage = Strings.EMPTY; @Transient private EndorsementCredential endorsementCredential = null; @@ -736,6 +738,22 @@ public class PlatformCredential extends DeviceAssociatedCertificate { this.componentFailures = componentFailures; } + /** + * Getter for the component failures message. + * @return string of failures. + */ + public String getComponentFailureMessage() { + return componentFailureMessage; + } + + /** + * Setter for the component failure message instance. + * @param componentFailureMessage a string of failures. + */ + public void setComponentFailureMessage(final String componentFailureMessage) { + this.componentFailureMessage = componentFailureMessage; + } + /** * Get the Platform Configuration Attribute from the Platform Certificate. * @return a map with all the attributes From 1adedfefe1c76db4bb22875fcabed5570858c409 Mon Sep 17 00:00:00 2001 From: Cyrus <24922493+cyrus-dev@users.noreply.github.com> Date: Fri, 31 Mar 2023 10:16:30 -0400 Subject: [PATCH 02/15] Added missing 'does NOT' to the even summary page [no ci] --- .../src/main/webapp/WEB-INF/jsp/rim-details.jsp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/HIRS_AttestationCAPortal/src/main/webapp/WEB-INF/jsp/rim-details.jsp b/HIRS_AttestationCAPortal/src/main/webapp/WEB-INF/jsp/rim-details.jsp index e4503d4c..ad100208 100644 --- a/HIRS_AttestationCAPortal/src/main/webapp/WEB-INF/jsp/rim-details.jsp +++ b/HIRS_AttestationCAPortal/src/main/webapp/WEB-INF/jsp/rim-details.jsp @@ -161,10 +161,10 @@