@harperfast/harper 5.2.9 → 5.3.0-alpha.1
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/agent/mcpTools.ts +1 -1
- package/agent/session.ts +25 -14
- package/bin/cliOperations.ts +46 -9
- package/bin/copyDb.ts +282 -59
- package/bin/deploySetup.ts +16 -5
- package/bin/harper.ts +1 -1
- package/bin/help.ts +4 -1
- package/bin/lite.ts +4 -1
- package/bin/restart.ts +59 -3
- package/bin/run.ts +6 -11
- package/bin/upgrade.js +7 -3
- package/bin/workloadIdentity.ts +119 -0
- package/components/Application.ts +2414 -242
- package/components/ApplicationScope.ts +8 -0
- package/components/EntryHandler.ts +59 -39
- package/components/OptionsWatcher.ts +150 -74
- package/components/RuntimeModuleTracker.ts +38 -7
- package/components/Scope.ts +37 -15
- package/components/awaitRestart.ts +84 -0
- package/components/componentLoader.ts +340 -30
- package/components/componentPreparationLock.ts +16 -5
- package/components/mcp/adapters/harperHttp.ts +4 -0
- package/components/mcp/listChanged.ts +4 -0
- package/components/mcp/toolRegistry.ts +2 -0
- package/components/mcp/tools/operations.ts +9 -0
- package/components/mcp/tools/schemas/operationDescriptions.ts +2 -2
- package/components/operations.js +270 -78
- package/components/operationsValidation.js +49 -1
- package/components/status/ComponentStatusRegistry.ts +59 -0
- package/config/RootConfigWatcher.ts +80 -34
- package/config/configUtils.ts +291 -34
- package/config/harperConfigEnvVars.ts +170 -27
- package/config-root.schema.json +29 -0
- package/dataLayer/blobBackup.ts +160 -50
- package/dataLayer/delete.ts +6 -1
- package/dataLayer/harperBridge/ResourceBridge.ts +52 -8
- package/dataLayer/harperBridge/lmdbBridge/lmdbMethods/DeleteAuditLogsBeforeResults.js +3 -1
- package/dataLayer/hdbInfoController.ts +34 -1
- package/dataLayer/insert.ts +44 -1
- package/dataLayer/rocksdbBackup.ts +53 -10
- package/dataLayer/schema.ts +11 -1
- package/dataLayer/schemaDescribe.ts +8 -1
- package/dist/agent/mcpTools.js +1 -1
- package/dist/agent/mcpTools.js.map +1 -1
- package/dist/agent/session.d.ts +22 -0
- package/dist/agent/session.js +26 -15
- package/dist/agent/session.js.map +1 -1
- package/dist/bin/cliOperations.js +48 -9
- package/dist/bin/cliOperations.js.map +1 -1
- package/dist/bin/copyDb.d.ts +12 -1
- package/dist/bin/copyDb.js +248 -60
- package/dist/bin/copyDb.js.map +1 -1
- package/dist/bin/deploySetup.d.ts +2 -0
- package/dist/bin/deploySetup.js +11 -3
- package/dist/bin/deploySetup.js.map +1 -1
- package/dist/bin/harper.js +1 -1
- package/dist/bin/harper.js.map +1 -1
- package/dist/bin/help.js +4 -1
- package/dist/bin/help.js.map +1 -1
- package/dist/bin/lite.js +4 -1
- package/dist/bin/lite.js.map +1 -1
- package/dist/bin/restart.js +54 -5
- package/dist/bin/restart.js.map +1 -1
- package/dist/bin/run.js +4 -10
- package/dist/bin/run.js.map +1 -1
- package/dist/bin/upgrade.js +4 -3
- package/dist/bin/upgrade.js.map +1 -1
- package/dist/bin/workloadIdentity.d.ts +18 -0
- package/dist/bin/workloadIdentity.js +100 -0
- package/dist/bin/workloadIdentity.js.map +1 -0
- package/dist/components/Application.d.ts +139 -16
- package/dist/components/Application.js +2215 -267
- package/dist/components/Application.js.map +1 -1
- package/dist/components/ApplicationScope.d.ts +8 -0
- package/dist/components/ApplicationScope.js +7 -0
- package/dist/components/ApplicationScope.js.map +1 -1
- package/dist/components/EntryHandler.js +26 -10
- package/dist/components/EntryHandler.js.map +1 -1
- package/dist/components/OptionsWatcher.d.ts +1 -0
- package/dist/components/OptionsWatcher.js +141 -74
- package/dist/components/OptionsWatcher.js.map +1 -1
- package/dist/components/RuntimeModuleTracker.js +40 -6
- package/dist/components/RuntimeModuleTracker.js.map +1 -1
- package/dist/components/Scope.js +38 -13
- package/dist/components/Scope.js.map +1 -1
- package/dist/components/awaitRestart.d.ts +33 -0
- package/dist/components/awaitRestart.js +61 -0
- package/dist/components/awaitRestart.js.map +1 -0
- package/dist/components/componentLoader.d.ts +38 -1
- package/dist/components/componentLoader.js +279 -22
- package/dist/components/componentLoader.js.map +1 -1
- package/dist/components/componentPreparationLock.d.ts +5 -0
- package/dist/components/componentPreparationLock.js +14 -6
- package/dist/components/componentPreparationLock.js.map +1 -1
- package/dist/components/mcp/adapters/harperHttp.js +4 -0
- package/dist/components/mcp/adapters/harperHttp.js.map +1 -1
- package/dist/components/mcp/listChanged.js +5 -0
- package/dist/components/mcp/listChanged.js.map +1 -1
- package/dist/components/mcp/toolRegistry.d.ts +1 -0
- package/dist/components/mcp/toolRegistry.js.map +1 -1
- package/dist/components/mcp/tools/operations.d.ts +5 -0
- package/dist/components/mcp/tools/operations.js +9 -0
- package/dist/components/mcp/tools/operations.js.map +1 -1
- package/dist/components/mcp/tools/schemas/operationDescriptions.js +2 -2
- package/dist/components/mcp/tools/schemas/operationDescriptions.js.map +1 -1
- package/dist/components/operations.js +231 -77
- package/dist/components/operations.js.map +1 -1
- package/dist/components/operationsValidation.js +49 -1
- package/dist/components/operationsValidation.js.map +1 -1
- package/dist/components/status/ComponentStatusRegistry.d.ts +0 -4
- package/dist/components/status/ComponentStatusRegistry.js +63 -0
- package/dist/components/status/ComponentStatusRegistry.js.map +1 -1
- package/dist/config/RootConfigWatcher.d.ts +7 -1
- package/dist/config/RootConfigWatcher.js +64 -27
- package/dist/config/RootConfigWatcher.js.map +1 -1
- package/dist/config/configUtils.d.ts +9 -1
- package/dist/config/configUtils.js +254 -33
- package/dist/config/configUtils.js.map +1 -1
- package/dist/config/harperConfigEnvVars.d.ts +16 -0
- package/dist/config/harperConfigEnvVars.js +162 -25
- package/dist/config/harperConfigEnvVars.js.map +1 -1
- package/dist/dataLayer/blobBackup.d.ts +49 -20
- package/dist/dataLayer/blobBackup.js +139 -50
- package/dist/dataLayer/blobBackup.js.map +1 -1
- package/dist/dataLayer/delete.js +1 -1
- package/dist/dataLayer/delete.js.map +1 -1
- package/dist/dataLayer/harperBridge/ResourceBridge.d.ts +14 -1
- package/dist/dataLayer/harperBridge/ResourceBridge.js +51 -10
- package/dist/dataLayer/harperBridge/ResourceBridge.js.map +1 -1
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/DeleteAuditLogsBeforeResults.d.ts +3 -1
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/DeleteAuditLogsBeforeResults.js +3 -1
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/DeleteAuditLogsBeforeResults.js.map +1 -1
- package/dist/dataLayer/hdbInfoController.d.ts +10 -0
- package/dist/dataLayer/hdbInfoController.js +30 -1
- package/dist/dataLayer/hdbInfoController.js.map +1 -1
- package/dist/dataLayer/insert.d.ts +9 -1
- package/dist/dataLayer/insert.js +30 -0
- package/dist/dataLayer/insert.js.map +1 -1
- package/dist/dataLayer/rocksdbBackup.d.ts +2 -2
- package/dist/dataLayer/rocksdbBackup.js +45 -8
- package/dist/dataLayer/rocksdbBackup.js.map +1 -1
- package/dist/dataLayer/schema.js +8 -0
- package/dist/dataLayer/schema.js.map +1 -1
- package/dist/dataLayer/schemaDescribe.js +8 -1
- package/dist/dataLayer/schemaDescribe.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js.map +1 -1
- package/dist/json/systemSchema.json +52 -0
- package/dist/resources/DatabaseTransaction.d.ts +55 -0
- package/dist/resources/DatabaseTransaction.js +459 -45
- package/dist/resources/DatabaseTransaction.js.map +1 -1
- package/dist/resources/LMDBTransaction.js +22 -4
- package/dist/resources/LMDBTransaction.js.map +1 -1
- package/dist/resources/PrimaryRocksDatabase.d.ts +1 -0
- package/dist/resources/PrimaryRocksDatabase.js +29 -0
- package/dist/resources/PrimaryRocksDatabase.js.map +1 -1
- package/dist/resources/RecordEncoder.d.ts +20 -0
- package/dist/resources/RecordEncoder.js +94 -9
- package/dist/resources/RecordEncoder.js.map +1 -1
- package/dist/resources/RequestTarget.d.ts +2 -0
- package/dist/resources/RequestTarget.js.map +1 -1
- package/dist/resources/Resource.js +20 -11
- package/dist/resources/Resource.js.map +1 -1
- package/dist/resources/ResourceInterface.d.ts +20 -1
- package/dist/resources/ResourceInterface.js.map +1 -1
- package/dist/resources/RocksIndexStore.d.ts +6 -1
- package/dist/resources/RocksIndexStore.js +24 -9
- package/dist/resources/RocksIndexStore.js.map +1 -1
- package/dist/resources/RocksTransactionLogStore.d.ts +14 -1
- package/dist/resources/RocksTransactionLogStore.js +57 -17
- package/dist/resources/RocksTransactionLogStore.js.map +1 -1
- package/dist/resources/Table.d.ts +112 -8
- package/dist/resources/Table.js +1073 -191
- package/dist/resources/Table.js.map +1 -1
- package/dist/resources/auditStore.d.ts +11 -2
- package/dist/resources/auditStore.js +325 -71
- package/dist/resources/auditStore.js.map +1 -1
- package/dist/resources/blob.d.ts +129 -9
- package/dist/resources/blob.js +992 -114
- package/dist/resources/blob.js.map +1 -1
- package/dist/resources/branchDatabase.d.ts +48 -0
- package/dist/resources/branchDatabase.js +892 -0
- package/dist/resources/branchDatabase.js.map +1 -0
- package/dist/resources/crdt.js +50 -12
- package/dist/resources/crdt.js.map +1 -1
- package/dist/resources/databases.d.ts +150 -0
- package/dist/resources/databases.js +1200 -239
- package/dist/resources/databases.js.map +1 -1
- package/dist/resources/defineTable.d.ts +10 -2
- package/dist/resources/defineTable.js +9 -1
- package/dist/resources/defineTable.js.map +1 -1
- package/dist/resources/graphql.d.ts +1 -1
- package/dist/resources/graphql.js +50 -15
- package/dist/resources/graphql.js.map +1 -1
- package/dist/resources/indexes/HierarchicalNavigableSmallWorld.d.ts +1 -0
- package/dist/resources/indexes/HierarchicalNavigableSmallWorld.js +6 -2
- package/dist/resources/indexes/HierarchicalNavigableSmallWorld.js.map +1 -1
- package/dist/resources/longLivedTransactions.d.ts +71 -0
- package/dist/resources/longLivedTransactions.js +358 -0
- package/dist/resources/longLivedTransactions.js.map +1 -0
- package/dist/resources/models/backendRegistry.d.ts +26 -0
- package/dist/resources/models/backendRegistry.js +60 -2
- package/dist/resources/models/backendRegistry.js.map +1 -1
- package/dist/resources/models/bootstrap.d.ts +33 -1
- package/dist/resources/models/bootstrap.js +416 -31
- package/dist/resources/models/bootstrap.js.map +1 -1
- package/dist/resources/recordLock.d.ts +80 -0
- package/dist/resources/recordLock.js +184 -0
- package/dist/resources/recordLock.js.map +1 -0
- package/dist/resources/replayLogs.d.ts +14 -1
- package/dist/resources/replayLogs.js +152 -24
- package/dist/resources/replayLogs.js.map +1 -1
- package/dist/resources/replayLogsGuards.d.ts +94 -7
- package/dist/resources/replayLogsGuards.js +111 -7
- package/dist/resources/replayLogsGuards.js.map +1 -1
- package/dist/resources/search.js +158 -6
- package/dist/resources/search.js.map +1 -1
- package/dist/resources/transactionBroadcast.d.ts +1 -1
- package/dist/resources/transactionBroadcast.js +2 -2
- package/dist/resources/transactionBroadcast.js.map +1 -1
- package/dist/security/auth.js +61 -30
- package/dist/security/auth.js.map +1 -1
- package/dist/security/authn/oidc/claims.d.ts +22 -0
- package/dist/security/authn/oidc/claims.js +71 -0
- package/dist/security/authn/oidc/claims.js.map +1 -0
- package/dist/security/authn/oidc/identityToken.d.ts +27 -0
- package/dist/security/authn/oidc/identityToken.js +111 -0
- package/dist/security/authn/oidc/identityToken.js.map +1 -0
- package/dist/security/authn/oidc/jwks.d.ts +25 -0
- package/dist/security/authn/oidc/jwks.js +261 -0
- package/dist/security/authn/oidc/jwks.js.map +1 -0
- package/dist/security/authn/oidc/providers/generic.d.ts +13 -0
- package/dist/security/authn/oidc/providers/generic.js +34 -0
- package/dist/security/authn/oidc/providers/generic.js.map +1 -0
- package/dist/security/authn/oidc/providers/githubActions.d.ts +11 -0
- package/dist/security/authn/oidc/providers/githubActions.js +129 -0
- package/dist/security/authn/oidc/providers/githubActions.js.map +1 -0
- package/dist/security/authn/oidc/providers/index.d.ts +37 -0
- package/dist/security/authn/oidc/providers/index.js +24 -0
- package/dist/security/authn/oidc/providers/index.js.map +1 -0
- package/dist/security/authn/oidc/tokenExchange.d.ts +12 -0
- package/dist/security/authn/oidc/tokenExchange.js +306 -0
- package/dist/security/authn/oidc/tokenExchange.js.map +1 -0
- package/dist/security/authn/oidc/trustPolicyOperations.d.ts +49 -0
- package/dist/security/authn/oidc/trustPolicyOperations.js +358 -0
- package/dist/security/authn/oidc/trustPolicyOperations.js.map +1 -0
- package/dist/security/authn/oidc/types.d.ts +38 -0
- package/dist/security/authn/oidc/types.js +6 -0
- package/dist/security/authn/oidc/types.js.map +1 -0
- package/dist/security/certificateVerification/index.js +40 -11
- package/dist/security/certificateVerification/index.js.map +1 -1
- package/dist/security/certificateVerification/trustedIssuers.d.ts +24 -0
- package/dist/security/certificateVerification/trustedIssuers.js +79 -0
- package/dist/security/certificateVerification/trustedIssuers.js.map +1 -0
- package/dist/security/certificateVerification/types.d.ts +1 -0
- package/dist/security/credentialProvenance.d.ts +35 -0
- package/dist/security/credentialProvenance.js +51 -0
- package/dist/security/credentialProvenance.js.map +1 -0
- package/dist/security/credentialRejection.d.ts +4 -0
- package/dist/security/credentialRejection.js +24 -0
- package/dist/security/credentialRejection.js.map +1 -0
- package/dist/security/deferredAuthentication.d.ts +36 -0
- package/dist/security/deferredAuthentication.js +70 -0
- package/dist/security/deferredAuthentication.js.map +1 -0
- package/dist/security/impersonation.d.ts +21 -0
- package/dist/security/impersonation.js +108 -9
- package/dist/security/impersonation.js.map +1 -1
- package/dist/security/jsLoader.d.ts +6 -0
- package/dist/security/jsLoader.js +75 -15
- package/dist/security/jsLoader.js.map +1 -1
- package/dist/security/keys.js +301 -71
- package/dist/security/keys.js.map +1 -1
- package/dist/security/operationScope.d.ts +21 -0
- package/dist/security/operationScope.js +36 -0
- package/dist/security/operationScope.js.map +1 -0
- package/dist/security/permissionsTranslator.js +21 -0
- package/dist/security/permissionsTranslator.js.map +1 -1
- package/dist/security/tokenAuthentication.d.ts +19 -1
- package/dist/security/tokenAuthentication.js +191 -10
- package/dist/security/tokenAuthentication.js.map +1 -1
- package/dist/security/user.js +4 -3
- package/dist/security/user.js.map +1 -1
- package/dist/server/DurableSubscriptionsSession.d.ts +2 -2
- package/dist/server/DurableSubscriptionsSession.js +67 -10
- package/dist/server/DurableSubscriptionsSession.js.map +1 -1
- package/dist/server/REST.js +73 -0
- package/dist/server/REST.js.map +1 -1
- package/dist/server/graphqlQuerying.js +4 -0
- package/dist/server/graphqlQuerying.js.map +1 -1
- package/dist/server/http.d.ts +11 -0
- package/dist/server/http.js +88 -15
- package/dist/server/http.js.map +1 -1
- package/dist/server/itc/serverHandlers.js +8 -1
- package/dist/server/itc/serverHandlers.js.map +1 -1
- package/dist/server/jobs/jobProcess.js +6 -2
- package/dist/server/jobs/jobProcess.js.map +1 -1
- package/dist/server/jobs/jobs.js +4 -1
- package/dist/server/jobs/jobs.js.map +1 -1
- package/dist/server/liveSubscriptionAuth.d.ts +26 -4
- package/dist/server/liveSubscriptionAuth.js +105 -39
- package/dist/server/liveSubscriptionAuth.js.map +1 -1
- package/dist/server/loadRootComponents.js +49 -10
- package/dist/server/loadRootComponents.js.map +1 -1
- package/dist/server/mqtt.d.ts +2 -0
- package/dist/server/mqtt.js +165 -30
- package/dist/server/mqtt.js.map +1 -1
- package/dist/server/nodeName.d.ts +2 -0
- package/dist/server/nodeName.js +107 -23
- package/dist/server/nodeName.js.map +1 -1
- package/dist/server/serverHelpers/Headers.d.ts +25 -0
- package/dist/server/serverHelpers/Headers.js +139 -1
- package/dist/server/serverHelpers/Headers.js.map +1 -1
- package/dist/server/serverHelpers/contentTypes.d.ts +9 -0
- package/dist/server/serverHelpers/contentTypes.js +32 -25
- package/dist/server/serverHelpers/contentTypes.js.map +1 -1
- package/dist/server/serverHelpers/deployValidationState.d.ts +3 -0
- package/dist/server/serverHelpers/deployValidationState.js +9 -19
- package/dist/server/serverHelpers/deployValidationState.js.map +1 -1
- package/dist/server/serverHelpers/operationAuthorizationState.d.ts +12 -0
- package/dist/server/serverHelpers/operationAuthorizationState.js +24 -2
- package/dist/server/serverHelpers/operationAuthorizationState.js.map +1 -1
- package/dist/server/serverHelpers/registeredOperations.d.ts +5 -4
- package/dist/server/serverHelpers/registeredOperations.js +74 -21
- package/dist/server/serverHelpers/registeredOperations.js.map +1 -1
- package/dist/server/serverHelpers/requestSanitization.d.ts +11 -0
- package/dist/server/serverHelpers/requestSanitization.js +20 -0
- package/dist/server/serverHelpers/requestSanitization.js.map +1 -0
- package/dist/server/serverHelpers/serverHandlers.js +6 -3
- package/dist/server/serverHelpers/serverHandlers.js.map +1 -1
- package/dist/server/serverHelpers/serverUtilities.d.ts +18 -0
- package/dist/server/serverHelpers/serverUtilities.js +90 -20
- package/dist/server/serverHelpers/serverUtilities.js.map +1 -1
- package/dist/server/serverHelpers/sharedMessageEncoding.d.ts +67 -0
- package/dist/server/serverHelpers/sharedMessageEncoding.js +280 -0
- package/dist/server/serverHelpers/sharedMessageEncoding.js.map +1 -0
- package/dist/server/serverHelpers/uwsServer.js +19 -1
- package/dist/server/serverHelpers/uwsServer.js.map +1 -1
- package/dist/server/static.js +24 -28
- package/dist/server/static.js.map +1 -1
- package/dist/server/storageReclamation.d.ts +12 -0
- package/dist/server/storageReclamation.js +26 -0
- package/dist/server/storageReclamation.js.map +1 -1
- package/dist/server/threads/itc.d.ts +7 -2
- package/dist/server/threads/itc.js +5 -1
- package/dist/server/threads/itc.js.map +1 -1
- package/dist/server/threads/manageThreads.d.ts +26 -3
- package/dist/server/threads/manageThreads.js +517 -65
- package/dist/server/threads/manageThreads.js.map +1 -1
- package/dist/server/threads/socketRouter.js +89 -26
- package/dist/server/threads/socketRouter.js.map +1 -1
- package/dist/server/threads/threadHeapMemory.d.ts +2 -0
- package/dist/server/threads/threadHeapMemory.js +31 -0
- package/dist/server/threads/threadHeapMemory.js.map +1 -0
- package/dist/server/threads/threadServer.js +46 -15
- package/dist/server/threads/threadServer.js.map +1 -1
- package/dist/sqlEngine/config.d.ts +1 -3
- package/dist/sqlEngine/config.js +19 -16
- package/dist/sqlEngine/config.js.map +1 -1
- package/dist/sqlTranslator/index.d.ts +1 -1
- package/dist/sqlTranslator/index.js +30 -7
- package/dist/sqlTranslator/index.js.map +1 -1
- package/dist/upgrade/directives/5-3-0.d.ts +7 -0
- package/dist/upgrade/directives/5-3-0.js +148 -0
- package/dist/upgrade/directives/5-3-0.js.map +1 -0
- package/dist/upgrade/directives/directivesController.js +2 -1
- package/dist/upgrade/directives/directivesController.js.map +1 -1
- package/dist/utility/OperationFunctionCaller.js +2 -1
- package/dist/utility/OperationFunctionCaller.js.map +1 -1
- package/dist/utility/common_utils.d.ts +16 -0
- package/dist/utility/common_utils.js +32 -6
- package/dist/utility/common_utils.js.map +1 -1
- package/dist/utility/componentNames.d.ts +8 -0
- package/dist/utility/componentNames.js +12 -1
- package/dist/utility/componentNames.js.map +1 -1
- package/dist/utility/environment/environmentManager.js +3 -6
- package/dist/utility/environment/environmentManager.js.map +1 -1
- package/dist/utility/environment/systemInformation.d.ts +1 -0
- package/dist/utility/environment/systemInformation.js +1 -0
- package/dist/utility/environment/systemInformation.js.map +1 -1
- package/dist/utility/errors/commonErrors.d.ts +2 -0
- package/dist/utility/errors/commonErrors.js +2 -0
- package/dist/utility/errors/commonErrors.js.map +1 -1
- package/dist/utility/errors/hdbError.d.ts +17 -0
- package/dist/utility/errors/hdbError.js +30 -1
- package/dist/utility/errors/hdbError.js.map +1 -1
- package/dist/utility/globalSchema.d.ts +18 -0
- package/dist/utility/hdbTerms.d.ts +16 -0
- package/dist/utility/hdbTerms.js +18 -2
- package/dist/utility/hdbTerms.js.map +1 -1
- package/dist/utility/logging/harper_logger.d.ts +2 -0
- package/dist/utility/logging/harper_logger.js +91 -14
- package/dist/utility/logging/harper_logger.js.map +1 -1
- package/dist/utility/logging/logRotator.js +76 -49
- package/dist/utility/logging/logRotator.js.map +1 -1
- package/dist/utility/nodeIdentity.d.ts +9 -0
- package/dist/utility/nodeIdentity.js +58 -0
- package/dist/utility/nodeIdentity.js.map +1 -0
- package/dist/utility/npmUtilities.js +9 -7
- package/dist/utility/npmUtilities.js.map +1 -1
- package/dist/utility/operationPermissions.d.ts +3 -1
- package/dist/utility/operationPermissions.js +16 -1
- package/dist/utility/operationPermissions.js.map +1 -1
- package/dist/utility/operation_authorization.d.ts +10 -7
- package/dist/utility/operation_authorization.js +212 -41
- package/dist/utility/operation_authorization.js.map +1 -1
- package/dist/utility/watchPath.d.ts +29 -0
- package/dist/utility/watchPath.js +68 -0
- package/dist/utility/watchPath.js.map +1 -0
- package/dist/utility/watcherFallback.d.ts +86 -0
- package/dist/utility/watcherFallback.js +278 -1
- package/dist/utility/watcherFallback.js.map +1 -1
- package/dist/validation/configValidator.d.ts +12 -0
- package/dist/validation/configValidator.js +199 -72
- package/dist/validation/configValidator.js.map +1 -1
- package/dist/validation/installValidator.js +12 -0
- package/dist/validation/installValidator.js.map +1 -1
- package/dist/validation/validationWrapper.d.ts +11 -0
- package/dist/validation/validationWrapper.js +16 -3
- package/dist/validation/validationWrapper.js.map +1 -1
- package/index.ts +2 -0
- package/json/systemSchema.json +52 -0
- package/npm-shrinkwrap.json +196 -194
- package/package.json +7 -6
- package/resources/DESIGN.md +114 -52
- package/resources/DatabaseTransaction.ts +521 -43
- package/resources/LMDBTransaction.ts +26 -4
- package/resources/PrimaryRocksDatabase.ts +28 -1
- package/resources/RecordEncoder.ts +103 -8
- package/resources/RequestTarget.ts +2 -0
- package/resources/Resource.ts +17 -9
- package/resources/ResourceInterface.ts +23 -0
- package/resources/RocksIndexStore.ts +30 -9
- package/resources/RocksTransactionLogStore.ts +78 -21
- package/resources/Table.ts +1110 -159
- package/resources/auditStore.ts +331 -73
- package/resources/blob.ts +1029 -110
- package/resources/branchDatabase.ts +941 -0
- package/resources/crdt.ts +76 -12
- package/resources/databases.ts +1310 -252
- package/resources/defineTable.ts +18 -2
- package/resources/graphql.ts +70 -16
- package/resources/indexes/HierarchicalNavigableSmallWorld.ts +6 -2
- package/resources/longLivedTransactions.ts +360 -0
- package/resources/models/backendRegistry.ts +84 -2
- package/resources/models/bootstrap.ts +473 -28
- package/resources/recordLock.ts +253 -0
- package/resources/replayLogs.ts +147 -26
- package/resources/replayLogsGuards.ts +171 -8
- package/resources/search.ts +154 -7
- package/resources/transactionBroadcast.ts +3 -3
- package/security/auth.ts +68 -29
- package/security/authn/oidc/claims.ts +72 -0
- package/security/authn/oidc/identityToken.ts +129 -0
- package/security/authn/oidc/jwks.ts +260 -0
- package/security/authn/oidc/providers/generic.ts +40 -0
- package/security/authn/oidc/providers/githubActions.ts +137 -0
- package/security/authn/oidc/providers/index.ts +52 -0
- package/security/authn/oidc/tokenExchange.ts +300 -0
- package/security/authn/oidc/trustPolicyOperations.ts +343 -0
- package/security/authn/oidc/types.ts +41 -0
- package/security/certificateVerification/index.ts +54 -13
- package/security/certificateVerification/trustedIssuers.ts +76 -0
- package/security/certificateVerification/types.ts +1 -0
- package/security/credentialProvenance.ts +47 -0
- package/security/credentialRejection.ts +22 -0
- package/security/deferredAuthentication.ts +71 -0
- package/security/impersonation.ts +117 -12
- package/security/jsLoader.ts +81 -18
- package/security/keys.ts +298 -72
- package/security/operationScope.ts +33 -0
- package/security/permissionsTranslator.js +23 -0
- package/security/tokenAuthentication.ts +233 -12
- package/security/user.ts +4 -3
- package/server/DESIGN.md +183 -16
- package/server/DurableSubscriptionsSession.ts +71 -11
- package/server/REST.ts +79 -1
- package/server/graphqlQuerying.ts +4 -0
- package/server/http.ts +99 -18
- package/server/itc/serverHandlers.js +8 -1
- package/server/jobs/jobProcess.ts +8 -2
- package/server/jobs/jobs.ts +4 -1
- package/server/liveSubscriptionAuth.ts +129 -46
- package/server/loadRootComponents.js +50 -8
- package/server/mqtt.ts +179 -38
- package/server/nodeName.ts +103 -21
- package/server/serverHelpers/Headers.ts +131 -0
- package/server/serverHelpers/contentTypes.ts +29 -21
- package/server/serverHelpers/deployValidationState.ts +24 -13
- package/server/serverHelpers/operationAuthorizationState.ts +34 -3
- package/server/serverHelpers/registeredOperations.ts +79 -22
- package/server/serverHelpers/requestSanitization.ts +15 -0
- package/server/serverHelpers/serverHandlers.js +6 -3
- package/server/serverHelpers/serverUtilities.ts +104 -31
- package/server/serverHelpers/sharedMessageEncoding.ts +307 -0
- package/server/serverHelpers/uwsServer.ts +17 -2
- package/server/static.ts +23 -29
- package/server/storageReclamation.ts +23 -0
- package/server/threads/itc.js +11 -1
- package/server/threads/manageThreads.js +526 -56
- package/server/threads/socketRouter.ts +81 -26
- package/server/threads/threadHeapMemory.ts +26 -0
- package/server/threads/threadServer.js +43 -15
- package/sqlTranslator/index.ts +31 -8
- package/studio/web/assets/Chat-BnCBegQz.js +2267 -0
- package/studio/web/assets/FloatingChat-CoDW1ySS.js +23 -0
- package/studio/web/assets/{abnfDiagram-VCTEODGH-C0_BAZyO.js → abnfDiagram-VCTEODGH-B0BebmD2.js} +1 -1
- package/studio/web/assets/{alertDialog-DIHt7Z0r.js → alertDialog-CQyAJJhl.js} +1 -1
- package/studio/web/assets/{apiToken-c3Rd-w6g.js → apiToken-Bwk5BLXW.js} +1 -1
- package/studio/web/assets/applications-DHxGi7JH.js +296 -0
- package/studio/web/assets/architecture-7GRP2DOG-LB-MLAAb.js +1 -0
- package/studio/web/assets/{architectureDiagram-5GKGNRK7-BWzrASgm.js → architectureDiagram-5GKGNRK7-7SW3GD-K.js} +1 -1
- package/studio/web/assets/authStore-C3Nfubqr.js +3 -0
- package/studio/web/assets/{blockDiagram-NRAW4CY4-BdJX9Khj.js → blockDiagram-I7D4REHJ-BqguiadH.js} +2 -2
- package/studio/web/assets/{button-DhiX-njv.js → button-BIsUKRZq.js} +2 -2
- package/studio/web/assets/{c4Diagram-UCG6FXSJ-CI6MzGmQ.js → c4Diagram-7LVT6UL2-LBNf8t_X.js} +1 -1
- package/studio/web/assets/channel-yictG-U-.js +1 -0
- package/studio/web/assets/{chevron-up-Df2c8uoU.js → chevron-up-DtKGqDn3.js} +1 -1
- package/studio/web/assets/{chunk-TEH6E4GO-P87k5mNi.js → chunk-4HAMMTFA-DWtTut21.js} +1 -1
- package/studio/web/assets/{chunk-75Z2AOVW-BT8tVmks.js → chunk-75Z2AOVW-QGQD6th2.js} +1 -1
- package/studio/web/assets/{chunk-DU6HZSFF-9kAOOmI6.js → chunk-DU6HZSFF-Chq20Ba5.js} +1 -1
- package/studio/web/assets/{chunk-F27PBJKO-BW7ao8AY.js → chunk-F27PBJKO-BVA5EPhV.js} +1 -1
- package/studio/web/assets/{chunk-GMAD6QVW-BNyXpoQO.js → chunk-GMAD6QVW-BeS7S07A.js} +1 -1
- package/studio/web/assets/{chunk-OBVCFTLP-D4wWOqDQ.js → chunk-GVQU2GXP-sbwVIQ8i.js} +1 -1
- package/studio/web/assets/{chunk-G27WJ6UU-COyLMcgK.js → chunk-IMKFNOWR-Bnh3tAVd.js} +1 -1
- package/studio/web/assets/{chunk-JQ64N6SF-Cyz1IeLf.js → chunk-L3NEJ4N5-COfUyKII.js} +1 -1
- package/studio/web/assets/chunk-OSK3NFVY-ByciRftO.js +10 -0
- package/studio/web/assets/{chunk-P2QGCYS3-DmIFY4d7.js → chunk-P2QGCYS3-CP1VhG_c.js} +1 -1
- package/studio/web/assets/{chunk-POPQ4Y6H-BPrvMyKz.js → chunk-POPQ4Y6H-ClWhhkwW.js} +1 -1
- package/studio/web/assets/{chunk-PWAF6VOD-2zB6IW9i.js → chunk-PWAF6VOD-1z1THyS5.js} +1 -1
- package/studio/web/assets/{chunk-RHFEMEQ7-2FgyI8YU.js → chunk-SHT3W25Y-LpQkMsah.js} +2 -2
- package/studio/web/assets/{chunk-SVP7TREG-FwtbH2QC.js → chunk-SVP7TREG-jtdAHw0S.js} +1 -1
- package/studio/web/assets/{chunk-LCL6LL3I-HOzK_ppE.js → chunk-TICWLB2K-VOwzetX-.js} +1 -1
- package/studio/web/assets/classDiagram-ZZMXUADV-VaEwSy_g.js +1 -0
- package/studio/web/assets/classDiagram-v2-VYDZK3BY-VaEwSy_g.js +1 -0
- package/studio/web/assets/{createLucideIcon-BKGPfjm2.js → createLucideIcon-CzW9508A.js} +1 -1
- package/studio/web/assets/{cssMode-CEN2mzSA.js → cssMode-s0cWI-_M.js} +1 -1
- package/studio/web/assets/{cynefin-OW5HDTMX-BRkpLFQV.js → cynefin-OW5HDTMX-BbdbCvub.js} +1 -1
- package/studio/web/assets/{cynefinDiagram-5FMLGOSQ-CHT1DaX6.js → cynefinDiagram-5FMLGOSQ-TP-aIqbt.js} +1 -1
- package/studio/web/assets/{dagre-3AP2YEHR-DpUXBh63.js → dagre-GXQ25YYZ-DShnGpGo.js} +1 -1
- package/studio/web/assets/{diagram-S7CK7UJ4-BuymVFZT.js → diagram-S7CK7UJ4-aoCVTtcy.js} +1 -1
- package/studio/web/assets/{diagram-UQ7AKVKN-CyP148RM.js → diagram-UQ7AKVKN-DglXtQ6x.js} +1 -1
- package/studio/web/assets/{diagram-VSXAHHWV-CoCAg3M9.js → diagram-VSXAHHWV-fhEdmkwM.js} +1 -1
- package/studio/web/assets/{diagram-VX7I27RA-BpOqCFca.js → diagram-VX7I27RA-DccVJet6.js} +1 -1
- package/studio/web/assets/{diagram-Z3DM3KII-Bfpw7Vbj.js → diagram-Z3DM3KII-D-RyJJb7.js} +1 -1
- package/studio/web/assets/{dialog-CBf0Mr1d.js → dialog-Cn2uWgD4.js} +1 -1
- package/studio/web/assets/{dist-lkA3O3eM.js → dist-DP8UjMB_.js} +1 -1
- package/studio/web/assets/{download-BtTOBem-.js → download-B5T5r7ss.js} +1 -1
- package/studio/web/assets/{ebnfDiagram-PWID7BFC-DS_6aWqL.js → ebnfDiagram-PWID7BFC-DJGpIpz_.js} +1 -1
- package/studio/web/assets/{editor-D8oDeCTL.js → editor-DNcRHK54.js} +1 -1
- package/studio/web/assets/{erDiagram-SSCWMZ5O-DJNk6Fgw.js → erDiagram-RLTQ6QDP-CIfNlgkC.js} +1 -1
- package/studio/web/assets/eventmodeling-NTZA5JFV-CLxnp2CR.js +1 -0
- package/studio/web/assets/flowDiagram-HODETNUW-BIbhmz9f.js +1 -0
- package/studio/web/assets/{ganttDiagram-EL5Y4UJY-2pOExxMY.js → ganttDiagram-EL5Y4UJY-BxToTzzD.js} +1 -1
- package/studio/web/assets/{getAnalytics-D4LKGeVy.js → getAnalytics-GHK8ORfM.js} +1 -1
- package/studio/web/assets/{gitGraph-4MIJSDKK-CH5ZxwzF.js → gitGraph-4MIJSDKK-D2s2w8lE.js} +1 -1
- package/studio/web/assets/{gitGraphDiagram-WWUBYQGX-DVIsIhbO.js → gitGraphDiagram-WWUBYQGX-Dwntd4-x.js} +1 -1
- package/studio/web/assets/{html-u3vOg7LJ.js → html-Bdssedlg.js} +1 -1
- package/studio/web/assets/{htmlMode-DyO31v-P.js → htmlMode-CoDlJ3fw.js} +1 -1
- package/studio/web/assets/{index-Cxj2_wsl.css → index-7RMEgVG1.css} +1 -1
- package/studio/web/assets/index-D6sxmFLR.js +824 -0
- package/studio/web/assets/index.lazy-tmU5BS8s.js +2 -0
- package/studio/web/assets/{info-A6RAGUB7-CPQfTnaG.js → info-A6RAGUB7-DYjkvb0C.js} +1 -1
- package/studio/web/assets/{infoDiagram-RXCK75RN-DlwLYlwm.js → infoDiagram-27XIBGKW-Bnp1FJE5.js} +1 -1
- package/studio/web/assets/{ishikawaDiagram-5VMMS53U-BRXRp29U.js → ishikawaDiagram-5VMMS53U-D9Xh2r6X.js} +1 -1
- package/studio/web/assets/{javascript-CUvxOyTC.js → javascript-B8meVSTH.js} +1 -1
- package/studio/web/assets/{journeyDiagram-EYS64GPL-B0ou8k0n.js → journeyDiagram-3NMN7TZE-CokIi6ll.js} +2 -2
- package/studio/web/assets/{jsonMode-f_IwbF3D.js → jsonMode-DpIPd35T.js} +1 -1
- package/studio/web/assets/{kanban-definition-3QL26DDD-uYg7iYzp.js → kanban-definition-UXKFOSKX-CukSFJfX.js} +1 -1
- package/studio/web/assets/{languageServices-DXtZ6rEF.js → languageServices-C_5FMJzQ.js} +1 -1
- package/studio/web/assets/{lspLanguageFeatures-B4pCF1zO.js → lspLanguageFeatures-BIzNBzPK.js} +1 -1
- package/studio/web/assets/{mermaid-parser.core-Ck-fC8b7.js → mermaid-parser.core-BlEsOWNO.js} +3 -3
- package/studio/web/assets/{mermaid.core-CP8aNNYm.js → mermaid.core-BlkGaMIH.js} +5 -5
- package/studio/web/assets/{mindmap-definition-FBJOCRG2-CgTZ-rit.js → mindmap-definition-YA3MSWOX-IprMc_0j.js} +1 -1
- package/studio/web/assets/{notifications-D3tIQ4sg.js → notifications-CQf18QKb.js} +1 -1
- package/studio/web/assets/notifications-CvZivSbh.js +1 -0
- package/studio/web/assets/{packet-AYTQ26CC-DEyoPtPb.js → packet-AYTQ26CC-Bi3V04Zi.js} +1 -1
- package/studio/web/assets/{pegDiagram-XKGWAZYB-DrD-7sD9.js → pegDiagram-XKGWAZYB-BNuPDLZY.js} +1 -1
- package/studio/web/assets/{pie-WAS4IAKB-wjj-EI1d.js → pie-WAS4IAKB-_6DoDbng.js} +1 -1
- package/studio/web/assets/{pieDiagram-E7YTZNPT-GntqDCzv.js → pieDiagram-E7YTZNPT-DqNb6Ht2.js} +1 -1
- package/studio/web/assets/{profile-DZWU7MgT.js → profile-DdOwtntb.js} +1 -1
- package/studio/web/assets/{quadrantDiagram-AXDQQJYC-0UeqXQGd.js → quadrantDiagram-AXDQQJYC-BGH9E2YR.js} +1 -1
- package/studio/web/assets/{radar-RG4KPBEZ-DFSA5h7k.js → radar-RG4KPBEZ-DDdVczcL.js} +1 -1
- package/studio/web/assets/{railroad-74A4TZTK-CaOUG9wR.js → railroad-74A4TZTK-BJUP4Jds.js} +1 -1
- package/studio/web/assets/railroad-abnf-HS5TGJTU-Bm3L1L0h.js +1 -0
- package/studio/web/assets/railroad-ebnf-LZEXJU2U-CKzLGlkw.js +1 -0
- package/studio/web/assets/railroad-peg-WCYAUIDC-S8xLjslx.js +1 -0
- package/studio/web/assets/{railroadDiagram-O6MQD6OU-yHUELZaV.js → railroadDiagram-O6MQD6OU-DGTPh2KZ.js} +1 -1
- package/studio/web/assets/{regions-CkyurXzE.js → regions-n69fwagr.js} +1 -1
- package/studio/web/assets/{register-BUyhWjBO.js → register-PfWTCXWB.js} +3 -3
- package/studio/web/assets/{requirementDiagram-EFPCY7ZU-DNEGFjuW.js → requirementDiagram-BXWQKSXE-BJnO6uLz.js} +1 -1
- package/studio/web/assets/{sankeyDiagram-P5KCCOFB-DpyAmSVR.js → sankeyDiagram-P5KCCOFB-0vSOdymH.js} +1 -1
- package/studio/web/assets/{sequenceDiagram-WJ2MYXX4-TyaT7xNk.js → sequenceDiagram-WJ2MYXX4-hETizDWE.js} +1 -1
- package/studio/web/assets/{setComponentFile-CeyKSZAa.js → setComponentFile-Bg6O7X0S.js} +1 -1
- package/studio/web/assets/{setup-D2kn7cAA.js → setup-CUx_aUDl.js} +2 -2
- package/studio/web/assets/{stateDiagram-HBIQ2CUA-CeEdTArZ.js → stateDiagram-D77RDMKH-CdYQ_KtC.js} +1 -1
- package/studio/web/assets/stateDiagram-v2-MP3YSRHH-CdKuzQMT.js +1 -0
- package/studio/web/assets/status-D7BVKqX9.js +61 -0
- package/studio/web/assets/{swimlanes-XN3QIQJK-B54FmF46.js → swimlanes-42K2YHIH-B8cHIpU4.js} +1 -1
- package/studio/web/assets/swimlanesDiagram-VR7AAH4N-DmOSJwaH.js +8 -0
- package/studio/web/assets/{tabs-B_G5zscN.js → tabs-BrHu7gJi.js} +1 -1
- package/studio/web/assets/{timeline-definition-24CTP7MA-D-a9ujbo.js → timeline-definition-24CTP7MA-BJWYSXqF.js} +1 -1
- package/studio/web/assets/{toggleHighContrast-C0UW6rI2.js → toggleHighContrast-DBSyXzMr.js} +1 -1
- package/studio/web/assets/{treeView-Q6P3EWNA-CrW_6JnS.js → treeView-Q6P3EWNA-qxe_v6CQ.js} +1 -1
- package/studio/web/assets/{treemap-WGGIJYW6-BxyYLdP_.js → treemap-WGGIJYW6-dDo97XXF.js} +1 -1
- package/studio/web/assets/{tsMode-DBC0zmDx.js → tsMode-BByKCjBS.js} +1 -1
- package/studio/web/assets/{typescript-DApRQir3.js → typescript-DDLnLpw9.js} +1 -1
- package/studio/web/assets/{useEntityRestURL-DB6JStU1.js → useEntityRestURL-31CHGaHk.js} +1 -1
- package/studio/web/assets/{useLocalStorage-Dtj1QS8_.js → useLocalStorage-BqMR3D8_.js} +1 -1
- package/studio/web/assets/vendor-core-c2JRRJpV.js +58 -0
- package/studio/web/assets/vendor-datadog-CLUcJXOo.js +6 -0
- package/studio/web/assets/{vendor-react-Dyj4O3HE.js → vendor-react-CJV_K1u4.js} +1 -1
- package/studio/web/assets/vendor-tanstack-DxzraizX.js +1 -0
- package/studio/web/assets/{vendor-ui-vhu-UHhF.js → vendor-ui-BUjK0h8a.js} +2 -2
- package/studio/web/assets/{vennDiagram-4TSXK5OY-Cy7s7Mpy.js → vennDiagram-4TSXK5OY-A3i-lCdl.js} +1 -1
- package/studio/web/assets/{wardley-WFR3VGLG-BeBL35g2.js → wardley-WFR3VGLG-B0ik-_6g.js} +1 -1
- package/studio/web/assets/{wardleyDiagram-VM6X3IG4-BylmIGSg.js → wardleyDiagram-VM6X3IG4-CjrkKWUR.js} +1 -1
- package/studio/web/assets/{workers-C0bFIedw.js → workers-pR3jRY9D.js} +1 -1
- package/studio/web/assets/x-DIzaLEdK.js +1 -0
- package/studio/web/assets/{xml-HWd01lU-.js → xml-2iRnMhQO.js} +1 -1
- package/studio/web/assets/{xychartDiagram-S5SC5T6Z-CoKALMXr.js → xychartDiagram-S5SC5T6Z-Biok4GYV.js} +1 -1
- package/studio/web/assets/{yaml-CIH0Nt-h.js → yaml-Bf92gJpd.js} +1 -1
- package/studio/web/index.html +14 -14
- package/upgrade/directives/5-3-0.ts +132 -0
- package/upgrade/directives/directivesController.ts +2 -1
- package/utility/OperationFunctionCaller.ts +2 -1
- package/utility/common_utils.ts +30 -5
- package/utility/componentNames.ts +12 -0
- package/utility/environment/environmentManager.ts +3 -7
- package/utility/environment/systemInformation.ts +7 -0
- package/utility/errors/commonErrors.ts +4 -0
- package/utility/errors/hdbError.ts +29 -0
- package/utility/hdbTerms.ts +17 -0
- package/utility/logging/harper_logger.ts +87 -14
- package/utility/logging/logRotator.ts +72 -45
- package/utility/nodeIdentity.ts +45 -0
- package/utility/npmUtilities.ts +10 -8
- package/utility/operationPermissions.ts +18 -1
- package/utility/operation_authorization.ts +231 -42
- package/utility/watchPath.ts +63 -0
- package/utility/watcherFallback.ts +270 -0
- package/validation/configValidator.ts +209 -72
- package/validation/installValidator.ts +15 -0
- package/validation/validationWrapper.ts +18 -4
- package/studio/web/assets/Chat-JpO8EtUu.js +0 -2067
- package/studio/web/assets/FloatingChat-Bcj3xSZu.js +0 -23
- package/studio/web/assets/applications-ByqLRKyZ.js +0 -296
- package/studio/web/assets/architecture-7GRP2DOG-DNdx5tEU.js +0 -1
- package/studio/web/assets/authStore-qKmCZcaf.js +0 -3
- package/studio/web/assets/channel-DtCV8PTL.js +0 -1
- package/studio/web/assets/chunk-R7TYR2AO-Irip67yr.js +0 -10
- package/studio/web/assets/classDiagram-DTDB5LWJ-DbO_dCNE.js +0 -1
- package/studio/web/assets/classDiagram-v2-JRS7N3AN-DbO_dCNE.js +0 -1
- package/studio/web/assets/eventmodeling-NTZA5JFV-5jbe4A5P.js +0 -1
- package/studio/web/assets/flowDiagram-A5DVABFB-Dp9Ezlow.js +0 -1
- package/studio/web/assets/index-aSt5tY-L.js +0 -824
- package/studio/web/assets/index.lazy-B9jiPwT8.js +0 -2
- package/studio/web/assets/notifications-CUoYgU98.js +0 -1
- package/studio/web/assets/railroad-abnf-HS5TGJTU-Bc0Qi0WH.js +0 -1
- package/studio/web/assets/railroad-ebnf-LZEXJU2U-G8rVVZ2C.js +0 -1
- package/studio/web/assets/railroad-peg-WCYAUIDC-CrehKBhC.js +0 -1
- package/studio/web/assets/stateDiagram-v2-4QOOHH4V-D4tuw9Su.js +0 -1
- package/studio/web/assets/status-D7Xn5ePA.js +0 -61
- package/studio/web/assets/swimlanesDiagram-VK2B7HYN-XOhmNEvq.js +0 -8
- package/studio/web/assets/vendor-core-RCcadM3e.js +0 -73
- package/studio/web/assets/vendor-datadog-BRv-mOv1.js +0 -6
- package/studio/web/assets/vendor-tanstack-BiFWSB3W.js +0 -1
- package/studio/web/assets/x-B9o9hsep.js +0 -1
- /package/studio/web/assets/{sizeCapture-X5ZJPWSS-B0uUizjq.js → sizeCapture-INFHLROL-B0uUizjq.js} +0 -0
|
@@ -517,6 +517,7 @@ const rocksDBDatabaseLevelStats = new Set<string>([
|
|
|
517
517
|
'numberKeysWritten',
|
|
518
518
|
'numberReseeksIteration',
|
|
519
519
|
'numRunningFlushes',
|
|
520
|
+
'numSnapshots',
|
|
520
521
|
'oldestSnapshotTime',
|
|
521
522
|
'stallMicros',
|
|
522
523
|
'txnOverheadMutexOldCommitMap',
|
|
@@ -547,6 +548,12 @@ type RocksDBStats = {
|
|
|
547
548
|
numberKeysWritten: number;
|
|
548
549
|
numberReseeksIteration: number;
|
|
549
550
|
numRunningFlushes: number;
|
|
551
|
+
// Live RocksDB snapshots for this database. In-flight reads legitimately hold one, so what
|
|
552
|
+
// matters is a count that stays nonzero while nothing is reading: obsolete versions behind the
|
|
553
|
+
// oldest snapshot cannot be discarded for as long as it is held (#2107). oldestSnapshotTime
|
|
554
|
+
// alone can't show accrual — it stops moving once the oldest snapshot is pinned.
|
|
555
|
+
// Optional: rocksdb-js 2.7.1 does not yet report rocksdb.num-snapshots.
|
|
556
|
+
numSnapshots?: number;
|
|
550
557
|
oldestSnapshotTime: number;
|
|
551
558
|
stallMicros: number;
|
|
552
559
|
txnOverheadMutexOldCommitMap: number;
|
|
@@ -132,6 +132,8 @@ const OPERATION_AUTH_ERROR_MSGS = {
|
|
|
132
132
|
OP_IS_SU_ONLY: (op) => `Operation '${op}' is restricted to 'super_user' roles`,
|
|
133
133
|
OP_NOT_FOUND: (op) => `Operation '${op}' not found`,
|
|
134
134
|
OP_NOT_IN_OPERATIONS: (op) => `Operation '${op}' is not permitted for this role's operations configuration`,
|
|
135
|
+
PUT_WITH_ATTRIBUTE_PERMS: (schema, table) =>
|
|
136
|
+
`'put' is not permitted for a role with attribute permissions on '${schema}.${table}', because replacing a record removes the attributes the request omits and those removals cannot be checked against attribute permissions. Use 'update' or 'upsert' to merge, or a REST PUT, which restores attributes the role may not update.`,
|
|
135
137
|
OPERATIONS_MUST_BE_ARRAY: "Permission 'operations' must be an array of operation names or group names",
|
|
136
138
|
INVALID_OPERATIONS_OP: (op) =>
|
|
137
139
|
`Invalid operations value '${op}'. Must be a valid operation name or group (e.g. 'read_only').`,
|
|
@@ -234,6 +236,8 @@ const CUSTOM_FUNCTIONS_ERROR_MSGS = {
|
|
|
234
236
|
NO_FILE: 'File does not exist',
|
|
235
237
|
BAD_FILE_NAME: 'File name can only contain alphanumeric, dash and underscore characters',
|
|
236
238
|
BAD_PROJECT_NAME: 'Project name can only contain alphanumeric, dash and underscores characters',
|
|
239
|
+
RESERVED_PROJECT_NAME: (project: string) =>
|
|
240
|
+
`Component name '${project}' is reserved for Harper's '${project}' configuration section; deploy under a different name`,
|
|
237
241
|
BAD_PACKAGE: 'Packaged project must be base64-encoded tar file of project directory',
|
|
238
242
|
DROP_FUNCTION: 'Error dropping custom function, check the log for more details',
|
|
239
243
|
ADD_FUNCTION: 'Error adding custom function project, check the log for more details',
|
|
@@ -85,6 +85,35 @@ export class IndexRebuildingError extends ServerError {
|
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
+
/**
|
|
89
|
+
* Thrown when a write transaction's commit kept losing write-intent conflicts past its queue-time
|
|
90
|
+
* budget (`storage.maxTransactionQueueTime`, or the transaction's own larger `timeoutBudget`) and
|
|
91
|
+
* Harper abandoned it rather than let the request wait on an intent holder that may never release
|
|
92
|
+
* (issue #2450). `retryable` is false when part of the transaction already landed durably — the
|
|
93
|
+
* caller must not replay a request whose earlier store committed.
|
|
94
|
+
*/
|
|
95
|
+
export class TransactionCommitConflictTimeoutError extends ServerError {
|
|
96
|
+
code: string;
|
|
97
|
+
retryable: boolean;
|
|
98
|
+
constructor(message: string, retryable: boolean) {
|
|
99
|
+
super(message, 503);
|
|
100
|
+
this.name = 'TransactionCommitConflictTimeoutError';
|
|
101
|
+
this.code = 'TRANSACTION_COMMIT_CONFLICT_TIMEOUT';
|
|
102
|
+
this.retryable = retryable;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export class UpdateAttributesLockTimeoutError extends ServerError {
|
|
107
|
+
code: string;
|
|
108
|
+
retryable: boolean;
|
|
109
|
+
constructor(message: string) {
|
|
110
|
+
super(message, 503);
|
|
111
|
+
this.name = 'UpdateAttributesLockTimeoutError';
|
|
112
|
+
this.code = 'UPDATE_ATTRIBUTES_LOCK_TIMEOUT';
|
|
113
|
+
this.retryable = true;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
88
117
|
/** One structured validation failure. `path` is dot-scoped (`body.price`, `query.sort`, `params.id`). */
|
|
89
118
|
export interface ValidationIssue {
|
|
90
119
|
/** Where the failure occurred, e.g. `body.price`, `query.expand`, `params.id`. */
|
package/utility/hdbTerms.ts
CHANGED
|
@@ -155,6 +155,9 @@ export const MAX_SET_TIMEOUT_MS = 2147483647;
|
|
|
155
155
|
/** Harper File Permissions Mode */
|
|
156
156
|
export const HDB_FILE_PERMISSIONS = 0o700;
|
|
157
157
|
|
|
158
|
+
/** Smallest `threads.maxHeapMemory` (MB) a worker thread is accepted on — see server/threads/threadHeapMemory.ts */
|
|
159
|
+
export const MIN_THREAD_HEAP_MEMORY_MB = 64;
|
|
160
|
+
|
|
158
161
|
/** Database directory */
|
|
159
162
|
export const DATABASES_DIR_NAME = 'database';
|
|
160
163
|
/** Suffix for in-progress LMDB→RocksDB migration staging directories: excluded from database
|
|
@@ -211,6 +214,8 @@ export const SYSTEM_TABLE_NAMES = {
|
|
|
211
214
|
DEPLOYMENT_TABLE_NAME: 'hdb_deployment',
|
|
212
215
|
AGENT_SESSION_TABLE_NAME: 'hdb_agent_session',
|
|
213
216
|
SECRET_TABLE_NAME: 'hdb_secret',
|
|
217
|
+
OIDC_TRUST_TABLE_NAME: 'hdb_oidc_trust',
|
|
218
|
+
OIDC_TOKEN_USE_TABLE_NAME: 'hdb_oidc_token_use',
|
|
214
219
|
} as const;
|
|
215
220
|
|
|
216
221
|
/** Hash attribute for the system info table */
|
|
@@ -245,6 +250,7 @@ export const OPERATIONS_ENUM = {
|
|
|
245
250
|
INSERT: 'insert',
|
|
246
251
|
UPDATE: 'update',
|
|
247
252
|
UPSERT: 'upsert',
|
|
253
|
+
PUT: 'put',
|
|
248
254
|
SEARCH_BY_CONDITIONS: 'search_by_conditions',
|
|
249
255
|
SEARCH_BY_HASH: 'search_by_hash',
|
|
250
256
|
SEARCH_BY_ID: 'search_by_id',
|
|
@@ -348,6 +354,10 @@ export const OPERATIONS_ENUM = {
|
|
|
348
354
|
LIST_SECRETS: 'list_secrets',
|
|
349
355
|
DELETE_SECRET: 'delete_secret',
|
|
350
356
|
GET_SECRETS_PUBLIC_KEY: 'get_secrets_public_key',
|
|
357
|
+
ADD_OIDC_TRUST: 'add_oidc_trust',
|
|
358
|
+
LIST_OIDC_TRUST: 'list_oidc_trust',
|
|
359
|
+
DROP_OIDC_TRUST: 'drop_oidc_trust',
|
|
360
|
+
EXCHANGE_OIDC_TOKEN: 'exchange_oidc_token',
|
|
351
361
|
GET_DEPLOYMENT_PAYLOAD: 'get_deployment_payload',
|
|
352
362
|
DELETE_DEPLOYMENT_PAYLOAD: 'delete_deployment_payload',
|
|
353
363
|
AGENT_PROMPT: 'agent_prompt',
|
|
@@ -683,9 +693,11 @@ export const CONFIG_PARAMS = {
|
|
|
683
693
|
STORAGE_MAXTRANSACTIONOPENTIME: 'storage_maxTransactionOpenTime',
|
|
684
694
|
STORAGE_MAX_READ_TRANSACTION_OPEN_TIME: 'storage_maxReadTransactionOpenTime',
|
|
685
695
|
STORAGE_DEBUGLONGTRANSACTIONS: 'storage_debugLongTransactions',
|
|
696
|
+
STORAGE_LONGTRANSACTIONREPORTTHRESHOLD: 'storage_longTransactionReportThreshold',
|
|
686
697
|
STORAGE_PATH: 'storage_path',
|
|
687
698
|
STORAGE_BACKUPPATH: 'storage_backupPath',
|
|
688
699
|
STORAGE_BLOBPATHS: 'storage_blobPaths',
|
|
700
|
+
STORAGE_BLOBS_COMPRESSION: 'storage_blobs_compression',
|
|
689
701
|
STORAGE_BLOBCLEANUPSPEED: 'storage_blobCleanupSpeed',
|
|
690
702
|
STORAGE_BLOBREADTIMEOUT: 'storage_blobReadTimeout',
|
|
691
703
|
STORAGE_BLOBRETENTION: 'storage_blobRetention',
|
|
@@ -730,6 +742,10 @@ export const CONFIG_PARAMS = {
|
|
|
730
742
|
CLONED: 'cloned',
|
|
731
743
|
NODE_HOSTNAME: 'node_hostname',
|
|
732
744
|
NODE_URL: 'node_url',
|
|
745
|
+
SQL_ENGINE: 'sql_engine',
|
|
746
|
+
SQL_ALLOWFULLSCAN: 'sql_allowFullScan',
|
|
747
|
+
SQL_MAXSORTROWS: 'sql_maxSortRows',
|
|
748
|
+
SQL_MAXHASHROWS: 'sql_maxHashRows',
|
|
733
749
|
} as const;
|
|
734
750
|
|
|
735
751
|
/**
|
|
@@ -926,6 +942,7 @@ export const JWT_ENUM = {
|
|
|
926
942
|
export const ITC_EVENT_TYPES = {
|
|
927
943
|
SHUTDOWN: 'shutdown',
|
|
928
944
|
CHILD_STARTED: 'child_started',
|
|
945
|
+
CHILD_STARTUP_PHASE: 'child_startup_phase',
|
|
929
946
|
CHILD_STOPPED: 'child_stopped',
|
|
930
947
|
SCHEMA: 'schema',
|
|
931
948
|
USER: 'user',
|
|
@@ -100,25 +100,48 @@ let hdbProperties;
|
|
|
100
100
|
|
|
101
101
|
let rootConfig;
|
|
102
102
|
|
|
103
|
-
|
|
104
|
-
|
|
103
|
+
// `mainLoggerRef` defaults to the module's private `mainLogger` singleton (the real production
|
|
104
|
+
// behavior) but can be overridden by callers (currently just tests) so the inheritance decision
|
|
105
|
+
// below can be exercised against a throwaway logger without reaching into module-private state.
|
|
106
|
+
export function updateLogger(logger: any, logOptions: any, name?: string, mainLoggerRef: any = mainLogger) {
|
|
107
|
+
// Fall back to the main logger's rotation (like level/path below) so an external/component
|
|
108
|
+
// logger with no rotation block of its own inherits maxSize/interval/etc rather than losing
|
|
109
|
+
// rotation entirely (#1877). Excluded when `logger` IS mainLoggerRef: the fallback would just
|
|
110
|
+
// reassign mainLogger.rotation to itself, making it impossible to ever clear main's rotation.
|
|
111
|
+
const inheritedRotation = logOptions.rotation ?? (logger === mainLoggerRef ? undefined : mainLoggerRef?.rotation);
|
|
112
|
+
if (inheritedRotation && inheritedRotation === mainLoggerRef?.rotation) {
|
|
113
|
+
// This logger has no rotation block of its own and is inheriting main's wholesale — but
|
|
114
|
+
// inheriting `rotation.path` too would point this logger's archives at wherever main
|
|
115
|
+
// archives to. If this logger's file lives on a different filesystem/volume than that
|
|
116
|
+
// directory, the rotator's fs.rename() there fails with EXDEV and the tick error leaks
|
|
117
|
+
// (contained in logRotator.ts) without ever rotating this log. Strip the inherited path so
|
|
118
|
+
// rotation instead defaults beside this logger's own path (logRotator's own <log dir>/rotated
|
|
119
|
+
// fallback); an explicit `rotation.path` in this logger's own config still wins, since that
|
|
120
|
+
// goes through `logOptions.rotation` above, not this fallback. Clone rather than mutate:
|
|
121
|
+
// `inheritedRotation` is the literal object shared by mainLogger.rotation and every other
|
|
122
|
+
// component that inherited it.
|
|
123
|
+
const { path: _inheritedPath, ...rotationWithoutPath } = inheritedRotation;
|
|
124
|
+
logger.rotation = rotationWithoutPath;
|
|
125
|
+
} else {
|
|
126
|
+
logger.rotation = inheritedRotation;
|
|
127
|
+
}
|
|
105
128
|
let path = logOptions.path;
|
|
106
129
|
if (path) {
|
|
107
130
|
if (!logOptions.root) logOptions.root = pathModule.dirname(path);
|
|
108
131
|
} else if (logOptions.root) {
|
|
109
132
|
path = join(logOptions.root, logName);
|
|
110
133
|
} else {
|
|
111
|
-
path =
|
|
134
|
+
path = mainLoggerRef.path;
|
|
112
135
|
if (!logOptions.root) logOptions.root = pathModule.dirname(path);
|
|
113
136
|
}
|
|
114
137
|
if (path) logger.path = path;
|
|
115
138
|
else console.error('No path for logger', logOptions);
|
|
116
|
-
logger.level = LOG_LEVEL_HIERARCHY[logOptions.level] ??
|
|
139
|
+
logger.level = LOG_LEVEL_HIERARCHY[logOptions.level] ?? mainLoggerRef?.level ?? LOG_LEVEL_HIERARCHY.info;
|
|
117
140
|
updateConditional(logger);
|
|
118
141
|
logger.logToStdstreams = logOptions.stdStreams ?? false;
|
|
119
142
|
// if there is a configured tag or if a component is logging to default/main log path, use the component name as the tag
|
|
120
143
|
// to differentiate it
|
|
121
|
-
logger.tag = logOptions.tag ?? ((
|
|
144
|
+
logger.tag = logOptions.tag ?? ((mainLoggerRef.path === logger.path || externalLogger.path === logger.path) && name);
|
|
122
145
|
}
|
|
123
146
|
// creates a logger where the methods are only defined if they are within the log level.
|
|
124
147
|
// Using this conditional logger means that every method call must be optional like log.trace?.('message),
|
|
@@ -145,7 +168,7 @@ function resolveLogPath(configPath: string, rootPath: string) {
|
|
|
145
168
|
async function updateLogSettings() {
|
|
146
169
|
if (!rootConfig) {
|
|
147
170
|
// set up the initial watcher
|
|
148
|
-
rootConfig =
|
|
171
|
+
rootConfig = getSharedRootConfigWatcher();
|
|
149
172
|
// wait for it to be ready
|
|
150
173
|
await rootConfig.ready;
|
|
151
174
|
// TODO: Any way to differentiate changes that we can and can't handle?
|
|
@@ -383,8 +406,20 @@ module.exports = {
|
|
|
383
406
|
disableStdio,
|
|
384
407
|
isStdioBrokenError,
|
|
385
408
|
externalLogger,
|
|
409
|
+
updateLogger,
|
|
386
410
|
};
|
|
387
411
|
|
|
412
|
+
// Writes past the stdio guard installed by installStdioGuard, which would otherwise route the
|
|
413
|
+
// text back into the file logger this is the fallback for, and swallows a broken pipe - there is
|
|
414
|
+
// nowhere left to report it.
|
|
415
|
+
function writeToStdioDirectly(stream, text) {
|
|
416
|
+
try {
|
|
417
|
+
nativeStdWrite.call(stream, text);
|
|
418
|
+
} catch {
|
|
419
|
+
// stdio is gone too
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
|
|
388
423
|
// A bare no-op would read as permanent backpressure to a pipe()'d source; this drains and
|
|
389
424
|
// discards instead.
|
|
390
425
|
function noopWrite(_chunk?: any, encoding?: any, callback?: any) {
|
|
@@ -510,10 +545,17 @@ export function initLogSettings(forceInit = false) {
|
|
|
510
545
|
|
|
511
546
|
logLevel = logLevel === undefined ? defaultLevel : logLevel;
|
|
512
547
|
|
|
513
|
-
|
|
548
|
+
// createLogger shadows the module-level `logToStdstreams` with this option, so omitting it
|
|
549
|
+
// drops every log written before a config exists rather than routing it to the streams.
|
|
550
|
+
mainLogger = createLogger({ level: logLevel, stdStreams: logToStdstreams });
|
|
514
551
|
// setup the external logger
|
|
515
552
|
externalLogger = mainLogger.forComponent('external');
|
|
516
553
|
externalLogger.tag = null; // don't tag by default
|
|
554
|
+
// The streams are this branch's only sink, so it needs the same EPIPE/EIO listeners the
|
|
555
|
+
// configured path installs below: `harper install | head -1` closes the reader, and the
|
|
556
|
+
// async error would otherwise land on a stream with none and take the install down. The
|
|
557
|
+
// guard's write override is inert here, because `log_to_file` is false.
|
|
558
|
+
stdioLogging();
|
|
517
559
|
return;
|
|
518
560
|
}
|
|
519
561
|
|
|
@@ -727,6 +769,8 @@ export function createLogger(options: any = {} as any) {
|
|
|
727
769
|
return logger;
|
|
728
770
|
}
|
|
729
771
|
const LOG_TIME_USAGE_THRESHOLD = 100;
|
|
772
|
+
// How long to write straight to stdio after the log file refuses an append.
|
|
773
|
+
const APPEND_RETRY_COOLDOWN = 5000;
|
|
730
774
|
/**
|
|
731
775
|
* Get the file logger for the given path. If it doesn't exist, create it.
|
|
732
776
|
* @param path
|
|
@@ -735,7 +779,7 @@ const LOG_TIME_USAGE_THRESHOLD = 100;
|
|
|
735
779
|
*/
|
|
736
780
|
function getFileLogger(path, rotation, isExternalInstance) {
|
|
737
781
|
let logger = fileLoggers.get(path);
|
|
738
|
-
let logFD, loggedFDError, logTimer;
|
|
782
|
+
let logFD, loggedFDError, loggedAppendError, logTimer, retryAppendAfter;
|
|
739
783
|
let logBuffer;
|
|
740
784
|
let logTimeUsage = 0;
|
|
741
785
|
if (!logger) {
|
|
@@ -788,14 +832,37 @@ function getFileLogger(path, rotation, isExternalInstance) {
|
|
|
788
832
|
// this is called on a timer, and will write the log buffer to the file
|
|
789
833
|
function logQueuedData(entry?: any) {
|
|
790
834
|
openLogFile(undefined);
|
|
791
|
-
|
|
835
|
+
const payload = logBuffer ? logBuffer.join('') : entry;
|
|
836
|
+
// A file that just refused a write will refuse the next one too, and every attempt costs a
|
|
837
|
+
// failed syscall plus a thrown error on whatever path is logging - which, on a full volume,
|
|
838
|
+
// is the request path at full rate. Go straight to stdio until the cooldown expires.
|
|
839
|
+
if (logFD && !(retryAppendAfter > performance.now())) {
|
|
792
840
|
let startTime = performance.now();
|
|
793
|
-
|
|
841
|
+
try {
|
|
842
|
+
fs.appendFileSync(logFD, payload);
|
|
843
|
+
// Both cleared, so a volume that fills again months later reports itself again
|
|
844
|
+
retryAppendAfter = undefined;
|
|
845
|
+
loggedAppendError = false;
|
|
846
|
+
} catch (error) {
|
|
847
|
+
retryAppendAfter = performance.now() + APPEND_RETRY_COOLDOWN;
|
|
848
|
+
// A log write must never take the process down: on an exhausted volume this throws from
|
|
849
|
+
// both inline and timer call sites, making every log statement a crash point (#847).
|
|
850
|
+
// The fallback goes through nativeStdWrite rather than console because
|
|
851
|
+
// installStdioGuard routes console output back into this same file logger when
|
|
852
|
+
// logging.file and logging.console are both on, which would recurse until the stack blew.
|
|
853
|
+
if (!loggedAppendError) {
|
|
854
|
+
loggedAppendError = true;
|
|
855
|
+
writeToStdioDirectly(process.stderr, `Harper cannot write to its log file: ${error}\n`);
|
|
856
|
+
}
|
|
857
|
+
writeToStdioDirectly(process.stdout, payload);
|
|
858
|
+
logBuffer = null;
|
|
859
|
+
return;
|
|
860
|
+
}
|
|
794
861
|
let endTime = performance.now();
|
|
795
862
|
// determine if we are using more than about two percent of processing time for log writes recently, and if so, we
|
|
796
863
|
// will start buffering
|
|
797
864
|
logTimeUsage = Math.max(endTime, logTimeUsage) + (endTime - startTime) * 50;
|
|
798
|
-
} else
|
|
865
|
+
} else writeToStdioDirectly(process.stdout, payload);
|
|
799
866
|
if (logBuffer) logBuffer = null;
|
|
800
867
|
}
|
|
801
868
|
|
|
@@ -815,8 +882,13 @@ function getFileLogger(path, rotation, isExternalInstance) {
|
|
|
815
882
|
} catch (error) {
|
|
816
883
|
if (error.code === 'ENOENT' && !isRetry) {
|
|
817
884
|
// if the directory doesn't exist, create it
|
|
818
|
-
|
|
819
|
-
|
|
885
|
+
try {
|
|
886
|
+
fs.mkdirpSync(pathModule.dirname(path));
|
|
887
|
+
return openLogFile(true);
|
|
888
|
+
} catch (mkdirError) {
|
|
889
|
+
// creating the log directory can fail for the same reason the log write can
|
|
890
|
+
error = mkdirError;
|
|
891
|
+
}
|
|
820
892
|
}
|
|
821
893
|
if (!loggedFDError) {
|
|
822
894
|
loggedFDError = true;
|
|
@@ -1811,7 +1883,7 @@ export function AuthAuditLog(
|
|
|
1811
1883
|
this.path = path;
|
|
1812
1884
|
}
|
|
1813
1885
|
// we have to load this at the end to avoid circular dependencies problems
|
|
1814
|
-
import {
|
|
1886
|
+
import { getSharedRootConfigWatcher } from '../../config/RootConfigWatcher.ts';
|
|
1815
1887
|
|
|
1816
1888
|
export const getLogFilePath = () => logFilePath;
|
|
1817
1889
|
export const forComponent = (name: string, isExternal?: boolean) => mainLogger.forComponent(name, isExternal);
|
|
@@ -1846,4 +1918,5 @@ export default {
|
|
|
1846
1918
|
errorForLog,
|
|
1847
1919
|
inspectForLog,
|
|
1848
1920
|
isErrorLike,
|
|
1921
|
+
updateLogger,
|
|
1849
1922
|
};
|
|
@@ -6,6 +6,7 @@ import { promisify } from 'util';
|
|
|
6
6
|
import { pipeline } from 'stream';
|
|
7
7
|
const pipe = promisify(pipeline);
|
|
8
8
|
import * as path from 'path';
|
|
9
|
+
import { createHash } from 'crypto';
|
|
9
10
|
import * as envMgr from '../environment/environmentManager.ts';
|
|
10
11
|
envMgr.initSync();
|
|
11
12
|
import hdbLogger from './harper_logger.ts';
|
|
@@ -67,62 +68,71 @@ function logRotator({ logger, maxSize, interval, retention, enabled, path: rotat
|
|
|
67
68
|
let lastRotationTime = Date.now();
|
|
68
69
|
hdbLogger.trace('Log rotate enabled, maxSize:', maxSize, 'interval:', interval);
|
|
69
70
|
const setIntervalId = setInterval(async () => {
|
|
70
|
-
//
|
|
71
|
-
//
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
if (fileStats && fileStats.size >= maxBytes) {
|
|
71
|
+
// The tick is async but setInterval doesn't await it, so any error that escapes this callback
|
|
72
|
+
// becomes an unhandled rejection rather than surfacing anywhere useful — and since it isn't
|
|
73
|
+
// caught, it also skips the retention cleanup below. Contain everything here and report via
|
|
74
|
+
// the logger instead, so one bad tick (e.g. an unexpected fs error) never kills rotation for
|
|
75
|
+
// the rest of the process's life.
|
|
76
|
+
try {
|
|
77
|
+
// A missing/relocated active log file only invalidates the rotation checks below — retention cleanup
|
|
78
|
+
// must still run. So skip the individual check on ENOENT rather than returning from the whole tick.
|
|
79
|
+
if (maxBytes) {
|
|
80
|
+
let fileStats;
|
|
82
81
|
try {
|
|
83
|
-
|
|
82
|
+
fileStats = await fsProm.stat(logger.path);
|
|
84
83
|
} catch (err) {
|
|
85
|
-
// If the log file doesn't exist, skip rotation
|
|
84
|
+
// If the log file doesn't exist, skip the size-based rotation check
|
|
86
85
|
if (err.code !== 'ENOENT') throw err;
|
|
87
86
|
}
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
87
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
// If the log file doesn't exist, skip rotation
|
|
99
|
-
if (err.code !== 'ENOENT') throw err;
|
|
88
|
+
if (fileStats && fileStats.size >= maxBytes) {
|
|
89
|
+
try {
|
|
90
|
+
lastRotatedLogPath = await moveLogFile(logger.path, rotatedLogDir, logger);
|
|
91
|
+
} catch (err) {
|
|
92
|
+
// If the log file doesn't exist, skip rotation
|
|
93
|
+
if (err.code !== 'ENOENT') throw err;
|
|
94
|
+
}
|
|
100
95
|
}
|
|
101
96
|
}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
files = [];
|
|
97
|
+
|
|
98
|
+
if (maxInterval) {
|
|
99
|
+
const minSinceLastRotate = Date.now() - lastRotationTime;
|
|
100
|
+
if (minSinceLastRotate >= maxInterval) {
|
|
101
|
+
try {
|
|
102
|
+
lastRotatedLogPath = await moveLogFile(logger.path, rotatedLogDir, logger);
|
|
103
|
+
lastRotationTime = Date.now();
|
|
104
|
+
} catch (err) {
|
|
105
|
+
// If the log file doesn't exist, skip rotation
|
|
106
|
+
if (err.code !== 'ENOENT') throw err;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
115
109
|
}
|
|
116
|
-
|
|
110
|
+
if (retention || reclamationPriority) {
|
|
111
|
+
// remove old logs after retention time
|
|
112
|
+
// adjust retention time if there is a reclamation priority in place
|
|
113
|
+
const retentionMs = convertToMS(retention ?? '1M') / (1 + reclamationPriority);
|
|
114
|
+
reclamationPriority = 0; // reset it after use
|
|
115
|
+
let files;
|
|
117
116
|
try {
|
|
118
|
-
|
|
119
|
-
if (Date.now() - fileStats.mtimeMs > retentionMs) {
|
|
120
|
-
await fsProm.unlink(path.join(rotatedLogDir, file));
|
|
121
|
-
}
|
|
117
|
+
files = await fsProm.readdir(rotatedLogDir);
|
|
122
118
|
} catch (err) {
|
|
123
|
-
|
|
119
|
+
// The rotated log dir may not exist yet (nothing rotated so far); nothing to clean up
|
|
120
|
+
if (err.code !== 'ENOENT') hdbLogger.error('Error reading rotated log directory', rotatedLogDir, err);
|
|
121
|
+
files = [];
|
|
122
|
+
}
|
|
123
|
+
for (const file of files) {
|
|
124
|
+
try {
|
|
125
|
+
const fileStats = await fsProm.stat(path.join(rotatedLogDir, file));
|
|
126
|
+
if (Date.now() - fileStats.mtimeMs > retentionMs) {
|
|
127
|
+
await fsProm.unlink(path.join(rotatedLogDir, file));
|
|
128
|
+
}
|
|
129
|
+
} catch (err) {
|
|
130
|
+
hdbLogger.error('Error trying to remove log', file, err);
|
|
131
|
+
}
|
|
124
132
|
}
|
|
125
133
|
}
|
|
134
|
+
} catch (err) {
|
|
135
|
+
hdbLogger.error('Error during log rotation audit tick for', logger.path, err);
|
|
126
136
|
}
|
|
127
137
|
}, auditInterval ?? LOG_AUDIT_INTERVAL).unref();
|
|
128
138
|
return {
|
|
@@ -135,11 +145,28 @@ function logRotator({ logger, maxSize, interval, retention, enabled, path: rotat
|
|
|
135
145
|
};
|
|
136
146
|
}
|
|
137
147
|
|
|
148
|
+
// Monotonically increasing across every rotation in this process, regardless of which logger/source
|
|
149
|
+
// triggered it — combined with the pid, this guarantees two archive names can never collide even if
|
|
150
|
+
// two rotations for two different sources race concurrently within the same audit-interval tick.
|
|
151
|
+
let rotationSequence = 0;
|
|
152
|
+
|
|
138
153
|
async function moveLogFile(logPath: string, rotatedLogPath: string, logger?: any) {
|
|
139
154
|
const compress = envMgr.get(CONFIG_PARAMS.LOGGING_ROTATION_COMPRESS);
|
|
155
|
+
// Name the archive after its source log (hdb, external, a component name, ...), not a fixed
|
|
156
|
+
// "HDB" literal — external/component loggers can now inherit rotation from the main logger
|
|
157
|
+
// (#1877) and default to the same rotated directory as it, so distinct sources rotating in
|
|
158
|
+
// the same audit tick must not collide on the same timestamp-only filename. A basename alone
|
|
159
|
+
// is not enough either: two distinct source paths can share a basename (e.g. `/logs/a/hdb.log`
|
|
160
|
+
// and `/logs/b/hdb.log`), so a hash of the full resolved source path plus a pid+sequence suffix
|
|
161
|
+
// give every archive a name POSIX rename() can never clobber, even under a same-millisecond race.
|
|
162
|
+
const sourceName = path.basename(logPath, path.extname(logPath)) || 'HDB';
|
|
163
|
+
// sha256, not sha1: this only needs a stable identifier, not cryptographic strength, but a FIPS-mode
|
|
164
|
+
// OpenSSL provider disables sha1 and throws synchronously, which would crash every rotation tick.
|
|
165
|
+
const sourceId = createHash('sha256').update(path.resolve(logPath)).digest('hex').slice(0, 8);
|
|
166
|
+
const uniqueSuffix = `${process.pid}-${rotationSequence++}`;
|
|
140
167
|
let fullRotateLogPath = path.join(
|
|
141
168
|
rotatedLogPath,
|
|
142
|
-
|
|
169
|
+
`${sourceName}-${sourceId}-${new Date(Date.now()).toISOString().replaceAll(':', '-')}-${uniqueSuffix}.log`
|
|
143
170
|
);
|
|
144
171
|
// Move log file to rotated log path first (if we crash
|
|
145
172
|
// during compression, we don't want to restart the compression with a new file)
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { isIP } from 'node:net';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A node's identity — node.hostname, and the replication.hostname / certificate it falls back to —
|
|
5
|
+
* must be a bare hostname or IP literal, not a URL: it becomes the certificate common name and the
|
|
6
|
+
* host replication advertises and dials, so a scheme/port/path/non-string corrupts both (harper#2218,
|
|
7
|
+
* where "ws://http://host:9926:9925" resolves to host "http"). Returns a reason clause when `value`
|
|
8
|
+
* is not a bare host, else undefined. An empty string is "unset" (a caller's cue to fall back), not a
|
|
9
|
+
* violation.
|
|
10
|
+
*/
|
|
11
|
+
export function bareHostViolation(value: unknown): string | undefined {
|
|
12
|
+
if (typeof value !== 'string') return `must be a string, but is a ${value === null ? 'null' : typeof value}`;
|
|
13
|
+
if (value === '') return undefined;
|
|
14
|
+
// The identity is stored unbracketed (bracketing belongs to URL construction). Reject a bracketed
|
|
15
|
+
// form so it is never cached — otherwise net.isIP fails on it and the certificate SAN is mistyped
|
|
16
|
+
// as DNS rather than IP, and the same node's identity string would differ by source.
|
|
17
|
+
if (value.includes('[') || value.includes(']'))
|
|
18
|
+
return 'must be an unbracketed IPv6 literal (e.g. "::1", not "[::1]")';
|
|
19
|
+
// A zone id ("fe80::1%eth0") passes net.isIP but has no valid URL authority, so exclude it here.
|
|
20
|
+
if (isIP(value) && !value.includes('%')) return undefined; // a bare IPv4/IPv6 literal is a valid identity
|
|
21
|
+
if (value.includes('://')) return 'must not include a URL scheme';
|
|
22
|
+
let url;
|
|
23
|
+
try {
|
|
24
|
+
// Parse under a special scheme so the host grammar matches the ws:// replication URLs that
|
|
25
|
+
// consume this value — a host this accepts is one the consumer accepts (a non-special scheme is
|
|
26
|
+
// more lenient and would pass e.g. "node%20" or "0x7f.1"). A port or path makes url.hostname
|
|
27
|
+
// differ from the input and is caught by the round-trip check below.
|
|
28
|
+
url = new URL(`https://${value}`);
|
|
29
|
+
} catch {
|
|
30
|
+
return 'is not a valid hostname';
|
|
31
|
+
}
|
|
32
|
+
// Report the port before the round-trip check: the parser strips a default port for the scheme it
|
|
33
|
+
// was given (":443" under https), which would otherwise surface as a vaguer "is not a bare hostname".
|
|
34
|
+
if (url.port || (url.hostname && value.slice(url.hostname.length).startsWith(':'))) {
|
|
35
|
+
return 'must not include a port';
|
|
36
|
+
}
|
|
37
|
+
if (url.username || url.password) return 'must not include credentials';
|
|
38
|
+
if (url.search) return 'must not include a query string';
|
|
39
|
+
if (url.hash) return 'must not include a fragment';
|
|
40
|
+
if (url.pathname && url.pathname !== '/') return 'must not include a path';
|
|
41
|
+
// The host must survive parsing unchanged (compared case-insensitively, since URL lowercases it);
|
|
42
|
+
// anything that does not round-trip carried extra syntax and is not a bare host.
|
|
43
|
+
if (url.hostname.toLowerCase() !== value.toLowerCase()) return 'is not a bare hostname';
|
|
44
|
+
return undefined;
|
|
45
|
+
}
|
package/utility/npmUtilities.ts
CHANGED
|
@@ -12,7 +12,7 @@ import harperLogger from './logging/harper_logger.ts';
|
|
|
12
12
|
|
|
13
13
|
import { CONFIG_PARAMS } from './hdbTerms.ts';
|
|
14
14
|
import { getConfigPath } from '../config/configUtils.ts';
|
|
15
|
-
import { nonInteractiveSpawn } from '../components/Application.ts';
|
|
15
|
+
import { nonInteractiveSpawn, packageManagerInstallArguments } from '../components/Application.ts';
|
|
16
16
|
import { withComponentPreparationLock } from '../components/componentPreparationLock.ts';
|
|
17
17
|
import { isThreadRunning } from '../server/threads/manageThreads.js';
|
|
18
18
|
|
|
@@ -26,18 +26,19 @@ export async function installModules(req: any) {
|
|
|
26
26
|
'install_node_modules is deprecated. Dependencies are automatically installed on' +
|
|
27
27
|
' deploy, and install_node_modules can lead to inconsistent behavior';
|
|
28
28
|
harperLogger.warn(deprecationWarning, req.projects);
|
|
29
|
-
const validation = modulesValidator(req);
|
|
29
|
+
const { error: validation, value: validatedRequest } = modulesValidator(req);
|
|
30
30
|
if (validation) {
|
|
31
31
|
throw handleHDBError(validation, validation.message, HTTP_STATUS_CODES.BAD_REQUEST);
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
const { projects, dry_run: dryRun } = validatedRequest;
|
|
35
35
|
|
|
36
36
|
const componentsRootDirPath = getConfigPath(CONFIG_PARAMS.COMPONENTSROOT);
|
|
37
37
|
|
|
38
38
|
const responseObject: any = {};
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
// `allowInstallScripts` is true because this operation has always run a project's install lifecycle
|
|
41
|
+
const args = [...packageManagerInstallArguments('npm', true, true), '--json'];
|
|
41
42
|
if (dryRun) args.push('--dry-run');
|
|
42
43
|
|
|
43
44
|
for (const project of projects) {
|
|
@@ -91,15 +92,16 @@ function parseNPMStdErr(stderr: string) {
|
|
|
91
92
|
}
|
|
92
93
|
|
|
93
94
|
/**
|
|
94
|
-
* Validator for
|
|
95
|
+
* Validator for installModules
|
|
95
96
|
* @param {Object} req
|
|
96
|
-
* @returns {*}
|
|
97
97
|
*/
|
|
98
98
|
function modulesValidator(req: any) {
|
|
99
|
+
// `dryRun` was the only spelling that worked before dry_run was honored; keep it accepted, but
|
|
100
|
+
// reject a request that carries both rather than picking a winner
|
|
99
101
|
const funcSchema = Joi.object({
|
|
100
102
|
projects: Joi.array().min(1).items(Joi.string()).required(),
|
|
101
103
|
dry_run: Joi.boolean().default(false),
|
|
102
|
-
});
|
|
104
|
+
}).rename('dryRun', 'dry_run', { ignoreUndefined: true });
|
|
103
105
|
|
|
104
|
-
return validator.
|
|
106
|
+
return validator.validateAndConvertBySchema(req, funcSchema);
|
|
105
107
|
}
|
|
@@ -69,6 +69,7 @@ export const OPERATION_PERMISSION_GROUPS = {
|
|
|
69
69
|
OPERATIONS_ENUM.INSERT,
|
|
70
70
|
OPERATIONS_ENUM.UPDATE,
|
|
71
71
|
OPERATIONS_ENUM.UPSERT,
|
|
72
|
+
OPERATIONS_ENUM.PUT,
|
|
72
73
|
OPERATIONS_ENUM.DELETE,
|
|
73
74
|
// Bulk load
|
|
74
75
|
OPERATIONS_ENUM.CSV_DATA_LOAD,
|
|
@@ -97,6 +98,11 @@ const validGroups: Set<string> = new Set(Object.keys(OPERATION_PERMISSION_GROUPS
|
|
|
97
98
|
// permission) whose names may fall outside OPERATIONS_ENUM. Tracked so they're grantable in a
|
|
98
99
|
// role's `operations` allowlist (add_role/alter_role/impersonation validate against this set too).
|
|
99
100
|
const dynamicallyRegisteredOps: Set<string> = new Set();
|
|
101
|
+
// The same, for ops registered on a WORKER and mirrored here by the OPERATION_REGISTERED bridge.
|
|
102
|
+
// Deliberately a separate set: the two threads can register the same name independently (a hot
|
|
103
|
+
// deploy can add a `startOnMainThread` component while the worker offering that name is retiring),
|
|
104
|
+
// so worker-lifecycle cleanup must not be able to revoke a mark this thread made itself.
|
|
105
|
+
const workerRegisteredOps: Set<string> = new Set();
|
|
100
106
|
|
|
101
107
|
/**
|
|
102
108
|
* Mark a dynamically-registered operation name as a valid target for role `operations` grants.
|
|
@@ -115,13 +121,24 @@ export function unregisterGrantableOperation(name: string): void {
|
|
|
115
121
|
dynamicallyRegisteredOps.delete(name);
|
|
116
122
|
}
|
|
117
123
|
|
|
124
|
+
export function registerWorkerGrantableOperation(name: string): void {
|
|
125
|
+
workerRegisteredOps.add(name);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export function unregisterWorkerGrantableOperation(name: string): void {
|
|
129
|
+
workerRegisteredOps.delete(name);
|
|
130
|
+
}
|
|
131
|
+
|
|
118
132
|
/**
|
|
119
133
|
* Validates that every entry in an operations array is a known operation name or group name.
|
|
120
134
|
* Returns the first invalid entry, or null if all entries are valid.
|
|
121
135
|
*/
|
|
122
136
|
export function validateOperations(operations: readonly unknown[]): string | null {
|
|
123
137
|
for (const op of operations) {
|
|
124
|
-
if (
|
|
138
|
+
if (
|
|
139
|
+
typeof op !== 'string' ||
|
|
140
|
+
(!validOps.has(op) && !validGroups.has(op) && !dynamicallyRegisteredOps.has(op) && !workerRegisteredOps.has(op))
|
|
141
|
+
) {
|
|
125
142
|
return String(op);
|
|
126
143
|
}
|
|
127
144
|
}
|