@camstack/server 1.2.578 → 1.2.580
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-config.js +2 -11
- package/dist/agent/agent-http-auth.js +91 -78
- package/dist/agent/agent-http.js +89 -139
- package/dist/agent/agent-hub-registration.js +31 -58
- package/dist/agent/agent-json-file.js +59 -0
- package/dist/agent/agent-mesh-gate.js +57 -0
- package/dist/agent/agent-node-certificates.js +7 -7
- package/dist/agent/agent-pairing-routes.js +1 -4
- package/dist/agent/agent-pairing-store.js +8 -8
- package/dist/agent/agent-service.js +0 -9
- package/dist/agent/main.js +41 -99
- package/dist/api/core/auth.router.js +11 -0
- package/dist/api/core/cap-providers.js +3 -1
- package/dist/api/core/certificates.router.js +2 -2
- package/dist/api/core/server-name.js +64 -0
- package/dist/api/oauth2/consent-page.js +22 -31
- package/dist/api/oauth2/oauth2-routes.js +5 -0
- package/dist/api/trpc/trpc.context.js +3 -3
- package/dist/api/trpc/trpc.router.js +29 -2
- package/dist/auth/app-confirm-page.js +38 -24
- package/dist/auth/app-confirm-routes.js +8 -1
- package/dist/auth/app-page-shell.js +123 -0
- package/dist/auth/app-page-strings.js +157 -0
- package/dist/auth/app-passkey-page.js +47 -26
- package/dist/auth/app-passkey-routes.js +9 -2
- package/dist/auth/app-refused-route.js +43 -0
- package/dist/auth/session-connections.js +136 -0
- package/dist/auth/sso-finish-app.js +7 -1
- package/dist/boot/boot-config.js +7 -5
- package/dist/core/agent/agent-registry.service.js +0 -10
- package/dist/core/moleculer/hub-mesh-guard.js +30 -101
- package/dist/core/moleculer/moleculer.service.js +8 -32
- package/dist/main.js +33 -2
- package/package.json +9 -9
- package/dist/agent/agent-mesh-enroll.js +0 -317
- package/dist/agent/agent-mesh-join.js +0 -140
- package/dist/api/mesh/enroll.routes.js +0 -34
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.registerMeshEnrollRoute = registerMeshEnrollRoute;
|
|
4
|
-
const system_1 = require("@camstack/system");
|
|
5
|
-
function registerMeshEnrollRoute(fastify) {
|
|
6
|
-
fastify.post('/api/mesh/enroll', async (request, reply) => {
|
|
7
|
-
const caState = (0, system_1.getProcessMeshCaState)();
|
|
8
|
-
if (caState.state !== 'ready') {
|
|
9
|
-
return reply.status(503).send({
|
|
10
|
-
ok: false,
|
|
11
|
-
error: `mesh CA unavailable: ${caState.reason}`,
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
const body = request.body ?? {};
|
|
15
|
-
const result = await (0, system_1.enrollMeshNode)({ token: body.token ?? '', csr: body.csr ?? '' }, {
|
|
16
|
-
ca: caState.ca,
|
|
17
|
-
onRecordFailed: (nodeId, error) => fastify.log.warn({ nodeId, error: error instanceof Error ? error.message : String(error) }, 'mesh enroll: the issued leaf could not be recorded'),
|
|
18
|
-
onIssued: async (nodeId, certPem) => {
|
|
19
|
-
await (0, system_1.getProcessMeshCertificateRegistry)()?.recordIssued(nodeId, certPem, 'enroll');
|
|
20
|
-
},
|
|
21
|
-
});
|
|
22
|
-
if (!result.ok) {
|
|
23
|
-
return reply.status(result.status).send({ ok: false, error: result.error });
|
|
24
|
-
}
|
|
25
|
-
return reply.send({
|
|
26
|
-
ok: true,
|
|
27
|
-
cert: result.cert,
|
|
28
|
-
caCert: result.caCert,
|
|
29
|
-
nodeId: result.nodeId,
|
|
30
|
-
notAfter: result.notAfter,
|
|
31
|
-
serialNumber: result.serialNumber,
|
|
32
|
-
});
|
|
33
|
-
});
|
|
34
|
-
}
|