@indra.ai/deva.security 0.0.28 → 0.0.29
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 +50 -21
- package/package.json +4 -8
package/feature/methods.js
CHANGED
|
@@ -54,8 +54,9 @@ export default {
|
|
|
54
54
|
describe: Return a system id to the user from the Log Buddy.
|
|
55
55
|
***************/
|
|
56
56
|
uid(packet) {
|
|
57
|
+
const uid = packet.q.text ? true : false
|
|
57
58
|
this.feature('security');
|
|
58
|
-
const id = this.lib.uid();
|
|
59
|
+
const id = this.lib.uid(uid);
|
|
59
60
|
return Promise.resolve(id);
|
|
60
61
|
},
|
|
61
62
|
|
|
@@ -93,32 +94,60 @@ export default {
|
|
|
93
94
|
return Promise.resolve(cipher);
|
|
94
95
|
},
|
|
95
96
|
|
|
96
|
-
async
|
|
97
|
+
async sign(packet) {
|
|
97
98
|
this.context('signature');
|
|
98
99
|
this.action('method', 'signature');
|
|
99
|
-
const
|
|
100
|
-
const
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
const
|
|
100
|
+
const uid = this.lib.uid(true);
|
|
101
|
+
const transport = packet.id;
|
|
102
|
+
|
|
103
|
+
let type;
|
|
104
|
+
const {meta} = packet.q;
|
|
105
|
+
const {params} = meta;
|
|
106
|
+
|
|
107
|
+
if (!params[1] || params[1] === 'client') type = `#${meta.key}.${params.join('.')}`;
|
|
108
|
+
else type = `#${meta.key}.${params.join('.')}`;
|
|
109
|
+
|
|
110
|
+
const signer = !params[1] || params[1] === 'client' ? this.client() : this.agent();
|
|
111
|
+
const created = this.lib.formatDate(Date.now(), 'long', true);
|
|
112
|
+
const message = packet.q.text || '';
|
|
113
|
+
const client = this.client();
|
|
114
|
+
const {profile} = signer;
|
|
115
|
+
|
|
116
|
+
console.log(client.profile.token);
|
|
104
117
|
|
|
105
118
|
const data = {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
119
|
+
uid,
|
|
120
|
+
transport,
|
|
121
|
+
type,
|
|
122
|
+
signer: signer.id,
|
|
123
|
+
name: profile.name,
|
|
124
|
+
caseid: profile.caseid,
|
|
125
|
+
message,
|
|
126
|
+
token: client.profile.token,
|
|
127
|
+
copyright: profile.copyright,
|
|
128
|
+
created,
|
|
129
|
+
};
|
|
130
|
+
data.md5 = this.lib.hash(data, 'md5');
|
|
131
|
+
data.sha256 = this.lib.hash(data, 'sha256');
|
|
132
|
+
|
|
113
133
|
const text = [
|
|
114
|
-
|
|
115
|
-
|
|
134
|
+
'::::::::::::::::::',
|
|
135
|
+
`::begin:signature:VectorGuardShield:${data.transport}`,
|
|
136
|
+
`type: ${type}`,
|
|
116
137
|
`name: ${data.name}`,
|
|
117
|
-
`
|
|
118
|
-
data.
|
|
119
|
-
|
|
120
|
-
data.
|
|
121
|
-
|
|
138
|
+
`message: ${data.message}`,
|
|
139
|
+
`token: ${data.token}`,
|
|
140
|
+
`---`,
|
|
141
|
+
`id: ${data.uid}`,
|
|
142
|
+
`${type}_id: ${data.signer}`,
|
|
143
|
+
`transport_id: ${data.transport}`,
|
|
144
|
+
`case_id: ${data.caseid}`,
|
|
145
|
+
`copyright: ${data.copyright}`,
|
|
146
|
+
`created: ${data.created}`,
|
|
147
|
+
`md5: ${data.md5}`,
|
|
148
|
+
`sha256: ${data.sha256}`,
|
|
149
|
+
`::end:signature:VectorGuardShield:${data.transport}`,
|
|
150
|
+
'::::::::::::::::::',
|
|
122
151
|
].join('\n').trim();
|
|
123
152
|
return {
|
|
124
153
|
text,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": 6507120243760,
|
|
3
3
|
"name": "@indra.ai/deva.security",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.29",
|
|
5
5
|
"author": "Quinn Michaels",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"copyright": "2025",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
},
|
|
29
29
|
"homepage": "https://deva.space/devas/security",
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@indra.ai/deva": "^1.5.
|
|
31
|
+
"@indra.ai/deva": "^1.5.40"
|
|
32
32
|
},
|
|
33
33
|
"data": {
|
|
34
34
|
"agent": {
|
|
@@ -72,6 +72,8 @@
|
|
|
72
72
|
"background": "/assets/devas/security/background.png",
|
|
73
73
|
"owner": "Quinn Michaels",
|
|
74
74
|
"creator": "Quinn Michaels",
|
|
75
|
+
"caseid": "FM-20250622-5114",
|
|
76
|
+
"copyright": "©2025 Quinn Michaels. All rights reserved.",
|
|
75
77
|
"created": "Monday, May 22, 2023 at 9:26 AM"
|
|
76
78
|
}
|
|
77
79
|
},
|
|
@@ -88,12 +90,6 @@
|
|
|
88
90
|
"label": "🔐SECURITY",
|
|
89
91
|
"signature": "@Security"
|
|
90
92
|
},
|
|
91
|
-
"live": {
|
|
92
|
-
"profile": "security",
|
|
93
|
-
"max_tokens": 50,
|
|
94
|
-
"words": 25,
|
|
95
|
-
"history": []
|
|
96
|
-
},
|
|
97
93
|
"ask": {
|
|
98
94
|
"history": []
|
|
99
95
|
},
|