@camstack/server 1.2.489 → 1.2.490
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/dist/agent/agent-http.js +8 -2
- package/package.json +4 -4
package/dist/agent/agent-http.js
CHANGED
|
@@ -385,10 +385,11 @@ async function createAgentHttpServer(getBroker, config) {
|
|
|
385
385
|
// eslint-disable-next-line oxc/no-async-endpoint-handlers
|
|
386
386
|
app.post('/api/agent/config', async (req, reply) => {
|
|
387
387
|
// `joinToken` is redeemed, never stored; `meshTls` only ever comes from an
|
|
388
|
-
// enrollment, never
|
|
388
|
+
// enrollment (or is cleared via `clearMeshTls`), never pasted as PEM.
|
|
389
389
|
const body = req.body ?? {};
|
|
390
390
|
const joinToken = body['joinToken'];
|
|
391
|
-
const
|
|
391
|
+
const clearMeshTls = body['clearMeshTls'] === true;
|
|
392
|
+
const patch = Object.fromEntries(Object.entries(body).filter(([k]) => k !== 'joinToken' && k !== 'meshTls' && k !== 'clearMeshTls'));
|
|
392
393
|
const existing = readConfigFile(config.configPath);
|
|
393
394
|
// Join-token enrollment (mesh mTLS Release A): the hub address comes from
|
|
394
395
|
// the token and wins over a `hubAddress` posted in the same form. Nothing is
|
|
@@ -411,6 +412,9 @@ async function createAgentHttpServer(getBroker, config) {
|
|
|
411
412
|
merged['hubAddress'] = enrolled.hubAddress;
|
|
412
413
|
merged['meshTls'] = enrolled.meshTls;
|
|
413
414
|
}
|
|
415
|
+
else if (clearMeshTls) {
|
|
416
|
+
delete merged['meshTls'];
|
|
417
|
+
}
|
|
414
418
|
writeConfigFile(config.configPath, merged);
|
|
415
419
|
if (enrolled !== null) {
|
|
416
420
|
console.log(`[Agent] Enrolled in the mesh CA via join token — hub ${enrolled.hubAddress}, ` +
|
|
@@ -432,11 +436,13 @@ async function createAgentHttpServer(getBroker, config) {
|
|
|
432
436
|
// false-positive "Restart required" prompts on no-op saves.
|
|
433
437
|
const reconnectRelevant = ['hubAddress', 'secret'];
|
|
434
438
|
const needsReconnect = enrolled !== null ||
|
|
439
|
+
clearMeshTls ||
|
|
435
440
|
reconnectRelevant.some((k) => Object.prototype.hasOwnProperty.call(patch, k) && patch[k] !== existing[k]);
|
|
436
441
|
return {
|
|
437
442
|
success: true,
|
|
438
443
|
restartRequired: needsReconnect,
|
|
439
444
|
...(enrolled !== null ? { enrolled: true } : {}),
|
|
445
|
+
...(clearMeshTls ? { clearedMeshTls: true } : {}),
|
|
440
446
|
};
|
|
441
447
|
});
|
|
442
448
|
// -- Agent reconnect (applies new hub/secret config) ----------------
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camstack/server",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.490",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"private": false,
|
|
6
6
|
"files": [
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
]
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@camstack/addon-admin-ui": "1.2.
|
|
41
|
-
"@camstack/addon-agent-ui": "1.2.
|
|
40
|
+
"@camstack/addon-admin-ui": "1.2.363",
|
|
41
|
+
"@camstack/addon-agent-ui": "1.2.198",
|
|
42
42
|
"@camstack/addon-auth": "1.2.135",
|
|
43
43
|
"@camstack/addon-decoder-nodeav": "1.2.122",
|
|
44
44
|
"@camstack/addon-notifiers": "1.2.129",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"@camstack/sdk": "1.2.128",
|
|
49
49
|
"@camstack/system": "1.2.384",
|
|
50
50
|
"@camstack/types": "1.2.334",
|
|
51
|
-
"@camstack/ui-library": "1.2.
|
|
51
|
+
"@camstack/ui-library": "1.2.256",
|
|
52
52
|
"@fastify/compress": "^9.0.0",
|
|
53
53
|
"@fastify/cookie": "^11.0.2",
|
|
54
54
|
"@fastify/cors": "^11.2.0",
|