@harperfast/harper-pro 5.0.1 → 5.0.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/analytics/profile.ts +47 -0
- package/core/bin/cliOperations.js +6 -4
- package/core/bin/copyDb.ts +208 -0
- package/core/bin/restart.js +8 -7
- package/core/bin/run.js +2 -1
- package/core/components/Application.ts +24 -9
- package/core/components/ApplicationScope.ts +2 -3
- package/core/components/componentLoader.ts +13 -2
- package/core/config/harperConfigEnvVars.ts +34 -0
- package/core/resources/DatabaseTransaction.ts +19 -2
- package/core/resources/RecordEncoder.ts +2 -2
- package/core/resources/ResourceInterface.ts +1 -1
- package/core/resources/RocksIndexStore.ts +20 -15
- package/core/resources/Table.ts +50 -25
- package/core/resources/analytics/write.ts +7 -10
- package/core/resources/databases.ts +29 -14
- package/core/resources/indexes/HierarchicalNavigableSmallWorld.ts +67 -30
- package/core/security/certificateVerification/ocspVerification.ts +1 -1
- package/core/security/jsLoader.ts +68 -22
- package/core/security/keys.js +7 -7
- package/core/security/user.ts +10 -8
- package/core/server/itc/serverHandlers.js +0 -4
- package/core/static/defaultConfig.yaml +1 -1
- package/core/utility/hdbTerms.ts +1 -0
- package/core/utility/install/installer.js +14 -10
- package/dist/analytics/profile.js +47 -0
- package/dist/analytics/profile.js.map +1 -1
- package/dist/cloneNode/cloneNode.js +5 -5
- package/dist/cloneNode/cloneNode.js.map +1 -1
- package/dist/core/bin/cliOperations.js +6 -4
- package/dist/core/bin/cliOperations.js.map +1 -1
- package/dist/core/bin/copyDb.js +197 -0
- package/dist/core/bin/copyDb.js.map +1 -1
- package/dist/core/bin/restart.js +8 -7
- package/dist/core/bin/restart.js.map +1 -1
- package/dist/core/bin/run.js +3 -1
- package/dist/core/bin/run.js.map +1 -1
- package/dist/core/components/Application.js +15 -5
- package/dist/core/components/Application.js.map +1 -1
- package/dist/core/components/ApplicationScope.js +2 -3
- package/dist/core/components/ApplicationScope.js.map +1 -1
- package/dist/core/components/componentLoader.js +11 -2
- package/dist/core/components/componentLoader.js.map +1 -1
- package/dist/core/config/harperConfigEnvVars.js +33 -0
- package/dist/core/config/harperConfigEnvVars.js.map +1 -1
- package/dist/core/resources/DatabaseTransaction.js +17 -2
- package/dist/core/resources/DatabaseTransaction.js.map +1 -1
- package/dist/core/resources/RecordEncoder.js +2 -2
- package/dist/core/resources/RecordEncoder.js.map +1 -1
- package/dist/core/resources/RocksIndexStore.js +19 -12
- package/dist/core/resources/RocksIndexStore.js.map +1 -1
- package/dist/core/resources/Table.js +55 -29
- package/dist/core/resources/Table.js.map +1 -1
- package/dist/core/resources/analytics/write.js +7 -10
- package/dist/core/resources/analytics/write.js.map +1 -1
- package/dist/core/resources/databases.js +18 -14
- package/dist/core/resources/databases.js.map +1 -1
- package/dist/core/resources/indexes/HierarchicalNavigableSmallWorld.js +38 -19
- package/dist/core/resources/indexes/HierarchicalNavigableSmallWorld.js.map +1 -1
- package/dist/core/security/certificateVerification/ocspVerification.js +1 -1
- package/dist/core/security/certificateVerification/ocspVerification.js.map +1 -1
- package/dist/core/security/jsLoader.js +54 -21
- package/dist/core/security/jsLoader.js.map +1 -1
- package/dist/core/security/keys.js +7 -7
- package/dist/core/security/keys.js.map +1 -1
- package/dist/core/security/user.js +9 -8
- package/dist/core/security/user.js.map +1 -1
- package/dist/core/server/itc/serverHandlers.js +0 -4
- package/dist/core/server/itc/serverHandlers.js.map +1 -1
- package/dist/core/utility/hdbTerms.js +1 -0
- package/dist/core/utility/hdbTerms.js.map +1 -1
- package/dist/core/utility/install/installer.js +11 -8
- package/dist/core/utility/install/installer.js.map +1 -1
- package/dist/replication/setNode.js +5 -2
- package/dist/replication/setNode.js.map +1 -1
- package/dist/security/certificate.js +28 -6
- package/dist/security/certificate.js.map +1 -1
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/replication/setNode.ts +5 -2
- package/security/certificate.ts +28 -6
- package/static/defaultConfig.yaml +1 -1
- package/studio/web/assets/{index-C0iJWrnF.js → index-CxTavHFE.js} +5 -5
- package/studio/web/assets/{index-C0iJWrnF.js.map → index-CxTavHFE.js.map} +1 -1
- package/studio/web/assets/{index.lazy-C647wC7n.js → index.lazy-CfiR1tvq.js} +2 -2
- package/studio/web/assets/{index.lazy-C647wC7n.js.map → index.lazy-CfiR1tvq.js.map} +1 -1
- package/studio/web/assets/{profile-BTS_ZjxV.js → profile-C-uokAal.js} +2 -2
- package/studio/web/assets/{profile-BTS_ZjxV.js.map → profile-C-uokAal.js.map} +1 -1
- package/studio/web/assets/{status-Dc-S5M23.js → status-D6xeT4ss.js} +2 -2
- package/studio/web/assets/{status-Dc-S5M23.js.map → status-D6xeT4ss.js.map} +1 -1
- package/studio/web/index.html +1 -1
package/security/certificate.ts
CHANGED
|
@@ -110,11 +110,33 @@ export async function signCertificate(req) {
|
|
|
110
110
|
}
|
|
111
111
|
|
|
112
112
|
export async function createCsr() {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
const
|
|
113
|
+
// The CSR should always use the self-signed HarperDB cert (RSA), even when
|
|
114
|
+
// the active replication cert is a non-RSA cert (e.g. Let's Encrypt EC).
|
|
115
|
+
const certificateTable = getCertTable();
|
|
116
|
+
const privateKeys: Map<string, string> = getPrivateKeys();
|
|
117
|
+
let opsCert, opsPrivateKey, certName, privateKeyName;
|
|
118
|
+
for await (const cert of certificateTable.search([])) {
|
|
119
|
+
if (cert.is_self_signed && !cert.is_authority) {
|
|
120
|
+
const key = privateKeys.get(cert.private_key_name);
|
|
121
|
+
if (key) {
|
|
122
|
+
opsCert = pki.certificateFromPem(cert.certificate);
|
|
123
|
+
opsPrivateKey = pki.privateKeyFromPem(key);
|
|
124
|
+
certName = cert.name;
|
|
125
|
+
privateKeyName = cert.private_key_name;
|
|
126
|
+
break;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
if (!opsCert || !opsPrivateKey) {
|
|
131
|
+
// Fall back to the replication cert (original behavior)
|
|
132
|
+
const rep = await getReplicationCert();
|
|
133
|
+
opsCert = pki.certificateFromPem(rep.options.cert);
|
|
134
|
+
opsPrivateKey = pki.privateKeyFromPem(rep.options.key);
|
|
135
|
+
certName = rep.name;
|
|
136
|
+
privateKeyName = rep.options.key_file;
|
|
137
|
+
}
|
|
116
138
|
|
|
117
|
-
logger.info?.('Creating CSR with cert named:',
|
|
139
|
+
logger.info?.('Creating CSR with cert named:', certName);
|
|
118
140
|
|
|
119
141
|
const csr = pki.createCertificationRequest();
|
|
120
142
|
csr.publicKey = opsCert.publicKey;
|
|
@@ -143,11 +165,11 @@ export async function createCsr() {
|
|
|
143
165
|
|
|
144
166
|
csr.sign(opsPrivateKey);
|
|
145
167
|
|
|
146
|
-
return forge.pki.certificationRequestToPem(csr);
|
|
168
|
+
return { pem: forge.pki.certificationRequestToPem(csr), privateKeyName };
|
|
147
169
|
}
|
|
148
170
|
|
|
149
171
|
export async function getReplicationCert() {
|
|
150
|
-
const SNICallback = createTLSSelector('
|
|
172
|
+
const SNICallback = createTLSSelector('replication');
|
|
151
173
|
const secureTarget = {
|
|
152
174
|
secureContexts: null,
|
|
153
175
|
setSecureContext: () => {},
|