@live-change/security-service 0.8.30 → 0.8.32
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/ban.js +4 -3
- package/event.js +8 -9
- package/package.json +5 -5
package/ban.js
CHANGED
|
@@ -284,14 +284,15 @@ definition.trigger({
|
|
|
284
284
|
|
|
285
285
|
const ban = app.generateUid()
|
|
286
286
|
|
|
287
|
-
service.trigger({
|
|
288
|
-
type: 'createTimer',
|
|
287
|
+
service.trigger({ type: 'createTimer' }, {
|
|
289
288
|
timer: {
|
|
290
289
|
timestamp: banExpire.getTime() + 1000,
|
|
291
290
|
service: 'security',
|
|
292
291
|
trigger: {
|
|
293
292
|
type: 'removeExpiredBan',
|
|
294
|
-
|
|
293
|
+
data: {
|
|
294
|
+
ban
|
|
295
|
+
}
|
|
295
296
|
}
|
|
296
297
|
}
|
|
297
298
|
})
|
package/event.js
CHANGED
|
@@ -91,19 +91,20 @@ async function processSecurityPatterns(event, time, service) {
|
|
|
91
91
|
|
|
92
92
|
let promises = []
|
|
93
93
|
for (const relation of newRelations) {
|
|
94
|
-
if (relation.type
|
|
94
|
+
if (relation.type === 'eq') {
|
|
95
95
|
// will be handled by event
|
|
96
|
-
} else if (relation.type
|
|
96
|
+
} else if (relation.type === 'timeout') {
|
|
97
97
|
const id = crypto.createHash('md5').update(event.id + relation.relation).digest('hex')
|
|
98
|
-
promises.push(service.trigger({
|
|
99
|
-
type: "createTimer",
|
|
98
|
+
promises.push(service.trigger({ type: "createTimer" }, {
|
|
100
99
|
timer: {
|
|
101
100
|
id,
|
|
102
101
|
timestamp: relation.time,
|
|
103
102
|
service: 'security',
|
|
104
103
|
trigger: {
|
|
105
104
|
type: 'handleTimeout',
|
|
106
|
-
|
|
105
|
+
data: {
|
|
106
|
+
timeout: relation
|
|
107
|
+
}
|
|
107
108
|
}
|
|
108
109
|
}
|
|
109
110
|
}))
|
|
@@ -121,8 +122,7 @@ async function processSecurityPatterns(event, time, service) {
|
|
|
121
122
|
// will be handled by event
|
|
122
123
|
} else if (relationModel.wait) {
|
|
123
124
|
const id = crypto.createHash('md5').update(event.id + relation.relation).digest('hex')
|
|
124
|
-
promises.push(service.trigger({
|
|
125
|
-
type: "cancelTimerIfExists",
|
|
125
|
+
promises.push(service.trigger({ type: "cancelTimerIfExists" }, {
|
|
126
126
|
timer: id
|
|
127
127
|
}))
|
|
128
128
|
} else {
|
|
@@ -235,10 +235,9 @@ definition.trigger({
|
|
|
235
235
|
for(const action of actions) {
|
|
236
236
|
const actionTypeUpperCase = action.type[0].toUpperCase() + action.type.slice(1)
|
|
237
237
|
//console.log("ACTION", JSON.stringify(action, null, ' '))
|
|
238
|
-
promises.push(service.trigger({
|
|
238
|
+
promises.push(service.trigger({ type: 'securityAction' + actionTypeUpperCase }, {
|
|
239
239
|
...action,
|
|
240
240
|
event,
|
|
241
|
-
type: 'securityAction' + actionTypeUpperCase
|
|
242
241
|
}))
|
|
243
242
|
}
|
|
244
243
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@live-change/security-service",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.32",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -22,10 +22,10 @@
|
|
|
22
22
|
},
|
|
23
23
|
"type": "module",
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@live-change/framework": "^0.8.
|
|
26
|
-
"@live-change/pattern": "^0.8.
|
|
27
|
-
"@live-change/pattern-db": "^0.8.
|
|
25
|
+
"@live-change/framework": "^0.8.32",
|
|
26
|
+
"@live-change/pattern": "^0.8.32",
|
|
27
|
+
"@live-change/pattern-db": "^0.8.32",
|
|
28
28
|
"nodemailer": "^6.7.2"
|
|
29
29
|
},
|
|
30
|
-
"gitHead": "
|
|
30
|
+
"gitHead": "9ea7767670a99404794087726223064c45d798d3"
|
|
31
31
|
}
|