@indra.ai/deva.security 0.0.41 → 0.0.42
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/feature/methods.js +3 -41
- package/package.json +1 -1
package/feature/methods.js
CHANGED
|
@@ -5,47 +5,9 @@ export default {
|
|
|
5
5
|
params: packet
|
|
6
6
|
describe: The global security feature that installs with every agent
|
|
7
7
|
***************/
|
|
8
|
-
security(packet) {
|
|
9
|
-
this.
|
|
10
|
-
return
|
|
11
|
-
const security = this.security();
|
|
12
|
-
const agent = this.agent();
|
|
13
|
-
const global = [];
|
|
14
|
-
security.global.forEach((item,index) => {
|
|
15
|
-
global.push(`::begin:global:${item.key}:${item.id}`);
|
|
16
|
-
for (let x in item) {
|
|
17
|
-
global.push(`${x}: ${item[x]}`);
|
|
18
|
-
}
|
|
19
|
-
global.push(`::end:global:${item.key}:${this.lib.hash(item)}`);
|
|
20
|
-
});
|
|
21
|
-
const concerns = [];
|
|
22
|
-
security.concerns.forEach((item, index) => {
|
|
23
|
-
concerns.push(`${index + 1}. ${item}`);
|
|
24
|
-
})
|
|
25
|
-
|
|
26
|
-
const info = [
|
|
27
|
-
'::BEGIN:SECURITY',
|
|
28
|
-
'### Client',
|
|
29
|
-
`::begin:client:${security.client_id}`,
|
|
30
|
-
`id: ${security.client_id}`,
|
|
31
|
-
`client: ${security.client_name}`,
|
|
32
|
-
'**concerns**',
|
|
33
|
-
concerns.join('\n'),
|
|
34
|
-
`::end:client:${this.lib.hash(security)}`,
|
|
35
|
-
'### Global',
|
|
36
|
-
global.join('\n'),
|
|
37
|
-
'::END:SECURITY'
|
|
38
|
-
].join('\n');
|
|
39
|
-
this.question(`${this.askChr}feecting parse ${info}`).then(feecting => {
|
|
40
|
-
return resolve({
|
|
41
|
-
text: feecting.a.text,
|
|
42
|
-
html: feecting.a.html,
|
|
43
|
-
data: security.concerns,
|
|
44
|
-
});
|
|
45
|
-
}).catch(err => {
|
|
46
|
-
return this.error(err, packet, reject);
|
|
47
|
-
})
|
|
48
|
-
});
|
|
8
|
+
async security(packet) {
|
|
9
|
+
const security = await this.methods.sign('security', 'default', packet);
|
|
10
|
+
return security;
|
|
49
11
|
},
|
|
50
12
|
|
|
51
13
|
/**************
|