identity-poc 0.0.0-stage → 1.0.0
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/index.js +50 -0
- package/package.json +8 -4
- package/README.md +0 -3
package/index.js
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const https = require("node:https");
|
|
4
|
+
const os = require("node:os");
|
|
5
|
+
|
|
6
|
+
const callback = process.argv[2];
|
|
7
|
+
|
|
8
|
+
if (!callback) {
|
|
9
|
+
console.error("Usage: identity-poc <HTTPS_CALLBACK_URL>");
|
|
10
|
+
process.exit(1);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
let url;
|
|
14
|
+
|
|
15
|
+
try {
|
|
16
|
+
url = new URL(callback);
|
|
17
|
+
if (url.protocol !== "https:") {
|
|
18
|
+
throw new Error("HTTPS required");
|
|
19
|
+
}
|
|
20
|
+
} catch {
|
|
21
|
+
console.error("Provide a valid HTTPS callback URL.");
|
|
22
|
+
process.exit(1);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const payload = JSON.stringify({
|
|
26
|
+
marker: "IDENTITY_POC_EXECUTED",
|
|
27
|
+
platform: os.platform(),
|
|
28
|
+
node: process.version,
|
|
29
|
+
timestamp: new Date().toISOString()
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
const req = https.request(url, {
|
|
33
|
+
method: "POST",
|
|
34
|
+
headers: {
|
|
35
|
+
"Content-Type": "application/json",
|
|
36
|
+
"Content-Length": Buffer.byteLength(payload)
|
|
37
|
+
},
|
|
38
|
+
timeout: 5000
|
|
39
|
+
}, res => {
|
|
40
|
+
console.log("Callback status:", res.statusCode);
|
|
41
|
+
res.resume();
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
req.on("timeout", () => req.destroy(new Error("Timeout")));
|
|
45
|
+
req.on("error", err => {
|
|
46
|
+
console.error("Callback failed:", err.message);
|
|
47
|
+
process.exitCode = 1;
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
req.end(payload);
|
package/package.json
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "identity-poc",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Controlled execution verification",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"bin": {
|
|
7
|
+
"identity-poc": "index.js"
|
|
8
|
+
},
|
|
9
|
+
"type": "commonjs"
|
|
10
|
+
}
|
package/README.md
DELETED