@indra.ai/deva.license 0.0.5 → 0.0.7
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 +23 -23
- package/package.json +2 -2
package/feature/methods.js
CHANGED
|
@@ -8,31 +8,31 @@ export default {
|
|
|
8
8
|
const license = await this.methods.sign('license', 'default', packet);
|
|
9
9
|
return license;
|
|
10
10
|
},
|
|
11
|
-
async license_check(
|
|
12
|
-
this.state('license', `check:
|
|
13
|
-
if !
|
|
14
|
-
this.state('license', `check:
|
|
15
|
-
if !
|
|
16
|
-
this.state('license', `check:uid:${
|
|
17
|
-
if (
|
|
18
|
-
this.state('license', `check:time:${
|
|
19
|
-
if (
|
|
20
|
-
this.state('license', `check:date:${
|
|
21
|
-
if (
|
|
22
|
-
this.state('license', `check:md5:${
|
|
23
|
-
if (
|
|
24
|
-
this.state('license', `check:sha256:${
|
|
25
|
-
if (
|
|
26
|
-
this.state('license', `check:sha512:${
|
|
27
|
-
if (
|
|
11
|
+
async license_check(personalVLA, packageVLA) {
|
|
12
|
+
this.state('license', `check:personalVLA:${packageVLA.uid}`);
|
|
13
|
+
if (!personalVLA) return false;
|
|
14
|
+
this.state('license', `check:packageVLA:${packageVLA.uid}`);
|
|
15
|
+
if (!packageVLA) return false;
|
|
16
|
+
this.state('license', `check:uid:${packageVLA.uid}`);
|
|
17
|
+
if (personalVLA.uid !== packageVLA.uid) return false;
|
|
18
|
+
this.state('license', `check:time:${packageVLA.uid}`);
|
|
19
|
+
if (personalVLA.time !== packageVLA.time) return false;
|
|
20
|
+
this.state('license', `check:date:${packageVLA.uid}`);
|
|
21
|
+
if (personalVLA.date !== packageVLA.date) return false;
|
|
22
|
+
this.state('license', `check:md5:${packageVLA.uid}`);
|
|
23
|
+
if (personalVLA.md5 !== packageVLA.md5) return false;
|
|
24
|
+
this.state('license', `check:sha256:${packageVLA.uid}`);
|
|
25
|
+
if (personalVLA.sha256 !== packageVLA.sha256) return false;
|
|
26
|
+
this.state('license', `check:sha512:${packageVLA.uid}`);
|
|
27
|
+
if (personalVLA.sha512 !== packageVLA.sha512) return false;
|
|
28
28
|
|
|
29
29
|
// this is to ensure no additional information is being transmitted.
|
|
30
|
-
this.state('license', `compare:sha256:${
|
|
31
|
-
const
|
|
32
|
-
const
|
|
33
|
-
if (
|
|
30
|
+
this.state('license', `compare:sha256:${packageVLA.uid}`);
|
|
31
|
+
const personalVLA_hash = this.lib.hash(personalVLA, 'sha256');
|
|
32
|
+
const packageVLA_hash = this.lib.hash(packageVLA, 'sha256');
|
|
33
|
+
if (personalVLA_hash !== packageVLA_hash) return false;
|
|
34
34
|
|
|
35
|
-
this.state('return', `license:${
|
|
36
|
-
return
|
|
35
|
+
this.state('return', `license:${packageVLA.uid}`);
|
|
36
|
+
return personalVLA;
|
|
37
37
|
}
|
|
38
38
|
};
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "41840925813499570000",
|
|
3
3
|
"name": "@indra.ai/deva.license",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.7",
|
|
5
5
|
"license": "VLA:20758568792947085964 LICENSE.md",
|
|
6
6
|
"VLA": {
|
|
7
7
|
"uid": "20758568792947085964",
|
|
8
|
-
"time":
|
|
8
|
+
"time": 1757363101337,
|
|
9
9
|
"date": "Mon, Sep 8, 2025 - 1:25:01 PM",
|
|
10
10
|
"md5": "tc0Ex0fgG8Eq5WP8+DyjYA==",
|
|
11
11
|
"sha256": "gHWsEEMiHhZrdpC8sms/I+dbpdYXGJfaOO7hzjsN8GQ=",
|