@indra.ai/deva.guard 0.0.29 → 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.
Files changed (2) hide show
  1. package/feature/methods.js +53 -63
  2. package/package.json +2 -2
@@ -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
- case: client.profile.caseid,
120
+ message,
121
+ caseid: client.profile.caseid,
110
122
  opts: opts.length? `:${opts.join(':')}` : '',
111
- agent: agent.profile,
112
- client: client.profile,
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('secure', `md5:${transport}`); // set state to secure hashing
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('secure', `sha256:${transport}`); // set state to secure hashing
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('secure', `sha512:${transport}`); // set state to secure hashing
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
- `agent: ${data.agent.id}`,
153
- `client: ${data.client.id}`,
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,32 +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')
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
+
238
243
  this.state('set', `data:${transport}`); // set the state to set data
239
244
  // data packet
240
245
  const data = {
241
246
  uid,
242
- message,
243
247
  time,
244
248
  transport,
245
249
  write,
246
- case: client.profile.caseid,
250
+ message,
251
+ caseid: client.profile.caseid,
247
252
  opts: opts.length? `:${opts.join(':')}` : '',
248
- agent: agent.profile,
249
- client: client.profile,
253
+ agent: agent_profile,
254
+ client: client_profile,
250
255
  name: client.profile.name,
251
- fullname: client.profile.fullname,
252
- nickname: client.profile.nickname,
253
- birthname: client.profile.birthname,
254
- gender: client.profile.gender,
255
- pronouns: client.profile.pronouns,
256
- emojis: client.profile.emojis,
257
256
  company: client.profile.company,
258
- address: `${client.profile.address} ${client.profile.city} ${client.profile.state} ${client.profile.zipcode}`,
259
- family: client.profile.family,
260
- friends: client.profile.friends,
257
+ emojis: client.profile.emojis,
261
258
  token: client.profile.token,
262
259
  warning: client.profile.warning,
260
+ token,
263
261
  concerns,
264
262
  meta,
265
263
  params,
@@ -268,13 +266,13 @@ export default {
268
266
  copyright: client.profile.copyright,
269
267
  };
270
268
 
271
- this.state('secure', `md5:${transport}`); // set state to secure hashing
269
+ this.state('hash', `md5:${transport}`); // set state to hash hashing
272
270
  data.md5 = this.lib.hash(data, 'md5'); // hash data packet into md5 and inert into data.
273
271
 
274
- this.state('secure', `sha256:${transport}`); // set state to secure hashing
272
+ this.state('hash', `sha256:${transport}`); // set state to hash hashing
275
273
  data.sha256 = this.lib.hash(data, 'sha256'); // hash data into sha 256 then set in data.
276
274
 
277
- this.state('secure', `sha512:${transport}`); // set state to secure hashing
275
+ this.state('hash', `sha512:${transport}`); // set state to hash hashing
278
276
  data.sha512 = this.lib.hash(data, 'sha512'); // hash data into sha 512 then set in data.
279
277
 
280
278
  this.state('set', `text:${transport}`); // set state to text for output formatting.
@@ -283,28 +281,20 @@ export default {
283
281
  `::BEGIN:${data.write}:${transport}`,
284
282
  `#VectorGuardShield${data.opts} ${data.message}`,
285
283
  `::begin:vector:guard:shield:${transport}:${data.emojis}`,
286
- `time: ${data.time}`,
287
284
  `transport: ${data.transport}`,
288
- `agent: ${data.agent.id}`,
289
- `client: ${data.client.id}`,
285
+ `time: ${data.time}`,
286
+ `caseid: ${data.caseid}`,
287
+ `agent: ${data.agent}`,
288
+ `client: ${data.client}`,
290
289
  `name: ${data.name}`,
291
- `fullname: ${data.fullname}`,
292
- `nickname: ${data.nickname}`,
293
- `family: ${data.family}`,
294
- `friends: ${data.friends}`,
295
- `gender: ${data.gender}`,
296
- `pronouns: ${data.pronouns}`,
297
290
  `company: ${data.company}`,
298
- `address: ${data.address}`,
299
291
  `token: ${data.token}`,
300
- `concerns: ${data.concerns}`,
301
292
  `warning: ${data.warning}`,
302
- `caseid: ${data.caseid}`,
303
293
  `created: ${data.created}`,
294
+ `copyright: ${data.copyright}`,
304
295
  `md5: ${data.md5}`,
305
296
  `sha256: ${data.sha256}`,
306
297
  `sha512: ${data.sha512}`,
307
- `copyright: ${data.copyright}`,
308
298
  `::end:vector:guard:shield:${data.transport}:${data.emojis}`,
309
299
  `::END:${data.write}:${transport}`,
310
300
  '::::',
@@ -396,13 +386,13 @@ export default {
396
386
  created,
397
387
  };
398
388
 
399
- this.state('secure', `md5:${transport}`); // set state to secure hashing
389
+ this.state('hash', `md5:${transport}`); // set state to hash hashing
400
390
  data.md5 = this.lib.hash(data, 'md5'); // hash data packet into md5 and inert into data.
401
391
 
402
- this.state('secure', `sha256:${transport}`); // set state to secure hashing
392
+ this.state('hash', `sha256:${transport}`); // set state to hash hashing
403
393
  data.sha256 = this.lib.hash(data, 'sha256'); // hash data into sha 256 then set in data.
404
394
 
405
- this.state('secure', `sha512:${transport}`); // set state to secure hashing
395
+ this.state('hash', `sha512:${transport}`); // set state to hash hashing
406
396
  data.sha512 = this.lib.hash(data, 'sha512'); // hash data into sha 512 then set in data.
407
397
 
408
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.29",
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.41"
30
+ "@indra.ai/deva": "^1.5.43"
31
31
  },
32
32
  "data": {
33
33
  "agent": {