Skip to content

Commit

Permalink
Add option to allow insecure SSL for mqtt publish action
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristianGmw committed Jul 30, 2021
1 parent 73c1d46 commit 958f8fe
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@maibornwolff/alt-core-js",
"version": "1.18.7",
"version": "1.18.8",
"description": "Simple test framework supporting execution of different `scenarios` based on `action` templates. The framework supports definition of different action types in an *yaml* format, including e.g. which endpoints have to be called with which parameters as well as defining validation rules to be applied on the responses. It also supports detailed report creation of the test results.",
"main": "lib/index",
"types": "lib/index",
Expand Down
5 changes: 5 additions & 0 deletions src/model/MqttPublishAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ class MqttPublishAction implements Action {

public allowFailure = false;

private allowInsecure = false;

private readonly diagramConfiguration: DiagramConfiguration;

private readonly variableAsPayload?: string;
Expand All @@ -58,6 +60,7 @@ class MqttPublishAction implements Action {
protoEncoding = actionDef.protoEncoding,
invokeEvenOnFail = actionDef.invokeEvenOnFail,
allowFailure = actionDef.allowFailure,
allowInsecure = actionDef.allowInsecure,
diagramConfiguration = actionDef.diagramConfiguration ?? {},
variableAsPayload = actionDef.variableAsPayload,
) {
Expand All @@ -73,6 +76,7 @@ class MqttPublishAction implements Action {
this.description = desc;
this.invokeEvenOnFail = invokeEvenOnFail;
this.allowFailure = allowFailure;
this.allowInsecure = allowInsecure;
this.diagramConfiguration = diagramConfiguration;
this.variableAsPayload = variableAsPayload;
}
Expand Down Expand Up @@ -154,6 +158,7 @@ class MqttPublishAction implements Action {
reconnectPeriod: 1000,
connectTimeout: 30000,
resubscribe: true,
rejectUnauthorized: !this.allowInsecure,
});

client.on('connect', () => {
Expand Down

0 comments on commit 958f8fe

Please sign in to comment.