@indra.ai/deva.security 0.0.35 → 0.0.36
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 +18 -7
- package/package.json +1 -1
package/feature/methods.js
CHANGED
|
@@ -61,13 +61,14 @@ export default {
|
|
|
61
61
|
},
|
|
62
62
|
|
|
63
63
|
/**************
|
|
64
|
-
method: md5 hash
|
|
64
|
+
method: md5, sha256, sha512 hash
|
|
65
65
|
params: packet
|
|
66
|
-
describe: Return system md5
|
|
66
|
+
describe: Return system md5, sha256, sha512 hash from value.
|
|
67
67
|
***************/
|
|
68
68
|
hash(packet) {
|
|
69
69
|
const transport = packet.id;
|
|
70
|
-
this.
|
|
70
|
+
this.zone('security', `hash:${transport}`);
|
|
71
|
+
this.feature('security', `hash:${transport}`);
|
|
71
72
|
this.action('method', `hash:${transport}`);
|
|
72
73
|
|
|
73
74
|
this.state('set', `meta:${transport}`); //set the meta state for the proxy
|
|
@@ -81,6 +82,8 @@ export default {
|
|
|
81
82
|
|
|
82
83
|
this.state('set', `hash:${transport}`); //set the meta state for the proxy
|
|
83
84
|
const hash = this.lib.hash(packet.q.text, algo);
|
|
85
|
+
|
|
86
|
+
this.state('return', `hash:${transport}`);
|
|
84
87
|
return Promise.resolve(hash);
|
|
85
88
|
},
|
|
86
89
|
|
|
@@ -102,8 +105,13 @@ export default {
|
|
|
102
105
|
describe: Return system date for today.
|
|
103
106
|
***************/
|
|
104
107
|
today(packet) {
|
|
105
|
-
|
|
108
|
+
const transport = packet.id;
|
|
109
|
+
this.zone('security', `today:${transport}`);
|
|
110
|
+
this.feature('security', `today:${transport}`);
|
|
111
|
+
this.action('method', `today:${transport}`);
|
|
112
|
+
this.state('get', `today:${transport}`);
|
|
106
113
|
const theDate = this.lib.formatDate(Date.now(), 'long', true);
|
|
114
|
+
this.state('get', `today:${transport}`);
|
|
107
115
|
return Promise.resolve(theDate);
|
|
108
116
|
},
|
|
109
117
|
/**************
|
|
@@ -112,10 +120,13 @@ export default {
|
|
|
112
120
|
describe: Return system date for today.
|
|
113
121
|
***************/
|
|
114
122
|
time(packet) {
|
|
115
|
-
|
|
116
|
-
this.
|
|
117
|
-
this.
|
|
123
|
+
const transport = packet.id;
|
|
124
|
+
this.zone('security', `time:${transport}`);
|
|
125
|
+
this.feature('security', `time:${transport}`);
|
|
126
|
+
this.action('method', `time:${transport}`);
|
|
127
|
+
this.state('get', `time:${transport}`);
|
|
118
128
|
const theTime = Date.now();
|
|
129
|
+
this.state('return', `time:${transport}`);
|
|
119
130
|
return Promise.resolve(theTime);
|
|
120
131
|
},
|
|
121
132
|
|