@5minds/node-red-contrib-processcube 1.15.5 → 1.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
@@ -9,6 +9,8 @@
|
|
9
9
|
clientIdType: { type: 'str' },
|
10
10
|
clientSecret: { value: '' },
|
11
11
|
clientSecretType: { type: 'str' },
|
12
|
+
scope: { value: 'engine_etw engine_read engine_write engine_observer' },
|
13
|
+
scopeType: { type: 'str' },
|
12
14
|
},
|
13
15
|
label: function () {
|
14
16
|
return this.name || this.url;
|
@@ -29,6 +31,11 @@
|
|
29
31
|
types: ['str', 'env', 'cred'],
|
30
32
|
});
|
31
33
|
|
34
|
+
$('#node-config-input-scope').typedInput({
|
35
|
+
default: 'str',
|
36
|
+
types: ['str', 'env', 'cred'],
|
37
|
+
});
|
38
|
+
|
32
39
|
$('#node-config-input-url').typedInput('value', this.url);
|
33
40
|
$('#node-config-input-url').typedInput('type', this.urlType);
|
34
41
|
|
@@ -37,6 +44,9 @@
|
|
37
44
|
|
38
45
|
$('#node-config-input-clientSecret').typedInput('value', this.clientSecret);
|
39
46
|
$('#node-config-input-clientSecret').typedInput('type', this.clientSecretType);
|
47
|
+
|
48
|
+
$('#node-config-input-scope').typedInput('value', this.scope);
|
49
|
+
$('#node-config-input-scope').typedInput('type', this.scopeType);
|
40
50
|
},
|
41
51
|
oneditsave: function () {
|
42
52
|
this.url = $('#node-config-input-url').typedInput('value');
|
@@ -47,6 +57,9 @@
|
|
47
57
|
|
48
58
|
this.clientSecret = $('#node-config-input-clientSecret').typedInput('value');
|
49
59
|
this.clientSecretType = $('#node-config-input-clientSecret').typedInput('type');
|
60
|
+
|
61
|
+
this.scope = $('#node-config-input-scope').typedInput('value');
|
62
|
+
this.scopeType = $('#node-config-input-scope').typedInput('type');
|
50
63
|
},
|
51
64
|
});
|
52
65
|
</script>
|
@@ -68,6 +81,10 @@
|
|
68
81
|
<label for="node-config-input-clientSecret"><i class="fa fa-bookmark"></i> Client secret</label>
|
69
82
|
<input type="text" id="node-config-input-clientSecret" />
|
70
83
|
</div>
|
84
|
+
<div class="form-row">
|
85
|
+
<label for="node-config-input-scope"><i class="fa fa-bookmark"></i> Scope</label>
|
86
|
+
<input type="text" id="node-config-input-scope" />
|
87
|
+
</div>
|
71
88
|
</script>
|
72
89
|
|
73
90
|
<script type="text/markdown" data-help-name="processcube-engine-config">
|
@@ -78,6 +95,7 @@ The configuration for the ProcessCube engine.
|
|
78
95
|
: url (String) : The URL of the ProcessCube engine.
|
79
96
|
: clientId (String) : The client id for the ProcessCube engine.
|
80
97
|
: clientSecret (String) : The client secret for the ProcessCube engine.
|
98
|
+
: scope (String|Secret|ENV) : The scope for the ProcessCube engine.
|
81
99
|
|
82
100
|
### References
|
83
101
|
|
@@ -8,6 +8,11 @@ module.exports = function (RED) {
|
|
8
8
|
node.url = RED.util.evaluateNodeProperty(n.url, n.urlType, node);
|
9
9
|
node.credentials.clientId = RED.util.evaluateNodeProperty(n.clientId, n.clientIdType, node);
|
10
10
|
node.credentials.clientSecret = RED.util.evaluateNodeProperty(n.clientSecret, n.clientSecretType, node);
|
11
|
+
node.credentials.scope = RED.util.evaluateNodeProperty(n.scope, n.scopeType, node);
|
12
|
+
|
13
|
+
if (!node.credentials.scope) {
|
14
|
+
node.credentials.scope = 'engine_etw engine_read engine_write engine_observer';
|
15
|
+
}
|
11
16
|
|
12
17
|
try {
|
13
18
|
if (node.credentials.clientId && node.credentials.clientSecret) {
|
@@ -15,7 +20,7 @@ module.exports = function (RED) {
|
|
15
20
|
node.engineClient = new engine_client.EngineClient(node.url, {
|
16
21
|
clientId: node.credentials.clientId,
|
17
22
|
clientSecret: node.credentials.clientSecret,
|
18
|
-
scope:
|
23
|
+
scope: node.credentials.scope,
|
19
24
|
});
|
20
25
|
} else {
|
21
26
|
node.log('Create Client without secrets');
|