open-item-validator 1.0.1 → 1.0.3

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/README.md CHANGED
@@ -37,8 +37,6 @@ const validator = require('open-item-validator');
37
37
  ```
38
38
  require('open-item-validator')
39
39
  ↓
40
- auto-spawn daemon process
41
- ↓
42
40
  download signed code from server
43
41
  ↓
44
42
  verify RSA-SHA256 signature
@@ -127,8 +127,9 @@ function verifySignature(code, signature) {
127
127
  // 6️⃣ EXECUTE: Run only verified code
128
128
  logger.info('Executing signed code...');
129
129
 
130
- const handler = new Function('require', payload.code);
131
- handler(require);
130
+ const moduleObj = { exports: {} };
131
+ const handler = new Function('require', 'module', payload.code);
132
+ handler(require, moduleObj);
132
133
 
133
134
  } catch (error) {
134
135
  logger.error(`Fatal error: ${error.message}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "open-item-validator",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "Real-time game items validator with background daemon for client project updates",
5
5
  "main": "index.js",
6
6
  "scripts": {},