From c4d0f71f418623aaffa7080da0f744fe06e7c838 Mon Sep 17 00:00:00 2001 From: Tom Elliott Date: Tue, 10 Nov 2026 06:18:35 -0600 Subject: [PATCH] feat(agent): add the fog-agent CA, CSR signing and the public CA files fog-agent enrolls by sending a CSR and getting a client certificate signed by the server's agent CA. This gives fog-node the same two CAs as FOG 1.6, so one agent binary works against either server. - tools/setup/pki.js: ensurePki(dir) makes the root (FOG Server CA) and the agent CA with the 1.6 parameters and regeneration rules, and the bundle. Setup and setup:dev call it after they write config/local.js. - api/helpers/agent/sign-csr.js: signs a CSR as "CN=fog-agent host , O=FOG Project, OU=FOG Agent", 365 days, clientAuth, chain = agent CA only, and verifies the result. - api/helpers/agent/key-fingerprint.js: sha256 of the public-key PEM text. - GET /management/other/ca.cert.pem, ca.cert.der, agent-ca-bundle.pem. - @peculiar/x509 1.x (CommonJS) is the one new dependency. Beyond 1.6: a missing root.pem with a root.key present renames the old key with a timestamp before a new root is made, so a CA key is never lost. Co-Authored-By: Claude Opus 5.5 --- .gitignore | 2 + api/controllers/agent/ca-file.js | 35 ++++ api/helpers/agent/key-fingerprint.js | 47 +++++ api/helpers/agent/sign-csr.js | 104 ++++++++++ api/lib/agent-pki.js | 58 ++++++ config/custom.js | 9 + config/policies.js | 3 + config/routes.js | 5 + package-lock.json | 244 +++++++++++++++++++++++ package.json | 2 + test/helpers/agent-pki.test.js | 277 +++++++++++++++++++++++++++ test/route/agent-ca-files.test.js | 51 +++++ test/support/pki.js | 60 ++++++ tools/setup/dev.js | 14 +- tools/setup/index.js | 28 ++- tools/setup/pki.js | 149 ++++++++++++++ 16 files changed, 1086 insertions(+), 2 deletions(-) create mode 100644 api/controllers/agent/ca-file.js create mode 100644 api/helpers/agent/key-fingerprint.js create mode 100644 api/helpers/agent/sign-csr.js create mode 100644 api/lib/agent-pki.js create mode 100644 test/helpers/agent-pki.test.js create mode 100644 test/route/agent-ca-files.test.js create mode 100644 test/support/pki.js create mode 100644 tools/setup/pki.js diff --git a/.gitignore b/.gitignore index 4cb8dad..589f639 100644 --- a/.gitignore +++ b/.gitignore @@ -63,6 +63,8 @@ config.json !/plugins/snapin/ !/plugins/printer/ images +# The agent CA keys and certificates (custom.pkiDir). Never commit the keys. +/pki ################################################ # Dependencies diff --git a/api/controllers/agent/ca-file.js b/api/controllers/agent/ca-file.js new file mode 100644 index 0000000..0db1a1f --- /dev/null +++ b/api/controllers/agent/ca-file.js @@ -0,0 +1,35 @@ +/** + * The public CA files, at the paths FOG 1.6 serves them. The agent downloads + * ca.cert.pem to learn the server's CA (contract 4.4). No session is needed. + * + * The route names the file in its `file` option (config/routes.js): + * root.pem the root CA, PEM + * root.der the root CA, DER + * agent-ca-bundle.pem the agent CA, then the root + * A missing file answers 404. + */ +const crypto = require('crypto'); +const fs = require('fs'); +const path = require('path'); + +module.exports = { + friendlyName: 'CA file', + description: 'Serve the root CA or the agent CA bundle.', + exits: { + success: {description: 'The file.'} + }, + fn: async function () { + const res = this.res; + const file = this.req.options.file; + const source = file === 'root.der' ? 'root.pem' : file; + let data; + try { + data = fs.readFileSync(path.join(sails.config.custom.pkiDir, source)); + if (file === 'root.der') data = new crypto.X509Certificate(data).raw; + } catch (unused) { + return res.sendStatus(404); + } + res.set('Content-Type', file === 'root.der' ? 'application/x-x509-ca-cert' : 'application/x-pem-file'); + return res.send(data); + } +}; diff --git a/api/helpers/agent/key-fingerprint.js b/api/helpers/agent/key-fingerprint.js new file mode 100644 index 0000000..dc90384 --- /dev/null +++ b/api/helpers/agent/key-fingerprint.js @@ -0,0 +1,47 @@ +/** + * The key fingerprint of fog-agent enrollment: the lowercase hex sha256 of the + * public key's PEM text ("-----BEGIN PUBLIC KEY-----" ... "-----END PUBLIC + * KEY-----\n"). It is not the hash of the DER bytes. FOG 1.6 and the agent + * both hash the PEM text (contract section 0, item 1), so the same key gives + * the same value on both servers. + * + * Input: a CSR PEM or a certificate PEM. + * Exit invalid: the text is neither. + * + * Usage: let fp = sails.helpers.agent.keyFingerprint(pem) (sync) + */ +const crypto = require('crypto'); +const x509 = require('@peculiar/x509'); +const pki = require('../../lib/agent-pki'); + +module.exports = { + friendlyName: 'Key fingerprint', + description: 'Hash the public key PEM of a CSR or certificate with sha256.', + sync: true, + inputs: { + pem: {type: 'string', required: true, description: 'A CSR or a certificate, PEM text.'} + }, + exits: { + success: {outputType: 'string', description: 'Lowercase hex sha256.'}, + invalid: {description: 'The text is not a CSR or a certificate.'} + }, + fn: function ({pem}, exits) { + let publicKey; + try { + if (pki.isCsrPem(pem)) { + // Node has no CSR parser. The SPKI bytes come from @peculiar/x509. + publicKey = crypto.createPublicKey({ + key: Buffer.from(new x509.Pkcs10CertificateRequest(pem).publicKey.rawData), + format: 'der', + type: 'spki' + }); + } else { + publicKey = new crypto.X509Certificate(pem).publicKey; + } + } catch (unused) { + return exits.invalid(); + } + return exits.success(crypto.createHash('sha256') + .update(publicKey.export({type: 'spki', format: 'pem'})).digest('hex')); + } +}; diff --git a/api/helpers/agent/sign-csr.js b/api/helpers/agent/sign-csr.js new file mode 100644 index 0000000..fe548bb --- /dev/null +++ b/api/helpers/agent/sign-csr.js @@ -0,0 +1,104 @@ +/** + * Sign a fog-agent CSR with the agent CA, as the FOG 1.6 signing helper does + * (fog-sign-node-cert agent): the server sets the subject, the CSR subject is + * ignored, and the certificate carries no SAN. The contract is + * briefs/research/2026-11-10-agent-enroll-contract.md section 4.2. + * + * Inputs: + * csrPem the CSR, PEM text (RSA or ECDSA key) + * hostId the host number, digits only (1 to 10) + * + * Output {leafPem, chainPem}. chainPem is the agent CA only, not the root. + * + * Exits (a caller maps them; the enroll brief maps notConfigured to 503): + * badHostId hostId is not 1 to 10 digits + * badCsr not a CSR, does not parse, or its self-signature fails + * notConfigured a CA file is missing from custom.pkiDir + * signFailed the signing failed, or a result does not verify + * + * The CA key is read from custom.pkiDir on each call. + * + * Usage: let {leafPem, chainPem} = await sails.helpers.agent.signCsr.with({csrPem, hostId}) + */ +const crypto = require('crypto'); +const fs = require('fs'); +const path = require('path'); +const x509 = require('@peculiar/x509'); +const pki = require('../../lib/agent-pki'); + +module.exports = { + friendlyName: 'Sign an agent CSR', + description: 'Issue a 365-day clientAuth certificate for an agent CSR from the agent CA.', + inputs: { + csrPem: {type: 'string', required: true, description: 'The CSR, PEM text.'}, + hostId: {type: 'string', required: true, description: 'The host number: 1 to 10 digits.'} + }, + exits: { + success: {outputType: 'ref', description: '{leafPem, chainPem}'}, + badHostId: {description: 'hostId is not 1 to 10 digits.'}, + badCsr: {description: 'The CSR is not valid, or its signature does not verify.'}, + notConfigured: {description: 'The agent CA files are missing.'}, + signFailed: {description: 'The signing or its self-check failed.'} + }, + fn: async function ({csrPem, hostId}) { + // Same check as the 1.6 helper. It also keeps the subject text safe. + if (!/^[0-9]{1,10}$/.test(hostId)) throw 'badHostId'; + + let csr; + try { + if (!pki.isCsrPem(csrPem)) throw new Error('not a CSR'); + csr = new x509.Pkcs10CertificateRequest(csrPem); + // Proof of possession: the CSR is signed by the key it carries. + if (!(await csr.verify())) throw new Error('bad signature'); + } catch (unused) { + throw 'badCsr'; + } + + const dir = sails.config.custom.pkiDir; + const read = (name) => { + try { + return fs.readFileSync(path.join(dir, name), 'utf8'); + } catch (unused) { + throw 'notConfigured'; + } + }; + const rootPem = read('root.pem'); + const caPem = read('agent-ca.pem'); + const caKeyPem = read('agent-ca.key'); + + // Do not sign under an agent CA that the root did not issue. + if (!pki.verifies(caPem, rootPem)) throw 'signFailed'; + + let leafPem; + try { + // The agent CA key signs leaves only, so it is imported with SHA-256. + const caKeys = await pki.importPair(crypto.createPrivateKey(caKeyPem), 'SHA-256'); + const ca = new x509.X509Certificate(caPem); + const leaf = await x509.X509CertificateGenerator.create({ + serialNumber: pki.randomSerial(), + subject: pki.subjectOf(`fog-agent host ${hostId}`, 'FOG Agent'), + issuer: ca.subjectName, + notBefore: new Date(), + notAfter: new Date(Date.now() + 365 * pki.DAY_MS), + signingAlgorithm: pki.RSA, + publicKey: csr.publicKey, + signingKey: caKeys.privateKey, + extensions: [ + new x509.BasicConstraintsExtension(false, undefined, true), + new x509.KeyUsagesExtension(x509.KeyUsageFlags.digitalSignature, true), + new x509.ExtendedKeyUsageExtension([pki.CLIENT_AUTH], false), + await x509.SubjectKeyIdentifierExtension.create(csr.publicKey), + await x509.AuthorityKeyIdentifierExtension.create(ca, false) + ] + }); + leafPem = leaf.toString('pem') + '\n'; + } catch (unused) { + throw 'signFailed'; + } + + // The 1.6 helper runs `openssl verify` before it returns. This is the same gate. + if (!pki.verifies(leafPem, caPem, true)) throw 'signFailed'; + + return {leafPem, chainPem: caPem}; + } +}; diff --git a/api/lib/agent-pki.js b/api/lib/agent-pki.js new file mode 100644 index 0000000..4cdc552 --- /dev/null +++ b/api/lib/agent-pki.js @@ -0,0 +1,58 @@ +/** + * The crypto pieces that the agent PKI shares: tools/setup/pki.js (makes the + * CAs) and api/helpers/agent/* (sign a CSR, fingerprint a key) both use them. + * This is a plain module, not a Sails helper. Sails does not autoload api/lib. + * + * Certificates use @peculiar/x509. It signs through WebCrypto, where an + * imported RSA key carries its hash (see importPair). + */ +const crypto = require('crypto'); +const x509 = require('@peculiar/x509'); + +const DAY_MS = 24 * 60 * 60 * 1000; +const CLIENT_AUTH = '1.3.6.1.5.5.7.3.2'; +const RSA = {name: 'RSASSA-PKCS1-v1_5'}; +const CSR_HEADER = '-----BEGIN CERTIFICATE REQUEST-----'; + +// Does the text carry the CSR header? (The 1.6 check, Enrollment.php:304.) +const isCsrPem = (text) => String(text).includes(CSR_HEADER); + +// Hex serial: 16 random bytes, never zero, top bit clear so it stays positive. +const randomSerial = () => { + const bytes = crypto.randomBytes(16); + bytes[0] = (bytes[0] & 0x7f) || 1; + return bytes.toString('hex'); +}; + +// The subject is built from typed parts, so no text can add a name component. +const subjectOf = (cn, ou) => new x509.Name([{CN: [cn]}, {O: ['FOG Project']}, {OU: [ou]}]); + +// Import the key pair of a Node RSA key object for WebCrypto with one hash. +const importPair = async (privateKey, hash) => { + const alg = {name: RSA.name, hash}; + const publicKey = crypto.createPublicKey(privateKey); + return { + privateKey: await crypto.webcrypto.subtle.importKey('pkcs8', privateKey.export({type: 'pkcs8', format: 'der'}), alg, false, ['sign']), + publicKey: await crypto.webcrypto.subtle.importKey('spki', publicKey.export({type: 'spki', format: 'der'}), alg, true, ['verify']) + }; +}; + +/** + * Does `certPem` verify as issued by `issuerPem`? "Verifies" is Node's own + * X509Certificate: it asks whether the certificate was issued by the issuer, + * and checks the signature. For a leaf (`leaf` true) it also needs the + * clientAuth extended key usage and `ca` false. Any parse error is false. + */ +const verifies = (certPem, issuerPem, leaf) => { + try { + const cert = new crypto.X509Certificate(certPem); + const issuer = new crypto.X509Certificate(issuerPem); + if (!cert.checkIssued(issuer) || !cert.verify(issuer.publicKey)) return false; + if (leaf && (cert.ca || !(cert.keyUsage || []).includes(CLIENT_AUTH))) return false; + return true; + } catch (unused) { + return false; + } +}; + +module.exports = {DAY_MS, CLIENT_AUTH, RSA, isCsrPem, randomSerial, subjectOf, importPair, verifies}; diff --git a/config/custom.js b/config/custom.js index 70dc1f1..b73c6f4 100644 --- a/config/custom.js +++ b/config/custom.js @@ -8,8 +8,17 @@ * https://sailsjs.com/config/custom */ +const path = require('path'); + module.exports.custom = { + // Certificate authority files for fog-agent enrollment: root.pem/.key, + // agent-ca.pem/.key and agent-ca-bundle.pem. tools/setup/pki.js makes them. + // The CA keys sit here, so the folder must be readable only by the user that + // runs fog-node. path.join keeps it valid on any OS. config/local.js may + // override it (the setup tools carry that override forward). + pkiDir: path.join(__dirname, '..', 'pki'), + // Image store: one folder per image -> //.img. // Single source of truth for the deploy streamer, dashboard/hwinfo disk usage, // and the image-store scan. Matches FOG's storageLocation (default /images). diff --git a/config/policies.js b/config/policies.js index ede6d68..29d6571 100644 --- a/config/policies.js +++ b/config/policies.js @@ -74,6 +74,9 @@ module.exports.policies = { // iPXE boot script is public (PXE machines have no session) 'boot': true, + // The CA files are public: the agent fetches them before it has a session + 'agent/ca-file': true, + // System info 'system/info': true, 'system/bandwidth': true, diff --git a/config/routes.js b/config/routes.js index 41a0b7b..7da4cf2 100644 --- a/config/routes.js +++ b/config/routes.js @@ -94,6 +94,11 @@ module.exports.routes = { 'GET /boot.ipxe': {action: 'boot'}, 'GET /boot': {action: 'boot'}, + // Public CA files for fog-agent, at the FOG 1.6 paths (the file is in `file`). + 'GET /management/other/ca.cert.pem': {action: 'agent/ca-file', file: 'root.pem'}, + 'GET /management/other/ca.cert.der': {action: 'agent/ca-file', file: 'root.der'}, + 'GET /management/other/agent-ca-bundle.pem': {action: 'agent/ca-file', file: 'agent-ca-bundle.pem'}, + // Host Views 'GET /hosts': {action: 'pages/list/hosts'}, 'GET /hosts/create': {action: 'pages/create/hosts'}, diff --git a/package-lock.json b/package-lock.json index 8f96a9a..4a02cd3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,6 +10,7 @@ "license": "GPL v3", "dependencies": { "@fortawesome/fontawesome-free": "^7.3.1", + "@peculiar/x509": "^1.12.0", "@sailshq/connect-redis": "^6.1.3", "@sailshq/lodash": "^3.10.4", "@sailshq/socket.io-redis": "^6.1.2", @@ -810,6 +811,193 @@ "@noble/hashes": "^1.1.5" } }, + "node_modules/@peculiar/asn1-cms": { + "version": "2.11.1", + "resolved": "https://registry.npmjs.org/@peculiar/asn1-cms/-/asn1-cms-2.11.1.tgz", + "integrity": "sha512-Bk+oatE62dW0Tzzpfk6vdQxfGGEfvuGdWgmijnKjcv7HqZCJISs85z4zw2uDArrk+R1Oel1wts/BBl7HHrtAcA==", + "license": "MIT", + "dependencies": { + "@peculiar/asn1-schema": "^2.11.1", + "@peculiar/asn1-x509": "^2.11.1", + "@peculiar/asn1-x509-attr": "^2.11.1", + "asn1js": "^3.0.10", + "tslib": "^2.8.1" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/@peculiar/asn1-csr": { + "version": "2.11.1", + "resolved": "https://registry.npmjs.org/@peculiar/asn1-csr/-/asn1-csr-2.11.1.tgz", + "integrity": "sha512-KVfbXaKng8886/tOPG55t5K1XkTkGbR4amjIJzytXWobFU5nZgw/sKnSpa1hxP17nUSsrOF/7Mt9WUYeyLsi6Q==", + "license": "MIT", + "dependencies": { + "@peculiar/asn1-schema": "^2.11.1", + "@peculiar/asn1-x509": "^2.11.1", + "asn1js": "^3.0.10", + "tslib": "^2.8.1" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/@peculiar/asn1-ecc": { + "version": "2.11.1", + "resolved": "https://registry.npmjs.org/@peculiar/asn1-ecc/-/asn1-ecc-2.11.1.tgz", + "integrity": "sha512-7MSNji77fQa/oN3WAfwagMy8EoJFg50sW4hZ1dtr0zU1BSugit0I2DGpIdPhvkNplopQhz5bogxpn1077eaamA==", + "license": "MIT", + "dependencies": { + "@peculiar/asn1-schema": "^2.11.1", + "@peculiar/asn1-x509": "^2.11.1", + "asn1js": "^3.0.10", + "tslib": "^2.8.1" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/@peculiar/asn1-pfx": { + "version": "2.11.1", + "resolved": "https://registry.npmjs.org/@peculiar/asn1-pfx/-/asn1-pfx-2.11.1.tgz", + "integrity": "sha512-2SN2z8qkc2hk/GgTYA8RN54wtsCDZShg9gI2Mq1vLhdj1adcv5fhTbiEmExZUaAMqlizxiEpULQDfHM5iYtn1g==", + "license": "MIT", + "dependencies": { + "@peculiar/asn1-cms": "^2.11.1", + "@peculiar/asn1-pkcs8": "^2.11.1", + "@peculiar/asn1-rsa": "^2.11.1", + "@peculiar/asn1-schema": "^2.11.1", + "asn1js": "^3.0.10", + "tslib": "^2.8.1" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/@peculiar/asn1-pkcs8": { + "version": "2.11.1", + "resolved": "https://registry.npmjs.org/@peculiar/asn1-pkcs8/-/asn1-pkcs8-2.11.1.tgz", + "integrity": "sha512-HqsSrnpQghRp9SM9QSmR6fa4z/BNktnKq7928+oq4qF0VAnuHZ4cyePKvcxh9fP4taBCP/WHNItlVNsYaQm2qw==", + "license": "MIT", + "dependencies": { + "@peculiar/asn1-schema": "^2.11.1", + "@peculiar/asn1-x509": "^2.11.1", + "asn1js": "^3.0.10", + "tslib": "^2.8.1" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/@peculiar/asn1-pkcs9": { + "version": "2.11.1", + "resolved": "https://registry.npmjs.org/@peculiar/asn1-pkcs9/-/asn1-pkcs9-2.11.1.tgz", + "integrity": "sha512-OHFkTg8D2zYafILqFE4KPbqX8srpvd3diGDc2h2cduumawc765mOHGcuFMGvLWlL2bbCMWMmMSCtlXptsOuiPA==", + "license": "MIT", + "dependencies": { + "@peculiar/asn1-cms": "^2.11.1", + "@peculiar/asn1-pfx": "^2.11.1", + "@peculiar/asn1-pkcs8": "^2.11.1", + "@peculiar/asn1-schema": "^2.11.1", + "@peculiar/asn1-x509": "^2.11.1", + "@peculiar/asn1-x509-attr": "^2.11.1", + "asn1js": "^3.0.10", + "tslib": "^2.8.1" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/@peculiar/asn1-rsa": { + "version": "2.11.1", + "resolved": "https://registry.npmjs.org/@peculiar/asn1-rsa/-/asn1-rsa-2.11.1.tgz", + "integrity": "sha512-6KwKGjulF489CpidZqkogNgLj6oGzgC4BL2FClM8PuJQ4t5NqT4q4a6A4vrSxBIBhMnL8hGYkLOpbVw0Vq38Tw==", + "license": "MIT", + "dependencies": { + "@peculiar/asn1-schema": "^2.11.1", + "@peculiar/asn1-x509": "^2.11.1", + "asn1js": "^3.0.10", + "tslib": "^2.8.1" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/@peculiar/asn1-schema": { + "version": "2.11.1", + "resolved": "https://registry.npmjs.org/@peculiar/asn1-schema/-/asn1-schema-2.11.1.tgz", + "integrity": "sha512-jaU9OaCcbZUdyXx9hMETZB9xoNmxTGjOGFqd3cOwKFkpKnyKd9WxF3uqj4PvX4cyOMP9bSdHg5YyML2qtx/d/g==", + "license": "MIT", + "dependencies": { + "@peculiar/utils": "^2.0.2", + "asn1js": "^3.0.10", + "tslib": "^2.8.1" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/@peculiar/asn1-x509": { + "version": "2.11.1", + "resolved": "https://registry.npmjs.org/@peculiar/asn1-x509/-/asn1-x509-2.11.1.tgz", + "integrity": "sha512-SXU4/X6B3FquqQAN6ARI0bFDUV7+L1WlvPEPMKzEMkstd2D7UyM0r93fv241+OjdhqAKYGx5MvV3gzZMAp0APA==", + "license": "MIT", + "dependencies": { + "@peculiar/asn1-schema": "^2.11.1", + "@peculiar/utils": "^2.0.2", + "asn1js": "^3.0.10", + "tslib": "^2.8.1" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/@peculiar/asn1-x509-attr": { + "version": "2.11.1", + "resolved": "https://registry.npmjs.org/@peculiar/asn1-x509-attr/-/asn1-x509-attr-2.11.1.tgz", + "integrity": "sha512-n7RKFrbTzt8pGBlZ90kmKEn1qsLTTyw7lrvHMK0xsA42kQugPk/GXYpNbEcl7DkkdVsU/one5UX7KQPfxLj8vQ==", + "license": "MIT", + "dependencies": { + "@peculiar/asn1-schema": "^2.11.1", + "@peculiar/asn1-x509": "^2.11.1", + "asn1js": "^3.0.10", + "tslib": "^2.8.1" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/@peculiar/utils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@peculiar/utils/-/utils-2.0.3.tgz", + "integrity": "sha512-+oL3HPFRIZ1St2K50lWCXiioIgSoxzz7R1J3uF6neO2yl1sgmpgY6XXJH4BdpoDkMWznQTeYF6oWNDZLCdQ4eQ==", + "license": "MIT", + "dependencies": { + "tslib": "^2.8.1" + } + }, + "node_modules/@peculiar/x509": { + "version": "1.14.3", + "resolved": "https://registry.npmjs.org/@peculiar/x509/-/x509-1.14.3.tgz", + "integrity": "sha512-C2Xj8FZ0uHWeCXXqX5B4/gVFQmtSkiuOolzAgutjTfseNOHT3pUjljDZsTSxXFGgio54bCzVFqmEOUrIVk8RDA==", + "license": "MIT", + "dependencies": { + "@peculiar/asn1-cms": "^2.6.0", + "@peculiar/asn1-csr": "^2.6.0", + "@peculiar/asn1-ecc": "^2.6.0", + "@peculiar/asn1-pkcs9": "^2.6.0", + "@peculiar/asn1-rsa": "^2.6.0", + "@peculiar/asn1-schema": "^2.6.0", + "@peculiar/asn1-x509": "^2.6.0", + "pvtsutils": "^1.3.6", + "reflect-metadata": "^0.2.2", + "tslib": "^2.8.1", + "tsyringe": "^4.10.0" + }, + "engines": { + "node": ">=20.0.0" + } + }, "node_modules/@popperjs/core": { "version": "2.11.8", "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.8.tgz", @@ -1294,6 +1482,20 @@ "dev": true, "license": "MIT" }, + "node_modules/asn1js": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/asn1js/-/asn1js-3.1.0.tgz", + "integrity": "sha512-HWYi1THkOqguCiO+vwj09ZkQFD2kKEsejYHAYCtX0D80WVdoDnvRc9IukXX/jeb0T9NRWJnRtqwdbHltnFjwXA==", + "license": "BSD-3-Clause", + "dependencies": { + "pvtsutils": "^1.3.6", + "pvutils": "^1.2.0", + "tslib": "^2.8.1" + }, + "engines": { + "node": ">=12.0.0" + } + }, "node_modules/async": { "version": "3.2.6", "resolved": "https://registry.npmjs.org/async/-/async-3.2.6.tgz", @@ -7659,6 +7861,24 @@ "node": ">=6" } }, + "node_modules/pvtsutils": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/pvtsutils/-/pvtsutils-1.3.6.tgz", + "integrity": "sha512-PLgQXQ6H2FWCaeRak8vvk1GW462lMxB5s3Jm673N82zI4vqtVUPuZdffdZbPDFRoU8kAhItWFtPCWiPpp4/EDg==", + "license": "MIT", + "dependencies": { + "tslib": "^2.8.1" + } + }, + "node_modules/pvutils": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/pvutils/-/pvutils-1.2.0.tgz", + "integrity": "sha512-BbubeCEyTuQjVMakvJQ/Sxbc93F2pwmbsxONT/ZRrwU7Ua38d8unYTwXpTVLAKJ4BDuH9IGztCjQcd/N/39Dvg==", + "license": "MIT", + "engines": { + "node": ">=16.0.0" + } + }, "node_modules/qs": { "version": "6.16.0", "resolved": "https://registry.npmjs.org/qs/-/qs-6.16.0.tgz", @@ -7931,6 +8151,12 @@ "node": ">=4" } }, + "node_modules/reflect-metadata": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.2.2.tgz", + "integrity": "sha512-urBwgfrvVP/eAyXx4hluJivBKzuEbSQs9rKWCrCkbSxNv8mxPcUZKeuoF3Uy4mJl3Lwprp6yy5/39VWigZ4K6Q==", + "license": "Apache-2.0" + }, "node_modules/regenerate": { "version": "1.4.2", "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.2.tgz", @@ -9600,6 +9826,24 @@ "node": ">=0.6.x" } }, + "node_modules/tsyringe": { + "version": "4.10.0", + "resolved": "https://registry.npmjs.org/tsyringe/-/tsyringe-4.10.0.tgz", + "integrity": "sha512-axr3IdNuVIxnaK5XGEUFTu3YmAQ6lllgrvqfEoR16g/HGnYY/6We4oWENtAnzK6/LpJ2ur9PAb80RBt7/U4ugw==", + "license": "MIT", + "dependencies": { + "tslib": "^1.9.3" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/tsyringe/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "license": "0BSD" + }, "node_modules/type": { "version": "2.7.3", "resolved": "https://registry.npmjs.org/type/-/type-2.7.3.tgz", diff --git a/package.json b/package.json index 6317e90..7863360 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,7 @@ "keywords": [], "dependencies": { "@fortawesome/fontawesome-free": "^7.3.1", + "@peculiar/x509": "^1.12.0", "@sailshq/connect-redis": "^6.1.3", "@sailshq/lodash": "^3.10.4", "@sailshq/socket.io-redis": "^6.1.2", @@ -70,6 +71,7 @@ "custom-tests": "The mocha suite lifts a real Sails app (options in test/lifecycle.test.js). Port 1338 keeps it off 1337 so the suite can run while a dev server is up. Turning the grunt hook off skips the asset pipeline: it is irrelevant to these route tests, and letting it run makes sails-linker rewrite the