@botbuddy/cli 1.61.2 → 1.61.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/daemon/bin/darwin-arm64/botbuddy-daemon +0 -0
- package/daemon/bin/linux-x64/botbuddy-daemon +0 -0
- package/daemon-release/darwin-arm64.json +4 -4
- package/daemon-release/linux-x64.json +4 -4
- package/daemon-release/manifest.json +5 -5
- package/package.json +1 -1
- package/src/daemon/bootstrap.mjs +8 -4
- package/src/daemon/profile-delivery.mjs +6 -2
|
Binary file
|
|
Binary file
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
"release_version": "1.61.
|
|
3
|
-
"source_commit": "
|
|
4
|
-
"source_sha256": "
|
|
2
|
+
"release_version": "1.61.3",
|
|
3
|
+
"source_commit": "7c2f279f36d7ceb5f8d7a84e5698fe2dcf2f22e8",
|
|
4
|
+
"source_sha256": "170bd3f629a5bc5f894ae46191da975ff49f6761fd1b64da2aa6c2f76cc2472a",
|
|
5
5
|
"target": "darwin-arm64",
|
|
6
|
-
"sha256": "
|
|
6
|
+
"sha256": "612de50e3fd1d37a43007f8aaca735dbb2f5cc92e9c2b8d96fd198f0153ef6ec"
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
"release_version": "1.61.
|
|
3
|
-
"source_commit": "
|
|
4
|
-
"source_sha256": "
|
|
2
|
+
"release_version": "1.61.3",
|
|
3
|
+
"source_commit": "7c2f279f36d7ceb5f8d7a84e5698fe2dcf2f22e8",
|
|
4
|
+
"source_sha256": "170bd3f629a5bc5f894ae46191da975ff49f6761fd1b64da2aa6c2f76cc2472a",
|
|
5
5
|
"target": "linux-x64",
|
|
6
|
-
"sha256": "
|
|
6
|
+
"sha256": "75f71518b6446f547153e71e5c2a2cf15c8c475fd0e2039acfe561fa5cd66309"
|
|
7
7
|
}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schema_version": 1,
|
|
3
|
-
"release_version": "1.61.
|
|
4
|
-
"source_commit": "
|
|
5
|
-
"source_sha256": "
|
|
3
|
+
"release_version": "1.61.3",
|
|
4
|
+
"source_commit": "7c2f279f36d7ceb5f8d7a84e5698fe2dcf2f22e8",
|
|
5
|
+
"source_sha256": "170bd3f629a5bc5f894ae46191da975ff49f6761fd1b64da2aa6c2f76cc2472a",
|
|
6
6
|
"targets": {
|
|
7
7
|
"darwin-arm64": {
|
|
8
8
|
"goos": "darwin",
|
|
9
9
|
"goarch": "arm64",
|
|
10
10
|
"binary": "daemon/bin/darwin-arm64/botbuddy-daemon",
|
|
11
|
-
"sha256": "
|
|
11
|
+
"sha256": "612de50e3fd1d37a43007f8aaca735dbb2f5cc92e9c2b8d96fd198f0153ef6ec",
|
|
12
12
|
"mode": "0755"
|
|
13
13
|
},
|
|
14
14
|
"linux-x64": {
|
|
15
15
|
"goos": "linux",
|
|
16
16
|
"goarch": "amd64",
|
|
17
17
|
"binary": "daemon/bin/linux-x64/botbuddy-daemon",
|
|
18
|
-
"sha256": "
|
|
18
|
+
"sha256": "75f71518b6446f547153e71e5c2a2cf15c8c475fd0e2039acfe561fa5cd66309",
|
|
19
19
|
"mode": "0755"
|
|
20
20
|
}
|
|
21
21
|
}
|
package/package.json
CHANGED
package/src/daemon/bootstrap.mjs
CHANGED
|
@@ -67,10 +67,11 @@ function checkedSpec(spec) {
|
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
function checkedIdentity(value) {
|
|
70
|
-
if (!exactObject(value, ["version", "host_key", "public_key_spki_base64"]) ||
|
|
71
|
-
value.version !==
|
|
70
|
+
if (!exactObject(value, ["version", "host_key", "public_key_spki_base64", "hostname", "platform"]) ||
|
|
71
|
+
value.version !== 2 || typeof value.host_key !== "string" || !HOST_KEY_RE.test(value.host_key) ||
|
|
72
72
|
typeof value.public_key_spki_base64 !== "string" || !/^[A-Za-z0-9+/]+={0,2}$/.test(value.public_key_spki_base64) ||
|
|
73
|
-
value.public_key_spki_base64.length % 4 !== 0
|
|
73
|
+
value.public_key_spki_base64.length % 4 !== 0 || typeof value.hostname !== "string" ||
|
|
74
|
+
!/^[A-Za-z0-9][A-Za-z0-9.-]{0,252}$/.test(value.hostname) || !["darwin", "linux"].includes(value.platform)) fail("daemon_bootstrap_identity_invalid");
|
|
74
75
|
let spki;
|
|
75
76
|
try { spki = Buffer.from(value.public_key_spki_base64, "base64"); } catch { fail("daemon_bootstrap_identity_invalid"); }
|
|
76
77
|
if (
|
|
@@ -80,7 +81,7 @@ function checkedIdentity(value) {
|
|
|
80
81
|
spki[P256_SPKI_PREFIX.length] !== 0x04 ||
|
|
81
82
|
`bbh-${createHash("sha256").update(spki).digest("hex").slice(0, 24)}` !== value.host_key
|
|
82
83
|
) fail("daemon_bootstrap_identity_invalid");
|
|
83
|
-
return { hostKey: value.host_key, spki };
|
|
84
|
+
return { hostKey: value.host_key, spki, hostname: value.hostname, platform: value.platform };
|
|
84
85
|
}
|
|
85
86
|
|
|
86
87
|
function checkedRelease(value, spec) {
|
|
@@ -153,6 +154,7 @@ export function bootstrapRegistrationPayload({ identity, release, runtimeEngineI
|
|
|
153
154
|
if (!target.platform || !target.arch) fail("daemon_bootstrap_release_invalid");
|
|
154
155
|
const checked = checkedRelease(release, target);
|
|
155
156
|
const publicIdentity = checkedIdentity(identity);
|
|
157
|
+
if (publicIdentity.platform !== target.platform) fail("daemon_bootstrap_target_platform_mismatch");
|
|
156
158
|
if (typeof runtimeEngineId !== "string" || !ENGINE_ID_RE.test(runtimeEngineId)) fail("daemon_bootstrap_runtime_identity_invalid");
|
|
157
159
|
return {
|
|
158
160
|
host_key: publicIdentity.hostKey,
|
|
@@ -164,6 +166,8 @@ export function bootstrapRegistrationPayload({ identity, release, runtimeEngineI
|
|
|
164
166
|
runtime_kind: "go_daemon",
|
|
165
167
|
runtime_artifact_sha256: `sha256:${checked.sha256}`,
|
|
166
168
|
runtime_engine_id: runtimeEngineId,
|
|
169
|
+
runtime_platform: publicIdentity.platform,
|
|
170
|
+
hostname: publicIdentity.hostname,
|
|
167
171
|
};
|
|
168
172
|
}
|
|
169
173
|
|
|
@@ -139,11 +139,13 @@ function parseBootstrapIdentityReceipt(output) {
|
|
|
139
139
|
try { metadata = JSON.parse(text); } catch { throw failed(); }
|
|
140
140
|
if (
|
|
141
141
|
!metadata || typeof metadata !== "object" || Array.isArray(metadata) ||
|
|
142
|
-
Object.keys(metadata).length !==
|
|
142
|
+
Object.keys(metadata).length !== 5 || metadata.version !== 2 ||
|
|
143
143
|
typeof metadata.host_key !== "string" || !DAEMON_HOST_KEY_RE.test(metadata.host_key) ||
|
|
144
144
|
typeof metadata.public_key_spki_base64 !== "string" ||
|
|
145
145
|
!/^[A-Za-z0-9+/]+={0,2}$/.test(metadata.public_key_spki_base64) ||
|
|
146
|
-
metadata.public_key_spki_base64.length % 4 !== 0
|
|
146
|
+
metadata.public_key_spki_base64.length % 4 !== 0 ||
|
|
147
|
+
typeof metadata.hostname !== "string" || !/^[A-Za-z0-9][A-Za-z0-9.-]{0,252}$/.test(metadata.hostname) ||
|
|
148
|
+
(metadata.platform !== "darwin" && metadata.platform !== "linux")
|
|
147
149
|
) throw failed();
|
|
148
150
|
if (text !== `${JSON.stringify(metadata)}\n`) throw failed();
|
|
149
151
|
let spki;
|
|
@@ -160,6 +162,8 @@ function parseBootstrapIdentityReceipt(output) {
|
|
|
160
162
|
version: metadata.version,
|
|
161
163
|
host_key: metadata.host_key,
|
|
162
164
|
public_key_spki_base64: metadata.public_key_spki_base64,
|
|
165
|
+
hostname: metadata.hostname,
|
|
166
|
+
platform: metadata.platform,
|
|
163
167
|
};
|
|
164
168
|
}
|
|
165
169
|
|