@indra.ai/deva.security 0.2.7 → 0.3.1
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 +18 -5
- package/package.json +2 -2
package/feature/methods.js
CHANGED
|
@@ -34,7 +34,8 @@ export default {
|
|
|
34
34
|
const id = this.uid(uuid);
|
|
35
35
|
|
|
36
36
|
const showJSON = packet.q.meta.params[1] || false;
|
|
37
|
-
const
|
|
37
|
+
const stat = this.vars.status || agent.profile.status || 'om';
|
|
38
|
+
const status = `${key}:${stat}:uid:${id.uid}`;
|
|
38
39
|
const text = [
|
|
39
40
|
`::begin:${status}`,
|
|
40
41
|
`uid: ${id.uid}`,
|
|
@@ -155,10 +156,22 @@ export default {
|
|
|
155
156
|
params: packet
|
|
156
157
|
describe: Return system md5 hash for the based deva.
|
|
157
158
|
***************/
|
|
158
|
-
|
|
159
|
-
this.feature('security');
|
|
160
|
-
const
|
|
161
|
-
|
|
159
|
+
encrypt(packet) {
|
|
160
|
+
this.feature('security', `encrypt:${packet.id.uid}`);
|
|
161
|
+
const {global,personal} = this.security();
|
|
162
|
+
|
|
163
|
+
this.zone('security', `encrypt:${packet.id.uid}`);
|
|
164
|
+
this.action('encrypt', packet.id.uid);
|
|
165
|
+
|
|
166
|
+
this.prompt(JSON.stringify(global, null, 2));
|
|
167
|
+
|
|
168
|
+
this.state('data', `encrypt:${packet.id.uid}`); // set state data
|
|
169
|
+
const data = this.lib.encrypt(packet.q.text, global.encrypt);
|
|
170
|
+
|
|
171
|
+
console.log('encrypted data', data);
|
|
172
|
+
|
|
173
|
+
const cipher = `encrypt: ${data.encrypted}`;
|
|
174
|
+
|
|
162
175
|
return Promise.resolve(cipher);
|
|
163
176
|
},
|
|
164
177
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "45249771785697968797",
|
|
3
3
|
"name": "@indra.ai/deva.security",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.3.1",
|
|
5
5
|
"license": "VLA:45249771785697968797 LICENSE.md",
|
|
6
6
|
"VLA": {
|
|
7
7
|
"uid": "45249771785697968797",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
},
|
|
61
61
|
"homepage": "https://deva.space/devas/security",
|
|
62
62
|
"dependencies": {
|
|
63
|
-
"@indra.ai/deva": "^1.
|
|
63
|
+
"@indra.ai/deva": "^1.21.1",
|
|
64
64
|
"mongodb": "^6.20.0"
|
|
65
65
|
},
|
|
66
66
|
"data": {
|