@harperfast/harper 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/bin/cliOperations.js +6 -4
- package/bin/copyDb.ts +208 -0
- package/bin/restart.js +8 -7
- package/bin/run.js +2 -1
- package/components/Application.ts +24 -9
- package/components/ApplicationScope.ts +2 -3
- package/components/componentLoader.ts +13 -2
- package/config/harperConfigEnvVars.ts +34 -0
- package/dist/bin/cliOperations.js +6 -4
- package/dist/bin/cliOperations.js.map +1 -1
- package/dist/bin/copyDb.d.ts +1 -0
- package/dist/bin/copyDb.js +197 -0
- package/dist/bin/copyDb.js.map +1 -1
- package/dist/bin/restart.js +8 -7
- package/dist/bin/restart.js.map +1 -1
- package/dist/bin/run.js +3 -1
- package/dist/bin/run.js.map +1 -1
- package/dist/components/Application.js +15 -5
- package/dist/components/Application.js.map +1 -1
- package/dist/components/ApplicationScope.d.ts +2 -2
- package/dist/components/ApplicationScope.js +2 -3
- package/dist/components/ApplicationScope.js.map +1 -1
- package/dist/components/componentLoader.js +11 -2
- package/dist/components/componentLoader.js.map +1 -1
- package/dist/config/harperConfigEnvVars.d.ts +16 -0
- package/dist/config/harperConfigEnvVars.js +33 -0
- package/dist/config/harperConfigEnvVars.js.map +1 -1
- package/dist/resources/DatabaseTransaction.js +17 -2
- package/dist/resources/DatabaseTransaction.js.map +1 -1
- package/dist/resources/RecordEncoder.d.ts +1 -1
- package/dist/resources/RecordEncoder.js +2 -2
- package/dist/resources/RecordEncoder.js.map +1 -1
- package/dist/resources/ResourceInterface.d.ts +1 -1
- package/dist/resources/RocksIndexStore.d.ts +14 -7
- package/dist/resources/RocksIndexStore.js +19 -12
- package/dist/resources/RocksIndexStore.js.map +1 -1
- package/dist/resources/Table.js +55 -29
- package/dist/resources/Table.js.map +1 -1
- package/dist/resources/analytics/write.js +7 -10
- package/dist/resources/analytics/write.js.map +1 -1
- package/dist/resources/databases.js +18 -14
- package/dist/resources/databases.js.map +1 -1
- package/dist/resources/indexes/HierarchicalNavigableSmallWorld.d.ts +2 -1
- package/dist/resources/indexes/HierarchicalNavigableSmallWorld.js +38 -19
- package/dist/resources/indexes/HierarchicalNavigableSmallWorld.js.map +1 -1
- package/dist/security/certificateVerification/ocspVerification.js +1 -1
- package/dist/security/certificateVerification/ocspVerification.js.map +1 -1
- package/dist/security/jsLoader.js +54 -21
- package/dist/security/jsLoader.js.map +1 -1
- package/dist/security/keys.js +7 -7
- package/dist/security/keys.js.map +1 -1
- package/dist/security/user.js +9 -8
- package/dist/security/user.js.map +1 -1
- package/dist/server/itc/serverHandlers.js +0 -4
- package/dist/server/itc/serverHandlers.js.map +1 -1
- package/dist/utility/hdbTerms.d.ts +1 -0
- package/dist/utility/hdbTerms.js +1 -0
- package/dist/utility/hdbTerms.js.map +1 -1
- package/dist/utility/install/installer.js +11 -8
- package/dist/utility/install/installer.js.map +1 -1
- package/package.json +3 -3
- package/resources/DatabaseTransaction.ts +19 -2
- package/resources/RecordEncoder.ts +2 -2
- package/resources/ResourceInterface.ts +1 -1
- package/resources/RocksIndexStore.ts +20 -15
- package/resources/Table.ts +50 -25
- package/resources/analytics/write.ts +7 -10
- package/resources/databases.ts +29 -14
- package/resources/indexes/HierarchicalNavigableSmallWorld.ts +67 -30
- package/security/certificateVerification/ocspVerification.ts +1 -1
- package/security/jsLoader.ts +68 -22
- package/security/keys.js +7 -7
- package/security/user.ts +10 -8
- package/server/itc/serverHandlers.js +0 -4
- 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/utility/hdbTerms.ts +1 -0
- package/utility/install/installer.js +14 -10
package/security/keys.js
CHANGED
|
@@ -125,7 +125,7 @@ function getCertTable() {
|
|
|
125
125
|
}
|
|
126
126
|
|
|
127
127
|
async function getReplicationCert() {
|
|
128
|
-
const SNICallback = createTLSSelector('
|
|
128
|
+
const SNICallback = createTLSSelector('replication');
|
|
129
129
|
const secureTarget = {
|
|
130
130
|
secureContexts: null,
|
|
131
131
|
setSecureContext: (_ctx) => {},
|
|
@@ -238,7 +238,7 @@ function loadCertificates() {
|
|
|
238
238
|
|
|
239
239
|
promise = certificateTable.put({
|
|
240
240
|
name: certCn,
|
|
241
|
-
uses: config.uses ?? [
|
|
241
|
+
uses: config.uses ?? [configKey.includes('operations') ? ['operations-api'] : []],
|
|
242
242
|
ciphers: config.ciphers,
|
|
243
243
|
certificate: certificatePem,
|
|
244
244
|
private_key_name,
|
|
@@ -351,7 +351,7 @@ function certExtensions() {
|
|
|
351
351
|
async function createCertificateTable(cert, caCert) {
|
|
352
352
|
await setCertTable({
|
|
353
353
|
name: getThisNodeName(),
|
|
354
|
-
uses: ['
|
|
354
|
+
uses: ['replication'],
|
|
355
355
|
certificate: cert,
|
|
356
356
|
private_key_name: 'privateKey.pem',
|
|
357
357
|
is_authority: false,
|
|
@@ -360,7 +360,7 @@ async function createCertificateTable(cert, caCert) {
|
|
|
360
360
|
|
|
361
361
|
await setCertTable({
|
|
362
362
|
name: caCert.subject.getField('CN').value,
|
|
363
|
-
uses: [
|
|
363
|
+
uses: [],
|
|
364
364
|
certificate: pki.certificateToPem(caCert),
|
|
365
365
|
private_key_name: 'privateKey.pem',
|
|
366
366
|
is_authority: true,
|
|
@@ -600,7 +600,7 @@ async function reviewSelfSignedCert() {
|
|
|
600
600
|
|
|
601
601
|
await setCertTable({
|
|
602
602
|
name: hdbCa.subject.getField('CN').value,
|
|
603
|
-
uses: [
|
|
603
|
+
uses: [],
|
|
604
604
|
certificate: pki.certificateToPem(hdbCa),
|
|
605
605
|
private_key_name: keyName,
|
|
606
606
|
is_authority: true,
|
|
@@ -621,7 +621,7 @@ async function reviewSelfSignedCert() {
|
|
|
621
621
|
const newPublicCert = await generateCertificates(pki.privateKeyFromPem(caAndKey.private_key), publicKey, hdbCa);
|
|
622
622
|
await setCertTable({
|
|
623
623
|
name: certName,
|
|
624
|
-
uses: ['
|
|
624
|
+
uses: ['replication'],
|
|
625
625
|
certificate: newPublicCert,
|
|
626
626
|
is_authority: false,
|
|
627
627
|
private_key_name: caAndKey.ca.private_key_name,
|
|
@@ -755,7 +755,7 @@ function createTLSSelector(type, mtlsOptions) {
|
|
|
755
755
|
}
|
|
756
756
|
let quality = cert.is_self_signed ? 1 : 3;
|
|
757
757
|
// prefer operations certificates for operations API
|
|
758
|
-
if (cert.uses?.includes(type)) quality +=
|
|
758
|
+
if (cert.uses?.includes(type)) quality += 3;
|
|
759
759
|
|
|
760
760
|
const private_key = getPrivateKeyByName(cert.private_key_name);
|
|
761
761
|
|
package/security/user.ts
CHANGED
|
@@ -258,14 +258,16 @@ async function userInfo(body): Promise<string | User> {
|
|
|
258
258
|
}
|
|
259
259
|
|
|
260
260
|
let user = _.cloneDeep(body.hdb_user);
|
|
261
|
-
let roleData =
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
261
|
+
let roleData =
|
|
262
|
+
user.role &&
|
|
263
|
+
(await search.searchByHash({
|
|
264
|
+
schema: 'system',
|
|
265
|
+
table: 'hdb_role',
|
|
266
|
+
hash_values: [user.role.id],
|
|
267
|
+
get_attributes: ['*'],
|
|
268
|
+
}));
|
|
267
269
|
|
|
268
|
-
user.role = roleData[0];
|
|
270
|
+
user.role = roleData?.[0];
|
|
269
271
|
delete user.password;
|
|
270
272
|
delete user.refresh_token;
|
|
271
273
|
delete user.hash;
|
|
@@ -429,7 +431,7 @@ async function getSuperUser(): Promise<User | undefined> {
|
|
|
429
431
|
await setUsersWithRolesCache();
|
|
430
432
|
}
|
|
431
433
|
for (let [, user] of usersWithRolesMap) {
|
|
432
|
-
if (user.role
|
|
434
|
+
if (user.role?.role === 'super_user') return user;
|
|
433
435
|
}
|
|
434
436
|
}
|
|
435
437
|
|
|
@@ -46,10 +46,6 @@ async function schemaHandler(event) {
|
|
|
46
46
|
*/
|
|
47
47
|
async function syncSchemaMetadata(msg) {
|
|
48
48
|
try {
|
|
49
|
-
// reset current read transactions to ensure that we are getting the very latest data
|
|
50
|
-
harperBridge.resetReadTxn(hdbTerms.SYSTEM_SCHEMA_NAME, hdbTerms.SYSTEM_TABLE_NAMES.TABLE_TABLE_NAME);
|
|
51
|
-
harperBridge.resetReadTxn(hdbTerms.SYSTEM_SCHEMA_NAME, hdbTerms.SYSTEM_TABLE_NAMES.ATTRIBUTE_TABLE_NAME);
|
|
52
|
-
harperBridge.resetReadTxn(hdbTerms.SYSTEM_SCHEMA_NAME, hdbTerms.SYSTEM_TABLE_NAMES.SCHEMA_TABLE_NAME);
|
|
53
49
|
// TODO: Eventually should indicate which database/table changed so we don't have to scan everything
|
|
54
50
|
let databases = resetDatabases();
|
|
55
51
|
if (msg.table && msg.database)
|