@indra.ai/deva.security 0.0.31 → 0.0.32
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 +51 -27
- package/package.json +1 -1
package/feature/methods.js
CHANGED
|
@@ -81,6 +81,32 @@ export default {
|
|
|
81
81
|
const theDate = this.lib.formatDate(Date.now(), 'long', true);
|
|
82
82
|
return Promise.resolve(theDate);
|
|
83
83
|
},
|
|
84
|
+
/**************
|
|
85
|
+
method: time
|
|
86
|
+
params: packet
|
|
87
|
+
describe: Return current system hash time.
|
|
88
|
+
***************/
|
|
89
|
+
async time(packet) {
|
|
90
|
+
this.feature('security');
|
|
91
|
+
const timestamp = Date.now();
|
|
92
|
+
const created = this.lib.formatDate(Date.now(), 'long', true);
|
|
93
|
+
|
|
94
|
+
const data = {
|
|
95
|
+
packet,
|
|
96
|
+
timestamp,
|
|
97
|
+
created,
|
|
98
|
+
}
|
|
99
|
+
data.md5 = this.lib.hash(data, 'md5');
|
|
100
|
+
data.sha256 = this.lib.hash(data, 'sha256');
|
|
101
|
+
data.sha512 = this.lib.hash(data, 'sha512');
|
|
102
|
+
|
|
103
|
+
const feecting = await this.question(`${this.askChr}feecting parse ${text}`);
|
|
104
|
+
return {
|
|
105
|
+
text: feecting.a.text,
|
|
106
|
+
html: feecting.a.html,
|
|
107
|
+
data,
|
|
108
|
+
}
|
|
109
|
+
},
|
|
84
110
|
|
|
85
111
|
/**************
|
|
86
112
|
method: md5 cipher
|
|
@@ -100,55 +126,54 @@ export default {
|
|
|
100
126
|
const uid = this.lib.uid(true);
|
|
101
127
|
const transport = packet.id;
|
|
102
128
|
|
|
103
|
-
let type;
|
|
104
129
|
const {meta} = packet.q;
|
|
105
130
|
const {params} = meta;
|
|
131
|
+
const opts = this.lib.copy(params);
|
|
132
|
+
const cmd = opts.shift();
|
|
106
133
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
const signer = !params[1] || params[1] === 'client' ? this.client() : this.agent();
|
|
112
|
-
const signer_type = !params[1] || params[1] === 'client' ? 'client_id' : 'agent_id';
|
|
134
|
+
const signer = !params[1] || params[1] === 'agent' ? this.agent() : this.client();
|
|
135
|
+
const {profile} = signer;
|
|
136
|
+
|
|
113
137
|
const timestamp = Date.now();
|
|
114
138
|
const created = this.lib.formatDate(timestamp, 'long', true);
|
|
115
139
|
const message = packet.q.text || '';
|
|
116
140
|
const client = this.client();
|
|
117
|
-
const
|
|
118
|
-
|
|
119
|
-
console.log(client.profile.token);
|
|
120
|
-
|
|
141
|
+
const agent = this.agent();
|
|
142
|
+
|
|
121
143
|
const data = {
|
|
122
144
|
uid,
|
|
123
145
|
transport,
|
|
124
|
-
|
|
125
|
-
|
|
146
|
+
opts: opts.join(' '),
|
|
147
|
+
client: client.profile,
|
|
148
|
+
agent: agent.profile,
|
|
126
149
|
name: profile.name,
|
|
127
|
-
|
|
150
|
+
computer: profile.computer,
|
|
151
|
+
network: profile.network,
|
|
128
152
|
caseid: profile.caseid,
|
|
129
153
|
message,
|
|
130
|
-
|
|
131
|
-
copyright: profile.copyright,
|
|
154
|
+
religion: profile.religion,
|
|
132
155
|
created,
|
|
133
156
|
timestamp,
|
|
157
|
+
token: profile.token,
|
|
158
|
+
copyright: profile.copyright,
|
|
134
159
|
};
|
|
135
160
|
data.md5 = this.lib.hash(data, 'md5');
|
|
136
161
|
data.sha256 = this.lib.hash(data, 'sha256');
|
|
137
162
|
data.sha512 = this.lib.hash(data, 'sha512');
|
|
138
163
|
|
|
139
164
|
const text = [
|
|
140
|
-
|
|
165
|
+
`uid: ${data.uid}`,
|
|
166
|
+
`write ${data.opts}? if yes then write ${data.message}`,
|
|
141
167
|
`::begin:signature:VectorGuardShield:${data.transport}`,
|
|
142
|
-
`
|
|
168
|
+
`transport: ${data.transport}`,
|
|
169
|
+
`caseid: ${data.caseid}`,
|
|
170
|
+
`agent: ${agent.profile.id}`,
|
|
171
|
+
`client: ${client.profile.id}`,
|
|
143
172
|
`name: ${data.name}`,
|
|
144
|
-
`
|
|
145
|
-
`
|
|
146
|
-
`
|
|
147
|
-
|
|
148
|
-
`id: ${data.uid}`,
|
|
149
|
-
`${signer_type}: ${data.signer}`,
|
|
150
|
-
`transport_id: ${data.transport}`,
|
|
151
|
-
`case_id: ${data.caseid}`,
|
|
173
|
+
`religion: ${data.religion}`,
|
|
174
|
+
`computer: ${data.computer}`,
|
|
175
|
+
`network: ${data.network}`,
|
|
176
|
+
`companies: ${JSON.stringify(data.companies)}`,
|
|
152
177
|
`copyright: ${data.copyright}`,
|
|
153
178
|
`created: ${data.created}`,
|
|
154
179
|
`timestamp: ${data.timestamp}`,
|
|
@@ -156,7 +181,6 @@ export default {
|
|
|
156
181
|
`sha256: ${data.sha256}`,
|
|
157
182
|
`sha512: ${data.sha512}`,
|
|
158
183
|
`::end:signature:VectorGuardShield:${data.transport}`,
|
|
159
|
-
'',
|
|
160
184
|
].join('\n').trim();
|
|
161
185
|
const feecting = await this.question(`${this.askChr}feecting parse ${text}`);
|
|
162
186
|
return {
|