From 81d490c9cac82c6e12f6a24bf7f71a807ecbf429 Mon Sep 17 00:00:00 2001 From: "Haritz S. Sierra" <31985294+haritzsaiz@users.noreply.github.com> Date: Tue, 2 Jan 2024 07:13:22 +0100 Subject: [PATCH] fixing DMS - AWS integration and cert expirations (#17) Signed-off-by: Haritz Saiz --- .../views/CaInspector/IssuedCertificates.tsx | 2 +- .../DmsActions/DMSForm.tsx | 18 +++++++----------- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/src/views/CertificateAuthoritiesView/views/CaInspector/IssuedCertificates.tsx b/src/views/CertificateAuthoritiesView/views/CaInspector/IssuedCertificates.tsx index 49c90de..cea0bbc 100644 --- a/src/views/CertificateAuthoritiesView/views/CaInspector/IssuedCertificates.tsx +++ b/src/views/CertificateAuthoritiesView/views/CaInspector/IssuedCertificates.tsx @@ -143,7 +143,7 @@ export const IssuedCertificates: React.FC = ({ caData }) => { {moment(cert.valid_to).format("DD-MM-YYYY HH:mm")} - {moment.duration(moment(caData.valid_to).diff(moment())).humanize(true)} + {moment.duration(moment(cert.valid_to).diff(moment())).humanize(true)} ), diff --git a/src/views/DeviceManufacturingSystemView/DmsActions/DMSForm.tsx b/src/views/DeviceManufacturingSystemView/DmsActions/DMSForm.tsx index 6035b97..1f4728d 100644 --- a/src/views/DeviceManufacturingSystemView/DmsActions/DMSForm.tsx +++ b/src/views/DeviceManufacturingSystemView/DmsActions/DMSForm.tsx @@ -292,11 +292,7 @@ export const DMSForm: React.FC = ({ dms, onSubmit, actionLabel = "Create" if (data.awsIotIntegration.enableShadow) { shadowConfig = { enable: true, - shadow_name: data.awsIotIntegration.shadowType === "classic" - ? "" - : ( - data.awsIotIntegration.namedShadowName === "lamassu-identity" ? "" : data.awsIotIntegration.namedShadowName - ) + shadow_name: data.awsIotIntegration.shadowType === "classic" ? "" : data.awsIotIntegration.namedShadowName }; } @@ -859,8 +855,8 @@ function policyBuilder (accountID: string, shadowName: string) { "iot:Publish" ], Resource: [ - "arn:aws:iot:eu-west-1:ACCOUNTID:topic/${iot:Connection.Thing.ThingName}", - "arn:aws:iot:eu-west-1:ACCOUNTID:topic/${iot:Connection.Thing.ThingName}/shadow/SHADOWID*" + "arn:aws:iot:eu-west-1:ACCOUNTID:topic/$aws/things/${iot:Connection.Thing.ThingName}", + "arn:aws:iot:eu-west-1:ACCOUNTID:topic/$aws/things/${iot:Connection.Thing.ThingName}/shadow/SHADOWID*" ] }, { @@ -870,8 +866,8 @@ function policyBuilder (accountID: string, shadowName: string) { ], Resource: [ // "arn:aws:iot:eu-west-1:ACCOUNTID:topicfilter/dt/lms/well-known/cacerts", - "arn:aws:iot:eu-west-1:ACCOUNTID:topicfilter/${iot:Connection.Thing.ThingName}", - "arn:aws:iot:eu-west-1:ACCOUNTID:topicfilter/${iot:Connection.Thing.ThingName}/shadow/SHADOWID*" + "arn:aws:iot:eu-west-1:ACCOUNTID:topicfilter/$aws/things/${iot:Connection.Thing.ThingName}", + "arn:aws:iot:eu-west-1:ACCOUNTID:topicfilter/$aws/things/${iot:Connection.Thing.ThingName}/shadow/SHADOWID*" ] }, { @@ -881,8 +877,8 @@ function policyBuilder (accountID: string, shadowName: string) { ], Resource: [ // "arn:aws:iot:eu-west-1:ACCOUNTID:topic/dt/lms/well-known/cacerts", - "arn:aws:iot:eu-west-1:ACCOUNTID:topic/${iot:Connection.Thing.ThingName}", - "arn:aws:iot:eu-west-1:ACCOUNTID:topic/${iot:Connection.Thing.ThingName}/shadow/SHADOWID*" + "arn:aws:iot:eu-west-1:ACCOUNTID:topic/$aws/things/${iot:Connection.Thing.ThingName}", + "arn:aws:iot:eu-west-1:ACCOUNTID:topic/$aws/things/${iot:Connection.Thing.ThingName}/shadow/SHADOWID*" ] } ]