@jambonz/node-red-contrib-jambonz 2.4.21 → 2.4.22
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 +1 -1
- package/src/nodes/libs.js +1 -0
- package/src/nodes/userauth.html +37 -15
- package/src/nodes/userauth.js +11 -4
package/package.json
CHANGED
package/src/nodes/libs.js
CHANGED
package/src/nodes/userauth.html
CHANGED
|
@@ -17,10 +17,14 @@ RED.nodes.registerType('user auth',{
|
|
|
17
17
|
ha1Type: {},
|
|
18
18
|
expires: {value: ''},
|
|
19
19
|
expiresType: {},
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
application: {value: ''},
|
|
21
|
+
applicationType: {},
|
|
22
|
+
directUser: {value: ''},
|
|
23
|
+
directUserType: {},
|
|
24
|
+
directApp: {value: ''},
|
|
25
|
+
directAppType: {},
|
|
26
|
+
directQueue: {value: ''},
|
|
27
|
+
directQueueType: {},
|
|
24
28
|
},
|
|
25
29
|
inputs:1,
|
|
26
30
|
outputs:1,
|
|
@@ -39,13 +43,21 @@ RED.nodes.registerType('user auth',{
|
|
|
39
43
|
types: ['str', 'msg', 'flow', 'global', 'jsonata', 'env', mustacheType],
|
|
40
44
|
typeField: $('#node-input-expiresType')
|
|
41
45
|
});
|
|
42
|
-
$('#node-input-
|
|
46
|
+
$('#node-input-application').typedInput({
|
|
43
47
|
types: ['str', 'msg', 'flow', 'global', 'jsonata', 'env', mustacheType],
|
|
44
|
-
typeField: $('#node-input-
|
|
48
|
+
typeField: $('#node-input-applicationType')
|
|
45
49
|
});
|
|
46
|
-
$('#node-input-
|
|
47
|
-
types: ['
|
|
48
|
-
typeField: $('#node-input-
|
|
50
|
+
$('#node-input-directUser').typedInput({
|
|
51
|
+
types: ['bool', 'msg', 'flow', 'global', 'jsonata', 'env', mustacheType],
|
|
52
|
+
typeField: $('#node-input-directUserType')
|
|
53
|
+
});
|
|
54
|
+
$('#node-input-directApp').typedInput({
|
|
55
|
+
types: ['bool', 'msg', 'flow', 'global', 'jsonata', 'env', mustacheType],
|
|
56
|
+
typeField: $('#node-input-directAppType')
|
|
57
|
+
});
|
|
58
|
+
$('#node-input-directQueue').typedInput({
|
|
59
|
+
types: ['bool', 'msg', 'flow', 'global', 'jsonata', 'env', mustacheType],
|
|
60
|
+
typeField: $('#node-input-directQueueType')
|
|
49
61
|
});
|
|
50
62
|
}
|
|
51
63
|
});
|
|
@@ -77,14 +89,24 @@ RED.nodes.registerType('user auth',{
|
|
|
77
89
|
<input type="hidden" id="node-input-expiresType">
|
|
78
90
|
</div>
|
|
79
91
|
<div class="form-row">
|
|
80
|
-
<label for="node-input-
|
|
81
|
-
<input type="text" id="node-input-
|
|
82
|
-
<input type="hidden" id="node-input-
|
|
92
|
+
<label for="node-input-application">Default Application</label>
|
|
93
|
+
<input type="text" id="node-input-application">
|
|
94
|
+
<input type="hidden" id="node-input-applicationType">
|
|
95
|
+
</div>
|
|
96
|
+
<div class="form-row">
|
|
97
|
+
<label for="node-input-directUser">Allow direct calling to other users</label>
|
|
98
|
+
<input type="text" id="node-input-directUser">
|
|
99
|
+
<input type="hidden" id="node-input-directUserType">
|
|
100
|
+
</div>
|
|
101
|
+
<div class="form-row">
|
|
102
|
+
<label for="node-input-directApp">Allow direct calling to applications</label>
|
|
103
|
+
<input type="text" id="node-input-directApp">
|
|
104
|
+
<input type="hidden" id="node-input-directAppType">
|
|
83
105
|
</div>
|
|
84
106
|
<div class="form-row">
|
|
85
|
-
<label for="node-input-
|
|
86
|
-
<input type="text" id="node-input-
|
|
87
|
-
<input type="hidden" id="node-input-
|
|
107
|
+
<label for="node-input-directQueue">Allow direct calling to queues</label>
|
|
108
|
+
<input type="text" id="node-input-directQueue">
|
|
109
|
+
<input type="hidden" id="node-input-directQueueType">
|
|
88
110
|
</div>
|
|
89
111
|
</fieldset>
|
|
90
112
|
</script>
|
package/src/nodes/userauth.js
CHANGED
|
@@ -7,6 +7,8 @@ module.exports = function(RED) {
|
|
|
7
7
|
RED.nodes.createNode(this, config);
|
|
8
8
|
var node = this;
|
|
9
9
|
node.on('input', function(msg) {
|
|
10
|
+
console.log(config.directUser)
|
|
11
|
+
console.log(config.directUserType)
|
|
10
12
|
var attemptedAuthentication = false;
|
|
11
13
|
var auth = msg.authRequest;
|
|
12
14
|
var authResponse = {};
|
|
@@ -56,13 +58,18 @@ module.exports = function(RED) {
|
|
|
56
58
|
grantedExpires = Math.min(auth.expires, expires);
|
|
57
59
|
}
|
|
58
60
|
}
|
|
59
|
-
const
|
|
60
|
-
const
|
|
61
|
+
const application = new_resolve(RED, config.application, config.applicationType, node, msg);
|
|
62
|
+
const directUser = new_resolve(RED, config.directUser, config.directUserType, node, msg);
|
|
63
|
+
const directApp = new_resolve(RED, config.directApp, config.directAppType, node, msg);
|
|
64
|
+
const directQueue = new_resolve(RED, config.directQueue, config.directQueueType, node, msg);
|
|
65
|
+
console.log(directUser)
|
|
61
66
|
Object.assign(authResponse, {
|
|
62
67
|
status: 'ok',
|
|
63
68
|
expires: grantedExpires != null ? grantedExpires : null,
|
|
64
|
-
|
|
65
|
-
|
|
69
|
+
application_sid: application || null,
|
|
70
|
+
allow_direct_user_calling: directUser,
|
|
71
|
+
allow_direct_app_calling: directApp,
|
|
72
|
+
allow_direct_queue_calling: directQueue,
|
|
66
73
|
});
|
|
67
74
|
Object.keys(authResponse).forEach((k) => authResponse[k] == null && delete authResponse[k]);
|
|
68
75
|
}
|