@indra.ai/deva.security 0.0.34 → 0.0.35
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 +14 -1
- package/package.json +1 -1
package/feature/methods.js
CHANGED
|
@@ -66,8 +66,21 @@ export default {
|
|
|
66
66
|
describe: Return system md5 hash for the based deva.
|
|
67
67
|
***************/
|
|
68
68
|
hash(packet) {
|
|
69
|
+
const transport = packet.id;
|
|
69
70
|
this.feature('security');
|
|
70
|
-
|
|
71
|
+
this.action('method', `hash:${transport}`);
|
|
72
|
+
|
|
73
|
+
this.state('set', `meta:${transport}`); //set the meta state for the proxy
|
|
74
|
+
const {meta} = packet.q; // set the meta information from the packet question.
|
|
75
|
+
|
|
76
|
+
this.state('set', `params:${transport}`); //set the meta state for the proxy
|
|
77
|
+
const {params} = meta; // set params from the meta information.
|
|
78
|
+
|
|
79
|
+
this.state('set', `algo:${transport}`); //set the meta state for the proxy
|
|
80
|
+
const algo = params[1] ? params[1] : 'md5'
|
|
81
|
+
|
|
82
|
+
this.state('set', `hash:${transport}`); //set the meta state for the proxy
|
|
83
|
+
const hash = this.lib.hash(packet.q.text, algo);
|
|
71
84
|
return Promise.resolve(hash);
|
|
72
85
|
},
|
|
73
86
|
|