Skip to content

Commit

Permalink
fixing DMS - AWS integration and cert expirations (#17)
Browse files Browse the repository at this point in the history
Signed-off-by: Haritz Saiz <[email protected]>
  • Loading branch information
haritzsaiz authored Jan 2, 2024
1 parent 8b7bf87 commit 81d490c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ export const IssuedCertificates: React.FC<Props> = ({ caData }) => {
{moment(cert.valid_to).format("DD-MM-YYYY HH:mm")}
</Typography >
<Typography style={{ fontWeight: "300", fontSize: 12, color: theme.palette.text.primary }}>
{moment.duration(moment(caData.valid_to).diff(moment())).humanize(true)}
{moment.duration(moment(cert.valid_to).diff(moment())).humanize(true)}
</Typography >
</Box>
),
Expand Down
18 changes: 7 additions & 11 deletions src/views/DeviceManufacturingSystemView/DmsActions/DMSForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -292,11 +292,7 @@ export const DMSForm: React.FC<Props> = ({ 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
};
}

Expand Down Expand Up @@ -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*"
]
},
{
Expand All @@ -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*"
]
},
{
Expand All @@ -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*"
]
}
]
Expand Down

0 comments on commit 81d490c

Please sign in to comment.