@harperfast/harper 5.2.13 → 5.3.0-beta.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 +58 -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 +120 -4
- package/bin/run.ts +6 -11
- package/bin/upgrade.js +7 -3
- package/bin/workloadIdentity.ts +119 -0
- package/components/Application.ts +3436 -242
- package/components/ApplicationScope.ts +8 -0
- package/components/EntryHandler.ts +59 -39
- package/components/OptionsWatcher.ts +440 -98
- package/components/RuntimeModuleTracker.ts +38 -7
- package/components/Scope.ts +56 -15
- package/components/awaitRestart.ts +84 -0
- package/components/componentLoader.ts +381 -32
- package/components/componentPreparationLock.ts +16 -5
- package/components/deploymentOperations.ts +4 -1
- package/components/deploymentRecorder.ts +9 -2
- 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 +537 -113
- package/components/operationsValidation.js +98 -3
- package/components/packageComponent.ts +25 -1
- package/components/requestRestart.ts +11 -0
- package/components/status/ComponentStatusRegistry.ts +59 -0
- package/config/RootConfigWatcher.ts +240 -40
- package/config/configReadRetry.ts +62 -0
- package/config/configUtils.ts +357 -48
- package/config/harperConfigEnvVars.ts +170 -27
- package/config/parseConfigFile.ts +34 -0
- package/config/readConfigFileSync.ts +44 -0
- package/config/watcherArming.ts +59 -0
- package/config-root.schema.json +33 -0
- package/dataLayer/blobBackup.ts +160 -50
- package/dataLayer/delete.ts +6 -1
- package/dataLayer/harperBridge/ResourceBridge.ts +80 -10
- 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 +61 -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 +91 -6
- 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 +235 -17
- package/dist/components/Application.js +3038 -238
- 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 +4 -0
- package/dist/components/OptionsWatcher.js +440 -99
- 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 +52 -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 +313 -24
- 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/deploymentOperations.js +4 -1
- package/dist/components/deploymentOperations.js.map +1 -1
- package/dist/components/deploymentRecorder.d.ts +4 -2
- package/dist/components/deploymentRecorder.js +1 -0
- package/dist/components/deploymentRecorder.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.d.ts +28 -0
- package/dist/components/operations.js +476 -113
- package/dist/components/operations.js.map +1 -1
- package/dist/components/operationsValidation.js +97 -3
- package/dist/components/operationsValidation.js.map +1 -1
- package/dist/components/packageComponent.js +24 -0
- package/dist/components/packageComponent.js.map +1 -1
- package/dist/components/requestRestart.d.ts +1 -0
- package/dist/components/requestRestart.js +7 -0
- package/dist/components/requestRestart.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 +9 -1
- package/dist/config/RootConfigWatcher.js +228 -37
- package/dist/config/RootConfigWatcher.js.map +1 -1
- package/dist/config/configReadRetry.d.ts +8 -0
- package/dist/config/configReadRetry.js +62 -0
- package/dist/config/configReadRetry.js.map +1 -0
- package/dist/config/configUtils.d.ts +11 -2
- package/dist/config/configUtils.js +304 -47
- 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/config/parseConfigFile.d.ts +4 -0
- package/dist/config/parseConfigFile.js +35 -0
- package/dist/config/parseConfigFile.js.map +1 -0
- package/dist/config/readConfigFileSync.d.ts +1 -0
- package/dist/config/readConfigFileSync.js +47 -0
- package/dist/config/readConfigFileSync.js.map +1 -0
- package/dist/config/watcherArming.d.ts +15 -0
- package/dist/config/watcherArming.js +59 -0
- package/dist/config/watcherArming.js.map +1 -0
- 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 +72 -12
- 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 +2 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/json/systemSchema.json +55 -0
- package/dist/resources/DatabaseTransaction.d.ts +77 -0
- package/dist/resources/DatabaseTransaction.js +586 -54
- package/dist/resources/DatabaseTransaction.js.map +1 -1
- package/dist/resources/LMDBTransaction.d.ts +2 -1
- package/dist/resources/LMDBTransaction.js +43 -6
- package/dist/resources/LMDBTransaction.js.map +1 -1
- package/dist/resources/PrimaryRocksDatabase.d.ts +1 -0
- package/dist/resources/PrimaryRocksDatabase.js +49 -5
- package/dist/resources/PrimaryRocksDatabase.js.map +1 -1
- package/dist/resources/RecordEncoder.d.ts +20 -0
- package/dist/resources/RecordEncoder.js +110 -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 +117 -24
- package/dist/resources/Resource.js.map +1 -1
- package/dist/resources/ResourceInterface.d.ts +28 -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 +24 -1
- package/dist/resources/RocksTransactionLogStore.js +160 -49
- package/dist/resources/RocksTransactionLogStore.js.map +1 -1
- package/dist/resources/Table.d.ts +165 -10
- package/dist/resources/Table.js +1805 -303
- package/dist/resources/Table.js.map +1 -1
- package/dist/resources/analytics/write.js +10 -3
- package/dist/resources/analytics/write.js.map +1 -1
- package/dist/resources/auditStore.d.ts +181 -2
- package/dist/resources/auditStore.js +640 -29
- 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/dataLoader.js +3 -4
- package/dist/resources/dataLoader.js.map +1 -1
- package/dist/resources/databases.d.ts +157 -14
- package/dist/resources/databases.js +1462 -325
- 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/derivedIndexRegistry.d.ts +5 -0
- package/dist/resources/derivedIndexRegistry.js +68 -0
- package/dist/resources/derivedIndexRegistry.js.map +1 -0
- package/dist/resources/derivedIndexRuntime.d.ts +215 -0
- package/dist/resources/derivedIndexRuntime.js +2027 -0
- package/dist/resources/derivedIndexRuntime.js.map +1 -0
- package/dist/resources/graphql.d.ts +1 -1
- package/dist/resources/graphql.js +52 -16
- package/dist/resources/graphql.js.map +1 -1
- package/dist/resources/indexes/HierarchicalNavigableSmallWorld.d.ts +103 -9
- package/dist/resources/indexes/HierarchicalNavigableSmallWorld.js +854 -41
- package/dist/resources/indexes/HierarchicalNavigableSmallWorld.js.map +1 -1
- package/dist/resources/indexes/hnswDerivedIndex.d.ts +67 -0
- package/dist/resources/indexes/hnswDerivedIndex.js +464 -0
- package/dist/resources/indexes/hnswDerivedIndex.js.map +1 -0
- package/dist/resources/indexes/hnswPlaneBinding.d.ts +65 -0
- package/dist/resources/indexes/hnswPlaneBinding.js +91 -0
- package/dist/resources/indexes/hnswPlaneBinding.js.map +1 -0
- 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/nodeIdMapping.d.ts +5 -0
- package/dist/resources/nodeIdMapping.js +49 -0
- package/dist/resources/nodeIdMapping.js.map +1 -1
- package/dist/resources/recordLock.d.ts +123 -0
- package/dist/resources/recordLock.js +315 -0
- package/dist/resources/recordLock.js.map +1 -0
- package/dist/resources/recordLockCoordinator.d.ts +557 -0
- package/dist/resources/recordLockCoordinator.js +2565 -0
- package/dist/resources/recordLockCoordinator.js.map +1 -0
- package/dist/resources/replayLogs.d.ts +14 -1
- package/dist/resources/replayLogs.js +157 -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/replicatedApplyFailure.d.ts +16 -0
- package/dist/resources/replicatedApplyFailure.js +63 -0
- package/dist/resources/replicatedApplyFailure.js.map +1 -0
- package/dist/resources/scheduler/scheduler.js +3 -3
- package/dist/resources/scheduler/scheduler.js.map +1 -1
- package/dist/resources/search.d.ts +10 -4
- package/dist/resources/search.js +283 -37
- package/dist/resources/search.js.map +1 -1
- package/dist/resources/tracked.d.ts +5 -1
- package/dist/resources/tracked.js +74 -23
- package/dist/resources/tracked.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 +77 -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 +106 -2
- 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 +16 -1
- package/dist/server/http.js +122 -17
- 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 +27 -0
- package/dist/server/serverHelpers/Headers.js +145 -1
- package/dist/server/serverHelpers/Headers.js.map +1 -1
- package/dist/server/serverHelpers/NodeAdapterResponse.d.ts +48 -0
- package/dist/server/serverHelpers/NodeAdapterResponse.js +220 -0
- package/dist/server/serverHelpers/NodeAdapterResponse.js.map +1 -0
- package/dist/server/serverHelpers/Request.d.ts +5 -10
- package/dist/server/serverHelpers/Request.js +38 -136
- package/dist/server/serverHelpers/Request.js.map +1 -1
- package/dist/server/serverHelpers/contentTypes.d.ts +11 -0
- package/dist/server/serverHelpers/contentTypes.js +221 -40
- 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 +178 -29
- 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 +5 -0
- package/dist/server/storageReclamation.js +17 -1
- package/dist/server/storageReclamation.js.map +1 -1
- package/dist/server/threads/isolatedApplications.d.ts +47 -0
- package/dist/server/threads/isolatedApplications.js +171 -0
- package/dist/server/threads/isolatedApplications.js.map +1 -0
- 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/logRotationTransport.d.ts +1 -0
- package/dist/server/threads/logRotationTransport.js +33 -0
- package/dist/server/threads/logRotationTransport.js.map +1 -0
- package/dist/server/threads/manageThreads.d.ts +83 -3
- package/dist/server/threads/manageThreads.js +769 -75
- package/dist/server/threads/manageThreads.js.map +1 -1
- package/dist/server/threads/socketRouter.d.ts +1 -0
- package/dist/server/threads/socketRouter.js +277 -31
- 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 +76 -22
- 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 +33 -0
- package/dist/utility/errors/hdbError.js +58 -1
- package/dist/utility/errors/hdbError.js.map +1 -1
- package/dist/utility/globalSchema.d.ts +18 -0
- package/dist/utility/hdbTerms.d.ts +18 -0
- package/dist/utility/hdbTerms.js +20 -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 +286 -30
- package/dist/utility/logging/harper_logger.js.map +1 -1
- package/dist/utility/logging/logGenerationCoordinator.d.ts +35 -0
- package/dist/utility/logging/logGenerationCoordinator.js +184 -0
- package/dist/utility/logging/logGenerationCoordinator.js.map +1 -0
- package/dist/utility/logging/logRotation.d.ts +46 -0
- package/dist/utility/logging/logRotation.js +365 -0
- package/dist/utility/logging/logRotation.js.map +1 -0
- package/dist/utility/logging/logRotator.d.ts +1 -1
- package/dist/utility/logging/logRotator.js +192 -85
- 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 +11 -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 +41 -0
- package/dist/utility/watcherFallback.js +153 -0
- package/dist/utility/watcherFallback.js.map +1 -1
- package/dist/validation/configValidator.d.ts +12 -0
- package/dist/validation/configValidator.js +205 -75
- 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 +8 -0
- package/json/systemSchema.json +55 -0
- package/npm-shrinkwrap.json +286 -194
- package/package.json +15 -7
- package/resources/DESIGN.md +219 -52
- package/resources/DatabaseTransaction.ts +657 -52
- package/resources/LMDBTransaction.ts +46 -6
- package/resources/PrimaryRocksDatabase.ts +46 -7
- package/resources/RecordEncoder.ts +124 -9
- package/resources/RequestTarget.ts +2 -0
- package/resources/Resource.ts +114 -22
- package/resources/ResourceInterface.ts +31 -0
- package/resources/RocksIndexStore.ts +30 -9
- package/resources/RocksTransactionLogStore.ts +188 -51
- package/resources/Table.ts +1960 -301
- package/resources/analytics/write.ts +10 -3
- package/resources/auditStore.ts +647 -32
- package/resources/blob.ts +1029 -110
- package/resources/branchDatabase.ts +941 -0
- package/resources/crdt.ts +76 -12
- package/resources/dataLoader.ts +3 -4
- package/resources/databases.ts +1584 -320
- package/resources/defineTable.ts +18 -2
- package/resources/derivedIndexRegistry.ts +56 -0
- package/resources/derivedIndexRuntime.ts +2292 -0
- package/resources/graphql.ts +72 -17
- package/resources/indexes/HierarchicalNavigableSmallWorld.ts +911 -48
- package/resources/indexes/hnswDerivedIndex.ts +531 -0
- package/resources/indexes/hnswPlaneBinding.ts +174 -0
- package/resources/longLivedTransactions.ts +360 -0
- package/resources/models/backendRegistry.ts +84 -2
- package/resources/models/bootstrap.ts +473 -28
- package/resources/nodeIdMapping.ts +50 -0
- package/resources/recordLock.ts +419 -0
- package/resources/recordLockCoordinator.ts +3043 -0
- package/resources/replayLogs.ts +152 -26
- package/resources/replayLogsGuards.ts +171 -8
- package/resources/replicatedApplyFailure.ts +77 -0
- package/resources/scheduler/scheduler.ts +4 -4
- package/resources/search.ts +288 -46
- package/resources/tracked.ts +73 -22
- 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 +83 -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 +194 -16
- package/server/DurableSubscriptionsSession.ts +71 -11
- package/server/REST.ts +115 -4
- package/server/graphqlQuerying.ts +4 -0
- package/server/http.ts +133 -20
- 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 +135 -0
- package/server/serverHelpers/NodeAdapterResponse.ts +221 -0
- package/server/serverHelpers/Request.ts +33 -131
- package/server/serverHelpers/contentTypes.ts +217 -36
- 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 +232 -40
- package/server/serverHelpers/sharedMessageEncoding.ts +307 -0
- package/server/serverHelpers/uwsServer.ts +17 -2
- package/server/static.ts +23 -29
- package/server/storageReclamation.ts +15 -2
- package/server/threads/isolatedApplications.ts +157 -0
- package/server/threads/itc.js +11 -1
- package/server/threads/logRotationTransport.ts +40 -0
- package/server/threads/manageThreads.js +771 -66
- package/server/threads/socketRouter.ts +291 -30
- package/server/threads/threadHeapMemory.ts +26 -0
- package/server/threads/threadServer.js +73 -22
- package/sqlTranslator/index.ts +31 -8
- package/studio/web/assets/{Chat-4RrB5134.js → Chat-D3j-1yY1.js} +1 -1
- package/studio/web/assets/{FloatingChat-omlNMDcJ.js → FloatingChat-BxJGYcfB.js} +3 -3
- package/studio/web/assets/{apiToken-Bke3wvfZ.js → apiToken-CT55oWOe.js} +1 -1
- package/studio/web/assets/{applications-DvFDYJgK.js → applications-D9Ct9_vm.js} +1 -1
- package/studio/web/assets/{cssMode-C1vRa7zh.js → cssMode-DV8H7VwA.js} +1 -1
- package/studio/web/assets/{editor-3XRWEDWX.js → editor-uatc0unt.js} +1 -1
- package/studio/web/assets/{html-CTY5tdMr.js → html-Bm6D6paN.js} +1 -1
- package/studio/web/assets/{htmlMode-CG1vSD9t.js → htmlMode-CEn7tpLG.js} +1 -1
- package/studio/web/assets/{index-Dfpeofdu.js → index-BIXW6Pu4.js} +5 -5
- package/studio/web/assets/{index.lazy-B1VOIv-t.js → index.lazy-UI7L-Vrk.js} +1 -1
- package/studio/web/assets/{javascript-CJeJzGnI.js → javascript-CJ0G3AFZ.js} +1 -1
- package/studio/web/assets/{jsonMode-CYPBwM82.js → jsonMode-DQADAYEa.js} +1 -1
- package/studio/web/assets/{languageServices-IKH4GUHl.js → languageServices-CAQJXWcI.js} +1 -1
- package/studio/web/assets/{lspLanguageFeatures-BC8_gxKG.js → lspLanguageFeatures-CCQ8P5sY.js} +1 -1
- package/studio/web/assets/{notifications-BfKBpYcq.js → notifications-BbxTU6Aw.js} +1 -1
- package/studio/web/assets/{notifications-DFbArTfC.js → notifications-Cvb3P1lB.js} +1 -1
- package/studio/web/assets/{profile-Q4-T6c-S.js → profile-Yyb7gsvL.js} +1 -1
- package/studio/web/assets/{regions-CtkV0xje.js → regions-OgjGHlU5.js} +1 -1
- package/studio/web/assets/{register-1ZZuMsiA.js → register-6qwNEOY3.js} +2 -2
- package/studio/web/assets/{setComponentFile-ZWLcWv5X.js → setComponentFile-BilDMtgB.js} +1 -1
- package/studio/web/assets/{setup-DWprJyJy.js → setup-J6qJ7OIU.js} +2 -2
- package/studio/web/assets/{status--aNm8isn.js → status-0RWGcfyD.js} +1 -1
- package/studio/web/assets/{toggleHighContrast-Cq_lt3XD.js → toggleHighContrast-BIn-vErT.js} +1 -1
- package/studio/web/assets/{tsMode-pjgytARx.js → tsMode-DgUXku4d.js} +1 -1
- package/studio/web/assets/{typescript-Cdg0mqUh.js → typescript-C9orXcsM.js} +1 -1
- package/studio/web/assets/{useEntityRestURL-RZhaY8Rn.js → useEntityRestURL-BEoXXbUB.js} +1 -1
- package/studio/web/assets/{workers-BgoXIqQe.js → workers-JVzSDmgx.js} +1 -1
- package/studio/web/assets/{xml-BwSeDMiP.js → xml-Cq-S8S4X.js} +1 -1
- package/studio/web/assets/{yaml-DotCUG5l.js → yaml-sfoRdh1M.js} +1 -1
- package/studio/web/index.html +1 -1
- 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 +57 -0
- package/utility/hdbTerms.ts +19 -0
- package/utility/logging/harper_logger.ts +278 -26
- package/utility/logging/logGenerationCoordinator.ts +196 -0
- package/utility/logging/logRotation.ts +367 -0
- package/utility/logging/logRotator.ts +213 -81
- package/utility/nodeIdentity.ts +45 -0
- package/utility/npmUtilities.ts +12 -8
- package/utility/operationPermissions.ts +18 -1
- package/utility/operation_authorization.ts +231 -42
- package/utility/watchPath.ts +63 -0
- package/utility/watcherFallback.ts +148 -0
- package/validation/configValidator.ts +215 -75
- package/validation/installValidator.ts +15 -0
- package/validation/validationWrapper.ts +18 -4
|
@@ -10,6 +10,8 @@ import * as hdbLogger from '../utility/logging/harper_logger.ts';
|
|
|
10
10
|
import * as hdbUtils from '../utility/common_utils.ts';
|
|
11
11
|
import * as hdbTerms from '../utility/hdbTerms.ts';
|
|
12
12
|
import { getDomainSocketPathMaxBytes } from '../utility/domainSocket.ts';
|
|
13
|
+
import { bareHostViolation } from '../utility/nodeIdentity.ts';
|
|
14
|
+
import { parseMaxSize } from '../utility/logging/logRotation.ts';
|
|
13
15
|
import * as validator from './validationWrapper.ts';
|
|
14
16
|
|
|
15
17
|
const DEFAULT_LOG_FOLDER = 'log';
|
|
@@ -18,7 +20,7 @@ const INVALID_SIZE_UNIT_MSG = 'Invalid logging.rotation.maxSize unit. Available
|
|
|
18
20
|
const INVALID_INTERVAL_UNIT_MSG =
|
|
19
21
|
'Invalid logging.rotation.interval unit. Available units are D (days), H (hours), M (months) or m (minutes)';
|
|
20
22
|
const INVALID_MAX_SIZE_VALUE_MSG =
|
|
21
|
-
"Invalid logging.rotation.maxSize value. Value should be a number followed by unit e.g. '10M'";
|
|
23
|
+
"Invalid logging.rotation.maxSize value. Value should be a positive number followed by unit e.g. '10M'";
|
|
22
24
|
const INVALID_INTERVAL_VALUE_MSG =
|
|
23
25
|
"Invalid logging.rotation.interval value. Value should be a number followed by unit e.g. '10D'";
|
|
24
26
|
const INVALID_RETENTION_UNIT_MSG =
|
|
@@ -29,6 +31,31 @@ const INVALID_RETENTION_VALUE_MSG =
|
|
|
29
31
|
const VALID_ROTATION_DURATION_UNITS = ['D', 'd', 'H', 'h', 'M', 'm'];
|
|
30
32
|
const UNDEFINED_OPS_API = 'rootPath config parameter is undefined';
|
|
31
33
|
|
|
34
|
+
/**
|
|
35
|
+
* What `deploy_component` writes into a root-config entry, plus the deployment-level keys
|
|
36
|
+
* componentLoader reads off it — the shape of a `sql` application deployed before the name was
|
|
37
|
+
* reserved. Closed to new keys: nothing new may take this shape.
|
|
38
|
+
*/
|
|
39
|
+
export const LEGACY_SQL_APPLICATION_KEYS = [
|
|
40
|
+
'package',
|
|
41
|
+
'files',
|
|
42
|
+
'path',
|
|
43
|
+
'install',
|
|
44
|
+
'credentials',
|
|
45
|
+
'loadComponent',
|
|
46
|
+
'urlPath',
|
|
47
|
+
'host',
|
|
48
|
+
'branchedDatabases',
|
|
49
|
+
'network',
|
|
50
|
+
'port',
|
|
51
|
+
'securePort',
|
|
52
|
+
];
|
|
53
|
+
|
|
54
|
+
export function isLegacySqlApplicationEntry(value: unknown): boolean {
|
|
55
|
+
if (typeof value !== 'object' || value === null) return false;
|
|
56
|
+
return LEGACY_SQL_APPLICATION_KEYS.some((key) => Object.hasOwn(value, key));
|
|
57
|
+
}
|
|
58
|
+
|
|
32
59
|
// Directory-path validation. The previous `([...]+)+$` nested quantifier
|
|
33
60
|
// backtracked catastrophically (ReDoS), hanging the CLI at 100% CPU on any
|
|
34
61
|
// value with a character outside its allow-list after a run of valid ones — a
|
|
@@ -52,6 +79,10 @@ const DIRECTORY_PATH_PATTERN = /^(?!\s*$)[^\x00-\x1f\x7f\x80-\x9f\u2028\u2029]+$
|
|
|
52
79
|
const portConstraints = Joi.alternatives([number.min(0), string])
|
|
53
80
|
.optional()
|
|
54
81
|
.empty(null);
|
|
82
|
+
// node.hostname / replication.hostname must be a bare host, not a URL (utility/nodeIdentity.ts).
|
|
83
|
+
// `Joi.any` (not `string`) so validateBareHost reports a non-string with its own reason.
|
|
84
|
+
const bareHostConstraints = Joi.any().custom(validateBareHost).optional().empty(null);
|
|
85
|
+
const nodeUrlConstraints = string.custom(validateNodeUrl).optional().empty(null);
|
|
55
86
|
// Controlled-flow ("directional") replication fields. A route's `replicates` is either a boolean
|
|
56
87
|
// (full replication on/off) or an object describing per-direction flow; `sends`/`receives` and
|
|
57
88
|
// `sendsTo`/`receivesFrom` are also accepted as top-level route keys (iterateRoutes normalizes both
|
|
@@ -102,6 +133,88 @@ export const routeConstraints = Joi.alternatives([
|
|
|
102
133
|
array.items(string),
|
|
103
134
|
]);
|
|
104
135
|
|
|
136
|
+
// Models — `models:` block opts a deployment into the per-backend registry.
|
|
137
|
+
// Per-backend shape is validated by a discriminated alternative on the
|
|
138
|
+
// `backend` field. Phase 2 (#629) lands ollama; Phase 3 (#630) lands openai.
|
|
139
|
+
//
|
|
140
|
+
// `.unknown(false)` on each known backend's schema turns field-name typos
|
|
141
|
+
// (`bakend: ollama`, `hsot: ...`) into boot-blocking validation errors.
|
|
142
|
+
// Without it, Joi's top-level `allowUnknown: true` propagates and typos
|
|
143
|
+
// silently survive into bootstrap. Unknown backend types (anything not in
|
|
144
|
+
// the `switch` list) fall through to a permissive schema so future Harper
|
|
145
|
+
// versions or third-party components can register their own backends
|
|
146
|
+
// without core schema edits — `bootstrapModels` logs+skips at runtime.
|
|
147
|
+
//
|
|
148
|
+
// `requestTimeoutMs: min(1)` (not `min(0)`) so the meaning is unambiguous:
|
|
149
|
+
// omit the field for "no timeout". `0` would validate but `composeSignal`
|
|
150
|
+
// treats it as "no timeout" via `if (!timeoutMs)`, surprising a test that
|
|
151
|
+
// sets 0 to mean "fail immediately".
|
|
152
|
+
const commonEntryFields = {
|
|
153
|
+
model: string.optional(),
|
|
154
|
+
requestTimeoutMs: number.min(1).optional(),
|
|
155
|
+
// Ordered fallback group — other logical names tried, in order, after this one (#1326).
|
|
156
|
+
fallback: Joi.array().items(string).optional(),
|
|
157
|
+
};
|
|
158
|
+
const ollamaEntrySchema = Joi.object({
|
|
159
|
+
backend: string.valid('ollama').required(),
|
|
160
|
+
host: string.optional(),
|
|
161
|
+
...commonEntryFields,
|
|
162
|
+
}).unknown(false);
|
|
163
|
+
const openaiEntrySchema = Joi.object({
|
|
164
|
+
backend: string.valid('openai').required(),
|
|
165
|
+
// `apiKey` may be a literal secret or a `${ENV_VAR}` placeholder; both
|
|
166
|
+
// are syntactically strings. `bootstrap.ts` runs `expandEnvVarsDeep`
|
|
167
|
+
// before construction; the backend rejects unresolved placeholders
|
|
168
|
+
// with an explicit error pointing at the env-var name.
|
|
169
|
+
apiKey: string.required(),
|
|
170
|
+
baseUrl: string.optional(),
|
|
171
|
+
organization: string.optional(),
|
|
172
|
+
...commonEntryFields,
|
|
173
|
+
}).unknown(false);
|
|
174
|
+
const anthropicEntrySchema = Joi.object({
|
|
175
|
+
backend: string.valid('anthropic').required(),
|
|
176
|
+
// Same secret-handling posture as openai's `apiKey`.
|
|
177
|
+
apiKey: string.required(),
|
|
178
|
+
baseUrl: string.optional(),
|
|
179
|
+
...commonEntryFields,
|
|
180
|
+
}).unknown(false);
|
|
181
|
+
const bedrockEntrySchema = Joi.object({
|
|
182
|
+
backend: string.valid('bedrock').required(),
|
|
183
|
+
// AWS credentials resolve via the SDK chain (env / shared file / IAM
|
|
184
|
+
// roles for service accounts) — no apiKey field. `region` is
|
|
185
|
+
// effectively required (Bedrock is regional) but the backend can
|
|
186
|
+
// fall back to AWS_REGION env, so we leave it optional here.
|
|
187
|
+
region: string.optional(),
|
|
188
|
+
...commonEntryFields,
|
|
189
|
+
}).unknown(false);
|
|
190
|
+
const unknownBackendEntrySchema = Joi.object({
|
|
191
|
+
backend: string.required(),
|
|
192
|
+
}).unknown(true);
|
|
193
|
+
const modelEntrySchema = Joi.alternatives().conditional('.backend', {
|
|
194
|
+
switch: [
|
|
195
|
+
{ is: 'ollama', then: ollamaEntrySchema },
|
|
196
|
+
{ is: 'openai', then: openaiEntrySchema },
|
|
197
|
+
{ is: 'anthropic', then: anthropicEntrySchema },
|
|
198
|
+
{ is: 'bedrock', then: bedrockEntrySchema },
|
|
199
|
+
],
|
|
200
|
+
otherwise: unknownBackendEntrySchema,
|
|
201
|
+
});
|
|
202
|
+
const modelsSchema = Joi.object({
|
|
203
|
+
embedding: Joi.object().pattern(Joi.string(), modelEntrySchema).optional(),
|
|
204
|
+
generative: Joi.object().pattern(Joi.string(), modelEntrySchema).optional(),
|
|
205
|
+
});
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* Validate a `models:` block on its own — the hot-reload path applies a watched file's block
|
|
209
|
+
* without the full boot validation, and must enforce the same schema boot does.
|
|
210
|
+
*/
|
|
211
|
+
export function validateModelsBlock(models) {
|
|
212
|
+
// `allowUnknown: true` mirrors the boot path, whose top-level option propagates into this
|
|
213
|
+
// subtree: a sibling of embedding/generative that boots must not block a reload. Entry-level
|
|
214
|
+
// strictness is preserved by each backend schema's `.unknown(false)`.
|
|
215
|
+
return modelsSchema.validate(models, { abortEarly: false, allowUnknown: true, errors: { wrap: { label: "'" } } });
|
|
216
|
+
}
|
|
217
|
+
|
|
105
218
|
let hdbRoot;
|
|
106
219
|
let skipFsVal = false;
|
|
107
220
|
|
|
@@ -157,76 +270,42 @@ export function configValidator(configJson, skipFsValidation = false) {
|
|
|
157
270
|
session: mcpSessionSchema.optional(),
|
|
158
271
|
});
|
|
159
272
|
|
|
160
|
-
//
|
|
161
|
-
//
|
|
162
|
-
//
|
|
163
|
-
//
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
//
|
|
174
|
-
//
|
|
175
|
-
//
|
|
176
|
-
const
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
...commonEntryFields,
|
|
197
|
-
}).unknown(false);
|
|
198
|
-
const anthropicEntrySchema = Joi.object({
|
|
199
|
-
backend: string.valid('anthropic').required(),
|
|
200
|
-
// Same secret-handling posture as openai's `apiKey`.
|
|
201
|
-
apiKey: string.required(),
|
|
202
|
-
baseUrl: string.optional(),
|
|
203
|
-
...commonEntryFields,
|
|
204
|
-
}).unknown(false);
|
|
205
|
-
const bedrockEntrySchema = Joi.object({
|
|
206
|
-
backend: string.valid('bedrock').required(),
|
|
207
|
-
// AWS credentials resolve via the SDK chain (env / shared file / IAM
|
|
208
|
-
// roles for service accounts) — no apiKey field. `region` is
|
|
209
|
-
// effectively required (Bedrock is regional) but the backend can
|
|
210
|
-
// fall back to AWS_REGION env, so we leave it optional here.
|
|
211
|
-
region: string.optional(),
|
|
212
|
-
...commonEntryFields,
|
|
213
|
-
}).unknown(false);
|
|
214
|
-
const unknownBackendEntrySchema = Joi.object({
|
|
215
|
-
backend: string.required(),
|
|
216
|
-
}).unknown(true);
|
|
217
|
-
const modelEntrySchema = Joi.alternatives().conditional('.backend', {
|
|
218
|
-
switch: [
|
|
219
|
-
{ is: 'ollama', then: ollamaEntrySchema },
|
|
220
|
-
{ is: 'openai', then: openaiEntrySchema },
|
|
221
|
-
{ is: 'anthropic', then: anthropicEntrySchema },
|
|
222
|
-
{ is: 'bedrock', then: bedrockEntrySchema },
|
|
223
|
-
],
|
|
224
|
-
otherwise: unknownBackendEntrySchema,
|
|
225
|
-
});
|
|
226
|
-
const modelsSchema = Joi.object({
|
|
227
|
-
embedding: Joi.object().pattern(Joi.string(), modelEntrySchema).optional(),
|
|
228
|
-
generative: Joi.object().pattern(Joi.string(), modelEntrySchema).optional(),
|
|
229
|
-
});
|
|
273
|
+
// `convert: false` — validateConfig() only writes the coerced value back into configDoc for
|
|
274
|
+
// threads/componentsRoot/logging/storage/operationsApi, not sql, so leaving Joi's default
|
|
275
|
+
// convert:true on here would accept a quoted `allowFullScan: "true"` and then silently drop
|
|
276
|
+
// it (getSqlEngineConfig()'s typeof guard rejects the still-unconverted string).
|
|
277
|
+
const sqlSettingsSchema = Joi.object({
|
|
278
|
+
engine: string.valid('legacy', 'new', 'auto').optional(),
|
|
279
|
+
allowFullScan: boolean.optional(),
|
|
280
|
+
maxSortRows: number.integer().min(1).optional(),
|
|
281
|
+
maxHashRows: number.integer().min(1).optional(),
|
|
282
|
+
})
|
|
283
|
+
.unknown(false)
|
|
284
|
+
.prefs({ convert: false });
|
|
285
|
+
|
|
286
|
+
// An application deployed under the name before it was reserved still boots; validateConfig()
|
|
287
|
+
// warns to rename it. Selected positively so a typo'd setting is still held to the settings
|
|
288
|
+
// schema instead of passing as an application.
|
|
289
|
+
const legacySqlApplicationSchema = Joi.object({
|
|
290
|
+
engine: Joi.any().forbidden(),
|
|
291
|
+
allowFullScan: Joi.any().forbidden(),
|
|
292
|
+
maxSortRows: Joi.any().forbidden(),
|
|
293
|
+
maxHashRows: Joi.any().forbidden(),
|
|
294
|
+
})
|
|
295
|
+
.unknown(true)
|
|
296
|
+
.messages({
|
|
297
|
+
'any.unknown': `{#label} cannot be set while 'sql' names a deployed application; redeploy that application under a different name`,
|
|
298
|
+
});
|
|
299
|
+
const sqlSchema = Joi.alternatives()
|
|
300
|
+
.conditional(
|
|
301
|
+
Joi.object()
|
|
302
|
+
.or(...LEGACY_SQL_APPLICATION_KEYS)
|
|
303
|
+
.unknown(true),
|
|
304
|
+
{ then: legacySqlApplicationSchema, otherwise: sqlSettingsSchema }
|
|
305
|
+
)
|
|
306
|
+
// `false`/null is how componentLoader spells a disabled entry, so an operator who had already
|
|
307
|
+
// turned a pre-reservation `sql` application off keeps booting.
|
|
308
|
+
.allow(false, null);
|
|
230
309
|
|
|
231
310
|
const configSchema = Joi.object({
|
|
232
311
|
authentication: Joi.alternatives(
|
|
@@ -247,8 +326,8 @@ export function configValidator(configJson, skipFsValidation = false) {
|
|
|
247
326
|
replicate: boolean.optional(),
|
|
248
327
|
}),
|
|
249
328
|
replication: Joi.object({
|
|
250
|
-
hostname:
|
|
251
|
-
url:
|
|
329
|
+
hostname: bareHostConstraints,
|
|
330
|
+
url: nodeUrlConstraints,
|
|
252
331
|
port: portConstraints,
|
|
253
332
|
securePort: portConstraints,
|
|
254
333
|
routes: array.optional().empty(null),
|
|
@@ -265,6 +344,10 @@ export function configValidator(configJson, skipFsValidation = false) {
|
|
|
265
344
|
copyCursorFlushIntervalMs: number.min(1).optional().empty(null),
|
|
266
345
|
replayTimeout: number.min(1).optional().empty(null),
|
|
267
346
|
}).optional(),
|
|
347
|
+
node: Joi.object({
|
|
348
|
+
hostname: bareHostConstraints,
|
|
349
|
+
url: string.optional().empty(null),
|
|
350
|
+
}).optional(),
|
|
268
351
|
componentsRoot: rootConstraints.optional(),
|
|
269
352
|
localStudio: Joi.object({
|
|
270
353
|
enabled: enabledConstraints,
|
|
@@ -352,6 +435,7 @@ export function configValidator(configJson, skipFsValidation = false) {
|
|
|
352
435
|
})
|
|
353
436
|
),
|
|
354
437
|
maxHeapMemory: number.min(0).optional(),
|
|
438
|
+
maxIsolated: number.integer().min(0).optional(),
|
|
355
439
|
preload: Joi.alternatives([string, array.items(string)])
|
|
356
440
|
.allow(null)
|
|
357
441
|
.optional(),
|
|
@@ -364,6 +448,30 @@ export function configValidator(configJson, skipFsValidation = false) {
|
|
|
364
448
|
writeAsync: boolean.required(),
|
|
365
449
|
overlappingSync: boolean.optional(),
|
|
366
450
|
caching: boolean.optional(),
|
|
451
|
+
blobs: Joi.object({
|
|
452
|
+
compression: Joi.object()
|
|
453
|
+
.pattern(
|
|
454
|
+
// exact content type, 'type/*' wildcard, or the 'default' entry
|
|
455
|
+
/^([\w.+-]+\/(\*|[\w.+-]+)|default)$/,
|
|
456
|
+
Joi.alternatives([
|
|
457
|
+
Joi.valid(false),
|
|
458
|
+
// .unknown(false) so a typo'd nested field (e.g. `treshold`) is rejected instead of
|
|
459
|
+
// silently inheriting the top-level validate() allowUnknown:true and falling back to
|
|
460
|
+
// the default threshold — matching config-root.schema.json.
|
|
461
|
+
Joi.object({ codec: Joi.valid('deflate').optional(), threshold: number.min(0).optional() }).unknown(
|
|
462
|
+
false
|
|
463
|
+
),
|
|
464
|
+
])
|
|
465
|
+
)
|
|
466
|
+
// fail on keys that are not a content type, a 'type/*' wildcard, or 'default' —
|
|
467
|
+
// a typo'd key would otherwise silently never match anything
|
|
468
|
+
.unknown(false)
|
|
469
|
+
.optional(),
|
|
470
|
+
})
|
|
471
|
+
// reject a misspelled property directly under storage.blobs (e.g. `compresion:`), which the
|
|
472
|
+
// top-level validate()'s allowUnknown:true would otherwise accept and silently leave off
|
|
473
|
+
.unknown(false)
|
|
474
|
+
.optional(),
|
|
367
475
|
compression: Joi.alternatives([
|
|
368
476
|
boolean.optional(),
|
|
369
477
|
Joi.object({ dictionary: string.optional(), threshold: number.optional() }),
|
|
@@ -378,6 +486,7 @@ export function configValidator(configJson, skipFsValidation = false) {
|
|
|
378
486
|
}).required(),
|
|
379
487
|
mcp: mcpSchema.optional(),
|
|
380
488
|
models: modelsSchema.optional(),
|
|
489
|
+
sql: sqlSchema.optional(),
|
|
381
490
|
ignoreScripts: boolean.optional(),
|
|
382
491
|
tls: Joi.alternatives([Joi.array().items(tlsConstraints), tlsConstraints]),
|
|
383
492
|
});
|
|
@@ -402,6 +511,36 @@ function doesPathExist(pathToCheck) {
|
|
|
402
511
|
return `Specified path ${pathToCheck} does not exist.`;
|
|
403
512
|
}
|
|
404
513
|
|
|
514
|
+
function validateBareHost(value, helpers) {
|
|
515
|
+
const violation = bareHostViolation(value);
|
|
516
|
+
if (violation) {
|
|
517
|
+
return helpers.message(
|
|
518
|
+
`{{#label}} ${violation}; it must be a bare hostname or IP literal (no scheme, port, or path) because it is this node's identity`
|
|
519
|
+
);
|
|
520
|
+
}
|
|
521
|
+
return value;
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
// A node URL supplies this node's identity via its host (server/nodeName.ts urlToNodeName), so it
|
|
525
|
+
// must have an authority. A hostless scheme ("mailto:", "data:", "file:") parses but has no host.
|
|
526
|
+
// A node URL supplies this node's identity via its host (server/nodeName.ts urlToNodeName). Only
|
|
527
|
+
// reject the unambiguous mistake: a value written as a real URL (with a "//" authority) that still
|
|
528
|
+
// parses to no host. Everything else is deliberately tolerated, because urlToNodeName skips a value
|
|
529
|
+
// it cannot take a host from and identity falls through to another source — a scheme-less
|
|
530
|
+
// "node1.example.com:9933" even parses as a *scheme*, so it is indistinguishable from "mailto:" here,
|
|
531
|
+
// and rejecting that shape would turn a previously harmless config into a boot failure.
|
|
532
|
+
function validateNodeUrl(value, helpers) {
|
|
533
|
+
if (!value.includes('//')) return value;
|
|
534
|
+
let host;
|
|
535
|
+
try {
|
|
536
|
+
host = new URL(value).hostname;
|
|
537
|
+
} catch {
|
|
538
|
+
return value; // unparseable — skipped at runtime, not worth failing the boot over
|
|
539
|
+
}
|
|
540
|
+
if (!host) return helpers.message('{{#label}} must be a URL with a host (e.g. "wss://node1.example.com:9933")');
|
|
541
|
+
return value;
|
|
542
|
+
}
|
|
543
|
+
|
|
405
544
|
function validatePath(value, helpers) {
|
|
406
545
|
Joi.assert(value, string.pattern(DIRECTORY_PATH_PATTERN, 'directory path'));
|
|
407
546
|
|
|
@@ -462,8 +601,9 @@ function validateRotationMaxSize(value, helpers) {
|
|
|
462
601
|
return helpers.message(INVALID_SIZE_UNIT_MSG);
|
|
463
602
|
}
|
|
464
603
|
|
|
465
|
-
|
|
466
|
-
|
|
604
|
+
// The same parser the write-path size check uses, so a value accepted here can never become a
|
|
605
|
+
// zero, negative or NaN byte limit downstream. `parseInt` alone accepted '0K', '-1K' and '1xK'.
|
|
606
|
+
if (!parseMaxSize(value)) {
|
|
467
607
|
return helpers.message(INVALID_MAX_SIZE_VALUE_MSG);
|
|
468
608
|
}
|
|
469
609
|
|
|
@@ -5,6 +5,7 @@ const { string, number } = Joi.types();
|
|
|
5
5
|
import * as fs from 'fs-extra';
|
|
6
6
|
import * as hdbTerms from '../utility/hdbTerms.ts';
|
|
7
7
|
import * as path from 'path';
|
|
8
|
+
import { bareHostViolation } from '../utility/nodeIdentity.ts';
|
|
8
9
|
import * as validator from './validationWrapper.ts';
|
|
9
10
|
|
|
10
11
|
export default installValidator;
|
|
@@ -22,11 +23,25 @@ function installValidator(param) {
|
|
|
22
23
|
null
|
|
23
24
|
),
|
|
24
25
|
[(hdbTerms.INSTALL_PROMPTS as any).TC_AGREEMENT]: string.valid('yes', 'YES', 'Yes'),
|
|
26
|
+
// Catch a bad node identity here rather than at first boot. This runs after the v5 migration
|
|
27
|
+
// copies REPLICATION_HOSTNAME into NODE_HOSTNAME, so an upgrade carrying a URL-ish value is
|
|
28
|
+
// reported during install with the same reason the config boundary would give (harper#2218).
|
|
29
|
+
[hdbTerms.INSTALL_PROMPTS.NODE_HOSTNAME]: Joi.custom(validateNodeHostname).allow('null', null),
|
|
25
30
|
});
|
|
26
31
|
|
|
27
32
|
return validator.validateBySchema(param, installSchema);
|
|
28
33
|
}
|
|
29
34
|
|
|
35
|
+
function validateNodeHostname(value, helpers) {
|
|
36
|
+
const violation = bareHostViolation(value);
|
|
37
|
+
if (violation) {
|
|
38
|
+
return helpers.message(
|
|
39
|
+
`{{#label}} ${violation}; it must be a bare hostname or IP literal (no scheme, port, or path) because it is this node's identity`
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
return value;
|
|
43
|
+
}
|
|
44
|
+
|
|
30
45
|
function validateRootAvailable(value, helpers) {
|
|
31
46
|
if (
|
|
32
47
|
fs.existsSync(path.join(value, 'system/hdb_user/data.mdb')) ||
|
|
@@ -84,6 +84,8 @@ export async function validateObjectAsync(object, fileConstraints) {
|
|
|
84
84
|
return null;
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
+
const SCHEMA_VALIDATION_OPTIONS = { allowUnknown: true, abortEarly: false, errors: { wrap: { label: "'" } } };
|
|
88
|
+
|
|
87
89
|
/**
|
|
88
90
|
*
|
|
89
91
|
* @param {{}} object
|
|
@@ -91,9 +93,21 @@ export async function validateObjectAsync(object, fileConstraints) {
|
|
|
91
93
|
* @returns {*}
|
|
92
94
|
*/
|
|
93
95
|
export function validateBySchema(object, schema) {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
return new Error(result.error.message);
|
|
96
|
+
const { error } = schema.validate(object, SCHEMA_VALIDATION_OPTIONS);
|
|
97
|
+
if (error) {
|
|
98
|
+
return new Error(error.message);
|
|
98
99
|
}
|
|
99
100
|
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Validates like `validateBySchema` and additionally hands back Joi's converted value (coerced
|
|
104
|
+
* types and schema defaults). `value` is Joi's best-effort conversion, so it is only meaningful
|
|
105
|
+
* when `error` is undefined.
|
|
106
|
+
* @param {{}} object
|
|
107
|
+
* @param {Joi.ObjectSchema} schema
|
|
108
|
+
*/
|
|
109
|
+
export function validateAndConvertBySchema(object, schema): { error: Error | undefined; value: any } {
|
|
110
|
+
const { error, value } = schema.validate(object, SCHEMA_VALIDATION_OPTIONS);
|
|
111
|
+
|
|
112
|
+
return { error: error ? new Error(error.message) : undefined, value };
|
|
113
|
+
}
|