New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@uhuru/awsiot-thing-creator

Package Overview
Dependencies
Maintainers
4
Versions
54
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@uhuru/awsiot-thing-creator - npm Package Compare versions

Comparing version 1.0.1-beta.35 to 1.0.1-beta.36

1

dist/thing-creator.d.ts

@@ -47,2 +47,3 @@ interface ConfigObject {

private deleteThing;
private removeCertificateFromThingAndDelete;
removeThingCerts({ failOnEmpty }?: {

@@ -49,0 +50,0 @@ failOnEmpty?: boolean;

53

dist/thing-creator.js

@@ -147,2 +147,34 @@ "use strict";

}
removeCertificateFromThingAndDelete(principal) {
return __awaiter(this, void 0, void 0, function* () {
const detachPolicyCmd = new client_iot_1.DetachPolicyCommand({
policyName: this.policyName,
target: principal
});
yield this.iotClient.send(detachPolicyCmd).catch((error) => {
throw new Error(`Failed to detach policy ${this.policyName} from ${principal}, reason: ${error.message}`);
});
const detachThingCmd = new client_iot_1.DetachThingPrincipalCommand({
principal: principal,
thingName: this.thingName
});
yield this.iotClient.send(detachThingCmd).catch((error) => {
throw new Error(`Failed to detach AWS IoT thing. Please check your AWS IoT configuration, reason: ${error.message}`);
});
const certificateId = principal.split('/')[1];
const updateCertCommand = new client_iot_1.UpdateCertificateCommand({
certificateId: certificateId,
newStatus: 'INACTIVE'
});
yield this.iotClient.send(updateCertCommand).catch((error) => {
throw new Error(`Failed to update certificate ${certificateId}, reason: ${error.message}`);
});
const deleteCertCommand = new client_iot_1.DeleteCertificateCommand({
certificateId
});
yield this.iotClient.send(deleteCertCommand).catch((error) => {
throw new Error(`Failed to delete certificate ${principal}, reason: ${error.message}`);
});
});
}
removeThingCerts({ failOnEmpty = true } = {}) {

@@ -166,22 +198,3 @@ return __awaiter(this, void 0, void 0, function* () {

for (const principal of principalsList) {
const detachPolicyCmd = new client_iot_1.DetachPolicyCommand({
policyName: this.policyName,
target: principal
});
yield this.iotClient.send(detachPolicyCmd).catch((error) => {
throw new Error(`Failed to detach policy ${this.policyName} from ${principal}, reason: ${error.message}`);
});
const detachThingCmd = new client_iot_1.DetachThingPrincipalCommand({
principal: principal,
thingName: this.thingName
});
yield this.iotClient.send(detachThingCmd).catch((error) => {
throw new Error(`Failed to detach AWS IoT thing. Please check your AWS IoT configuration, reason: ${error.message}`);
});
const deleteCertCommand = new client_iot_1.DeleteCertificateCommand({
certificateId: principal.split('/')[1]
});
yield this.iotClient.send(deleteCertCommand).catch((error) => {
throw new Error(`Failed to delete certificate ${principal}, reason: ${error.message}`);
});
yield this.removeCertificateFromThingAndDelete(principal);
}

@@ -188,0 +201,0 @@ });

{
"name": "@uhuru/awsiot-thing-creator",
"version": "1.0.1-beta.35",
"version": "1.0.1-beta.36",
"description": "",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc