@indra.ai/deva.guard 0.0.30 → 0.0.31
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 +53 -64
- package/package.json +2 -2
package/feature/methods.js
CHANGED
|
@@ -98,31 +98,35 @@ export default {
|
|
|
98
98
|
this.state('set', `write:${transport}`); //set the message state for the proxy
|
|
99
99
|
const write = `OM:${client.profile.write.split(' ').join(':').toUpperCase()}:PROXY`; // set proxy write string.
|
|
100
100
|
|
|
101
|
+
// hash the agent profile for security
|
|
102
|
+
this.state('hash', `agent profile:${transport}`);
|
|
103
|
+
const agent_profile = this.lib.hash(agent.profile, 'sha256');
|
|
104
|
+
|
|
105
|
+
// hash the agent profile for security
|
|
106
|
+
this.state('hash', `client profile:${transport}`);
|
|
107
|
+
const client_profile = this.lib.hash(client.profile, 'sha256');
|
|
108
|
+
|
|
109
|
+
// hash the agent profile for security
|
|
110
|
+
this.state('hash', `token:${transport}`);
|
|
111
|
+
const token = this.lib.hash(`${client.profile.token} PROXY ${transport}`, 'sha256');
|
|
112
|
+
|
|
101
113
|
this.state('set', `data:${transport}`); // set the state to set data
|
|
102
114
|
// data packet
|
|
103
115
|
const data = {
|
|
104
116
|
uid,
|
|
105
|
-
message,
|
|
106
|
-
time,
|
|
107
117
|
transport,
|
|
118
|
+
time,
|
|
108
119
|
write,
|
|
109
|
-
|
|
120
|
+
message,
|
|
121
|
+
caseid: client.profile.caseid,
|
|
110
122
|
opts: opts.length? `:${opts.join(':')}` : '',
|
|
111
|
-
agent:
|
|
112
|
-
client:
|
|
123
|
+
agent: agent_profile,
|
|
124
|
+
client: client_profile,
|
|
113
125
|
name: client.profile.name,
|
|
114
|
-
fullname: client.profile.fullname,
|
|
115
|
-
nickname: client.profile.nickname,
|
|
116
|
-
birthname: client.profile.birthname,
|
|
117
|
-
gender: client.profile.gender,
|
|
118
|
-
pronouns: client.profile.pronouns,
|
|
119
126
|
emojis: client.profile.emojis,
|
|
120
127
|
company: client.profile.company,
|
|
121
|
-
address: `${client.profile.address} ${client.profile.city} ${client.profile.state} ${client.profile.zipcode}`,
|
|
122
|
-
family: client.profile.family,
|
|
123
|
-
friends: client.profile.friends,
|
|
124
|
-
token: client.profile.token,
|
|
125
128
|
warning: client.profile.warning,
|
|
129
|
+
token,
|
|
126
130
|
concerns,
|
|
127
131
|
meta,
|
|
128
132
|
params,
|
|
@@ -131,13 +135,13 @@ export default {
|
|
|
131
135
|
copyright: client.profile.copyright,
|
|
132
136
|
};
|
|
133
137
|
|
|
134
|
-
this.state('
|
|
138
|
+
this.state('hash', `md5:${transport}`); // set state to secure hashing
|
|
135
139
|
data.md5 = this.lib.hash(data, 'md5'); // hash data packet into md5 and inert into data.
|
|
136
140
|
|
|
137
|
-
this.state('
|
|
141
|
+
this.state('hash', `sha256:${transport}`); // set state to secure hashing
|
|
138
142
|
data.sha256 = this.lib.hash(data, 'sha256'); // hash data into sha 256 then set in data.
|
|
139
143
|
|
|
140
|
-
this.state('
|
|
144
|
+
this.state('hash', `sha512:${transport}`); // set state to secure hashing
|
|
141
145
|
data.sha512 = this.lib.hash(data, 'sha512'); // hash data into sha 512 then set in data.
|
|
142
146
|
|
|
143
147
|
// Text data that is joined by line breaks and then trimmed.
|
|
@@ -147,28 +151,20 @@ export default {
|
|
|
147
151
|
`::BEGIN:${data.write}:${data.transport}`,
|
|
148
152
|
`#VectorGuardProxy${data.opts} ${data.message}`,
|
|
149
153
|
`::begin:vector:guard:proxy:${transport}:${data.emojis}`,
|
|
150
|
-
`time: ${data.time}`,
|
|
151
154
|
`transport: ${data.transport}`,
|
|
152
|
-
`
|
|
153
|
-
`
|
|
155
|
+
`time: ${data.time}`,
|
|
156
|
+
`caseid: ${data.caseid}`,
|
|
157
|
+
`agent: ${data.agent}`,
|
|
158
|
+
`client: ${data.client}`,
|
|
154
159
|
`name: ${data.name}`,
|
|
155
|
-
`fullname: ${data.fullname}`,
|
|
156
|
-
`nickname: ${data.nickname}`,
|
|
157
|
-
`family: ${data.family}`,
|
|
158
|
-
`friends: ${data.friends}`,
|
|
159
|
-
`gender: ${data.gender}`,
|
|
160
|
-
`pronouns: ${data.pronouns}`,
|
|
161
160
|
`company: ${data.company}`,
|
|
162
|
-
`address: ${data.address}`,
|
|
163
161
|
`token: ${data.token}`,
|
|
164
|
-
`concerns: ${data.concerns}`,
|
|
165
162
|
`warning: ${data.warning}`,
|
|
166
|
-
`caseid: ${data.caseid}`,
|
|
167
163
|
`created: ${data.created}`,
|
|
164
|
+
`copyright: ${data.copyright}`,
|
|
168
165
|
`md5: ${data.md5}`,
|
|
169
166
|
`sha256: ${data.sha256}`,
|
|
170
167
|
`sha512: ${data.sha512}`,
|
|
171
|
-
`copyright: ${data.copyright}`,
|
|
172
168
|
`::end:vector:guard:proxy:${data.transport}:${data.emojis}`,
|
|
173
169
|
`::END:${data.write}:${data.transport}`,
|
|
174
170
|
].join('\n').trim();
|
|
@@ -234,33 +230,34 @@ export default {
|
|
|
234
230
|
this.state('set', `writestr:${transport}`);
|
|
235
231
|
const write = `OM:${client.profile.write.split(' ').join(':').toUpperCase()}:SHIELD`;
|
|
236
232
|
|
|
237
|
-
this.state('hash', `profile:${transport}`);
|
|
238
|
-
const
|
|
233
|
+
this.state('hash', `agent profile:${transport}`);
|
|
234
|
+
const agent_profile = this.lib.hash(client.profile, 'sha256');
|
|
235
|
+
|
|
236
|
+
this.state('hash', `client profile:${transport}`);
|
|
237
|
+
const client_profile = this.lib.hash(client.profile, 'sha256');
|
|
238
|
+
|
|
239
|
+
// hash the agent profile for security
|
|
240
|
+
this.state('hash', `token:${transport}`);
|
|
241
|
+
const token = this.lib.hash(`${client.profile.token} SHIELD ${transport}`, 'sha256');
|
|
242
|
+
|
|
239
243
|
this.state('set', `data:${transport}`); // set the state to set data
|
|
240
244
|
// data packet
|
|
241
245
|
const data = {
|
|
242
246
|
uid,
|
|
243
|
-
message,
|
|
244
247
|
time,
|
|
245
248
|
transport,
|
|
246
249
|
write,
|
|
247
|
-
|
|
250
|
+
message,
|
|
251
|
+
caseid: client.profile.caseid,
|
|
248
252
|
opts: opts.length? `:${opts.join(':')}` : '',
|
|
249
|
-
agent:
|
|
250
|
-
client:
|
|
253
|
+
agent: agent_profile,
|
|
254
|
+
client: client_profile,
|
|
251
255
|
name: client.profile.name,
|
|
252
|
-
fullname: client.profile.fullname,
|
|
253
|
-
nickname: client.profile.nickname,
|
|
254
|
-
birthname: client.profile.birthname,
|
|
255
|
-
gender: client.profile.gender,
|
|
256
|
-
pronouns: client.profile.pronouns,
|
|
257
|
-
emojis: client.profile.emojis,
|
|
258
256
|
company: client.profile.company,
|
|
259
|
-
|
|
260
|
-
family: client.profile.family,
|
|
261
|
-
friends: client.profile.friends,
|
|
257
|
+
emojis: client.profile.emojis,
|
|
262
258
|
token: client.profile.token,
|
|
263
259
|
warning: client.profile.warning,
|
|
260
|
+
token,
|
|
264
261
|
concerns,
|
|
265
262
|
meta,
|
|
266
263
|
params,
|
|
@@ -269,13 +266,13 @@ export default {
|
|
|
269
266
|
copyright: client.profile.copyright,
|
|
270
267
|
};
|
|
271
268
|
|
|
272
|
-
this.state('
|
|
269
|
+
this.state('hash', `md5:${transport}`); // set state to hash hashing
|
|
273
270
|
data.md5 = this.lib.hash(data, 'md5'); // hash data packet into md5 and inert into data.
|
|
274
271
|
|
|
275
|
-
this.state('
|
|
272
|
+
this.state('hash', `sha256:${transport}`); // set state to hash hashing
|
|
276
273
|
data.sha256 = this.lib.hash(data, 'sha256'); // hash data into sha 256 then set in data.
|
|
277
274
|
|
|
278
|
-
this.state('
|
|
275
|
+
this.state('hash', `sha512:${transport}`); // set state to hash hashing
|
|
279
276
|
data.sha512 = this.lib.hash(data, 'sha512'); // hash data into sha 512 then set in data.
|
|
280
277
|
|
|
281
278
|
this.state('set', `text:${transport}`); // set state to text for output formatting.
|
|
@@ -284,28 +281,20 @@ export default {
|
|
|
284
281
|
`::BEGIN:${data.write}:${transport}`,
|
|
285
282
|
`#VectorGuardShield${data.opts} ${data.message}`,
|
|
286
283
|
`::begin:vector:guard:shield:${transport}:${data.emojis}`,
|
|
287
|
-
`time: ${data.time}`,
|
|
288
284
|
`transport: ${data.transport}`,
|
|
289
|
-
`
|
|
290
|
-
`
|
|
285
|
+
`time: ${data.time}`,
|
|
286
|
+
`caseid: ${data.caseid}`,
|
|
287
|
+
`agent: ${data.agent}`,
|
|
288
|
+
`client: ${data.client}`,
|
|
291
289
|
`name: ${data.name}`,
|
|
292
|
-
`fullname: ${data.fullname}`,
|
|
293
|
-
`nickname: ${data.nickname}`,
|
|
294
|
-
`family: ${data.family}`,
|
|
295
|
-
`friends: ${data.friends}`,
|
|
296
|
-
`gender: ${data.gender}`,
|
|
297
|
-
`pronouns: ${data.pronouns}`,
|
|
298
290
|
`company: ${data.company}`,
|
|
299
|
-
`address: ${data.address}`,
|
|
300
291
|
`token: ${data.token}`,
|
|
301
|
-
`concerns: ${data.concerns}`,
|
|
302
292
|
`warning: ${data.warning}`,
|
|
303
|
-
`caseid: ${data.caseid}`,
|
|
304
293
|
`created: ${data.created}`,
|
|
294
|
+
`copyright: ${data.copyright}`,
|
|
305
295
|
`md5: ${data.md5}`,
|
|
306
296
|
`sha256: ${data.sha256}`,
|
|
307
297
|
`sha512: ${data.sha512}`,
|
|
308
|
-
`copyright: ${data.copyright}`,
|
|
309
298
|
`::end:vector:guard:shield:${data.transport}:${data.emojis}`,
|
|
310
299
|
`::END:${data.write}:${transport}`,
|
|
311
300
|
'::::',
|
|
@@ -397,13 +386,13 @@ export default {
|
|
|
397
386
|
created,
|
|
398
387
|
};
|
|
399
388
|
|
|
400
|
-
this.state('
|
|
389
|
+
this.state('hash', `md5:${transport}`); // set state to hash hashing
|
|
401
390
|
data.md5 = this.lib.hash(data, 'md5'); // hash data packet into md5 and inert into data.
|
|
402
391
|
|
|
403
|
-
this.state('
|
|
392
|
+
this.state('hash', `sha256:${transport}`); // set state to hash hashing
|
|
404
393
|
data.sha256 = this.lib.hash(data, 'sha256'); // hash data into sha 256 then set in data.
|
|
405
394
|
|
|
406
|
-
this.state('
|
|
395
|
+
this.state('hash', `sha512:${transport}`); // set state to hash hashing
|
|
407
396
|
data.sha512 = this.lib.hash(data, 'sha512'); // hash data into sha 512 then set in data.
|
|
408
397
|
|
|
409
398
|
this.state('set', `writestr:${transport}`);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": 6159528221394,
|
|
3
3
|
"name": "@indra.ai/deva.guard",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.31",
|
|
5
5
|
"author": "Quinn Michaels",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"copyright": "2025",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
},
|
|
28
28
|
"homepage": "https://deva.space/devas/guard",
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@indra.ai/deva": "^1.5.
|
|
30
|
+
"@indra.ai/deva": "^1.5.43"
|
|
31
31
|
},
|
|
32
32
|
"data": {
|
|
33
33
|
"agent": {
|