xypriss 9.0.13 → 9.1.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/workflows/build-xems.md +9 -0
- package/.editorconfig +12 -0
- package/.env.test +4 -0
- package/.github/FUNDING.yml +15 -0
- package/.github/dependabot.yml +11 -0
- package/.github/workflows/codeql.yml +98 -0
- package/.github/workflows/release.yml +91 -0
- package/.private/.meta/+xypriss.meta.ts +6 -0
- package/.private/ACPES_UTF8_FIXES.md +129 -0
- package/.private/PLUGIN_API_TEST_PLAN.md +555 -0
- package/.private/README.md +6 -0
- package/.private/SESSION_SUMMARY_2025-12-12.md +229 -0
- package/.private/XYPRISS_BUG_FIX_REPORT.md +198 -0
- package/.private/XYPRISS_BUG_REPORT.md +140 -0
- package/.private/XYPRISS_RUST_CORE_BRAINSTORM.md +110 -0
- package/.private/acpes_gl_test.ts +38 -0
- package/.private/acpes_test_data.txt +6 -0
- package/.private/algos/comparison.md +87 -0
- package/.private/configs-example.ts +290 -0
- package/.private/configs.ts +22 -0
- package/.private/console-demo-simple.ts +61 -0
- package/.private/console-interception-examples.ts +260 -0
- package/.private/const.ts +6 -0
- package/.private/cpu.bench.md +53 -0
- package/.private/create_test_files.ts +43 -0
- package/.private/diagnose-proxy.cjs +176 -0
- package/.private/feedb.md +16 -0
- package/.private/filesystem-api.md +119 -0
- package/.private/fw.ts +10 -0
- package/.private/goserver.ts +56 -0
- package/.private/important/xm +12 -0
- package/.private/index.html +23 -0
- package/.private/intensive_test_server.ts +244 -0
- package/.private/k.md +2 -0
- package/.private/middlewares/testMiddleware.ts +11 -0
- package/.private/ms1.ts +12 -0
- package/.private/ms1_router2.ts +13 -0
- package/.private/ms1router.ts +10 -0
- package/.private/mserver.ts +14 -0
- package/.private/otherRouterFromFile.ts +11 -0
- package/.private/package_manager_brainstorming.md +804 -0
- package/.private/payload.json +46 -0
- package/.private/plg.json +3 -0
- package/.private/plugins/+plg.ts +8 -0
- package/.private/plugins/authServer.ts +24 -0
- package/.private/plugins/mainServer.ts +28 -0
- package/.private/plugins/t.ts +7 -0
- package/.private/productionCsp.ts +48 -0
- package/.private/repro_memory_error.ts +10 -0
- package/.private/repro_memory_error_dist.ts +10 -0
- package/.private/repro_sys.ts +10 -0
- package/.private/response_control_demo.ts +57 -0
- package/.private/rex.ts +22 -0
- package/.private/router/auth.route.ts +96 -0
- package/.private/router/index.router.ts +20 -0
- package/.private/router/index.ts +35 -0
- package/.private/router/v1.route.ts +9 -0
- package/.private/sandbox/xms/router/index.ts +12 -0
- package/.private/sandbox/xms/router/xserver1.route.ts +12 -0
- package/.private/sandbox/xms/router/xserver2.route.ts +37 -0
- package/.private/sandbox/xms/server.ts +14 -0
- package/.private/sandbox/xms/servers/xserver1.ts +8 -0
- package/.private/sandbox/xms/servers/xserver2.ts +6 -0
- package/.private/security-example.ts +149 -0
- package/.private/serializer.ts +13 -0
- package/.private/server.ts +200 -0
- package/.private/server2.ts +12 -0
- package/.private/test-mob.ts +15 -0
- package/.private/test-pkce.ts +43 -0
- package/.private/test-proxy.cjs +161 -0
- package/.private/test-query-endpoint.ts +28 -0
- package/.private/test-query-params-fix.cjs +184 -0
- package/.private/test-ratelimit.ts +27 -0
- package/.private/test-router.ts +40 -0
- package/.private/test-server-prod.ts +43 -0
- package/.private/test-server.ts +55 -0
- package/.private/test-trust-proxy-ranges.cjs +139 -0
- package/.private/test.json +53 -0
- package/.private/test.pluging.ts +37 -0
- package/.private/testPlugin_Logger.ts +20 -0
- package/.private/test_lifecycle_hooks.ts +120 -0
- package/.private/test_methods_suite.ts +134 -0
- package/.private/test_multi_server.ts +62 -0
- package/.private/test_plugin_api.ts +150 -0
- package/.private/test_upload.ts +103 -0
- package/.private/test_upload_comprehensive.ts +185 -0
- package/.private/testing-meta-config/.meta/+xypriss.meta.ts +4 -0
- package/.private/testing-meta-config/.quickdevignore +1 -0
- package/.private/testing-meta-config/README.md +238 -0
- package/.private/testing-meta-config/bun.lock +1184 -0
- package/.private/testing-meta-config/package-lock.json +4172 -0
- package/.private/testing-meta-config/package.json +31 -0
- package/.private/testing-meta-config/quickdev.config.json +34 -0
- package/.private/testing-meta-config/src/configs/host.conf.ts +83 -0
- package/.private/testing-meta-config/src/configs/xypriss.config.ts +45 -0
- package/.private/testing-meta-config/src/middleware/index.ts +40 -0
- package/.private/testing-meta-config/src/middleware/security.mlw.ts +29 -0
- package/.private/testing-meta-config/src/middleware/validation.middleware.ts +53 -0
- package/.private/testing-meta-config/src/routes/index.ts +97 -0
- package/.private/testing-meta-config/src/schema/user.schema.ts +8 -0
- package/.private/testing-meta-config/src/server.ts +67 -0
- package/.private/testing-meta-config/tsconfig.json +31 -0
- package/.private/testing-meta-config/xypriss.config.json +12 -0
- package/.private/type-safe-configs.ts +323 -0
- package/.private/upload_router.ts +28 -0
- package/.private/upload_serv.ts +48 -0
- package/.private/xms.md +1 -0
- package/.private/xvault.xems +0 -0
- package/.private/xypriss-cors-methods-array-bug.md +297 -0
- package/.quickdevignore +3 -0
- package/CONTRIBUTING.md +411 -0
- package/README.md +2 -1
- package/RELEASE_XFPM_G0.1.48.md +30 -0
- package/__tests__/COMPRESSION_FIX_SUMMARY.md +268 -0
- package/__tests__/COMPRESSION_PLUGIN_COMPLETE.md +224 -0
- package/__tests__/COMPRESSION_PLUGIN_IMPLEMENTATION_PLAN.md +253 -0
- package/__tests__/README.md +192 -0
- package/__tests__/TEST_INVESTIGATION_REPORT.md +247 -0
- package/__tests__/XYPRISS_COMPRESSION_SUMMARY.md +279 -0
- package/__tests__/acpes.test.html +12 -0
- package/__tests__/acpes_gl_test.ts +38 -0
- package/__tests__/analytics-engine.test.ts +292 -0
- package/__tests__/automatic-json-parsing.js +188 -0
- package/__tests__/bun-port-test.ts +186 -0
- package/__tests__/bun_cluster_test.ts +603 -0
- package/__tests__/bun_cluster_testv2.ts +448 -0
- package/__tests__/cache-persistence-fix-test.ts +149 -0
- package/__tests__/cache_testing/simplified_cache_test.ts +114 -0
- package/__tests__/cache_testing/test_redis_cache.ts +62 -0
- package/__tests__/cache_testing/type_safety_test.ts +200 -0
- package/__tests__/check_date.ts +10 -0
- package/__tests__/cluster_test.cjs +583 -0
- package/__tests__/cluster_test.js +38 -0
- package/__tests__/comprehensive-port-test.ts +192 -0
- package/__tests__/console.test.ts +262 -0
- package/__tests__/cors-multiserver-bug.test.ts +243 -0
- package/__tests__/cors-test-server.ts +124 -0
- package/__tests__/cors-test.html +98 -0
- package/__tests__/cors.test.ts +325 -0
- package/__tests__/crypto-operations.test.ts +334 -0
- package/__tests__/debug-conflict.js +69 -0
- package/__tests__/debug-memory.js +94 -0
- package/__tests__/debug-port.js +66 -0
- package/__tests__/debug-security.ts +54 -0
- package/__tests__/debug-server-startup.ts +187 -0
- package/__tests__/debug-test.js +73 -0
- package/__tests__/debug_logging.ts +104 -0
- package/__tests__/example-circular-fix.cjs +133 -0
- package/__tests__/express-listen-test.ts +144 -0
- package/__tests__/fObject.test.ts +38 -0
- package/__tests__/fast-routing-example.ts +166 -0
- package/__tests__/final-port-switch-test.ts +192 -0
- package/__tests__/fix-imports.cjs +109 -0
- package/__tests__/gl.ts +137 -0
- package/__tests__/gl_ts.ts +49 -0
- package/__tests__/glob.test.ts +11 -0
- package/__tests__/integration.test.ts +414 -0
- package/__tests__/memory-manager.test.ts +401 -0
- package/__tests__/memory-optimized-cluster.ts +359 -0
- package/__tests__/memory_friendly_test.ts +444 -0
- package/__tests__/middleware-id-tracking.test.ts +344 -0
- package/__tests__/middleware-system.test.ts +149 -0
- package/__tests__/middleware_test1.ts +61 -0
- package/__tests__/mobile-test/test-okhttp.js +71 -0
- package/__tests__/multi-server-404-config-test.ts +346 -0
- package/__tests__/network-plugin-example.js +203 -0
- package/__tests__/network-plugins-comprehensive.test.ts +523 -0
- package/__tests__/network-plugins-manual-demo.ts +376 -0
- package/__tests__/network-plugins-quick-test.ts +132 -0
- package/__tests__/object-collection-tracking.test.ts +337 -0
- package/__tests__/optimization-engine.test.ts +394 -0
- package/__tests__/plugin-system-test.ts +92 -0
- package/__tests__/plugins/+plg.ts +8 -0
- package/__tests__/plugins/t.ts +7 -0
- package/__tests__/port-availability-test.ts +153 -0
- package/__tests__/port-switch-conflict-test.ts +144 -0
- package/__tests__/port-switch-debug.ts +116 -0
- package/__tests__/rate-limiting.test.ts +221 -0
- package/__tests__/rate_lim.ts +44 -0
- package/__tests__/redirect.ts +164 -0
- package/__tests__/redis_cache_test.ts +25 -0
- package/__tests__/repro_rate_limit.ts +24 -0
- package/__tests__/router/index.ts +13 -0
- package/__tests__/router/test_router.ts +57 -0
- package/__tests__/router copy/index.router.ts +20 -0
- package/__tests__/router_test.ts +32 -0
- package/__tests__/run-all-tests.ts +179 -0
- package/__tests__/run-network-tests.sh +261 -0
- package/__tests__/run-placeholder-tests.ts +137 -0
- package/__tests__/security-example.ts +149 -0
- package/__tests__/security.test.ts +305 -0
- package/__tests__/server-creation.test.ts +253 -0
- package/__tests__/server.test.ts +70 -0
- package/__tests__/simple-port-test.ts +180 -0
- package/__tests__/simple_router_test.ts +45 -0
- package/__tests__/stress-test-network-plugins-fixed.sh +305 -0
- package/__tests__/stress-test-network-plugins.sh +328 -0
- package/__tests__/stress_test_intelligence.sh +384 -0
- package/__tests__/test/bun.lock +846 -0
- package/__tests__/test-acpes-utf8-fix.js +105 -0
- package/__tests__/test-acpes.js +102 -0
- package/__tests__/test-advanced-encryption.js +163 -0
- package/__tests__/test-all-network-plugins.mjs +353 -0
- package/__tests__/test-auto-port.cjs +109 -0
- package/__tests__/test-auto-ts/auto-check-test.ts +18 -0
- package/__tests__/test-cache-persistence-fix.ts +195 -0
- package/__tests__/test-circular-reference-fix.ts +214 -0
- package/__tests__/test-cluster-startup copy.ts +222 -0
- package/__tests__/test-cluster-startup.ts +222 -0
- package/__tests__/test-console-debug.ts +106 -0
- package/__tests__/test-cors.js +36 -0
- package/__tests__/test-ffunc.ts +138 -0
- package/__tests__/test-import.mjs +63 -0
- package/__tests__/test-integrated-network-plugins.mjs +493 -0
- package/__tests__/test-interface.ts +40 -0
- package/__tests__/test-json-parsing.mjs +87 -0
- package/__tests__/test-local-import.cjs +25 -0
- package/__tests__/test-local-import.js +28 -0
- package/__tests__/test-memory-cli.js +21 -0
- package/__tests__/test-modular.js +141 -0
- package/__tests__/test-no-conflict.ts +107 -0
- package/__tests__/test-port-conflict.js +64 -0
- package/__tests__/test-port-error.js +41 -0
- package/__tests__/test-port-manager.js +64 -0
- package/__tests__/test-power.ts +54 -0
- package/__tests__/test-realistic-bug-scenario.ts +101 -0
- package/__tests__/test-resilience.ts +53 -0
- package/__tests__/test-ultra-fast.ts +121 -0
- package/__tests__/test-user-example.mjs +114 -0
- package/__tests__/test-xhsc.ts +90 -0
- package/__tests__/test_cluster.ts +342 -0
- package/__tests__/test_cluster_simple.ts +221 -0
- package/__tests__/test_csrf_and_final.ts +187 -0
- package/__tests__/test_logging.ts +140 -0
- package/__tests__/test_manual_multer.ts +59 -0
- package/__tests__/test_manual_multer_client.ts +62 -0
- package/__tests__/test_matchit.rs +14 -0
- package/__tests__/test_plugins.ts +307 -0
- package/__tests__/test_real_cpu_work.ts +317 -0
- package/__tests__/test_request_management.ts +161 -0
- package/__tests__/test_router_and_middleware.ts +154 -0
- package/__tests__/test_upload.ts +62 -0
- package/__tests__/test_worker_direct.ts +77 -0
- package/__tests__/test_worker_pool.ts +224 -0
- package/__tests__/test_xjson.sh +21 -0
- package/__tests__/utils/cache.ts +15 -0
- package/__tests__/verify-network-plugins.sh +248 -0
- package/__tests__/wildcard-cors.test.ts +90 -0
- package/cache/.write_test +1 -0
- package/docs/ENVIRONMENT_SHIELD.md +68 -0
- package/docs/README.md +49 -0
- package/docs/XEMS_TUTORIAL.md +205 -0
- package/docs/cluster/MULTI_SERVER.md +479 -0
- package/docs/cluster/cluster-configuration-guide.md +92 -0
- package/docs/cluster/cluster-overview.md +33 -0
- package/docs/cluster/cluster-performance-tuning-updated.md +78 -0
- package/docs/cluster/multi-server.md +288 -0
- package/docs/config/CFG_API.md +61 -0
- package/docs/config/CONFIGS_API.md +414 -0
- package/docs/config/CONFIGS_QUICK_REFERENCE.md +124 -0
- package/docs/config/META_CONFIG.md +65 -0
- package/docs/config/NETWORK_CONFIG_GUIDE.md +441 -0
- package/docs/config/configuration.md +383 -0
- package/docs/core/CONST_API.md +88 -0
- package/docs/core/GLOBAL_APIS.md +190 -0
- package/docs/core/MEMORY_DETECTION.md +206 -0
- package/docs/core/MIDDLEWARE_ARCHITECTURE.md +227 -0
- package/docs/core/SERVER_CORE_ARCHITECTURE.md +68 -0
- package/docs/core/WORKSPACE_SYSTEM.md +97 -0
- package/docs/core/XHSC_CORE.md +90 -0
- package/docs/core/api-reference.md +406 -0
- package/docs/core/memory-management.md +350 -0
- package/docs/features/CONSOLE_INTERCEPTION_GUIDE.md +698 -0
- package/docs/features/CONSOLE_INTERCEPT_HOOK.md +516 -0
- package/docs/features/FILE_UPLOAD_GUIDE.md +486 -0
- package/docs/features/SYSTEM_INTELLIGENCE.md +81 -0
- package/docs/features/XJSON_API.md +445 -0
- package/docs/features/browser-terminal-control.md +707 -0
- package/docs/features/file-upload.md +674 -0
- package/docs/features/filesystem-api.md +242 -0
- package/docs/features/xfpm.md +157 -0
- package/docs/guides/EXAMPLES.md +483 -0
- package/docs/guides/FEATURES_OVERVIEW.md +59 -0
- package/docs/guides/INSTALLATION.md +114 -0
- package/docs/guides/QUICK_START.md +278 -0
- package/docs/guides/getting-started.md +472 -0
- package/docs/plugins/PLUGIN_API_IMPLEMENTATION.md +151 -0
- package/docs/plugins/PLUGIN_CORE_HOOKS.md +212 -0
- package/docs/plugins/PLUGIN_DATA_MASKING.md +53 -0
- package/docs/plugins/PLUGIN_DEVELOPMENT_GUIDE.md +1158 -0
- package/docs/plugins/PLUGIN_ERROR_HANDLING.md +82 -0
- package/docs/plugins/PLUGIN_MANAGEMENT_API.md +92 -0
- package/docs/plugins/PLUGIN_PERMISSIONS.md +123 -0
- package/docs/plugins/PLUGIN_STABILITY.md +66 -0
- package/docs/plugins/PLUGIN_SYSTEM_GUIDE.md +714 -0
- package/docs/plugins/plugins.md +550 -0
- package/docs/routing/HTTP_METHODS_REFERENCE.md +152 -0
- package/docs/routing/ROUTING.md +145 -0
- package/docs/routing/routing.md +456 -0
- package/docs/security/RATE_LIMIT_EXCLUSIONS.md +85 -0
- package/docs/security/ROUTE_BASED_SECURITY.md +373 -0
- package/docs/security/SECURITY.md +285 -0
- package/docs/security/TRUST_PROXY.md +353 -0
- package/docs/security/WILDCARD_CORS.md +284 -0
- package/docs/security/access-control-middleware.md +366 -0
- package/docs/security/advanced-cors-regexp.md +612 -0
- package/docs/security/enhanced-csp-configuration.md +520 -0
- package/docs/security/request-signature-auth.md +456 -0
- package/docs/security/security-features-overview.md +483 -0
- package/docs/system/README.md +202 -0
- package/docs/system/complete-reference.md +563 -0
- package/docs/system/configuration.md +438 -0
- package/docs/system/cpu-monitoring.md +462 -0
- package/docs/system/directory-management.md +611 -0
- package/docs/system/disk-information.md +554 -0
- package/docs/system/environment.md +445 -0
- package/docs/system/file-io.md +676 -0
- package/docs/system/memory-management.md +549 -0
- package/docs/system/migration-v5-to-v6.md +507 -0
- package/docs/system/network-statistics.md +645 -0
- package/docs/system/path-operations.md +506 -0
- package/docs/system/process-management.md +483 -0
- package/docs/system/search-filter.md +562 -0
- package/docs/system/sys-globals.md +119 -0
- package/docs/system/watching-streaming.md +99 -0
- package/examples/plugin-api-examples.ts +139 -0
- package/examples/security-example.ts +121 -0
- package/examples/security-showcase.ts +334 -0
- package/examples/server/package.json +0 -0
- package/examples/server/src/index.ts +5 -0
- package/examples/simple-cluster-example.ts +95 -0
- package/examples/xjson-example.ts +288 -0
- package/index.html +261 -0
- package/mods/ACPES/.acpes/2720a0cba:nehonix.a0cba72125.enc +1 -0
- package/mods/ACPES/LICENSE +21 -0
- package/mods/ACPES/README.md +203 -0
- package/mods/ACPES/docs/README.md +62 -0
- package/mods/ACPES/docs/advanced-encryption.md +248 -0
- package/mods/ACPES/docs/api-reference.md +216 -0
- package/mods/ACPES/docs/architecture.md +188 -0
- package/mods/ACPES/docs/getting-started.md +182 -0
- package/mods/ACPES/docs/platform-support.md +265 -0
- package/mods/ACPES/docs/security.md +292 -0
- package/mods/ACPES/docs/troubleshooting.md +0 -0
- package/mods/ACPES/package-lock.json +76 -0
- package/mods/ACPES/package.json +177 -0
- package/mods/ACPES/rollup.config.js +244 -0
- package/mods/ACPES/src/components/advancedEncryption.ts +354 -0
- package/mods/ACPES/src/components/compression.ts +52 -0
- package/mods/ACPES/src/components/encryption.ts +147 -0
- package/mods/ACPES/src/components/fingerprint.ts +45 -0
- package/mods/ACPES/src/components/index.ts +11 -0
- package/mods/ACPES/src/components/keyRotation.ts +299 -0
- package/mods/ACPES/src/components/security.ts +232 -0
- package/mods/ACPES/src/core/index.ts +11 -0
- package/mods/ACPES/src/core/platform.ts +112 -0
- package/mods/ACPES/src/core/storage.ts +730 -0
- package/mods/ACPES/src/index.ts +113 -0
- package/mods/ACPES/src/platforms/fallback.ts +80 -0
- package/mods/ACPES/src/platforms/index.ts +10 -0
- package/mods/ACPES/src/platforms/mobile.ts +101 -0
- package/mods/ACPES/src/platforms/node.ts +175 -0
- package/mods/ACPES/src/platforms/web.ts +147 -0
- package/mods/ACPES/src/types/index.ts +11 -0
- package/mods/ACPES/src/types/keyRotation.t.ts +20 -0
- package/mods/ACPES/src/types/options.ts +42 -0
- package/mods/ACPES/src/types/platform.ts +28 -0
- package/mods/ACPES/src/types/security.ts +39 -0
- package/mods/ACPES/src/types/storage.ts +23 -0
- package/mods/ACPES/src/utils/constants.ts +45 -0
- package/mods/ACPES/src/utils/helpers.ts +18 -0
- package/mods/ACPES/src/utils/index.ts +36 -0
- package/mods/ACPES/src/utils/prompt.ts +89 -0
- package/mods/ACPES/src/utils/validation.ts +51 -0
- package/mods/ACPES/tsconfig.json +42 -0
- package/mods/ACPES/yarn.lock +23 -0
- package/mods/memory-manager/Cargo.lock +974 -0
- package/mods/memory-manager/Cargo.toml +41 -0
- package/mods/memory-manager/NOTE.txt +3 -0
- package/mods/memory-manager/src/allocation_tracker.rs +371 -0
- package/mods/memory-manager/src/error.rs +294 -0
- package/mods/memory-manager/src/ffi.rs +469 -0
- package/mods/memory-manager/src/garbage_collector.rs +401 -0
- package/mods/memory-manager/src/lib.rs +138 -0
- package/mods/memory-manager/src/memory_manager.rs +429 -0
- package/mods/memory-manager/src/memory_pool.rs +564 -0
- package/mods/memory-manager/src/types.rs +285 -0
- package/mods/memory-manager/src/utils.rs +374 -0
- package/mods/security/LICENSE +21 -0
- package/mods/security/README.md +311 -0
- package/mods/security/bun.lock +1490 -0
- package/mods/security/docs/PKCE_API_DOCUMENTATION.md +255 -0
- package/mods/security/docs/api-reference.md +412 -0
- package/mods/security/docs/environment-setup.md +88 -0
- package/mods/security/docs/security-guide.md +395 -0
- package/mods/security/package-lock.json +7586 -0
- package/mods/security/package.json +249 -0
- package/mods/security/rollup.config.js +243 -0
- package/mods/security/src/algorithms/hash-algorithms.ts +894 -0
- package/mods/security/src/algorithms/registry.ts +82 -0
- package/mods/security/src/components/attestation.ts +1380 -0
- package/mods/security/src/components/cache/FastLRU.ts +402 -0
- package/mods/security/src/components/cache/SCC.ts +665 -0
- package/mods/security/src/components/cache/UFSIMC.ts +1399 -0
- package/mods/security/src/components/cache/cacheSys.ts +775 -0
- package/mods/security/src/components/cache/cacheSys.utils.ts +121 -0
- package/mods/security/src/components/cache/config/cache.config.ts +40 -0
- package/mods/security/src/components/cache/index.ts +1127 -0
- package/mods/security/src/components/cache/types/UFSIMC.type.ts +43 -0
- package/mods/security/src/components/cache/types/cache.type.ts +162 -0
- package/mods/security/src/components/cache/useCache.ts +287 -0
- package/mods/security/src/components/canary-tokens.ts +457 -0
- package/mods/security/src/components/entropy-augmentation.ts +611 -0
- package/mods/security/src/components/fortified-function/UFA/ultra-fast-allocator.ts +407 -0
- package/mods/security/src/components/fortified-function/UFA/ultra-fast-cache.ts +645 -0
- package/mods/security/src/components/fortified-function/UFA/ultra-fast-engine.ts +745 -0
- package/mods/security/src/components/fortified-function/const/exec.const.ts +26 -0
- package/mods/security/src/components/fortified-function/core/fortified-config.ts +443 -0
- package/mods/security/src/components/fortified-function/core/fortified-core.ts.txt +1347 -0
- package/mods/security/src/components/fortified-function/core/fortified-function-core.ts +785 -0
- package/mods/security/src/components/fortified-function/core/fortified-logger.ts +330 -0
- package/mods/security/src/components/fortified-function/core/index.ts +27 -0
- package/mods/security/src/components/fortified-function/core/mods/api-manager.ts +254 -0
- package/mods/security/src/components/fortified-function/core/mods/cache-manager.ts +148 -0
- package/mods/security/src/components/fortified-function/core/mods/execution-context.ts +135 -0
- package/mods/security/src/components/fortified-function/core/mods/execution-engine.ts +186 -0
- package/mods/security/src/components/fortified-function/core/mods/execution-router.ts +136 -0
- package/mods/security/src/components/fortified-function/core/mods/index.ts +20 -0
- package/mods/security/src/components/fortified-function/core/mods/memory-manager.ts +184 -0
- package/mods/security/src/components/fortified-function/core/mods/security-manager.ts +123 -0
- package/mods/security/src/components/fortified-function/core/mods/stats-manager.ts +194 -0
- package/mods/security/src/components/fortified-function/core/mods/timing-manager.ts +150 -0
- package/mods/security/src/components/fortified-function/engines/analytics-engine.ts +502 -0
- package/mods/security/src/components/fortified-function/engines/execution-engine.ts +520 -0
- package/mods/security/src/components/fortified-function/engines/index.ts +13 -0
- package/mods/security/src/components/fortified-function/engines/optimization-engine.ts +626 -0
- package/mods/security/src/components/fortified-function/fortified-function.ts +273 -0
- package/mods/security/src/components/fortified-function/index.ts +234 -0
- package/mods/security/src/components/fortified-function/performance/index.ts +15 -0
- package/mods/security/src/components/fortified-function/performance/performance-monitor.ts +293 -0
- package/mods/security/src/components/fortified-function/performance/performance-timer.ts +239 -0
- package/mods/security/src/components/fortified-function/security/index.ts +8 -0
- package/mods/security/src/components/fortified-function/security/security-handler.ts +283 -0
- package/mods/security/src/components/fortified-function/serializer/safe-serializer.ts +454 -0
- package/mods/security/src/components/fortified-function/smart-cache.ts +781 -0
- package/mods/security/src/components/fortified-function/types/fortified-types.ts +322 -0
- package/mods/security/src/components/fortified-function/types/types.ts +412 -0
- package/mods/security/src/components/fortified-function/types/ufa.type.ts +9 -0
- package/mods/security/src/components/fortified-function/utils/index.ts +13 -0
- package/mods/security/src/components/fortified-function/utils/utils.ts +98 -0
- package/mods/security/src/components/index.ts +37 -0
- package/mods/security/src/components/memory-hard.ts +1300 -0
- package/mods/security/src/components/post-quantum.ts +1366 -0
- package/mods/security/src/components/runtime-verification.ts +867 -0
- package/mods/security/src/components/secure-array/core/secure-array-core.ts +2028 -0
- package/mods/security/src/components/secure-array/crypto/ArrayCryptoHandler.ts +401 -0
- package/mods/security/src/components/secure-array/events/event-manager.ts +372 -0
- package/mods/security/src/components/secure-array/index.ts +295 -0
- package/mods/security/src/components/secure-array/metadata/metadata-manager.ts +406 -0
- package/mods/security/src/components/secure-array/serialization/ArraySerializationHandler.ts +469 -0
- package/mods/security/src/components/secure-array/types/index.ts +327 -0
- package/mods/security/src/components/secure-array/utils/id-generator.ts +86 -0
- package/mods/security/src/components/secure-array/utils/validation.ts +350 -0
- package/mods/security/src/components/secure-memory.ts +1155 -0
- package/mods/security/src/components/secure-object/README.md +217 -0
- package/mods/security/src/components/secure-object/core/secure-object-core.ts +2051 -0
- package/mods/security/src/components/secure-object/encryption/crypto-handler.ts +447 -0
- package/mods/security/src/components/secure-object/encryption/sensitive-keys.ts +227 -0
- package/mods/security/src/components/secure-object/events/event-manager.ts +246 -0
- package/mods/security/src/components/secure-object/index.ts +151 -0
- package/mods/security/src/components/secure-object/metadata/metadata-manager.ts +217 -0
- package/mods/security/src/components/secure-object/serialization/serialization-handler.ts +244 -0
- package/mods/security/src/components/secure-object/types/index.ts +124 -0
- package/mods/security/src/components/secure-object/utils/id-generator.ts +66 -0
- package/mods/security/src/components/secure-object/utils/validation.ts +288 -0
- package/mods/security/src/components/secure-serialization.ts +1178 -0
- package/mods/security/src/components/secure-string/README.md +275 -0
- package/mods/security/src/components/secure-string/advanced/entropy-analyzer.ts +402 -0
- package/mods/security/src/components/secure-string/advanced/performance-monitor.ts +527 -0
- package/mods/security/src/components/secure-string/advanced/quantum-safe.ts +385 -0
- package/mods/security/src/components/secure-string/buffer/buffer-manager.ts +246 -0
- package/mods/security/src/components/secure-string/core/secure-string-core.ts +1105 -0
- package/mods/security/src/components/secure-string/crypto/crypto-operations.ts +452 -0
- package/mods/security/src/components/secure-string/index.ts +274 -0
- package/mods/security/src/components/secure-string/operations/comparison-operations.ts +266 -0
- package/mods/security/src/components/secure-string/operations/string-operations.ts +333 -0
- package/mods/security/src/components/secure-string/types/index.ts +250 -0
- package/mods/security/src/components/secure-string/validation/string-validator.ts +401 -0
- package/mods/security/src/components/side-channel.ts +299 -0
- package/mods/security/src/components/tamper-evident-logging.ts +517 -0
- package/mods/security/src/const/DEFAULT_CONSOLE_CONFIG.ts +83 -0
- package/mods/security/src/const/buffer.const.ts +11 -0
- package/mods/security/src/core/crypt.ts +52 -0
- package/mods/security/src/core/crypto.ts +1001 -0
- package/mods/security/src/core/hash/hash-advanced.ts +530 -0
- package/mods/security/src/core/hash/hash-core.ts +556 -0
- package/mods/security/src/core/hash/hash-entropy.ts +359 -0
- package/mods/security/src/core/hash/hash-security.ts +538 -0
- package/mods/security/src/core/hash/hash-types.ts +107 -0
- package/mods/security/src/core/hash/hash-utils.ts +345 -0
- package/mods/security/src/core/hash/hash-validator.ts +382 -0
- package/mods/security/src/core/hash/index.ts +27 -0
- package/mods/security/src/core/hash.ts +34 -0
- package/mods/security/src/core/index.ts +6 -0
- package/mods/security/src/core/keys/ARCHITECTURE +82 -0
- package/mods/security/src/core/keys/algorithms/index.ts +9 -0
- package/mods/security/src/core/keys/algorithms/mods/Argon2Algo.ts +192 -0
- package/mods/security/src/core/keys/algorithms/mods/PBKDF2Algo.ts +374 -0
- package/mods/security/src/core/keys/algorithms/mods/ScryptAlgo.ts +401 -0
- package/mods/security/src/core/keys/index.ts +90 -0
- package/mods/security/src/core/keys/keys-core.ts +279 -0
- package/mods/security/src/core/keys/keys-logger.ts +278 -0
- package/mods/security/src/core/keys/keys-types.ts +255 -0
- package/mods/security/src/core/keys/keys-utils.ts +391 -0
- package/mods/security/src/core/keys.ts +135 -0
- package/mods/security/src/core/password/ARCHITECTURE +9 -0
- package/mods/security/src/core/password/index.ts +329 -0
- package/mods/security/src/core/password/password-algorithms.ts +519 -0
- package/mods/security/src/core/password/password-core.ts +394 -0
- package/mods/security/src/core/password/password-generator.ts +515 -0
- package/mods/security/src/core/password/password-migration.ts +324 -0
- package/mods/security/src/core/password/password-security.ts +649 -0
- package/mods/security/src/core/password/password-types.ts +246 -0
- package/mods/security/src/core/password/password-utils.ts +816 -0
- package/mods/security/src/core/password/swlist.ts +1117 -0
- package/mods/security/src/core/random/ARCHITECTURE +10 -0
- package/mods/security/src/core/random/index.ts +37 -0
- package/mods/security/src/core/random/random-core.ts +1115 -0
- package/mods/security/src/core/random/random-crypto.ts +446 -0
- package/mods/security/src/core/random/random-entropy.ts +453 -0
- package/mods/security/src/core/random/random-generators.ts +445 -0
- package/mods/security/src/core/random/random-security.ts +542 -0
- package/mods/security/src/core/random/random-sources.ts +461 -0
- package/mods/security/src/core/random/random-tokens.ts +421 -0
- package/mods/security/src/core/random/random-types.ts +255 -0
- package/mods/security/src/core/random.ts +14 -0
- package/mods/security/src/core/validators.ts +251 -0
- package/mods/security/src/generators/rsaKeyCalculator.ts +772 -0
- package/mods/security/src/helpers/Uint8Array.ts +392 -0
- package/mods/security/src/helpers/createEnu.ts +30 -0
- package/mods/security/src/helpers/express.middleware.helper.ts +59 -0
- package/mods/security/src/index.ts +1719 -0
- package/mods/security/src/types/console.ts +83 -0
- package/mods/security/src/types/global.ts +129 -0
- package/mods/security/src/types/index.ts +6 -0
- package/mods/security/src/types/options.ts +270 -0
- package/mods/security/src/types/random.ts +77 -0
- package/mods/security/src/types/secure-mem.type.ts +141 -0
- package/mods/security/src/types/secure-memory.ts +28 -0
- package/mods/security/src/types/security.ts +164 -0
- package/mods/security/src/types/stats.ts +149 -0
- package/mods/security/src/types/string.ts +69 -0
- package/mods/security/src/types.ts +582 -0
- package/mods/security/src/utils/CryptoAlgorithmUtils.ts +90 -0
- package/mods/security/src/utils/browserPolyfills.ts +288 -0
- package/mods/security/src/utils/constants.ts +169 -0
- package/mods/security/src/utils/crypto.type.ts +12 -0
- package/mods/security/src/utils/crypto.utils.ts +479 -0
- package/mods/security/src/utils/dataConverter.ts +89 -0
- package/mods/security/src/utils/detectInjection.ts +60 -0
- package/mods/security/src/utils/enc.test.ts +12 -0
- package/mods/security/src/utils/encoding.ts +999 -0
- package/mods/security/src/utils/errorHandler.ts +389 -0
- package/mods/security/src/utils/index.ts +10 -0
- package/mods/security/src/utils/memory/config-manager.ts +375 -0
- package/mods/security/src/utils/memory/event-manager.ts +320 -0
- package/mods/security/src/utils/memory/index.ts +304 -0
- package/mods/security/src/utils/memory/memory-manager.ts +1106 -0
- package/mods/security/src/utils/memory/memory-pool.ts +427 -0
- package/mods/security/src/utils/memory/reference-tracker.ts +454 -0
- package/mods/security/src/utils/memory/types.ts +255 -0
- package/mods/security/src/utils/memory-manager-new.ts +286 -0
- package/mods/security/src/utils/nodeModules.ts +307 -0
- package/mods/security/src/utils/patterns.ts +389 -0
- package/mods/security/src/utils/performanceMonitor.ts +412 -0
- package/mods/security/src/utils/securityUtils.ts +385 -0
- package/mods/security/src/utils/stats.ts +206 -0
- package/mods/security/src/utils/testing.ts +264 -0
- package/mods/security/tsconfig.json +40 -0
- package/package.json +57 -211
- package/quickdev.config.json +35 -0
- package/rollup.config.js +301 -0
- package/scripts/xys.run.js +1 -1
- package/secureStorage.xems +4 -0
- package/shared/logger/Logger.ts +841 -0
- package/shared/logger/index.ts +2 -0
- package/shared/logger/v2/Logger.ts..back.txt +812 -0
- package/shared/types/index.ts +2 -0
- package/shared/types/logger.type.ts +96 -0
- package/simulations/.meta/+xypriss.meta.ts +4 -0
- package/simulations/goxfpm-test2/.quickdevignore +1 -0
- package/simulations/goxfpm-test2/README.md +236 -0
- package/simulations/goxfpm-test2/package-lock.json +7108 -0
- package/simulations/goxfpm-test2/package.json +27 -0
- package/simulations/goxfpm-test2/quickdev.config.json +34 -0
- package/simulations/goxfpm-test2/src/configs/host.conf.ts +83 -0
- package/simulations/goxfpm-test2/src/configs/xypriss.config.ts +284 -0
- package/simulations/goxfpm-test2/src/middleware/index.ts +40 -0
- package/simulations/goxfpm-test2/src/middleware/security.mlw.ts +29 -0
- package/simulations/goxfpm-test2/src/middleware/validation.middleware.ts +53 -0
- package/simulations/goxfpm-test2/src/routes/index.ts +142 -0
- package/simulations/goxfpm-test2/src/schema/user.schema.ts +53 -0
- package/simulations/goxfpm-test2/src/server.ts +68 -0
- package/simulations/goxfpm-test2/tsconfig.json +35 -0
- package/simulations/goxfpm-test2/xypriss.config.json +21 -0
- package/simulations/lxpm_pkg_simulation/.quickdevignore +1 -0
- package/simulations/lxpm_pkg_simulation/README.md +236 -0
- package/simulations/lxpm_pkg_simulation/lxpm_pkg_simulation/.quickdevignore +1 -0
- package/simulations/lxpm_pkg_simulation/lxpm_pkg_simulation/README.md +236 -0
- package/simulations/lxpm_pkg_simulation/lxpm_pkg_simulation/package-lock.json +7108 -0
- package/simulations/lxpm_pkg_simulation/lxpm_pkg_simulation/package.json +31 -0
- package/simulations/lxpm_pkg_simulation/lxpm_pkg_simulation/quickdev.config.json +34 -0
- package/simulations/lxpm_pkg_simulation/lxpm_pkg_simulation/src/configs/host.conf.ts +83 -0
- package/simulations/lxpm_pkg_simulation/lxpm_pkg_simulation/src/configs/xypriss.config.ts +286 -0
- package/simulations/lxpm_pkg_simulation/lxpm_pkg_simulation/src/middleware/index.ts +40 -0
- package/simulations/lxpm_pkg_simulation/lxpm_pkg_simulation/src/middleware/security.mlw.ts +29 -0
- package/simulations/lxpm_pkg_simulation/lxpm_pkg_simulation/src/middleware/validation.middleware.ts +53 -0
- package/simulations/lxpm_pkg_simulation/lxpm_pkg_simulation/src/routes/index.ts +97 -0
- package/simulations/lxpm_pkg_simulation/lxpm_pkg_simulation/src/schema/user.schema.ts +53 -0
- package/simulations/lxpm_pkg_simulation/lxpm_pkg_simulation/src/server.ts +64 -0
- package/simulations/lxpm_pkg_simulation/lxpm_pkg_simulation/tsconfig.json +35 -0
- package/simulations/lxpm_pkg_simulation/lxpm_pkg_simulation/xypriss.config.json +21 -0
- package/simulations/lxpm_pkg_simulation/package-lock.json +7108 -0
- package/simulations/lxpm_pkg_simulation/package.json +31 -0
- package/simulations/lxpm_pkg_simulation/quickdev.config.json +34 -0
- package/simulations/lxpm_pkg_simulation/src/configs/host.conf.ts +83 -0
- package/simulations/lxpm_pkg_simulation/src/configs/xypriss.config.ts +286 -0
- package/simulations/lxpm_pkg_simulation/src/middleware/index.ts +40 -0
- package/simulations/lxpm_pkg_simulation/src/middleware/security.mlw.ts +29 -0
- package/simulations/lxpm_pkg_simulation/src/middleware/validation.middleware.ts +53 -0
- package/simulations/lxpm_pkg_simulation/src/routes/index.ts +97 -0
- package/simulations/lxpm_pkg_simulation/src/schema/user.schema.ts +53 -0
- package/simulations/lxpm_pkg_simulation/src/server.ts +64 -0
- package/simulations/lxpm_pkg_simulation/tsconfig.json +35 -0
- package/simulations/lxpm_pkg_simulation/xypriss.config.json +21 -0
- package/simulations/pkg/.meta/+xypriss.meta.ts +6 -0
- package/simulations/pkg/bun.lock +815 -0
- package/simulations/pkg/package-lock.json +4895 -0
- package/simulations/pkg/package.json +25 -0
- package/simulations/pkg/src/index.ts +15 -0
- package/simulations/pkg/src/logger.ts +0 -0
- package/simulations/pkg/tsconfig.json +29 -0
- package/simulations/pkg/xypriss.config.json +13 -0
- package/simulations/server/.meta/+xypriss.meta.ts +6 -0
- package/simulations/server/.quickdevignore +1 -0
- package/simulations/server/README.md +238 -0
- package/simulations/server/bun.lock +1184 -0
- package/simulations/server/package-lock.json +4829 -0
- package/simulations/server/package.json +25 -0
- package/simulations/server/quickdev.config.json +34 -0
- package/simulations/server/src/configs/host.conf.ts +83 -0
- package/simulations/server/src/configs/xypriss.config.ts +48 -0
- package/simulations/server/src/middleware/index.ts +40 -0
- package/simulations/server/src/middleware/security.mlw.ts +29 -0
- package/simulations/server/src/middleware/validation.middleware.ts +53 -0
- package/simulations/server/src/routes/index.ts +97 -0
- package/simulations/server/src/schema/user.schema.ts +8 -0
- package/simulations/server/src/server.ts +67 -0
- package/simulations/server/test_res.js +3 -0
- package/simulations/server/tsconfig.json +32 -0
- package/simulations/server/xypriss.config.json +22 -0
- package/simulations/test-project-goxfpm/.config +37 -0
- package/simulations/test-project-goxfpm/.quickdevignore +1 -0
- package/simulations/test-project-goxfpm/README.md +236 -0
- package/simulations/test-project-goxfpm/package-lock.json +7108 -0
- package/simulations/test-project-goxfpm/package.json +9 -0
- package/simulations/test-project-goxfpm/quickdev.config.json +34 -0
- package/simulations/test-project-goxfpm/src/configs/host.conf.ts +83 -0
- package/simulations/test-project-goxfpm/src/configs/xypriss.config.ts +302 -0
- package/simulations/test-project-goxfpm/src/middleware/index.ts +40 -0
- package/simulations/test-project-goxfpm/src/middleware/security.mlw.ts +29 -0
- package/simulations/test-project-goxfpm/src/middleware/validation.middleware.ts +53 -0
- package/simulations/test-project-goxfpm/src/routes/index.ts +142 -0
- package/simulations/test-project-goxfpm/src/schema/user.schema.ts +53 -0
- package/simulations/test-project-goxfpm/src/server.ts +68 -0
- package/simulations/test-project-goxfpm/tsconfig.json +35 -0
- package/simulations/test-project-goxfpm/xypriss.config.json +12 -0
- package/simulations/unpacking-test2/.quickdevignore +1 -0
- package/simulations/unpacking-test2/README.md +236 -0
- package/simulations/unpacking-test2/package-lock.json +7108 -0
- package/simulations/unpacking-test2/package.json +31 -0
- package/simulations/unpacking-test2/quickdev.config.json +34 -0
- package/simulations/unpacking-test2/src/configs/host.conf.ts +83 -0
- package/simulations/unpacking-test2/src/configs/xypriss.config.ts +286 -0
- package/simulations/unpacking-test2/src/middleware/index.ts +40 -0
- package/simulations/unpacking-test2/src/middleware/security.mlw.ts +29 -0
- package/simulations/unpacking-test2/src/middleware/validation.middleware.ts +53 -0
- package/simulations/unpacking-test2/src/routes/index.ts +97 -0
- package/simulations/unpacking-test2/src/schema/user.schema.ts +53 -0
- package/simulations/unpacking-test2/src/server.ts +64 -0
- package/simulations/unpacking-test2/tsconfig.json +35 -0
- package/simulations/unpacking-test2/xypriss.config.json +21 -0
- package/simulations/xems-realworld-testing/README.md +73 -0
- package/simulations/xems-realworld-testing/eslint.config.js +23 -0
- package/simulations/xems-realworld-testing/index.html +13 -0
- package/simulations/xems-realworld-testing/package.json +32 -0
- package/simulations/xems-realworld-testing/public/vite.svg +1 -0
- package/simulations/xems-realworld-testing/src/App.css +42 -0
- package/simulations/xems-realworld-testing/src/App.tsx +56 -0
- package/simulations/xems-realworld-testing/src/api.ts +104 -0
- package/simulations/xems-realworld-testing/src/components/Dashboard.tsx +219 -0
- package/simulations/xems-realworld-testing/src/components/LoginForm.tsx +155 -0
- package/simulations/xems-realworld-testing/src/components/RegisterForm.tsx +171 -0
- package/simulations/xems-realworld-testing/src/index.css +2 -0
- package/simulations/xems-realworld-testing/src/main.tsx +10 -0
- package/simulations/xems-realworld-testing/tsconfig.app.json +28 -0
- package/simulations/xems-realworld-testing/tsconfig.json +7 -0
- package/simulations/xems-realworld-testing/tsconfig.node.json +26 -0
- package/simulations/xems-realworld-testing/vite.config.ts +9 -0
- package/simulations/xems-server-test/.quickdevignore +1 -0
- package/simulations/xems-server-test/README.md +236 -0
- package/simulations/xems-server-test/package-lock.json +7108 -0
- package/simulations/xems-server-test/package.json +30 -0
- package/simulations/xems-server-test/quickdev.config.json +34 -0
- package/simulations/xems-server-test/src/configs/host.conf.ts +83 -0
- package/simulations/xems-server-test/src/configs/xypriss.config.ts +286 -0
- package/simulations/xems-server-test/src/middleware/index.ts +40 -0
- package/simulations/xems-server-test/src/middleware/security.mlw.ts +29 -0
- package/simulations/xems-server-test/src/middleware/validation.middleware.ts +53 -0
- package/simulations/xems-server-test/src/routes/index.ts +97 -0
- package/simulations/xems-server-test/src/schema/user.schema.ts +53 -0
- package/simulations/xems-server-test/src/server.ts +64 -0
- package/simulations/xems-server-test/tsconfig.json +35 -0
- package/simulations/xems-server-test/xypriss.config.json +21 -0
- package/src/FiUp.ts +102 -0
- package/src/cache/CacheFactory.ts +850 -0
- package/src/cache/SecureCacheAdapter.ts +1495 -0
- package/src/cache/cache-engine.ts +586 -0
- package/src/cache/index.ts +28 -0
- package/src/cache/type.ts +141 -0
- package/src/config.ts +455 -0
- package/src/const.ts +730 -0
- package/src/encryption/EncryptionService.ts +597 -0
- package/src/encryption/index.ts +36 -0
- package/src/file-upload.ts +288 -0
- package/src/index.ts +183 -0
- package/src/middleware/XJsonResponseHandler.ts +210 -0
- package/src/middleware/XemsSessionMiddleware.ts +125 -0
- package/src/middleware/XyPrissMiddlewareAPI.ts +518 -0
- package/src/middleware/built-in/BuiltInMiddleware.ts +567 -0
- package/src/middleware/built-in/security/BrowserOnlyProtector.ts +702 -0
- package/src/middleware/built-in/security/CommandInjectionDetector.ts +265 -0
- package/src/middleware/built-in/security/LDAPInjectionDetector.ts +113 -0
- package/src/middleware/built-in/security/MobileOnlyProtector.ts +664 -0
- package/src/middleware/built-in/security/PathTraversalDetector.ts +265 -0
- package/src/middleware/built-in/security/README.md +208 -0
- package/src/middleware/built-in/security/RequestSignatureProtector.ts +626 -0
- package/src/middleware/built-in/security/SQLInjectionDetector.ts +434 -0
- package/src/middleware/built-in/security/TerminalOnlyProtector.ts +624 -0
- package/src/middleware/built-in/security/XXEProtector.ts +212 -0
- package/src/middleware/built-in/security/index.ts +26 -0
- package/src/middleware/built-in/security/types.ts +175 -0
- package/src/middleware/safe-json-middleware.ts +236 -0
- package/src/middleware/security-middleware.ts +1541 -0
- package/src/plugins/PluginManager.ts +487 -0
- package/src/plugins/README.md +25 -0
- package/src/plugins/api/PluginAPI.ts +220 -0
- package/src/plugins/const/PluginHookIds.ts +76 -0
- package/src/plugins/core/PluginManager.ts +977 -0
- package/src/plugins/modules/PluginEngine.ts +676 -0
- package/src/plugins/modules/PluginRegistry.ts +419 -0
- package/src/plugins/modules/PluginRegistry.ts.bak +408 -0
- package/src/plugins/modules/builtin/SmartCachePlugin.ts +1082 -0
- package/src/plugins/modules/builtin/server-maintenance-plugin.ts +698 -0
- package/src/plugins/modules/core/CachePlugin.ts +2523 -0
- package/src/plugins/modules/index.ts +48 -0
- package/src/plugins/modules/network/builtin/CompressionPlugin.ts +343 -0
- package/src/plugins/modules/network/builtin/ConnectionPlugin.ts +941 -0
- package/src/plugins/modules/network/builtin/ProxyPlugin.ts +522 -0
- package/src/plugins/modules/network/core/NetworkPlugin.ts +323 -0
- package/src/plugins/modules/network/core/NetworkPluginFactory.ts +47 -0
- package/src/plugins/modules/network/index.ts +28 -0
- package/src/plugins/modules/network/types/NetworkTypes.ts +331 -0
- package/src/plugins/modules/network/types/cnp.type.ts +17 -0
- package/src/plugins/modules/network/utils/NetworkPluginUtils.ts +69 -0
- package/src/plugins/modules/types/PluginTypes.ts +277 -0
- package/src/plugins/modules/xems/XemsBuiltinPlugin.ts +291 -0
- package/src/plugins/modules/xems/XemsPlugin.ts +484 -0
- package/src/plugins/modules/xems/index.ts +2 -0
- package/src/plugins/plugin-manager.ts +188 -0
- package/src/plugins/route-optimization-plugin.ts +559 -0
- package/src/plugins/types/PluginTypes.ts +187 -0
- package/src/plugins/types/index.ts +84 -0
- package/src/quick-start.ts +41 -0
- package/src/schemas/plugingSchema.ts +42 -0
- package/src/server/FastServer.ts +1196 -0
- package/src/server/ServerFactory.ts +105 -0
- package/src/server/components/fastapi/CacheManager.ts +292 -0
- package/src/server/components/fastapi/FileUploadManager.ts +289 -0
- package/src/server/components/fastapi/FileWatcherManager.ts +646 -0
- package/src/server/components/fastapi/MonitoringManager.ts +375 -0
- package/src/server/components/fastapi/PerformanceManager.ts +382 -0
- package/src/server/components/fastapi/RedirectManager.ts +730 -0
- package/src/server/components/fastapi/RequestProcessor.ts +404 -0
- package/src/server/components/fastapi/RouteManager.ts +250 -0
- package/src/server/components/fastapi/WorkerPoolComponent.ts +114 -0
- package/src/server/components/fastapi/console/ConsoleInterceptor.ts +1202 -0
- package/src/server/components/fastapi/console/encryption/ConsoleEncryption.ts +299 -0
- package/src/server/components/fastapi/console/types.ts +318 -0
- package/src/server/components/fastapi/smart-routes.ts +485 -0
- package/src/server/components/fastapi/templates/redirectHtml.html +863 -0
- package/src/server/components/fastapi/templates/redirectTemp.ts +105 -0
- package/src/server/components/fastapi/typescript/TypeScriptChecker.ts +502 -0
- package/src/server/components/lifecycle/slcm.type.ts +45 -0
- package/src/server/components/multi-server/MultiServerApp.ts +667 -0
- package/src/server/components/multi-server/MultiServerManager.ts +451 -0
- package/src/server/conf/networkConnectionConf.ts +26 -0
- package/src/server/conf/proxyConfig.ts +21 -0
- package/src/server/conf/rateLimitConfig.ts +57 -0
- package/src/server/const/ExecutionPredictor_EP.const.ts +88 -0
- package/src/server/const/FileWatcher.config.ts +97 -0
- package/src/server/const/default.ts +366 -0
- package/src/server/const/http.ts +32 -0
- package/src/server/core/HttpServer.ts +574 -0
- package/src/server/core/RequestApp.ts +106 -0
- package/src/server/core/RequestEnhancer.ts +348 -0
- package/src/server/core/ResponseEnhancer.ts +588 -0
- package/src/server/core/StartupProcessor.ts +168 -0
- package/src/server/core/VirtualServer.ts +32 -0
- package/src/server/core/XHSCBridge.ts +779 -0
- package/src/server/core/XHSCProtocol.ts +389 -0
- package/src/server/core/XyDiagnosticsManager.ts +88 -0
- package/src/server/core/XyLifecycleManager.ts +348 -0
- package/src/server/core/XyModuleManager.ts +195 -0
- package/src/server/core/XyRoutingManager.ts +251 -0
- package/src/server/core/XyServerCreator.ts +117 -0
- package/src/server/core/XyprissApp.ts +758 -0
- package/src/server/core/request/XyRequestManager.ts +288 -0
- package/src/server/handlers/NotFoundHandler.ts +99 -0
- package/src/server/handlers/templates/notFoundTemplate.ts +662 -0
- package/src/server/middleware/MiddlewareManager.ts +296 -0
- package/src/server/optimization/ExecutionPredictor.nxs +0 -0
- package/src/server/optimization/ExecutionPredictor.ts +274 -0
- package/src/server/optimization/PerformanceProfiler.ts +318 -0
- package/src/server/optimization/RequestPreCompiler.ts +928 -0
- package/src/server/optimization/UltraFastOptimizer.ts +545 -0
- package/src/server/optimization/performance-monitor.ts +241 -0
- package/src/server/routing/Router.ts +506 -0
- package/src/server/routing/index.ts +14 -0
- package/src/server/service/Reload/FileWatcher.ts +982 -0
- package/src/server/service/Reload/HotReloader.ts +1050 -0
- package/src/server/service/Reload/exec/ExecutableBuilder.ts +419 -0
- package/src/server/service/Reload/exec/TypeScriptExecutor.ts +439 -0
- package/src/server/service/Reload/exec/build-executable.ts +50 -0
- package/src/server/service/Reload/types/TSExecutor.type.ts +18 -0
- package/src/server/service/Reload/types/fw.types.ts +117 -0
- package/src/server/service/Reload/types/hotreloader.ts +29 -0
- package/src/server/service/Reload/types/quickdev.type.ts +30 -0
- package/src/server/utils/ConfigLoader.ts +437 -0
- package/src/server/utils/PortManager.ts +316 -0
- package/src/server/utils/WorkerModeHandler.ts +72 -0
- package/src/server/utils/es_modules.ts +6 -0
- package/src/server/utils/forceClosePort.ts +427 -0
- package/src/server/utils/shouldRegisterRouteOnServer.ts +39 -0
- package/src/server/utils/trustProxy.ts +1005 -0
- package/src/server/utils/wildcardMatcher.ts +281 -0
- package/src/sys/FSApi.ts +1271 -0
- package/src/sys/PathApi.ts +209 -0
- package/src/sys/SysApi.ts +490 -0
- package/src/sys/System.ts +36 -0
- package/src/sys/XyPrissCache.ts +84 -0
- package/src/sys/XyPrissRunner.ts +299 -0
- package/src/sys/cmdr.ts +9 -0
- package/src/sys/types.ts +250 -0
- package/src/sys.ts +473 -0
- package/src/types/CpuMon.t.ts +46 -0
- package/src/types/ExecutionPredictor.type.ts +26 -0
- package/src/types/FiUp.type.ts +90 -0
- package/src/types/NotFoundConfig.ts +114 -0
- package/src/types/README.md +277 -0
- package/src/types/ReqPreCompiler.type.ts +55 -0
- package/src/types/UFOptimizer.type.ts +49 -0
- package/src/types/XyPrissRouter.types.ts +27 -0
- package/src/types/bun_cluster.t.ts +42 -0
- package/src/types/cluster.ipc.t.ts +198 -0
- package/src/types/components/CacheManager.type.ts +8 -0
- package/src/types/components/FWM.type.ts +10 -0
- package/src/types/components/MonitoringM.type.ts +13 -0
- package/src/types/components/PerfomanceMonitory.type.ts +13 -0
- package/src/types/components/PlugingM.type.ts +9 -0
- package/src/types/components/ReqProcessor.type.ts +14 -0
- package/src/types/components/RouteM.type.ts +12 -0
- package/src/types/httpServer.type.ts +154 -0
- package/src/types/index.ts +280 -0
- package/src/types/middleware-api.types.ts +220 -0
- package/src/types/middlewareManager.types.ts +20 -0
- package/src/types/mod/cache.ts +491 -0
- package/src/types/mod/core.ts +426 -0
- package/src/types/mod/monitoring.ts +544 -0
- package/src/types/mod/performance.ts +470 -0
- package/src/types/mod/routing.ts +454 -0
- package/src/types/mod/security.ts +1622 -0
- package/src/types/perfomance.ts +58 -0
- package/src/types/trustProxy.ts +148 -0
- package/src/types/types.ts +2189 -0
- package/src/types/xems.type.ts +89 -0
- package/src/utils/DotEnvLoader.ts +84 -0
- package/src/utils/mergeWithDefaults.ts +223 -0
- package/src/xhs/cluster/XHSCWorker.ts +238 -0
- package/tools/memory-cli/build.sh +36 -0
- package/tools/memory-cli/main.go +401 -0
- package/tools/xfpm-go/LICENSE +13 -0
- package/tools/xfpm-go/README.md +82 -0
- package/tools/xfpm-go/build.sh +91 -0
- package/tools/xfpm-go/cmd/xfpm/exec.go +68 -0
- package/tools/xfpm-go/cmd/xfpm/init.go +491 -0
- package/tools/xfpm-go/cmd/xfpm/list.go +287 -0
- package/tools/xfpm-go/cmd/xfpm/main.go +304 -0
- package/tools/xfpm-go/cmd/xfpm/run.go +107 -0
- package/tools/xfpm-go/cmd/xfpm/uninstall.go +233 -0
- package/tools/xfpm-go/cmd/xfpm/update.go +36 -0
- package/tools/xfpm-go/dev.sh +1 -0
- package/tools/xfpm-go/go.mod +46 -0
- package/tools/xfpm-go/go.sum +173 -0
- package/tools/xfpm-go/internal/core/cas.go +297 -0
- package/tools/xfpm-go/internal/core/config.go +83 -0
- package/tools/xfpm-go/internal/core/extractor.go +54 -0
- package/tools/xfpm-go/internal/core/installer.go +505 -0
- package/tools/xfpm-go/internal/core/project.go +53 -0
- package/tools/xfpm-go/internal/core/registry.go +303 -0
- package/tools/xfpm-go/internal/core/resolver.go +471 -0
- package/tools/xfpm-go/internal/core/script_runner.go +175 -0
- package/tools/xfpm-go/internal/utils/lib_version.go +5 -0
- package/tools/xfpm-go/internal/utils/logger.go +145 -0
- package/tools/xfpm-go/internal/utils/updater.go +131 -0
- package/tools/xfpm-go/pkg/npm/README.md +39 -0
- package/tools/xfpm-go/pkg/npm/install.js +51 -0
- package/tools/xfpm-go/pkg/npm/package.json +29 -0
- package/tools/xfpm-go/scripts/bridge.js +130 -0
- package/tools/xfpm-go/scripts/install.js +146 -0
- package/tools/xfpm-go/scripts/install.ps1 +140 -0
- package/tools/xfpm-go/scripts/install.sh +117 -0
- package/tools/xfpm-go/test/package/LICENSE +21 -0
- package/tools/xfpm-go/test/package/README.md +218 -0
- package/tools/xfpm-go/test/package/package.json +115 -0
- package/tools/xfpm-go/test.tgz +0 -0
- package/tools/xfpm-go/utils/helper_5936.ts +9 -0
- package/tools/xfpm-go/version.json +10 -0
- package/tools/xfpm-go/xfpm +0 -0
- package/tools/xyp/.intentionally-empty-file.o +0 -0
- package/tools/xyp/Cargo.lock +2602 -0
- package/tools/xyp/Cargo.toml +56 -0
- package/tools/xyp/README.md +78 -0
- package/tools/xyp/dev +3 -0
- package/tools/xyp/index.js +75 -0
- package/tools/xyp/install.js +286 -0
- package/tools/xyp/package copy.json +64 -0
- package/tools/xyp/package.json +65 -0
- package/tools/xyp/scripts/build.js +123 -0
- package/tools/xyp/scripts/build.sh +85 -0
- package/tools/xyp/src/commands/exec.rs +113 -0
- package/tools/xyp/src/commands/init.rs +378 -0
- package/tools/xyp/src/commands/install.rs +387 -0
- package/tools/xyp/src/commands/list.rs +62 -0
- package/tools/xyp/src/commands/mod.rs +7 -0
- package/tools/xyp/src/commands/run.rs +98 -0
- package/tools/xyp/src/commands/start.rs +18 -0
- package/tools/xyp/src/commands/uninstall.rs +156 -0
- package/tools/xyp/src/core/cas.rs +250 -0
- package/tools/xyp/src/core/config.rs +87 -0
- package/tools/xyp/src/core/extractor.rs +85 -0
- package/tools/xyp/src/core/installer.rs +683 -0
- package/tools/xyp/src/core/mod.rs +7 -0
- package/tools/xyp/src/core/registry.rs +333 -0
- package/tools/xyp/src/core/resolver.rs +830 -0
- package/tools/xyp/src/core/script_runner.rs +291 -0
- package/tools/xyp/src/main.rs +264 -0
- package/tools/xyp/src/utils/mod.rs +1 -0
- package/tools/xyp/src/utils/shell.rs +89 -0
- package/tools/xyp/xfpm +0 -0
- package/tools/xypriss-sys-go/README.md +47 -0
- package/tools/xypriss-sys-go/build.sh +139 -0
- package/tools/xypriss-sys-go/cmd/xsys/main.go +44 -0
- package/tools/xypriss-sys-go/go.mod +35 -0
- package/tools/xypriss-sys-go/go.sum +80 -0
- package/tools/xypriss-sys-go/internal/cli/archive.go +142 -0
- package/tools/xypriss-sys-go/internal/cli/fs.go +462 -0
- package/tools/xypriss-sys-go/internal/cli/monitor.go +110 -0
- package/tools/xypriss-sys-go/internal/cli/path.go +166 -0
- package/tools/xypriss-sys-go/internal/cli/root.go +140 -0
- package/tools/xypriss-sys-go/internal/cli/search.go +156 -0
- package/tools/xypriss-sys-go/internal/cli/server.go +240 -0
- package/tools/xypriss-sys-go/internal/cli/sys.go +321 -0
- package/tools/xypriss-sys-go/internal/cluster/intelligence.go +159 -0
- package/tools/xypriss-sys-go/internal/cluster/intelligence_unix.go +50 -0
- package/tools/xypriss-sys-go/internal/cluster/intelligence_windows.go +39 -0
- package/tools/xypriss-sys-go/internal/cluster/manager.go +226 -0
- package/tools/xypriss-sys-go/internal/cluster/strategy.go +41 -0
- package/tools/xypriss-sys-go/internal/cluster/worker.go +343 -0
- package/tools/xypriss-sys-go/internal/cluster/worker_unix.go +45 -0
- package/tools/xypriss-sys-go/internal/cluster/worker_windows.go +32 -0
- package/tools/xypriss-sys-go/internal/fs/fs.go +783 -0
- package/tools/xypriss-sys-go/internal/handlers/archive.go +68 -0
- package/tools/xypriss-sys-go/internal/handlers/fs.go +153 -0
- package/tools/xypriss-sys-go/internal/handlers/monitor.go +54 -0
- package/tools/xypriss-sys-go/internal/handlers/path.go +79 -0
- package/tools/xypriss-sys-go/internal/handlers/search.go +60 -0
- package/tools/xypriss-sys-go/internal/handlers/sys.go +110 -0
- package/tools/xypriss-sys-go/internal/ipc/bridge.go +352 -0
- package/tools/xypriss-sys-go/internal/ipc/circuit_breaker.go +93 -0
- package/tools/xypriss-sys-go/internal/ipc/metrics.go +85 -0
- package/tools/xypriss-sys-go/internal/ipc/types.go +102 -0
- package/tools/xypriss-sys-go/internal/proxy/proxy.go +538 -0
- package/tools/xypriss-sys-go/internal/router/router.go +332 -0
- package/tools/xypriss-sys-go/internal/server/server.go +658 -0
- package/tools/xypriss-sys-go/internal/sys/sys.go +432 -0
- package/tools/xypriss-sys-go/internal/sys/types.go +167 -0
- package/tools/xypriss-sys-go/internal/watcher/watcher.go +104 -0
- package/tsconfig.json +51 -0
- package/vault.xems +1 -0
- package/xfpm +0 -0
- package/xypriss.config.jsonc +22 -0
- package/dist/cjs/index.js +0 -2
- package/dist/cjs/mods/security/src/algorithms/hash-algorithms.js +0 -718
- package/dist/cjs/mods/security/src/algorithms/hash-algorithms.js.map +0 -1
- package/dist/cjs/mods/security/src/algorithms/registry.js +0 -83
- package/dist/cjs/mods/security/src/algorithms/registry.js.map +0 -1
- package/dist/cjs/mods/security/src/components/attestation.js +0 -1065
- package/dist/cjs/mods/security/src/components/attestation.js.map +0 -1
- package/dist/cjs/mods/security/src/components/cache/FastLRU.js +0 -323
- package/dist/cjs/mods/security/src/components/cache/FastLRU.js.map +0 -1
- package/dist/cjs/mods/security/src/components/cache/UFSIMC.js +0 -1133
- package/dist/cjs/mods/security/src/components/cache/UFSIMC.js.map +0 -1
- package/dist/cjs/mods/security/src/components/cache/cacheSys.js +0 -624
- package/dist/cjs/mods/security/src/components/cache/cacheSys.js.map +0 -1
- package/dist/cjs/mods/security/src/components/cache/cacheSys.utils.js +0 -127
- package/dist/cjs/mods/security/src/components/cache/cacheSys.utils.js.map +0 -1
- package/dist/cjs/mods/security/src/components/cache/config/cache.config.js +0 -39
- package/dist/cjs/mods/security/src/components/cache/config/cache.config.js.map +0 -1
- package/dist/cjs/mods/security/src/components/cache/index.js +0 -374
- package/dist/cjs/mods/security/src/components/cache/index.js.map +0 -1
- package/dist/cjs/mods/security/src/components/cache/useCache.js +0 -235
- package/dist/cjs/mods/security/src/components/cache/useCache.js.map +0 -1
- package/dist/cjs/mods/security/src/components/canary-tokens.js +0 -351
- package/dist/cjs/mods/security/src/components/canary-tokens.js.map +0 -1
- package/dist/cjs/mods/security/src/components/entropy-augmentation.js +0 -478
- package/dist/cjs/mods/security/src/components/entropy-augmentation.js.map +0 -1
- package/dist/cjs/mods/security/src/components/fortified-function/UFA/ultra-fast-allocator.js +0 -338
- package/dist/cjs/mods/security/src/components/fortified-function/UFA/ultra-fast-allocator.js.map +0 -1
- package/dist/cjs/mods/security/src/components/fortified-function/UFA/ultra-fast-cache.js +0 -536
- package/dist/cjs/mods/security/src/components/fortified-function/UFA/ultra-fast-cache.js.map +0 -1
- package/dist/cjs/mods/security/src/components/fortified-function/UFA/ultra-fast-engine.js +0 -614
- package/dist/cjs/mods/security/src/components/fortified-function/UFA/ultra-fast-engine.js.map +0 -1
- package/dist/cjs/mods/security/src/components/fortified-function/const/exec.const.js +0 -18
- package/dist/cjs/mods/security/src/components/fortified-function/const/exec.const.js.map +0 -1
- package/dist/cjs/mods/security/src/components/fortified-function/core/fortified-config.js +0 -356
- package/dist/cjs/mods/security/src/components/fortified-function/core/fortified-config.js.map +0 -1
- package/dist/cjs/mods/security/src/components/fortified-function/core/fortified-function-core.js +0 -520
- package/dist/cjs/mods/security/src/components/fortified-function/core/fortified-function-core.js.map +0 -1
- package/dist/cjs/mods/security/src/components/fortified-function/core/fortified-logger.js +0 -246
- package/dist/cjs/mods/security/src/components/fortified-function/core/fortified-logger.js.map +0 -1
- package/dist/cjs/mods/security/src/components/fortified-function/core/mods/api-manager.js +0 -189
- package/dist/cjs/mods/security/src/components/fortified-function/core/mods/api-manager.js.map +0 -1
- package/dist/cjs/mods/security/src/components/fortified-function/core/mods/cache-manager.js +0 -107
- package/dist/cjs/mods/security/src/components/fortified-function/core/mods/cache-manager.js.map +0 -1
- package/dist/cjs/mods/security/src/components/fortified-function/core/mods/execution-context.js +0 -105
- package/dist/cjs/mods/security/src/components/fortified-function/core/mods/execution-context.js.map +0 -1
- package/dist/cjs/mods/security/src/components/fortified-function/core/mods/execution-engine.js +0 -127
- package/dist/cjs/mods/security/src/components/fortified-function/core/mods/execution-engine.js.map +0 -1
- package/dist/cjs/mods/security/src/components/fortified-function/core/mods/execution-router.js +0 -93
- package/dist/cjs/mods/security/src/components/fortified-function/core/mods/execution-router.js.map +0 -1
- package/dist/cjs/mods/security/src/components/fortified-function/core/mods/memory-manager.js +0 -147
- package/dist/cjs/mods/security/src/components/fortified-function/core/mods/memory-manager.js.map +0 -1
- package/dist/cjs/mods/security/src/components/fortified-function/core/mods/security-manager.js +0 -102
- package/dist/cjs/mods/security/src/components/fortified-function/core/mods/security-manager.js.map +0 -1
- package/dist/cjs/mods/security/src/components/fortified-function/core/mods/stats-manager.js +0 -159
- package/dist/cjs/mods/security/src/components/fortified-function/core/mods/stats-manager.js.map +0 -1
- package/dist/cjs/mods/security/src/components/fortified-function/core/mods/timing-manager.js +0 -125
- package/dist/cjs/mods/security/src/components/fortified-function/core/mods/timing-manager.js.map +0 -1
- package/dist/cjs/mods/security/src/components/fortified-function/engines/analytics-engine.js +0 -370
- package/dist/cjs/mods/security/src/components/fortified-function/engines/analytics-engine.js.map +0 -1
- package/dist/cjs/mods/security/src/components/fortified-function/engines/execution-engine.js +0 -402
- package/dist/cjs/mods/security/src/components/fortified-function/engines/execution-engine.js.map +0 -1
- package/dist/cjs/mods/security/src/components/fortified-function/index.js +0 -174
- package/dist/cjs/mods/security/src/components/fortified-function/index.js.map +0 -1
- package/dist/cjs/mods/security/src/components/fortified-function/performance/performance-monitor.js +0 -240
- package/dist/cjs/mods/security/src/components/fortified-function/performance/performance-monitor.js.map +0 -1
- package/dist/cjs/mods/security/src/components/fortified-function/performance/performance-timer.js +0 -188
- package/dist/cjs/mods/security/src/components/fortified-function/performance/performance-timer.js.map +0 -1
- package/dist/cjs/mods/security/src/components/fortified-function/security/security-handler.js +0 -254
- package/dist/cjs/mods/security/src/components/fortified-function/security/security-handler.js.map +0 -1
- package/dist/cjs/mods/security/src/components/fortified-function/serializer/safe-serializer.js +0 -350
- package/dist/cjs/mods/security/src/components/fortified-function/serializer/safe-serializer.js.map +0 -1
- package/dist/cjs/mods/security/src/components/fortified-function/smart-cache.js +0 -693
- package/dist/cjs/mods/security/src/components/fortified-function/smart-cache.js.map +0 -1
- package/dist/cjs/mods/security/src/components/fortified-function/types/types.js +0 -16
- package/dist/cjs/mods/security/src/components/fortified-function/types/types.js.map +0 -1
- package/dist/cjs/mods/security/src/components/fortified-function/utils/utils.js +0 -76
- package/dist/cjs/mods/security/src/components/fortified-function/utils/utils.js.map +0 -1
- package/dist/cjs/mods/security/src/components/memory-hard.js +0 -922
- package/dist/cjs/mods/security/src/components/memory-hard.js.map +0 -1
- package/dist/cjs/mods/security/src/components/post-quantum.js +0 -323
- package/dist/cjs/mods/security/src/components/post-quantum.js.map +0 -1
- package/dist/cjs/mods/security/src/components/runtime-verification.js +0 -645
- package/dist/cjs/mods/security/src/components/runtime-verification.js.map +0 -1
- package/dist/cjs/mods/security/src/components/secure-array/core/secure-array-core.js +0 -1572
- package/dist/cjs/mods/security/src/components/secure-array/core/secure-array-core.js.map +0 -1
- package/dist/cjs/mods/security/src/components/secure-array/crypto/ArrayCryptoHandler.js +0 -330
- package/dist/cjs/mods/security/src/components/secure-array/crypto/ArrayCryptoHandler.js.map +0 -1
- package/dist/cjs/mods/security/src/components/secure-array/events/event-manager.js +0 -270
- package/dist/cjs/mods/security/src/components/secure-array/events/event-manager.js.map +0 -1
- package/dist/cjs/mods/security/src/components/secure-array/index.js +0 -66
- package/dist/cjs/mods/security/src/components/secure-array/index.js.map +0 -1
- package/dist/cjs/mods/security/src/components/secure-array/metadata/metadata-manager.js +0 -331
- package/dist/cjs/mods/security/src/components/secure-array/metadata/metadata-manager.js.map +0 -1
- package/dist/cjs/mods/security/src/components/secure-array/serialization/ArraySerializationHandler.js +0 -390
- package/dist/cjs/mods/security/src/components/secure-array/serialization/ArraySerializationHandler.js.map +0 -1
- package/dist/cjs/mods/security/src/components/secure-array/types/index.js +0 -87
- package/dist/cjs/mods/security/src/components/secure-array/types/index.js.map +0 -1
- package/dist/cjs/mods/security/src/components/secure-array/utils/id-generator.js +0 -80
- package/dist/cjs/mods/security/src/components/secure-array/utils/id-generator.js.map +0 -1
- package/dist/cjs/mods/security/src/components/secure-array/utils/validation.js +0 -275
- package/dist/cjs/mods/security/src/components/secure-array/utils/validation.js.map +0 -1
- package/dist/cjs/mods/security/src/components/secure-memory.js +0 -906
- package/dist/cjs/mods/security/src/components/secure-memory.js.map +0 -1
- package/dist/cjs/mods/security/src/components/secure-object/core/secure-object-core.js +0 -1605
- package/dist/cjs/mods/security/src/components/secure-object/core/secure-object-core.js.map +0 -1
- package/dist/cjs/mods/security/src/components/secure-object/encryption/crypto-handler.js +0 -362
- package/dist/cjs/mods/security/src/components/secure-object/encryption/crypto-handler.js.map +0 -1
- package/dist/cjs/mods/security/src/components/secure-object/encryption/sensitive-keys.js +0 -206
- package/dist/cjs/mods/security/src/components/secure-object/encryption/sensitive-keys.js.map +0 -1
- package/dist/cjs/mods/security/src/components/secure-object/events/event-manager.js +0 -197
- package/dist/cjs/mods/security/src/components/secure-object/events/event-manager.js.map +0 -1
- package/dist/cjs/mods/security/src/components/secure-object/index.js +0 -67
- package/dist/cjs/mods/security/src/components/secure-object/index.js.map +0 -1
- package/dist/cjs/mods/security/src/components/secure-object/metadata/metadata-manager.js +0 -183
- package/dist/cjs/mods/security/src/components/secure-object/metadata/metadata-manager.js.map +0 -1
- package/dist/cjs/mods/security/src/components/secure-object/serialization/serialization-handler.js +0 -197
- package/dist/cjs/mods/security/src/components/secure-object/serialization/serialization-handler.js.map +0 -1
- package/dist/cjs/mods/security/src/components/secure-object/utils/id-generator.js +0 -64
- package/dist/cjs/mods/security/src/components/secure-object/utils/id-generator.js.map +0 -1
- package/dist/cjs/mods/security/src/components/secure-object/utils/validation.js +0 -239
- package/dist/cjs/mods/security/src/components/secure-object/utils/validation.js.map +0 -1
- package/dist/cjs/mods/security/src/components/secure-serialization.js +0 -772
- package/dist/cjs/mods/security/src/components/secure-serialization.js.map +0 -1
- package/dist/cjs/mods/security/src/components/secure-string/advanced/entropy-analyzer.js +0 -308
- package/dist/cjs/mods/security/src/components/secure-string/advanced/entropy-analyzer.js.map +0 -1
- package/dist/cjs/mods/security/src/components/secure-string/advanced/performance-monitor.js +0 -335
- package/dist/cjs/mods/security/src/components/secure-string/advanced/performance-monitor.js.map +0 -1
- package/dist/cjs/mods/security/src/components/secure-string/advanced/quantum-safe.js +0 -245
- package/dist/cjs/mods/security/src/components/secure-string/advanced/quantum-safe.js.map +0 -1
- package/dist/cjs/mods/security/src/components/secure-string/buffer/buffer-manager.js +0 -205
- package/dist/cjs/mods/security/src/components/secure-string/buffer/buffer-manager.js.map +0 -1
- package/dist/cjs/mods/security/src/components/secure-string/core/secure-string-core.js +0 -788
- package/dist/cjs/mods/security/src/components/secure-string/core/secure-string-core.js.map +0 -1
- package/dist/cjs/mods/security/src/components/secure-string/crypto/crypto-operations.js +0 -319
- package/dist/cjs/mods/security/src/components/secure-string/crypto/crypto-operations.js.map +0 -1
- package/dist/cjs/mods/security/src/components/secure-string/operations/comparison-operations.js +0 -221
- package/dist/cjs/mods/security/src/components/secure-string/operations/comparison-operations.js.map +0 -1
- package/dist/cjs/mods/security/src/components/secure-string/operations/string-operations.js +0 -234
- package/dist/cjs/mods/security/src/components/secure-string/operations/string-operations.js.map +0 -1
- package/dist/cjs/mods/security/src/components/secure-string/types/index.js +0 -41
- package/dist/cjs/mods/security/src/components/secure-string/types/index.js.map +0 -1
- package/dist/cjs/mods/security/src/components/secure-string/validation/string-validator.js +0 -334
- package/dist/cjs/mods/security/src/components/secure-string/validation/string-validator.js.map +0 -1
- package/dist/cjs/mods/security/src/components/side-channel.js +0 -146
- package/dist/cjs/mods/security/src/components/side-channel.js.map +0 -1
- package/dist/cjs/mods/security/src/components/tamper-evident-logging.js +0 -391
- package/dist/cjs/mods/security/src/components/tamper-evident-logging.js.map +0 -1
- package/dist/cjs/mods/security/src/const/buffer.const.js +0 -15
- package/dist/cjs/mods/security/src/const/buffer.const.js.map +0 -1
- package/dist/cjs/mods/security/src/core/crypto.js +0 -779
- package/dist/cjs/mods/security/src/core/crypto.js.map +0 -1
- package/dist/cjs/mods/security/src/core/hash/hash-advanced.js +0 -388
- package/dist/cjs/mods/security/src/core/hash/hash-advanced.js.map +0 -1
- package/dist/cjs/mods/security/src/core/hash/hash-core.js +0 -410
- package/dist/cjs/mods/security/src/core/hash/hash-core.js.map +0 -1
- package/dist/cjs/mods/security/src/core/hash/hash-entropy.js +0 -307
- package/dist/cjs/mods/security/src/core/hash/hash-entropy.js.map +0 -1
- package/dist/cjs/mods/security/src/core/hash/hash-security.js +0 -372
- package/dist/cjs/mods/security/src/core/hash/hash-security.js.map +0 -1
- package/dist/cjs/mods/security/src/core/hash/hash-types.js +0 -16
- package/dist/cjs/mods/security/src/core/hash/hash-types.js.map +0 -1
- package/dist/cjs/mods/security/src/core/hash/hash-utils.js +0 -328
- package/dist/cjs/mods/security/src/core/hash/hash-utils.js.map +0 -1
- package/dist/cjs/mods/security/src/core/hash/hash-validator.js +0 -312
- package/dist/cjs/mods/security/src/core/hash/hash-validator.js.map +0 -1
- package/dist/cjs/mods/security/src/core/hash.js +0 -25
- package/dist/cjs/mods/security/src/core/hash.js.map +0 -1
- package/dist/cjs/mods/security/src/core/keys/algorithms/mods/Argon2Algo.js +0 -135
- package/dist/cjs/mods/security/src/core/keys/algorithms/mods/Argon2Algo.js.map +0 -1
- package/dist/cjs/mods/security/src/core/keys/algorithms/mods/PBKDF2Algo.js +0 -293
- package/dist/cjs/mods/security/src/core/keys/algorithms/mods/PBKDF2Algo.js.map +0 -1
- package/dist/cjs/mods/security/src/core/keys/algorithms/mods/ScryptAlgo.js +0 -317
- package/dist/cjs/mods/security/src/core/keys/algorithms/mods/ScryptAlgo.js.map +0 -1
- package/dist/cjs/mods/security/src/core/keys/keys-core.js +0 -201
- package/dist/cjs/mods/security/src/core/keys/keys-core.js.map +0 -1
- package/dist/cjs/mods/security/src/core/keys/keys-logger.js +0 -234
- package/dist/cjs/mods/security/src/core/keys/keys-logger.js.map +0 -1
- package/dist/cjs/mods/security/src/core/keys/keys-types.js +0 -65
- package/dist/cjs/mods/security/src/core/keys/keys-types.js.map +0 -1
- package/dist/cjs/mods/security/src/core/keys/keys-utils.js +0 -322
- package/dist/cjs/mods/security/src/core/keys/keys-utils.js.map +0 -1
- package/dist/cjs/mods/security/src/core/keys.js +0 -136
- package/dist/cjs/mods/security/src/core/keys.js.map +0 -1
- package/dist/cjs/mods/security/src/core/password/index.js +0 -122
- package/dist/cjs/mods/security/src/core/password/index.js.map +0 -1
- package/dist/cjs/mods/security/src/core/password/password-algorithms.js +0 -397
- package/dist/cjs/mods/security/src/core/password/password-algorithms.js.map +0 -1
- package/dist/cjs/mods/security/src/core/password/password-core.js +0 -294
- package/dist/cjs/mods/security/src/core/password/password-core.js.map +0 -1
- package/dist/cjs/mods/security/src/core/password/password-generator.js +0 -365
- package/dist/cjs/mods/security/src/core/password/password-generator.js.map +0 -1
- package/dist/cjs/mods/security/src/core/password/password-migration.js +0 -237
- package/dist/cjs/mods/security/src/core/password/password-migration.js.map +0 -1
- package/dist/cjs/mods/security/src/core/password/password-security.js +0 -534
- package/dist/cjs/mods/security/src/core/password/password-security.js.map +0 -1
- package/dist/cjs/mods/security/src/core/password/password-types.js +0 -39
- package/dist/cjs/mods/security/src/core/password/password-types.js.map +0 -1
- package/dist/cjs/mods/security/src/core/password/password-utils.js +0 -651
- package/dist/cjs/mods/security/src/core/password/password-utils.js.map +0 -1
- package/dist/cjs/mods/security/src/core/password/swlist.js +0 -1122
- package/dist/cjs/mods/security/src/core/password/swlist.js.map +0 -1
- package/dist/cjs/mods/security/src/core/random/random-core.js +0 -962
- package/dist/cjs/mods/security/src/core/random/random-core.js.map +0 -1
- package/dist/cjs/mods/security/src/core/random/random-crypto.js +0 -339
- package/dist/cjs/mods/security/src/core/random/random-crypto.js.map +0 -1
- package/dist/cjs/mods/security/src/core/random/random-entropy.js +0 -387
- package/dist/cjs/mods/security/src/core/random/random-entropy.js.map +0 -1
- package/dist/cjs/mods/security/src/core/random/random-generators.js +0 -344
- package/dist/cjs/mods/security/src/core/random/random-generators.js.map +0 -1
- package/dist/cjs/mods/security/src/core/random/random-sources.js +0 -426
- package/dist/cjs/mods/security/src/core/random/random-sources.js.map +0 -1
- package/dist/cjs/mods/security/src/core/random/random-tokens.js +0 -309
- package/dist/cjs/mods/security/src/core/random/random-tokens.js.map +0 -1
- package/dist/cjs/mods/security/src/core/random/random-types.js +0 -36
- package/dist/cjs/mods/security/src/core/random/random-types.js.map +0 -1
- package/dist/cjs/mods/security/src/core/validators.js +0 -200
- package/dist/cjs/mods/security/src/core/validators.js.map +0 -1
- package/dist/cjs/mods/security/src/helpers/Uint8Array.js +0 -335
- package/dist/cjs/mods/security/src/helpers/Uint8Array.js.map +0 -1
- package/dist/cjs/mods/security/src/helpers/createEnu.js +0 -27
- package/dist/cjs/mods/security/src/helpers/createEnu.js.map +0 -1
- package/dist/cjs/mods/security/src/index.js +0 -406
- package/dist/cjs/mods/security/src/index.js.map +0 -1
- package/dist/cjs/mods/security/src/types/global.js +0 -51
- package/dist/cjs/mods/security/src/types/global.js.map +0 -1
- package/dist/cjs/mods/security/src/types/secure-mem.type.js +0 -106
- package/dist/cjs/mods/security/src/types/secure-mem.type.js.map +0 -1
- package/dist/cjs/mods/security/src/types/secure-memory.js +0 -20
- package/dist/cjs/mods/security/src/types/secure-memory.js.map +0 -1
- package/dist/cjs/mods/security/src/types.js +0 -63
- package/dist/cjs/mods/security/src/types.js.map +0 -1
- package/dist/cjs/mods/security/src/utils/CryptoAlgorithmUtils.js +0 -71
- package/dist/cjs/mods/security/src/utils/CryptoAlgorithmUtils.js.map +0 -1
- package/dist/cjs/mods/security/src/utils/constants.js +0 -111
- package/dist/cjs/mods/security/src/utils/constants.js.map +0 -1
- package/dist/cjs/mods/security/src/utils/crypto.utils.js +0 -386
- package/dist/cjs/mods/security/src/utils/crypto.utils.js.map +0 -1
- package/dist/cjs/mods/security/src/utils/dataConverter.js +0 -74
- package/dist/cjs/mods/security/src/utils/dataConverter.js.map +0 -1
- package/dist/cjs/mods/security/src/utils/encoding.js +0 -290
- package/dist/cjs/mods/security/src/utils/encoding.js.map +0 -1
- package/dist/cjs/mods/security/src/utils/errorHandler.js +0 -140
- package/dist/cjs/mods/security/src/utils/errorHandler.js.map +0 -1
- package/dist/cjs/mods/security/src/utils/memory/config-manager.js +0 -290
- package/dist/cjs/mods/security/src/utils/memory/config-manager.js.map +0 -1
- package/dist/cjs/mods/security/src/utils/memory/event-manager.js +0 -277
- package/dist/cjs/mods/security/src/utils/memory/event-manager.js.map +0 -1
- package/dist/cjs/mods/security/src/utils/memory/index.js +0 -162
- package/dist/cjs/mods/security/src/utils/memory/index.js.map +0 -1
- package/dist/cjs/mods/security/src/utils/memory/memory-manager.js +0 -888
- package/dist/cjs/mods/security/src/utils/memory/memory-manager.js.map +0 -1
- package/dist/cjs/mods/security/src/utils/memory/memory-pool.js +0 -356
- package/dist/cjs/mods/security/src/utils/memory/memory-pool.js.map +0 -1
- package/dist/cjs/mods/security/src/utils/memory/reference-tracker.js +0 -384
- package/dist/cjs/mods/security/src/utils/memory/reference-tracker.js.map +0 -1
- package/dist/cjs/mods/security/src/utils/memory/types.js +0 -56
- package/dist/cjs/mods/security/src/utils/memory/types.js.map +0 -1
- package/dist/cjs/mods/security/src/utils/patterns.js +0 -127
- package/dist/cjs/mods/security/src/utils/patterns.js.map +0 -1
- package/dist/cjs/mods/security/src/utils/performanceMonitor.js +0 -249
- package/dist/cjs/mods/security/src/utils/performanceMonitor.js.map +0 -1
- package/dist/cjs/mods/security/src/utils/stats.js +0 -182
- package/dist/cjs/mods/security/src/utils/stats.js.map +0 -1
- package/dist/cjs/package.json +0 -3
- package/dist/cjs/shared/logger/Logger.js +0 -591
- package/dist/cjs/shared/logger/Logger.js.map +0 -1
- package/dist/cjs/src/FiUp.js +0 -88
- package/dist/cjs/src/FiUp.js.map +0 -1
- package/dist/cjs/src/cache/CacheFactory.js +0 -416
- package/dist/cjs/src/cache/CacheFactory.js.map +0 -1
- package/dist/cjs/src/cache/SecureCacheAdapter.js +0 -1239
- package/dist/cjs/src/cache/SecureCacheAdapter.js.map +0 -1
- package/dist/cjs/src/cluster/bun-cluster-manager.js +0 -1656
- package/dist/cjs/src/cluster/bun-cluster-manager.js.map +0 -1
- package/dist/cjs/src/cluster/cluster-manager.js +0 -1023
- package/dist/cjs/src/cluster/cluster-manager.js.map +0 -1
- package/dist/cjs/src/cluster/memory-manager.js +0 -485
- package/dist/cjs/src/cluster/memory-manager.js.map +0 -1
- package/dist/cjs/src/cluster/modules/AutoScaler.js +0 -532
- package/dist/cjs/src/cluster/modules/AutoScaler.js.map +0 -1
- package/dist/cjs/src/cluster/modules/BunIPCManager.js +0 -603
- package/dist/cjs/src/cluster/modules/BunIPCManager.js.map +0 -1
- package/dist/cjs/src/cluster/modules/ClusterPersistenceManager.js +0 -437
- package/dist/cjs/src/cluster/modules/ClusterPersistenceManager.js.map +0 -1
- package/dist/cjs/src/cluster/modules/CpuMonitor.js +0 -659
- package/dist/cjs/src/cluster/modules/CpuMonitor.js.map +0 -1
- package/dist/cjs/src/cluster/modules/CrossPlatformMemory.js +0 -329
- package/dist/cjs/src/cluster/modules/CrossPlatformMemory.js.map +0 -1
- package/dist/cjs/src/cluster/modules/EventLoopMonitor.js +0 -265
- package/dist/cjs/src/cluster/modules/EventLoopMonitor.js.map +0 -1
- package/dist/cjs/src/cluster/modules/GCStatsTracker.js +0 -200
- package/dist/cjs/src/cluster/modules/GCStatsTracker.js.map +0 -1
- package/dist/cjs/src/cluster/modules/HealthMonitor.js +0 -461
- package/dist/cjs/src/cluster/modules/HealthMonitor.js.map +0 -1
- package/dist/cjs/src/cluster/modules/HeapStatsCollector.js +0 -111
- package/dist/cjs/src/cluster/modules/HeapStatsCollector.js.map +0 -1
- package/dist/cjs/src/cluster/modules/IPCManager.js +0 -781
- package/dist/cjs/src/cluster/modules/IPCManager.js.map +0 -1
- package/dist/cjs/src/cluster/modules/MetricsCollector.js +0 -559
- package/dist/cjs/src/cluster/modules/MetricsCollector.js.map +0 -1
- package/dist/cjs/src/cluster/modules/NetworkTracker.js +0 -162
- package/dist/cjs/src/cluster/modules/NetworkTracker.js.map +0 -1
- package/dist/cjs/src/cluster/modules/ProcessMonitor.js +0 -513
- package/dist/cjs/src/cluster/modules/ProcessMonitor.js.map +0 -1
- package/dist/cjs/src/cluster/modules/ThroughputCalculator.js +0 -186
- package/dist/cjs/src/cluster/modules/ThroughputCalculator.js.map +0 -1
- package/dist/cjs/src/cluster/modules/WorkerManager.js +0 -1186
- package/dist/cjs/src/cluster/modules/WorkerManager.js.map +0 -1
- package/dist/cjs/src/cluster/modules/strategy/LoadBalancer.js +0 -1123
- package/dist/cjs/src/cluster/modules/strategy/LoadBalancer.js.map +0 -1
- package/dist/cjs/src/config.js +0 -366
- package/dist/cjs/src/config.js.map +0 -1
- package/dist/cjs/src/const.js +0 -577
- package/dist/cjs/src/const.js.map +0 -1
- package/dist/cjs/src/encryption/EncryptionService.js +0 -422
- package/dist/cjs/src/encryption/EncryptionService.js.map +0 -1
- package/dist/cjs/src/file-upload.js +0 -259
- package/dist/cjs/src/file-upload.js.map +0 -1
- package/dist/cjs/src/index.js +0 -100
- package/dist/cjs/src/index.js.map +0 -1
- package/dist/cjs/src/middleware/XJsonResponseHandler.js +0 -152
- package/dist/cjs/src/middleware/XJsonResponseHandler.js.map +0 -1
- package/dist/cjs/src/middleware/XemsSessionMiddleware.js +0 -88
- package/dist/cjs/src/middleware/XemsSessionMiddleware.js.map +0 -1
- package/dist/cjs/src/middleware/XyPrissMiddlewareAPI.js +0 -354
- package/dist/cjs/src/middleware/XyPrissMiddlewareAPI.js.map +0 -1
- package/dist/cjs/src/middleware/built-in/BuiltInMiddleware.js +0 -524
- package/dist/cjs/src/middleware/built-in/BuiltInMiddleware.js.map +0 -1
- package/dist/cjs/src/middleware/built-in/security/BrowserOnlyProtector.js +0 -552
- package/dist/cjs/src/middleware/built-in/security/BrowserOnlyProtector.js.map +0 -1
- package/dist/cjs/src/middleware/built-in/security/CommandInjectionDetector.js +0 -215
- package/dist/cjs/src/middleware/built-in/security/CommandInjectionDetector.js.map +0 -1
- package/dist/cjs/src/middleware/built-in/security/LDAPInjectionDetector.js +0 -96
- package/dist/cjs/src/middleware/built-in/security/LDAPInjectionDetector.js.map +0 -1
- package/dist/cjs/src/middleware/built-in/security/MobileOnlyProtector.js +0 -504
- package/dist/cjs/src/middleware/built-in/security/MobileOnlyProtector.js.map +0 -1
- package/dist/cjs/src/middleware/built-in/security/PathTraversalDetector.js +0 -212
- package/dist/cjs/src/middleware/built-in/security/PathTraversalDetector.js.map +0 -1
- package/dist/cjs/src/middleware/built-in/security/RequestSignatureProtector.js +0 -481
- package/dist/cjs/src/middleware/built-in/security/RequestSignatureProtector.js.map +0 -1
- package/dist/cjs/src/middleware/built-in/security/SQLInjectionDetector.js +0 -335
- package/dist/cjs/src/middleware/built-in/security/SQLInjectionDetector.js.map +0 -1
- package/dist/cjs/src/middleware/built-in/security/TerminalOnlyProtector.js +0 -478
- package/dist/cjs/src/middleware/built-in/security/TerminalOnlyProtector.js.map +0 -1
- package/dist/cjs/src/middleware/built-in/security/XXEProtector.js +0 -175
- package/dist/cjs/src/middleware/built-in/security/XXEProtector.js.map +0 -1
- package/dist/cjs/src/middleware/safe-json-middleware.js +0 -159
- package/dist/cjs/src/middleware/safe-json-middleware.js.map +0 -1
- package/dist/cjs/src/middleware/security-middleware.js +0 -1059
- package/dist/cjs/src/middleware/security-middleware.js.map +0 -1
- package/dist/cjs/src/plugins/PluginManager.js +0 -410
- package/dist/cjs/src/plugins/PluginManager.js.map +0 -1
- package/dist/cjs/src/plugins/api/PluginAPI.js +0 -188
- package/dist/cjs/src/plugins/api/PluginAPI.js.map +0 -1
- package/dist/cjs/src/plugins/const/PluginHookIds.js +0 -64
- package/dist/cjs/src/plugins/const/PluginHookIds.js.map +0 -1
- package/dist/cjs/src/plugins/core/PluginManager.js +0 -677
- package/dist/cjs/src/plugins/core/PluginManager.js.map +0 -1
- package/dist/cjs/src/plugins/modules/PluginEngine.js +0 -494
- package/dist/cjs/src/plugins/modules/PluginEngine.js.map +0 -1
- package/dist/cjs/src/plugins/modules/PluginRegistry.js +0 -309
- package/dist/cjs/src/plugins/modules/PluginRegistry.js.map +0 -1
- package/dist/cjs/src/plugins/modules/builtin/JWTAuthPlugin.js +0 -591
- package/dist/cjs/src/plugins/modules/builtin/JWTAuthPlugin.js.map +0 -1
- package/dist/cjs/src/plugins/modules/builtin/ResponseTimePlugin.js +0 -413
- package/dist/cjs/src/plugins/modules/builtin/ResponseTimePlugin.js.map +0 -1
- package/dist/cjs/src/plugins/modules/builtin/SmartCachePlugin.js +0 -843
- package/dist/cjs/src/plugins/modules/builtin/SmartCachePlugin.js.map +0 -1
- package/dist/cjs/src/plugins/modules/builtin/server-maintenance-plugin.js +0 -588
- package/dist/cjs/src/plugins/modules/builtin/server-maintenance-plugin.js.map +0 -1
- package/dist/cjs/src/plugins/modules/core/CachePlugin.js +0 -1977
- package/dist/cjs/src/plugins/modules/core/CachePlugin.js.map +0 -1
- package/dist/cjs/src/plugins/modules/core/PerformancePlugin.js +0 -894
- package/dist/cjs/src/plugins/modules/core/PerformancePlugin.js.map +0 -1
- package/dist/cjs/src/plugins/modules/core/SecurityPlugin.js +0 -799
- package/dist/cjs/src/plugins/modules/core/SecurityPlugin.js.map +0 -1
- package/dist/cjs/src/plugins/modules/index.js +0 -302
- package/dist/cjs/src/plugins/modules/index.js.map +0 -1
- package/dist/cjs/src/plugins/modules/network/builtin/CompressionPlugin.js +0 -302
- package/dist/cjs/src/plugins/modules/network/builtin/CompressionPlugin.js.map +0 -1
- package/dist/cjs/src/plugins/modules/network/builtin/ConnectionPlugin.js +0 -797
- package/dist/cjs/src/plugins/modules/network/builtin/ConnectionPlugin.js.map +0 -1
- package/dist/cjs/src/plugins/modules/network/builtin/ProxyPlugin.js +0 -424
- package/dist/cjs/src/plugins/modules/network/builtin/ProxyPlugin.js.map +0 -1
- package/dist/cjs/src/plugins/modules/network/builtin/RateLimitPlugin.js +0 -605
- package/dist/cjs/src/plugins/modules/network/builtin/RateLimitPlugin.js.map +0 -1
- package/dist/cjs/src/plugins/modules/network/core/NetworkPlugin.js +0 -230
- package/dist/cjs/src/plugins/modules/network/core/NetworkPlugin.js.map +0 -1
- package/dist/cjs/src/plugins/modules/network/core/NetworkPluginFactory.js +0 -40
- package/dist/cjs/src/plugins/modules/network/core/NetworkPluginFactory.js.map +0 -1
- package/dist/cjs/src/plugins/modules/network/types/NetworkTypes.js +0 -24
- package/dist/cjs/src/plugins/modules/network/types/NetworkTypes.js.map +0 -1
- package/dist/cjs/src/plugins/modules/network/utils/NetworkPluginUtils.js +0 -63
- package/dist/cjs/src/plugins/modules/network/utils/NetworkPluginUtils.js.map +0 -1
- package/dist/cjs/src/plugins/modules/types/PluginTypes.js +0 -48
- package/dist/cjs/src/plugins/modules/types/PluginTypes.js.map +0 -1
- package/dist/cjs/src/plugins/modules/xems/XemsBuiltinPlugin.js +0 -216
- package/dist/cjs/src/plugins/modules/xems/XemsBuiltinPlugin.js.map +0 -1
- package/dist/cjs/src/plugins/modules/xems/XemsPlugin.js +0 -354
- package/dist/cjs/src/plugins/modules/xems/XemsPlugin.js.map +0 -1
- package/dist/cjs/src/plugins/plugin-manager.js +0 -151
- package/dist/cjs/src/plugins/plugin-manager.js.map +0 -1
- package/dist/cjs/src/plugins/route-optimization-plugin.js +0 -421
- package/dist/cjs/src/plugins/route-optimization-plugin.js.map +0 -1
- package/dist/cjs/src/plugins/server-maintenance-plugin.js +0 -588
- package/dist/cjs/src/plugins/server-maintenance-plugin.js.map +0 -1
- package/dist/cjs/src/quick-start.js +0 -43
- package/dist/cjs/src/quick-start.js.map +0 -1
- package/dist/cjs/src/schemas/plugingSchema.js +0 -40
- package/dist/cjs/src/schemas/plugingSchema.js.map +0 -1
- package/dist/cjs/src/server/FastServer.js +0 -858
- package/dist/cjs/src/server/FastServer.js.map +0 -1
- package/dist/cjs/src/server/ServerFactory.js +0 -67
- package/dist/cjs/src/server/ServerFactory.js.map +0 -1
- package/dist/cjs/src/server/components/fastapi/CacheManager.js +0 -245
- package/dist/cjs/src/server/components/fastapi/CacheManager.js.map +0 -1
- package/dist/cjs/src/server/components/fastapi/ClusterManagerComponent.js +0 -569
- package/dist/cjs/src/server/components/fastapi/ClusterManagerComponent.js.map +0 -1
- package/dist/cjs/src/server/components/fastapi/FileUploadManager.js +0 -197
- package/dist/cjs/src/server/components/fastapi/FileUploadManager.js.map +0 -1
- package/dist/cjs/src/server/components/fastapi/FileWatcherManager.js +0 -536
- package/dist/cjs/src/server/components/fastapi/FileWatcherManager.js.map +0 -1
- package/dist/cjs/src/server/components/fastapi/MonitoringManager.js +0 -307
- package/dist/cjs/src/server/components/fastapi/MonitoringManager.js.map +0 -1
- package/dist/cjs/src/server/components/fastapi/PerformanceManager.js +0 -297
- package/dist/cjs/src/server/components/fastapi/PerformanceManager.js.map +0 -1
- package/dist/cjs/src/server/components/fastapi/PluginManager.js +0 -395
- package/dist/cjs/src/server/components/fastapi/PluginManager.js.map +0 -1
- package/dist/cjs/src/server/components/fastapi/RedirectManager.js +0 -487
- package/dist/cjs/src/server/components/fastapi/RedirectManager.js.map +0 -1
- package/dist/cjs/src/server/components/fastapi/RequestProcessor.js +0 -213
- package/dist/cjs/src/server/components/fastapi/RequestProcessor.js.map +0 -1
- package/dist/cjs/src/server/components/fastapi/RouteManager.js +0 -190
- package/dist/cjs/src/server/components/fastapi/RouteManager.js.map +0 -1
- package/dist/cjs/src/server/components/fastapi/WorkerPoolComponent.js +0 -82
- package/dist/cjs/src/server/components/fastapi/WorkerPoolComponent.js.map +0 -1
- package/dist/cjs/src/server/components/fastapi/console/ConsoleInterceptor.js +0 -980
- package/dist/cjs/src/server/components/fastapi/console/ConsoleInterceptor.js.map +0 -1
- package/dist/cjs/src/server/components/fastapi/console/encryption/ConsoleEncryption.js +0 -216
- package/dist/cjs/src/server/components/fastapi/console/encryption/ConsoleEncryption.js.map +0 -1
- package/dist/cjs/src/server/components/fastapi/console/types.js +0 -163
- package/dist/cjs/src/server/components/fastapi/console/types.js.map +0 -1
- package/dist/cjs/src/server/components/fastapi/modules/UFRP/WorkerPoolManager.js +0 -265
- package/dist/cjs/src/server/components/fastapi/modules/UFRP/WorkerPoolManager.js.map +0 -1
- package/dist/cjs/src/server/components/fastapi/modules/UFRP/workers/Logger.js +0 -236
- package/dist/cjs/src/server/components/fastapi/modules/UFRP/workers/cpu-tasks.js +0 -294
- package/dist/cjs/src/server/components/fastapi/modules/UFRP/workers/enhanced-cpu-worker.js +0 -433
- package/dist/cjs/src/server/components/fastapi/modules/UFRP/workers/io-worker.js +0 -1617
- package/dist/cjs/src/server/components/fastapi/smart-routes.js +0 -347
- package/dist/cjs/src/server/components/fastapi/smart-routes.js.map +0 -1
- package/dist/cjs/src/server/components/fastapi/templates/redirectTemp.js +0 -101
- package/dist/cjs/src/server/components/fastapi/templates/redirectTemp.js.map +0 -1
- package/dist/cjs/src/server/components/lifecycle/ServerLifecycleManager.js +0 -522
- package/dist/cjs/src/server/components/lifecycle/ServerLifecycleManager.js.map +0 -1
- package/dist/cjs/src/server/components/multi-server/MultiServerApp.js +0 -534
- package/dist/cjs/src/server/components/multi-server/MultiServerApp.js.map +0 -1
- package/dist/cjs/src/server/components/multi-server/MultiServerManager.js +0 -326
- package/dist/cjs/src/server/components/multi-server/MultiServerManager.js.map +0 -1
- package/dist/cjs/src/server/conf/networkConnectionConf.js +0 -25
- package/dist/cjs/src/server/conf/networkConnectionConf.js.map +0 -1
- package/dist/cjs/src/server/conf/proxyConfig.js +0 -23
- package/dist/cjs/src/server/conf/proxyConfig.js.map +0 -1
- package/dist/cjs/src/server/const/Cluster.config.js +0 -215
- package/dist/cjs/src/server/const/Cluster.config.js.map +0 -1
- package/dist/cjs/src/server/const/ExecutionPredictor_EP.const.js +0 -73
- package/dist/cjs/src/server/const/ExecutionPredictor_EP.const.js.map +0 -1
- package/dist/cjs/src/server/const/FileWatcher.config.js +0 -98
- package/dist/cjs/src/server/const/FileWatcher.config.js.map +0 -1
- package/dist/cjs/src/server/const/default.js +0 -393
- package/dist/cjs/src/server/const/default.js.map +0 -1
- package/dist/cjs/src/server/const/http.js +0 -19
- package/dist/cjs/src/server/const/http.js.map +0 -1
- package/dist/cjs/src/server/core/HttpServer.js +0 -396
- package/dist/cjs/src/server/core/HttpServer.js.map +0 -1
- package/dist/cjs/src/server/core/RequestApp.js +0 -95
- package/dist/cjs/src/server/core/RequestApp.js.map +0 -1
- package/dist/cjs/src/server/core/RequestEnhancer.js +0 -288
- package/dist/cjs/src/server/core/RequestEnhancer.js.map +0 -1
- package/dist/cjs/src/server/core/ResponseEnhancer.js +0 -518
- package/dist/cjs/src/server/core/ResponseEnhancer.js.map +0 -1
- package/dist/cjs/src/server/core/StartupProcessor.js +0 -111
- package/dist/cjs/src/server/core/StartupProcessor.js.map +0 -1
- package/dist/cjs/src/server/core/VirtualServer.js +0 -33
- package/dist/cjs/src/server/core/VirtualServer.js.map +0 -1
- package/dist/cjs/src/server/core/XHSCBridge.js +0 -524
- package/dist/cjs/src/server/core/XHSCBridge.js.map +0 -1
- package/dist/cjs/src/server/core/XHSCProtocol.js +0 -314
- package/dist/cjs/src/server/core/XHSCProtocol.js.map +0 -1
- package/dist/cjs/src/server/core/XyDiagnosticsManager.js +0 -78
- package/dist/cjs/src/server/core/XyDiagnosticsManager.js.map +0 -1
- package/dist/cjs/src/server/core/XyLifecycleManager.js +0 -237
- package/dist/cjs/src/server/core/XyLifecycleManager.js.map +0 -1
- package/dist/cjs/src/server/core/XyModuleManager.js +0 -161
- package/dist/cjs/src/server/core/XyModuleManager.js.map +0 -1
- package/dist/cjs/src/server/core/XyRoutingManager.js +0 -187
- package/dist/cjs/src/server/core/XyRoutingManager.js.map +0 -1
- package/dist/cjs/src/server/core/XyServerCreator.js +0 -97
- package/dist/cjs/src/server/core/XyServerCreator.js.map +0 -1
- package/dist/cjs/src/server/core/XyprissApp.js +0 -483
- package/dist/cjs/src/server/core/XyprissApp.js.map +0 -1
- package/dist/cjs/src/server/core/request/XyRequestManager.js +0 -229
- package/dist/cjs/src/server/core/request/XyRequestManager.js.map +0 -1
- package/dist/cjs/src/server/handlers/NotFoundHandler.js +0 -84
- package/dist/cjs/src/server/handlers/NotFoundHandler.js.map +0 -1
- package/dist/cjs/src/server/handlers/templates/notFoundTemplate.js +0 -655
- package/dist/cjs/src/server/handlers/templates/notFoundTemplate.js.map +0 -1
- package/dist/cjs/src/server/middleware/MiddlewareManager.js +0 -197
- package/dist/cjs/src/server/middleware/MiddlewareManager.js.map +0 -1
- package/dist/cjs/src/server/optimization/ExecutionPredictor.js +0 -218
- package/dist/cjs/src/server/optimization/ExecutionPredictor.js.map +0 -1
- package/dist/cjs/src/server/optimization/PerformanceProfiler.js +0 -234
- package/dist/cjs/src/server/optimization/PerformanceProfiler.js.map +0 -1
- package/dist/cjs/src/server/optimization/RequestPreCompiler.js +0 -709
- package/dist/cjs/src/server/optimization/RequestPreCompiler.js.map +0 -1
- package/dist/cjs/src/server/optimization/UltraFastOptimizer.js +0 -427
- package/dist/cjs/src/server/optimization/UltraFastOptimizer.js.map +0 -1
- package/dist/cjs/src/server/optimization/performance-monitor.js +0 -162
- package/dist/cjs/src/server/optimization/performance-monitor.js.map +0 -1
- package/dist/cjs/src/server/routing/Router.js +0 -353
- package/dist/cjs/src/server/routing/Router.js.map +0 -1
- package/dist/cjs/src/server/service/Reload/FileWatcher.js +0 -756
- package/dist/cjs/src/server/service/Reload/FileWatcher.js.map +0 -1
- package/dist/cjs/src/server/service/Reload/HotReloader.js +0 -738
- package/dist/cjs/src/server/service/Reload/HotReloader.js.map +0 -1
- package/dist/cjs/src/server/service/Reload/exec/TypeScriptExecutor.js +0 -342
- package/dist/cjs/src/server/service/Reload/exec/TypeScriptExecutor.js.map +0 -1
- package/dist/cjs/src/server/utils/ConfigLoader.js +0 -362
- package/dist/cjs/src/server/utils/ConfigLoader.js.map +0 -1
- package/dist/cjs/src/server/utils/PortManager.js +0 -237
- package/dist/cjs/src/server/utils/PortManager.js.map +0 -1
- package/dist/cjs/src/server/utils/WorkerModeHandler.js +0 -65
- package/dist/cjs/src/server/utils/WorkerModeHandler.js.map +0 -1
- package/dist/cjs/src/server/utils/forceClosePort.js +0 -332
- package/dist/cjs/src/server/utils/forceClosePort.js.map +0 -1
- package/dist/cjs/src/server/utils/shouldRegisterRouteOnServer.js +0 -34
- package/dist/cjs/src/server/utils/shouldRegisterRouteOnServer.js.map +0 -1
- package/dist/cjs/src/server/utils/trustProxy.js +0 -778
- package/dist/cjs/src/server/utils/trustProxy.js.map +0 -1
- package/dist/cjs/src/sys/FSApi.js +0 -1144
- package/dist/cjs/src/sys/FSApi.js.map +0 -1
- package/dist/cjs/src/sys/FileSystem.js +0 -1302
- package/dist/cjs/src/sys/FileSystem.js.map +0 -1
- package/dist/cjs/src/sys/PathApi.js +0 -202
- package/dist/cjs/src/sys/PathApi.js.map +0 -1
- package/dist/cjs/src/sys/SysApi.js +0 -421
- package/dist/cjs/src/sys/SysApi.js.map +0 -1
- package/dist/cjs/src/sys/System.js +0 -40
- package/dist/cjs/src/sys/System.js.map +0 -1
- package/dist/cjs/src/sys/XyPrissCache.js +0 -70
- package/dist/cjs/src/sys/XyPrissCache.js.map +0 -1
- package/dist/cjs/src/sys/XyPrissRunner.js +0 -248
- package/dist/cjs/src/sys/XyPrissRunner.js.map +0 -1
- package/dist/cjs/src/sys.js +0 -404
- package/dist/cjs/src/sys.js.map +0 -1
- package/dist/cjs/src/types/NotFoundConfig.js +0 -86
- package/dist/cjs/src/types/NotFoundConfig.js.map +0 -1
- package/dist/cjs/src/utils/DotEnvLoader.js +0 -74
- package/dist/cjs/src/utils/DotEnvLoader.js.map +0 -1
- package/dist/cjs/src/utils/mergeWithDefaults.js +0 -176
- package/dist/cjs/src/utils/mergeWithDefaults.js.map +0 -1
- package/dist/cjs/src/xhs/cluster/XHSCWorker.js +0 -202
- package/dist/cjs/src/xhs/cluster/XHSCWorker.js.map +0 -1
- package/dist/esm/index.js +0 -2
- package/dist/esm/mods/security/src/algorithms/hash-algorithms.js +0 -696
- package/dist/esm/mods/security/src/algorithms/hash-algorithms.js.map +0 -1
- package/dist/esm/mods/security/src/algorithms/registry.js +0 -81
- package/dist/esm/mods/security/src/algorithms/registry.js.map +0 -1
- package/dist/esm/mods/security/src/components/attestation.js +0 -1059
- package/dist/esm/mods/security/src/components/attestation.js.map +0 -1
- package/dist/esm/mods/security/src/components/cache/FastLRU.js +0 -320
- package/dist/esm/mods/security/src/components/cache/FastLRU.js.map +0 -1
- package/dist/esm/mods/security/src/components/cache/UFSIMC.js +0 -1111
- package/dist/esm/mods/security/src/components/cache/UFSIMC.js.map +0 -1
- package/dist/esm/mods/security/src/components/cache/cacheSys.js +0 -622
- package/dist/esm/mods/security/src/components/cache/cacheSys.js.map +0 -1
- package/dist/esm/mods/security/src/components/cache/cacheSys.utils.js +0 -102
- package/dist/esm/mods/security/src/components/cache/cacheSys.utils.js.map +0 -1
- package/dist/esm/mods/security/src/components/cache/config/cache.config.js +0 -36
- package/dist/esm/mods/security/src/components/cache/config/cache.config.js.map +0 -1
- package/dist/esm/mods/security/src/components/cache/index.js +0 -367
- package/dist/esm/mods/security/src/components/cache/index.js.map +0 -1
- package/dist/esm/mods/security/src/components/cache/useCache.js +0 -232
- package/dist/esm/mods/security/src/components/cache/useCache.js.map +0 -1
- package/dist/esm/mods/security/src/components/canary-tokens.js +0 -346
- package/dist/esm/mods/security/src/components/canary-tokens.js.map +0 -1
- package/dist/esm/mods/security/src/components/entropy-augmentation.js +0 -476
- package/dist/esm/mods/security/src/components/entropy-augmentation.js.map +0 -1
- package/dist/esm/mods/security/src/components/fortified-function/UFA/ultra-fast-allocator.js +0 -336
- package/dist/esm/mods/security/src/components/fortified-function/UFA/ultra-fast-allocator.js.map +0 -1
- package/dist/esm/mods/security/src/components/fortified-function/UFA/ultra-fast-cache.js +0 -534
- package/dist/esm/mods/security/src/components/fortified-function/UFA/ultra-fast-cache.js.map +0 -1
- package/dist/esm/mods/security/src/components/fortified-function/UFA/ultra-fast-engine.js +0 -612
- package/dist/esm/mods/security/src/components/fortified-function/UFA/ultra-fast-engine.js.map +0 -1
- package/dist/esm/mods/security/src/components/fortified-function/const/exec.const.js +0 -11
- package/dist/esm/mods/security/src/components/fortified-function/const/exec.const.js.map +0 -1
- package/dist/esm/mods/security/src/components/fortified-function/core/fortified-config.js +0 -351
- package/dist/esm/mods/security/src/components/fortified-function/core/fortified-config.js.map +0 -1
- package/dist/esm/mods/security/src/components/fortified-function/core/fortified-function-core.js +0 -518
- package/dist/esm/mods/security/src/components/fortified-function/core/fortified-function-core.js.map +0 -1
- package/dist/esm/mods/security/src/components/fortified-function/core/fortified-logger.js +0 -243
- package/dist/esm/mods/security/src/components/fortified-function/core/fortified-logger.js.map +0 -1
- package/dist/esm/mods/security/src/components/fortified-function/core/mods/api-manager.js +0 -187
- package/dist/esm/mods/security/src/components/fortified-function/core/mods/api-manager.js.map +0 -1
- package/dist/esm/mods/security/src/components/fortified-function/core/mods/cache-manager.js +0 -105
- package/dist/esm/mods/security/src/components/fortified-function/core/mods/cache-manager.js.map +0 -1
- package/dist/esm/mods/security/src/components/fortified-function/core/mods/execution-context.js +0 -103
- package/dist/esm/mods/security/src/components/fortified-function/core/mods/execution-context.js.map +0 -1
- package/dist/esm/mods/security/src/components/fortified-function/core/mods/execution-engine.js +0 -125
- package/dist/esm/mods/security/src/components/fortified-function/core/mods/execution-engine.js.map +0 -1
- package/dist/esm/mods/security/src/components/fortified-function/core/mods/execution-router.js +0 -91
- package/dist/esm/mods/security/src/components/fortified-function/core/mods/execution-router.js.map +0 -1
- package/dist/esm/mods/security/src/components/fortified-function/core/mods/memory-manager.js +0 -145
- package/dist/esm/mods/security/src/components/fortified-function/core/mods/memory-manager.js.map +0 -1
- package/dist/esm/mods/security/src/components/fortified-function/core/mods/security-manager.js +0 -100
- package/dist/esm/mods/security/src/components/fortified-function/core/mods/security-manager.js.map +0 -1
- package/dist/esm/mods/security/src/components/fortified-function/core/mods/stats-manager.js +0 -157
- package/dist/esm/mods/security/src/components/fortified-function/core/mods/stats-manager.js.map +0 -1
- package/dist/esm/mods/security/src/components/fortified-function/core/mods/timing-manager.js +0 -123
- package/dist/esm/mods/security/src/components/fortified-function/core/mods/timing-manager.js.map +0 -1
- package/dist/esm/mods/security/src/components/fortified-function/engines/analytics-engine.js +0 -368
- package/dist/esm/mods/security/src/components/fortified-function/engines/analytics-engine.js.map +0 -1
- package/dist/esm/mods/security/src/components/fortified-function/engines/execution-engine.js +0 -400
- package/dist/esm/mods/security/src/components/fortified-function/engines/execution-engine.js.map +0 -1
- package/dist/esm/mods/security/src/components/fortified-function/index.js +0 -167
- package/dist/esm/mods/security/src/components/fortified-function/index.js.map +0 -1
- package/dist/esm/mods/security/src/components/fortified-function/performance/performance-monitor.js +0 -238
- package/dist/esm/mods/security/src/components/fortified-function/performance/performance-monitor.js.map +0 -1
- package/dist/esm/mods/security/src/components/fortified-function/performance/performance-timer.js +0 -186
- package/dist/esm/mods/security/src/components/fortified-function/performance/performance-timer.js.map +0 -1
- package/dist/esm/mods/security/src/components/fortified-function/security/security-handler.js +0 -252
- package/dist/esm/mods/security/src/components/fortified-function/security/security-handler.js.map +0 -1
- package/dist/esm/mods/security/src/components/fortified-function/serializer/safe-serializer.js +0 -344
- package/dist/esm/mods/security/src/components/fortified-function/serializer/safe-serializer.js.map +0 -1
- package/dist/esm/mods/security/src/components/fortified-function/smart-cache.js +0 -691
- package/dist/esm/mods/security/src/components/fortified-function/smart-cache.js.map +0 -1
- package/dist/esm/mods/security/src/components/fortified-function/types/types.js +0 -14
- package/dist/esm/mods/security/src/components/fortified-function/types/types.js.map +0 -1
- package/dist/esm/mods/security/src/components/fortified-function/utils/utils.js +0 -74
- package/dist/esm/mods/security/src/components/fortified-function/utils/utils.js.map +0 -1
- package/dist/esm/mods/security/src/components/memory-hard.js +0 -919
- package/dist/esm/mods/security/src/components/memory-hard.js.map +0 -1
- package/dist/esm/mods/security/src/components/post-quantum.js +0 -316
- package/dist/esm/mods/security/src/components/post-quantum.js.map +0 -1
- package/dist/esm/mods/security/src/components/runtime-verification.js +0 -643
- package/dist/esm/mods/security/src/components/runtime-verification.js.map +0 -1
- package/dist/esm/mods/security/src/components/secure-array/core/secure-array-core.js +0 -1570
- package/dist/esm/mods/security/src/components/secure-array/core/secure-array-core.js.map +0 -1
- package/dist/esm/mods/security/src/components/secure-array/crypto/ArrayCryptoHandler.js +0 -328
- package/dist/esm/mods/security/src/components/secure-array/crypto/ArrayCryptoHandler.js.map +0 -1
- package/dist/esm/mods/security/src/components/secure-array/events/event-manager.js +0 -268
- package/dist/esm/mods/security/src/components/secure-array/events/event-manager.js.map +0 -1
- package/dist/esm/mods/security/src/components/secure-array/index.js +0 -61
- package/dist/esm/mods/security/src/components/secure-array/index.js.map +0 -1
- package/dist/esm/mods/security/src/components/secure-array/metadata/metadata-manager.js +0 -329
- package/dist/esm/mods/security/src/components/secure-array/metadata/metadata-manager.js.map +0 -1
- package/dist/esm/mods/security/src/components/secure-array/serialization/ArraySerializationHandler.js +0 -388
- package/dist/esm/mods/security/src/components/secure-array/serialization/ArraySerializationHandler.js.map +0 -1
- package/dist/esm/mods/security/src/components/secure-array/types/index.js +0 -84
- package/dist/esm/mods/security/src/components/secure-array/types/index.js.map +0 -1
- package/dist/esm/mods/security/src/components/secure-array/utils/id-generator.js +0 -78
- package/dist/esm/mods/security/src/components/secure-array/utils/id-generator.js.map +0 -1
- package/dist/esm/mods/security/src/components/secure-array/utils/validation.js +0 -273
- package/dist/esm/mods/security/src/components/secure-array/utils/validation.js.map +0 -1
- package/dist/esm/mods/security/src/components/secure-memory.js +0 -884
- package/dist/esm/mods/security/src/components/secure-memory.js.map +0 -1
- package/dist/esm/mods/security/src/components/secure-object/core/secure-object-core.js +0 -1603
- package/dist/esm/mods/security/src/components/secure-object/core/secure-object-core.js.map +0 -1
- package/dist/esm/mods/security/src/components/secure-object/encryption/crypto-handler.js +0 -360
- package/dist/esm/mods/security/src/components/secure-object/encryption/crypto-handler.js.map +0 -1
- package/dist/esm/mods/security/src/components/secure-object/encryption/sensitive-keys.js +0 -203
- package/dist/esm/mods/security/src/components/secure-object/encryption/sensitive-keys.js.map +0 -1
- package/dist/esm/mods/security/src/components/secure-object/events/event-manager.js +0 -195
- package/dist/esm/mods/security/src/components/secure-object/events/event-manager.js.map +0 -1
- package/dist/esm/mods/security/src/components/secure-object/index.js +0 -63
- package/dist/esm/mods/security/src/components/secure-object/index.js.map +0 -1
- package/dist/esm/mods/security/src/components/secure-object/metadata/metadata-manager.js +0 -181
- package/dist/esm/mods/security/src/components/secure-object/metadata/metadata-manager.js.map +0 -1
- package/dist/esm/mods/security/src/components/secure-object/serialization/serialization-handler.js +0 -195
- package/dist/esm/mods/security/src/components/secure-object/serialization/serialization-handler.js.map +0 -1
- package/dist/esm/mods/security/src/components/secure-object/utils/id-generator.js +0 -62
- package/dist/esm/mods/security/src/components/secure-object/utils/id-generator.js.map +0 -1
- package/dist/esm/mods/security/src/components/secure-object/utils/validation.js +0 -237
- package/dist/esm/mods/security/src/components/secure-object/utils/validation.js.map +0 -1
- package/dist/esm/mods/security/src/components/secure-serialization.js +0 -769
- package/dist/esm/mods/security/src/components/secure-serialization.js.map +0 -1
- package/dist/esm/mods/security/src/components/secure-string/advanced/entropy-analyzer.js +0 -306
- package/dist/esm/mods/security/src/components/secure-string/advanced/entropy-analyzer.js.map +0 -1
- package/dist/esm/mods/security/src/components/secure-string/advanced/performance-monitor.js +0 -333
- package/dist/esm/mods/security/src/components/secure-string/advanced/performance-monitor.js.map +0 -1
- package/dist/esm/mods/security/src/components/secure-string/advanced/quantum-safe.js +0 -243
- package/dist/esm/mods/security/src/components/secure-string/advanced/quantum-safe.js.map +0 -1
- package/dist/esm/mods/security/src/components/secure-string/buffer/buffer-manager.js +0 -203
- package/dist/esm/mods/security/src/components/secure-string/buffer/buffer-manager.js.map +0 -1
- package/dist/esm/mods/security/src/components/secure-string/core/secure-string-core.js +0 -786
- package/dist/esm/mods/security/src/components/secure-string/core/secure-string-core.js.map +0 -1
- package/dist/esm/mods/security/src/components/secure-string/crypto/crypto-operations.js +0 -298
- package/dist/esm/mods/security/src/components/secure-string/crypto/crypto-operations.js.map +0 -1
- package/dist/esm/mods/security/src/components/secure-string/operations/comparison-operations.js +0 -219
- package/dist/esm/mods/security/src/components/secure-string/operations/comparison-operations.js.map +0 -1
- package/dist/esm/mods/security/src/components/secure-string/operations/string-operations.js +0 -232
- package/dist/esm/mods/security/src/components/secure-string/operations/string-operations.js.map +0 -1
- package/dist/esm/mods/security/src/components/secure-string/types/index.js +0 -37
- package/dist/esm/mods/security/src/components/secure-string/types/index.js.map +0 -1
- package/dist/esm/mods/security/src/components/secure-string/validation/string-validator.js +0 -332
- package/dist/esm/mods/security/src/components/secure-string/validation/string-validator.js.map +0 -1
- package/dist/esm/mods/security/src/components/side-channel.js +0 -142
- package/dist/esm/mods/security/src/components/side-channel.js.map +0 -1
- package/dist/esm/mods/security/src/components/tamper-evident-logging.js +0 -389
- package/dist/esm/mods/security/src/components/tamper-evident-logging.js.map +0 -1
- package/dist/esm/mods/security/src/const/buffer.const.js +0 -13
- package/dist/esm/mods/security/src/const/buffer.const.js.map +0 -1
- package/dist/esm/mods/security/src/core/crypto.js +0 -777
- package/dist/esm/mods/security/src/core/crypto.js.map +0 -1
- package/dist/esm/mods/security/src/core/hash/hash-advanced.js +0 -367
- package/dist/esm/mods/security/src/core/hash/hash-advanced.js.map +0 -1
- package/dist/esm/mods/security/src/core/hash/hash-core.js +0 -389
- package/dist/esm/mods/security/src/core/hash/hash-core.js.map +0 -1
- package/dist/esm/mods/security/src/core/hash/hash-entropy.js +0 -286
- package/dist/esm/mods/security/src/core/hash/hash-entropy.js.map +0 -1
- package/dist/esm/mods/security/src/core/hash/hash-security.js +0 -351
- package/dist/esm/mods/security/src/core/hash/hash-security.js.map +0 -1
- package/dist/esm/mods/security/src/core/hash/hash-types.js +0 -16
- package/dist/esm/mods/security/src/core/hash/hash-types.js.map +0 -1
- package/dist/esm/mods/security/src/core/hash/hash-utils.js +0 -307
- package/dist/esm/mods/security/src/core/hash/hash-utils.js.map +0 -1
- package/dist/esm/mods/security/src/core/hash/hash-validator.js +0 -310
- package/dist/esm/mods/security/src/core/hash/hash-validator.js.map +0 -1
- package/dist/esm/mods/security/src/core/hash.js +0 -9
- package/dist/esm/mods/security/src/core/hash.js.map +0 -1
- package/dist/esm/mods/security/src/core/keys/algorithms/mods/Argon2Algo.js +0 -133
- package/dist/esm/mods/security/src/core/keys/algorithms/mods/Argon2Algo.js.map +0 -1
- package/dist/esm/mods/security/src/core/keys/algorithms/mods/PBKDF2Algo.js +0 -272
- package/dist/esm/mods/security/src/core/keys/algorithms/mods/PBKDF2Algo.js.map +0 -1
- package/dist/esm/mods/security/src/core/keys/algorithms/mods/ScryptAlgo.js +0 -296
- package/dist/esm/mods/security/src/core/keys/algorithms/mods/ScryptAlgo.js.map +0 -1
- package/dist/esm/mods/security/src/core/keys/keys-core.js +0 -199
- package/dist/esm/mods/security/src/core/keys/keys-core.js.map +0 -1
- package/dist/esm/mods/security/src/core/keys/keys-logger.js +0 -231
- package/dist/esm/mods/security/src/core/keys/keys-logger.js.map +0 -1
- package/dist/esm/mods/security/src/core/keys/keys-types.js +0 -63
- package/dist/esm/mods/security/src/core/keys/keys-types.js.map +0 -1
- package/dist/esm/mods/security/src/core/keys/keys-utils.js +0 -316
- package/dist/esm/mods/security/src/core/keys/keys-utils.js.map +0 -1
- package/dist/esm/mods/security/src/core/keys.js +0 -134
- package/dist/esm/mods/security/src/core/keys.js.map +0 -1
- package/dist/esm/mods/security/src/core/password/index.js +0 -110
- package/dist/esm/mods/security/src/core/password/index.js.map +0 -1
- package/dist/esm/mods/security/src/core/password/password-algorithms.js +0 -395
- package/dist/esm/mods/security/src/core/password/password-algorithms.js.map +0 -1
- package/dist/esm/mods/security/src/core/password/password-core.js +0 -292
- package/dist/esm/mods/security/src/core/password/password-core.js.map +0 -1
- package/dist/esm/mods/security/src/core/password/password-generator.js +0 -363
- package/dist/esm/mods/security/src/core/password/password-generator.js.map +0 -1
- package/dist/esm/mods/security/src/core/password/password-migration.js +0 -235
- package/dist/esm/mods/security/src/core/password/password-migration.js.map +0 -1
- package/dist/esm/mods/security/src/core/password/password-security.js +0 -532
- package/dist/esm/mods/security/src/core/password/password-security.js.map +0 -1
- package/dist/esm/mods/security/src/core/password/password-types.js +0 -34
- package/dist/esm/mods/security/src/core/password/password-types.js.map +0 -1
- package/dist/esm/mods/security/src/core/password/password-utils.js +0 -630
- package/dist/esm/mods/security/src/core/password/password-utils.js.map +0 -1
- package/dist/esm/mods/security/src/core/password/swlist.js +0 -1120
- package/dist/esm/mods/security/src/core/password/swlist.js.map +0 -1
- package/dist/esm/mods/security/src/core/random/random-core.js +0 -960
- package/dist/esm/mods/security/src/core/random/random-core.js.map +0 -1
- package/dist/esm/mods/security/src/core/random/random-crypto.js +0 -337
- package/dist/esm/mods/security/src/core/random/random-crypto.js.map +0 -1
- package/dist/esm/mods/security/src/core/random/random-entropy.js +0 -366
- package/dist/esm/mods/security/src/core/random/random-entropy.js.map +0 -1
- package/dist/esm/mods/security/src/core/random/random-generators.js +0 -323
- package/dist/esm/mods/security/src/core/random/random-generators.js.map +0 -1
- package/dist/esm/mods/security/src/core/random/random-sources.js +0 -405
- package/dist/esm/mods/security/src/core/random/random-sources.js.map +0 -1
- package/dist/esm/mods/security/src/core/random/random-tokens.js +0 -307
- package/dist/esm/mods/security/src/core/random/random-tokens.js.map +0 -1
- package/dist/esm/mods/security/src/core/random/random-types.js +0 -27
- package/dist/esm/mods/security/src/core/random/random-types.js.map +0 -1
- package/dist/esm/mods/security/src/core/validators.js +0 -198
- package/dist/esm/mods/security/src/core/validators.js.map +0 -1
- package/dist/esm/mods/security/src/helpers/Uint8Array.js +0 -333
- package/dist/esm/mods/security/src/helpers/Uint8Array.js.map +0 -1
- package/dist/esm/mods/security/src/helpers/createEnu.js +0 -25
- package/dist/esm/mods/security/src/helpers/createEnu.js.map +0 -1
- package/dist/esm/mods/security/src/index.js +0 -340
- package/dist/esm/mods/security/src/index.js.map +0 -1
- package/dist/esm/mods/security/src/types/global.js +0 -49
- package/dist/esm/mods/security/src/types/global.js.map +0 -1
- package/dist/esm/mods/security/src/types/secure-mem.type.js +0 -102
- package/dist/esm/mods/security/src/types/secure-mem.type.js.map +0 -1
- package/dist/esm/mods/security/src/types/secure-memory.js +0 -20
- package/dist/esm/mods/security/src/types/secure-memory.js.map +0 -1
- package/dist/esm/mods/security/src/types.js +0 -63
- package/dist/esm/mods/security/src/types.js.map +0 -1
- package/dist/esm/mods/security/src/utils/CryptoAlgorithmUtils.js +0 -69
- package/dist/esm/mods/security/src/utils/CryptoAlgorithmUtils.js.map +0 -1
- package/dist/esm/mods/security/src/utils/constants.js +0 -105
- package/dist/esm/mods/security/src/utils/constants.js.map +0 -1
- package/dist/esm/mods/security/src/utils/crypto.utils.js +0 -380
- package/dist/esm/mods/security/src/utils/crypto.utils.js.map +0 -1
- package/dist/esm/mods/security/src/utils/dataConverter.js +0 -72
- package/dist/esm/mods/security/src/utils/dataConverter.js.map +0 -1
- package/dist/esm/mods/security/src/utils/encoding.js +0 -279
- package/dist/esm/mods/security/src/utils/encoding.js.map +0 -1
- package/dist/esm/mods/security/src/utils/errorHandler.js +0 -137
- package/dist/esm/mods/security/src/utils/errorHandler.js.map +0 -1
- package/dist/esm/mods/security/src/utils/memory/config-manager.js +0 -288
- package/dist/esm/mods/security/src/utils/memory/config-manager.js.map +0 -1
- package/dist/esm/mods/security/src/utils/memory/event-manager.js +0 -275
- package/dist/esm/mods/security/src/utils/memory/event-manager.js.map +0 -1
- package/dist/esm/mods/security/src/utils/memory/index.js +0 -141
- package/dist/esm/mods/security/src/utils/memory/index.js.map +0 -1
- package/dist/esm/mods/security/src/utils/memory/memory-manager.js +0 -886
- package/dist/esm/mods/security/src/utils/memory/memory-manager.js.map +0 -1
- package/dist/esm/mods/security/src/utils/memory/memory-pool.js +0 -354
- package/dist/esm/mods/security/src/utils/memory/memory-pool.js.map +0 -1
- package/dist/esm/mods/security/src/utils/memory/reference-tracker.js +0 -382
- package/dist/esm/mods/security/src/utils/memory/reference-tracker.js.map +0 -1
- package/dist/esm/mods/security/src/utils/memory/types.js +0 -56
- package/dist/esm/mods/security/src/utils/memory/types.js.map +0 -1
- package/dist/esm/mods/security/src/utils/patterns.js +0 -124
- package/dist/esm/mods/security/src/utils/patterns.js.map +0 -1
- package/dist/esm/mods/security/src/utils/performanceMonitor.js +0 -246
- package/dist/esm/mods/security/src/utils/performanceMonitor.js.map +0 -1
- package/dist/esm/mods/security/src/utils/stats.js +0 -180
- package/dist/esm/mods/security/src/utils/stats.js.map +0 -1
- package/dist/esm/package.json +0 -3
- package/dist/esm/shared/logger/Logger.js +0 -587
- package/dist/esm/shared/logger/Logger.js.map +0 -1
- package/dist/esm/src/FiUp.js +0 -82
- package/dist/esm/src/FiUp.js.map +0 -1
- package/dist/esm/src/cache/CacheFactory.js +0 -412
- package/dist/esm/src/cache/CacheFactory.js.map +0 -1
- package/dist/esm/src/cache/SecureCacheAdapter.js +0 -1237
- package/dist/esm/src/cache/SecureCacheAdapter.js.map +0 -1
- package/dist/esm/src/cluster/bun-cluster-manager.js +0 -1654
- package/dist/esm/src/cluster/bun-cluster-manager.js.map +0 -1
- package/dist/esm/src/cluster/cluster-manager.js +0 -1002
- package/dist/esm/src/cluster/cluster-manager.js.map +0 -1
- package/dist/esm/src/cluster/memory-manager.js +0 -483
- package/dist/esm/src/cluster/memory-manager.js.map +0 -1
- package/dist/esm/src/cluster/modules/AutoScaler.js +0 -530
- package/dist/esm/src/cluster/modules/AutoScaler.js.map +0 -1
- package/dist/esm/src/cluster/modules/BunIPCManager.js +0 -601
- package/dist/esm/src/cluster/modules/BunIPCManager.js.map +0 -1
- package/dist/esm/src/cluster/modules/ClusterPersistenceManager.js +0 -435
- package/dist/esm/src/cluster/modules/ClusterPersistenceManager.js.map +0 -1
- package/dist/esm/src/cluster/modules/CpuMonitor.js +0 -657
- package/dist/esm/src/cluster/modules/CpuMonitor.js.map +0 -1
- package/dist/esm/src/cluster/modules/CrossPlatformMemory.js +0 -326
- package/dist/esm/src/cluster/modules/CrossPlatformMemory.js.map +0 -1
- package/dist/esm/src/cluster/modules/EventLoopMonitor.js +0 -263
- package/dist/esm/src/cluster/modules/EventLoopMonitor.js.map +0 -1
- package/dist/esm/src/cluster/modules/GCStatsTracker.js +0 -198
- package/dist/esm/src/cluster/modules/GCStatsTracker.js.map +0 -1
- package/dist/esm/src/cluster/modules/HealthMonitor.js +0 -440
- package/dist/esm/src/cluster/modules/HealthMonitor.js.map +0 -1
- package/dist/esm/src/cluster/modules/HeapStatsCollector.js +0 -109
- package/dist/esm/src/cluster/modules/HeapStatsCollector.js.map +0 -1
- package/dist/esm/src/cluster/modules/IPCManager.js +0 -759
- package/dist/esm/src/cluster/modules/IPCManager.js.map +0 -1
- package/dist/esm/src/cluster/modules/MetricsCollector.js +0 -538
- package/dist/esm/src/cluster/modules/MetricsCollector.js.map +0 -1
- package/dist/esm/src/cluster/modules/NetworkTracker.js +0 -160
- package/dist/esm/src/cluster/modules/NetworkTracker.js.map +0 -1
- package/dist/esm/src/cluster/modules/ProcessMonitor.js +0 -511
- package/dist/esm/src/cluster/modules/ProcessMonitor.js.map +0 -1
- package/dist/esm/src/cluster/modules/ThroughputCalculator.js +0 -184
- package/dist/esm/src/cluster/modules/ThroughputCalculator.js.map +0 -1
- package/dist/esm/src/cluster/modules/WorkerManager.js +0 -1165
- package/dist/esm/src/cluster/modules/WorkerManager.js.map +0 -1
- package/dist/esm/src/cluster/modules/strategy/LoadBalancer.js +0 -1102
- package/dist/esm/src/cluster/modules/strategy/LoadBalancer.js.map +0 -1
- package/dist/esm/src/config.js +0 -362
- package/dist/esm/src/config.js.map +0 -1
- package/dist/esm/src/const.js +0 -574
- package/dist/esm/src/const.js.map +0 -1
- package/dist/esm/src/encryption/EncryptionService.js +0 -401
- package/dist/esm/src/encryption/EncryptionService.js.map +0 -1
- package/dist/esm/src/file-upload.js +0 -251
- package/dist/esm/src/file-upload.js.map +0 -1
- package/dist/esm/src/index.js +0 -62
- package/dist/esm/src/index.js.map +0 -1
- package/dist/esm/src/middleware/XJsonResponseHandler.js +0 -150
- package/dist/esm/src/middleware/XJsonResponseHandler.js.map +0 -1
- package/dist/esm/src/middleware/XemsSessionMiddleware.js +0 -86
- package/dist/esm/src/middleware/XemsSessionMiddleware.js.map +0 -1
- package/dist/esm/src/middleware/XyPrissMiddlewareAPI.js +0 -352
- package/dist/esm/src/middleware/XyPrissMiddlewareAPI.js.map +0 -1
- package/dist/esm/src/middleware/built-in/BuiltInMiddleware.js +0 -522
- package/dist/esm/src/middleware/built-in/BuiltInMiddleware.js.map +0 -1
- package/dist/esm/src/middleware/built-in/security/BrowserOnlyProtector.js +0 -550
- package/dist/esm/src/middleware/built-in/security/BrowserOnlyProtector.js.map +0 -1
- package/dist/esm/src/middleware/built-in/security/CommandInjectionDetector.js +0 -213
- package/dist/esm/src/middleware/built-in/security/CommandInjectionDetector.js.map +0 -1
- package/dist/esm/src/middleware/built-in/security/LDAPInjectionDetector.js +0 -94
- package/dist/esm/src/middleware/built-in/security/LDAPInjectionDetector.js.map +0 -1
- package/dist/esm/src/middleware/built-in/security/MobileOnlyProtector.js +0 -502
- package/dist/esm/src/middleware/built-in/security/MobileOnlyProtector.js.map +0 -1
- package/dist/esm/src/middleware/built-in/security/PathTraversalDetector.js +0 -210
- package/dist/esm/src/middleware/built-in/security/PathTraversalDetector.js.map +0 -1
- package/dist/esm/src/middleware/built-in/security/RequestSignatureProtector.js +0 -460
- package/dist/esm/src/middleware/built-in/security/RequestSignatureProtector.js.map +0 -1
- package/dist/esm/src/middleware/built-in/security/SQLInjectionDetector.js +0 -333
- package/dist/esm/src/middleware/built-in/security/SQLInjectionDetector.js.map +0 -1
- package/dist/esm/src/middleware/built-in/security/TerminalOnlyProtector.js +0 -476
- package/dist/esm/src/middleware/built-in/security/TerminalOnlyProtector.js.map +0 -1
- package/dist/esm/src/middleware/built-in/security/XXEProtector.js +0 -173
- package/dist/esm/src/middleware/built-in/security/XXEProtector.js.map +0 -1
- package/dist/esm/src/middleware/safe-json-middleware.js +0 -153
- package/dist/esm/src/middleware/safe-json-middleware.js.map +0 -1
- package/dist/esm/src/middleware/security-middleware.js +0 -1057
- package/dist/esm/src/middleware/security-middleware.js.map +0 -1
- package/dist/esm/src/plugins/PluginManager.js +0 -408
- package/dist/esm/src/plugins/PluginManager.js.map +0 -1
- package/dist/esm/src/plugins/api/PluginAPI.js +0 -184
- package/dist/esm/src/plugins/api/PluginAPI.js.map +0 -1
- package/dist/esm/src/plugins/const/PluginHookIds.js +0 -61
- package/dist/esm/src/plugins/const/PluginHookIds.js.map +0 -1
- package/dist/esm/src/plugins/core/PluginManager.js +0 -675
- package/dist/esm/src/plugins/core/PluginManager.js.map +0 -1
- package/dist/esm/src/plugins/modules/PluginEngine.js +0 -492
- package/dist/esm/src/plugins/modules/PluginEngine.js.map +0 -1
- package/dist/esm/src/plugins/modules/PluginRegistry.js +0 -307
- package/dist/esm/src/plugins/modules/PluginRegistry.js.map +0 -1
- package/dist/esm/src/plugins/modules/builtin/JWTAuthPlugin.js +0 -589
- package/dist/esm/src/plugins/modules/builtin/JWTAuthPlugin.js.map +0 -1
- package/dist/esm/src/plugins/modules/builtin/ResponseTimePlugin.js +0 -411
- package/dist/esm/src/plugins/modules/builtin/ResponseTimePlugin.js.map +0 -1
- package/dist/esm/src/plugins/modules/builtin/SmartCachePlugin.js +0 -841
- package/dist/esm/src/plugins/modules/builtin/SmartCachePlugin.js.map +0 -1
- package/dist/esm/src/plugins/modules/builtin/server-maintenance-plugin.js +0 -566
- package/dist/esm/src/plugins/modules/builtin/server-maintenance-plugin.js.map +0 -1
- package/dist/esm/src/plugins/modules/core/CachePlugin.js +0 -1975
- package/dist/esm/src/plugins/modules/core/CachePlugin.js.map +0 -1
- package/dist/esm/src/plugins/modules/core/PerformancePlugin.js +0 -872
- package/dist/esm/src/plugins/modules/core/PerformancePlugin.js.map +0 -1
- package/dist/esm/src/plugins/modules/core/SecurityPlugin.js +0 -797
- package/dist/esm/src/plugins/modules/core/SecurityPlugin.js.map +0 -1
- package/dist/esm/src/plugins/modules/index.js +0 -273
- package/dist/esm/src/plugins/modules/index.js.map +0 -1
- package/dist/esm/src/plugins/modules/network/builtin/CompressionPlugin.js +0 -281
- package/dist/esm/src/plugins/modules/network/builtin/CompressionPlugin.js.map +0 -1
- package/dist/esm/src/plugins/modules/network/builtin/ConnectionPlugin.js +0 -776
- package/dist/esm/src/plugins/modules/network/builtin/ConnectionPlugin.js.map +0 -1
- package/dist/esm/src/plugins/modules/network/builtin/ProxyPlugin.js +0 -422
- package/dist/esm/src/plugins/modules/network/builtin/ProxyPlugin.js.map +0 -1
- package/dist/esm/src/plugins/modules/network/builtin/RateLimitPlugin.js +0 -584
- package/dist/esm/src/plugins/modules/network/builtin/RateLimitPlugin.js.map +0 -1
- package/dist/esm/src/plugins/modules/network/core/NetworkPlugin.js +0 -228
- package/dist/esm/src/plugins/modules/network/core/NetworkPlugin.js.map +0 -1
- package/dist/esm/src/plugins/modules/network/core/NetworkPluginFactory.js +0 -38
- package/dist/esm/src/plugins/modules/network/core/NetworkPluginFactory.js.map +0 -1
- package/dist/esm/src/plugins/modules/network/types/NetworkTypes.js +0 -24
- package/dist/esm/src/plugins/modules/network/types/NetworkTypes.js.map +0 -1
- package/dist/esm/src/plugins/modules/network/utils/NetworkPluginUtils.js +0 -61
- package/dist/esm/src/plugins/modules/network/utils/NetworkPluginUtils.js.map +0 -1
- package/dist/esm/src/plugins/modules/types/PluginTypes.js +0 -48
- package/dist/esm/src/plugins/modules/types/PluginTypes.js.map +0 -1
- package/dist/esm/src/plugins/modules/xems/XemsBuiltinPlugin.js +0 -214
- package/dist/esm/src/plugins/modules/xems/XemsBuiltinPlugin.js.map +0 -1
- package/dist/esm/src/plugins/modules/xems/XemsPlugin.js +0 -349
- package/dist/esm/src/plugins/modules/xems/XemsPlugin.js.map +0 -1
- package/dist/esm/src/plugins/plugin-manager.js +0 -149
- package/dist/esm/src/plugins/plugin-manager.js.map +0 -1
- package/dist/esm/src/plugins/route-optimization-plugin.js +0 -419
- package/dist/esm/src/plugins/route-optimization-plugin.js.map +0 -1
- package/dist/esm/src/plugins/server-maintenance-plugin.js +0 -566
- package/dist/esm/src/plugins/server-maintenance-plugin.js.map +0 -1
- package/dist/esm/src/quick-start.js +0 -41
- package/dist/esm/src/quick-start.js.map +0 -1
- package/dist/esm/src/schemas/plugingSchema.js +0 -38
- package/dist/esm/src/schemas/plugingSchema.js.map +0 -1
- package/dist/esm/src/server/FastServer.js +0 -856
- package/dist/esm/src/server/FastServer.js.map +0 -1
- package/dist/esm/src/server/ServerFactory.js +0 -62
- package/dist/esm/src/server/ServerFactory.js.map +0 -1
- package/dist/esm/src/server/components/fastapi/CacheManager.js +0 -243
- package/dist/esm/src/server/components/fastapi/CacheManager.js.map +0 -1
- package/dist/esm/src/server/components/fastapi/ClusterManagerComponent.js +0 -567
- package/dist/esm/src/server/components/fastapi/ClusterManagerComponent.js.map +0 -1
- package/dist/esm/src/server/components/fastapi/FileUploadManager.js +0 -176
- package/dist/esm/src/server/components/fastapi/FileUploadManager.js.map +0 -1
- package/dist/esm/src/server/components/fastapi/FileWatcherManager.js +0 -534
- package/dist/esm/src/server/components/fastapi/FileWatcherManager.js.map +0 -1
- package/dist/esm/src/server/components/fastapi/MonitoringManager.js +0 -305
- package/dist/esm/src/server/components/fastapi/MonitoringManager.js.map +0 -1
- package/dist/esm/src/server/components/fastapi/PerformanceManager.js +0 -295
- package/dist/esm/src/server/components/fastapi/PerformanceManager.js.map +0 -1
- package/dist/esm/src/server/components/fastapi/PluginManager.js +0 -393
- package/dist/esm/src/server/components/fastapi/PluginManager.js.map +0 -1
- package/dist/esm/src/server/components/fastapi/RedirectManager.js +0 -485
- package/dist/esm/src/server/components/fastapi/RedirectManager.js.map +0 -1
- package/dist/esm/src/server/components/fastapi/RequestProcessor.js +0 -211
- package/dist/esm/src/server/components/fastapi/RequestProcessor.js.map +0 -1
- package/dist/esm/src/server/components/fastapi/RouteManager.js +0 -188
- package/dist/esm/src/server/components/fastapi/RouteManager.js.map +0 -1
- package/dist/esm/src/server/components/fastapi/WorkerPoolComponent.js +0 -80
- package/dist/esm/src/server/components/fastapi/WorkerPoolComponent.js.map +0 -1
- package/dist/esm/src/server/components/fastapi/console/ConsoleInterceptor.js +0 -978
- package/dist/esm/src/server/components/fastapi/console/ConsoleInterceptor.js.map +0 -1
- package/dist/esm/src/server/components/fastapi/console/encryption/ConsoleEncryption.js +0 -214
- package/dist/esm/src/server/components/fastapi/console/encryption/ConsoleEncryption.js.map +0 -1
- package/dist/esm/src/server/components/fastapi/console/types.js +0 -160
- package/dist/esm/src/server/components/fastapi/console/types.js.map +0 -1
- package/dist/esm/src/server/components/fastapi/modules/UFRP/WorkerPoolManager.js +0 -263
- package/dist/esm/src/server/components/fastapi/modules/UFRP/WorkerPoolManager.js.map +0 -1
- package/dist/esm/src/server/components/fastapi/modules/UFRP/workers/Logger.js +0 -236
- package/dist/esm/src/server/components/fastapi/modules/UFRP/workers/cpu-tasks.js +0 -294
- package/dist/esm/src/server/components/fastapi/modules/UFRP/workers/enhanced-cpu-worker.js +0 -433
- package/dist/esm/src/server/components/fastapi/modules/UFRP/workers/io-worker.js +0 -1617
- package/dist/esm/src/server/components/fastapi/smart-routes.js +0 -345
- package/dist/esm/src/server/components/fastapi/smart-routes.js.map +0 -1
- package/dist/esm/src/server/components/fastapi/templates/redirectTemp.js +0 -99
- package/dist/esm/src/server/components/fastapi/templates/redirectTemp.js.map +0 -1
- package/dist/esm/src/server/components/lifecycle/ServerLifecycleManager.js +0 -520
- package/dist/esm/src/server/components/lifecycle/ServerLifecycleManager.js.map +0 -1
- package/dist/esm/src/server/components/multi-server/MultiServerApp.js +0 -532
- package/dist/esm/src/server/components/multi-server/MultiServerApp.js.map +0 -1
- package/dist/esm/src/server/components/multi-server/MultiServerManager.js +0 -324
- package/dist/esm/src/server/components/multi-server/MultiServerManager.js.map +0 -1
- package/dist/esm/src/server/conf/networkConnectionConf.js +0 -23
- package/dist/esm/src/server/conf/networkConnectionConf.js.map +0 -1
- package/dist/esm/src/server/conf/proxyConfig.js +0 -21
- package/dist/esm/src/server/conf/proxyConfig.js.map +0 -1
- package/dist/esm/src/server/const/Cluster.config.js +0 -213
- package/dist/esm/src/server/const/Cluster.config.js.map +0 -1
- package/dist/esm/src/server/const/ExecutionPredictor_EP.const.js +0 -62
- package/dist/esm/src/server/const/ExecutionPredictor_EP.const.js.map +0 -1
- package/dist/esm/src/server/const/FileWatcher.config.js +0 -96
- package/dist/esm/src/server/const/FileWatcher.config.js.map +0 -1
- package/dist/esm/src/server/const/default.js +0 -389
- package/dist/esm/src/server/const/default.js.map +0 -1
- package/dist/esm/src/server/const/http.js +0 -17
- package/dist/esm/src/server/const/http.js.map +0 -1
- package/dist/esm/src/server/core/HttpServer.js +0 -394
- package/dist/esm/src/server/core/HttpServer.js.map +0 -1
- package/dist/esm/src/server/core/RequestApp.js +0 -93
- package/dist/esm/src/server/core/RequestApp.js.map +0 -1
- package/dist/esm/src/server/core/RequestEnhancer.js +0 -286
- package/dist/esm/src/server/core/RequestEnhancer.js.map +0 -1
- package/dist/esm/src/server/core/ResponseEnhancer.js +0 -516
- package/dist/esm/src/server/core/ResponseEnhancer.js.map +0 -1
- package/dist/esm/src/server/core/StartupProcessor.js +0 -109
- package/dist/esm/src/server/core/StartupProcessor.js.map +0 -1
- package/dist/esm/src/server/core/VirtualServer.js +0 -31
- package/dist/esm/src/server/core/VirtualServer.js.map +0 -1
- package/dist/esm/src/server/core/XHSCBridge.js +0 -502
- package/dist/esm/src/server/core/XHSCBridge.js.map +0 -1
- package/dist/esm/src/server/core/XHSCProtocol.js +0 -311
- package/dist/esm/src/server/core/XHSCProtocol.js.map +0 -1
- package/dist/esm/src/server/core/XyDiagnosticsManager.js +0 -76
- package/dist/esm/src/server/core/XyDiagnosticsManager.js.map +0 -1
- package/dist/esm/src/server/core/XyLifecycleManager.js +0 -235
- package/dist/esm/src/server/core/XyLifecycleManager.js.map +0 -1
- package/dist/esm/src/server/core/XyModuleManager.js +0 -159
- package/dist/esm/src/server/core/XyModuleManager.js.map +0 -1
- package/dist/esm/src/server/core/XyRoutingManager.js +0 -185
- package/dist/esm/src/server/core/XyRoutingManager.js.map +0 -1
- package/dist/esm/src/server/core/XyServerCreator.js +0 -95
- package/dist/esm/src/server/core/XyServerCreator.js.map +0 -1
- package/dist/esm/src/server/core/XyprissApp.js +0 -481
- package/dist/esm/src/server/core/XyprissApp.js.map +0 -1
- package/dist/esm/src/server/core/request/XyRequestManager.js +0 -227
- package/dist/esm/src/server/core/request/XyRequestManager.js.map +0 -1
- package/dist/esm/src/server/handlers/NotFoundHandler.js +0 -81
- package/dist/esm/src/server/handlers/NotFoundHandler.js.map +0 -1
- package/dist/esm/src/server/handlers/templates/notFoundTemplate.js +0 -653
- package/dist/esm/src/server/handlers/templates/notFoundTemplate.js.map +0 -1
- package/dist/esm/src/server/middleware/MiddlewareManager.js +0 -195
- package/dist/esm/src/server/middleware/MiddlewareManager.js.map +0 -1
- package/dist/esm/src/server/optimization/ExecutionPredictor.js +0 -216
- package/dist/esm/src/server/optimization/ExecutionPredictor.js.map +0 -1
- package/dist/esm/src/server/optimization/PerformanceProfiler.js +0 -232
- package/dist/esm/src/server/optimization/PerformanceProfiler.js.map +0 -1
- package/dist/esm/src/server/optimization/RequestPreCompiler.js +0 -707
- package/dist/esm/src/server/optimization/RequestPreCompiler.js.map +0 -1
- package/dist/esm/src/server/optimization/UltraFastOptimizer.js +0 -424
- package/dist/esm/src/server/optimization/UltraFastOptimizer.js.map +0 -1
- package/dist/esm/src/server/optimization/performance-monitor.js +0 -160
- package/dist/esm/src/server/optimization/performance-monitor.js.map +0 -1
- package/dist/esm/src/server/routing/Router.js +0 -351
- package/dist/esm/src/server/routing/Router.js.map +0 -1
- package/dist/esm/src/server/service/Reload/FileWatcher.js +0 -734
- package/dist/esm/src/server/service/Reload/FileWatcher.js.map +0 -1
- package/dist/esm/src/server/service/Reload/HotReloader.js +0 -735
- package/dist/esm/src/server/service/Reload/HotReloader.js.map +0 -1
- package/dist/esm/src/server/service/Reload/exec/TypeScriptExecutor.js +0 -339
- package/dist/esm/src/server/service/Reload/exec/TypeScriptExecutor.js.map +0 -1
- package/dist/esm/src/server/utils/ConfigLoader.js +0 -339
- package/dist/esm/src/server/utils/ConfigLoader.js.map +0 -1
- package/dist/esm/src/server/utils/PortManager.js +0 -235
- package/dist/esm/src/server/utils/PortManager.js.map +0 -1
- package/dist/esm/src/server/utils/WorkerModeHandler.js +0 -63
- package/dist/esm/src/server/utils/WorkerModeHandler.js.map +0 -1
- package/dist/esm/src/server/utils/forceClosePort.js +0 -330
- package/dist/esm/src/server/utils/forceClosePort.js.map +0 -1
- package/dist/esm/src/server/utils/shouldRegisterRouteOnServer.js +0 -32
- package/dist/esm/src/server/utils/shouldRegisterRouteOnServer.js.map +0 -1
- package/dist/esm/src/server/utils/trustProxy.js +0 -776
- package/dist/esm/src/server/utils/trustProxy.js.map +0 -1
- package/dist/esm/src/sys/FSApi.js +0 -1142
- package/dist/esm/src/sys/FSApi.js.map +0 -1
- package/dist/esm/src/sys/FileSystem.js +0 -1300
- package/dist/esm/src/sys/FileSystem.js.map +0 -1
- package/dist/esm/src/sys/PathApi.js +0 -199
- package/dist/esm/src/sys/PathApi.js.map +0 -1
- package/dist/esm/src/sys/SysApi.js +0 -419
- package/dist/esm/src/sys/SysApi.js.map +0 -1
- package/dist/esm/src/sys/System.js +0 -38
- package/dist/esm/src/sys/System.js.map +0 -1
- package/dist/esm/src/sys/XyPrissCache.js +0 -68
- package/dist/esm/src/sys/XyPrissCache.js.map +0 -1
- package/dist/esm/src/sys/XyPrissRunner.js +0 -244
- package/dist/esm/src/sys/XyPrissRunner.js.map +0 -1
- package/dist/esm/src/sys.js +0 -401
- package/dist/esm/src/sys.js.map +0 -1
- package/dist/esm/src/types/NotFoundConfig.js +0 -84
- package/dist/esm/src/types/NotFoundConfig.js.map +0 -1
- package/dist/esm/src/utils/DotEnvLoader.js +0 -72
- package/dist/esm/src/utils/DotEnvLoader.js.map +0 -1
- package/dist/esm/src/utils/mergeWithDefaults.js +0 -174
- package/dist/esm/src/utils/mergeWithDefaults.js.map +0 -1
- package/dist/esm/src/xhs/cluster/XHSCWorker.js +0 -181
- package/dist/esm/src/xhs/cluster/XHSCWorker.js.map +0 -1
- package/dist/index.d.ts +0 -9398
|
@@ -0,0 +1,1541 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* XyPriss Security Middleware
|
|
3
|
+
* Comprehensive security middleware using BuiltInMiddleware as single source of truth
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { XyPrissSecurity as XyPrissJS } from "xypriss-security";
|
|
7
|
+
import {
|
|
8
|
+
SecurityConfig,
|
|
9
|
+
SecurityLevel,
|
|
10
|
+
RateLimitConfig,
|
|
11
|
+
CSRFConfig,
|
|
12
|
+
HelmetConfig,
|
|
13
|
+
RequestSignatureConfig,
|
|
14
|
+
CompressionConfig,
|
|
15
|
+
HPPConfig,
|
|
16
|
+
MongoSanitizeConfig,
|
|
17
|
+
MorganConfig,
|
|
18
|
+
SlowDownConfig,
|
|
19
|
+
CORSConfig,
|
|
20
|
+
XSSConfig,
|
|
21
|
+
SQLInjectionConfig,
|
|
22
|
+
PathTraversalConfig,
|
|
23
|
+
CommandInjectionConfig,
|
|
24
|
+
XXEConfig,
|
|
25
|
+
LDAPInjectionConfig,
|
|
26
|
+
SecurityModuleRouteConfig,
|
|
27
|
+
RoutePattern,
|
|
28
|
+
} from "../types/mod/security";
|
|
29
|
+
import {
|
|
30
|
+
NextFunction,
|
|
31
|
+
XyPrisRequest,
|
|
32
|
+
XyPrisResponse,
|
|
33
|
+
} from "../types/httpServer.type";
|
|
34
|
+
import {
|
|
35
|
+
SQLInjectionDetector,
|
|
36
|
+
PathTraversalDetector,
|
|
37
|
+
CommandInjectionDetector,
|
|
38
|
+
XXEProtector,
|
|
39
|
+
LDAPInjectionDetector,
|
|
40
|
+
BrowserOnlyProtector,
|
|
41
|
+
TerminalOnlyProtector,
|
|
42
|
+
MobileOnlyProtector,
|
|
43
|
+
BrowserOnlyConfig,
|
|
44
|
+
TerminalOnlyConfig,
|
|
45
|
+
MobileOnlyConfig,
|
|
46
|
+
} from "./built-in/security";
|
|
47
|
+
import { Logger } from "../../shared/logger/Logger";
|
|
48
|
+
import { BuiltInMiddleware } from "./built-in/BuiltInMiddleware";
|
|
49
|
+
import xss from "xss"; // Used for custom XSS sanitization logic
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Security middleware class implementing comprehensive protection
|
|
53
|
+
* Implements SecurityConfig interface to ensure type safety
|
|
54
|
+
*/
|
|
55
|
+
export class SecurityMiddleware {
|
|
56
|
+
// SecurityConfig properties
|
|
57
|
+
public level: SecurityLevel;
|
|
58
|
+
public csrf: boolean | CSRFConfig;
|
|
59
|
+
public helmet: boolean | HelmetConfig;
|
|
60
|
+
public xss: boolean | XSSConfig;
|
|
61
|
+
public sqlInjection: boolean | SQLInjectionConfig;
|
|
62
|
+
public pathTraversal: boolean | PathTraversalConfig;
|
|
63
|
+
public commandInjection: boolean | CommandInjectionConfig;
|
|
64
|
+
public xxe: boolean | XXEConfig;
|
|
65
|
+
public ldapInjection: boolean | LDAPInjectionConfig;
|
|
66
|
+
public bruteForce: boolean | RateLimitConfig;
|
|
67
|
+
public rateLimit: boolean | RateLimitConfig;
|
|
68
|
+
public cors: boolean | CORSConfig;
|
|
69
|
+
public compression: boolean | CompressionConfig;
|
|
70
|
+
public hpp: boolean | HPPConfig;
|
|
71
|
+
public mongoSanitize: boolean | MongoSanitizeConfig;
|
|
72
|
+
public morgan: boolean | MorganConfig;
|
|
73
|
+
public slowDown: boolean | SlowDownConfig;
|
|
74
|
+
public browserOnly: boolean | BrowserOnlyConfig;
|
|
75
|
+
public terminalOnly: boolean | TerminalOnlyConfig;
|
|
76
|
+
public mobileOnly: boolean | MobileOnlyConfig;
|
|
77
|
+
public deviceAccess?: {
|
|
78
|
+
browserOnly?: boolean | BrowserOnlyConfig;
|
|
79
|
+
terminalOnly?: boolean | TerminalOnlyConfig;
|
|
80
|
+
mobileOnly?: boolean | MobileOnlyConfig;
|
|
81
|
+
};
|
|
82
|
+
public requestSignature: boolean | RequestSignatureConfig;
|
|
83
|
+
public encryption: Required<SecurityConfig>["encryption"];
|
|
84
|
+
public authentication: Required<SecurityConfig>["authentication"];
|
|
85
|
+
public routeConfig?: SecurityConfig["routeConfig"];
|
|
86
|
+
|
|
87
|
+
// Middleware instances from external libraries
|
|
88
|
+
private helmetMiddleware: any;
|
|
89
|
+
private corsMiddleware: any;
|
|
90
|
+
private rateLimitMiddleware: any;
|
|
91
|
+
private bruteForceMiddleware: any; // Separate middleware for brute force
|
|
92
|
+
private csrfMiddleware: any;
|
|
93
|
+
private browserOnlyMiddleware: any;
|
|
94
|
+
private terminalOnlyMiddleware: any;
|
|
95
|
+
private mobileOnlyMiddleware: any;
|
|
96
|
+
private requestSignatureMiddleware: any;
|
|
97
|
+
private mongoSanitizeMiddleware: any;
|
|
98
|
+
private hppMiddleware: any;
|
|
99
|
+
private compressionMiddleware: any;
|
|
100
|
+
private morganMiddleware: any;
|
|
101
|
+
private slowDownMiddleware: any;
|
|
102
|
+
|
|
103
|
+
// Security detectors
|
|
104
|
+
private sqlInjectionDetector: SQLInjectionDetector;
|
|
105
|
+
private pathTraversalDetector: PathTraversalDetector;
|
|
106
|
+
private commandInjectionDetector: CommandInjectionDetector;
|
|
107
|
+
private xxeProtector: XXEProtector;
|
|
108
|
+
private ldapInjectionDetector: LDAPInjectionDetector;
|
|
109
|
+
|
|
110
|
+
// Access control protectors
|
|
111
|
+
private browserOnlyProtector?: BrowserOnlyProtector;
|
|
112
|
+
private terminalOnlyProtector?: TerminalOnlyProtector;
|
|
113
|
+
private mobileOnlyProtector?: MobileOnlyProtector;
|
|
114
|
+
|
|
115
|
+
// Logger instance
|
|
116
|
+
private logger: Logger;
|
|
117
|
+
|
|
118
|
+
constructor(config: SecurityConfig = {}, logger?: Logger) {
|
|
119
|
+
// Initialize logger (create default if not provided)
|
|
120
|
+
this.logger =
|
|
121
|
+
logger ||
|
|
122
|
+
new Logger({
|
|
123
|
+
enabled: true,
|
|
124
|
+
level: "debug",
|
|
125
|
+
components: { security: true },
|
|
126
|
+
types: { debug: true },
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
// Set defaults and merge with provided config
|
|
130
|
+
this.level = config.level || "enhanced";
|
|
131
|
+
this.csrf = config.csrf !== false ? config.csrf || true : false;
|
|
132
|
+
this.helmet = config.helmet !== false ? config.helmet || true : false;
|
|
133
|
+
this.xss = config.xss !== false ? config.xss || true : false;
|
|
134
|
+
this.sqlInjection =
|
|
135
|
+
config.sqlInjection !== false ? config.sqlInjection || true : false;
|
|
136
|
+
this.pathTraversal =
|
|
137
|
+
config.pathTraversal !== false
|
|
138
|
+
? config.pathTraversal || false
|
|
139
|
+
: false;
|
|
140
|
+
this.commandInjection =
|
|
141
|
+
config.commandInjection !== false
|
|
142
|
+
? config.commandInjection || false
|
|
143
|
+
: false;
|
|
144
|
+
this.xxe = config.xxe !== false ? config.xxe || false : false;
|
|
145
|
+
this.ldapInjection =
|
|
146
|
+
config.ldapInjection !== false
|
|
147
|
+
? config.ldapInjection || false
|
|
148
|
+
: false;
|
|
149
|
+
this.bruteForce =
|
|
150
|
+
config.bruteForce !== false ? config.bruteForce || true : false;
|
|
151
|
+
this.rateLimit =
|
|
152
|
+
config.rateLimit !== false ? config.rateLimit || true : false;
|
|
153
|
+
|
|
154
|
+
// If rateLimit is explicitly configured as an object, disable bruteForce to avoid conflicts
|
|
155
|
+
if (typeof config.rateLimit === "object" && config.rateLimit !== null) {
|
|
156
|
+
this.bruteForce = false;
|
|
157
|
+
this.logger.debug(
|
|
158
|
+
"security",
|
|
159
|
+
"Brute force protection disabled because rateLimit is explicitly configured"
|
|
160
|
+
);
|
|
161
|
+
}
|
|
162
|
+
this.cors = config.cors !== false ? config.cors || true : false;
|
|
163
|
+
this.compression =
|
|
164
|
+
config.compression !== false ? config.compression || true : false;
|
|
165
|
+
this.hpp = config.hpp !== false ? config.hpp || true : false;
|
|
166
|
+
this.mongoSanitize =
|
|
167
|
+
config.mongoSanitize !== false
|
|
168
|
+
? config.mongoSanitize || true
|
|
169
|
+
: false;
|
|
170
|
+
this.morgan = config.morgan !== false ? config.morgan || true : false;
|
|
171
|
+
this.slowDown =
|
|
172
|
+
config.slowDown !== false ? config.slowDown || true : false;
|
|
173
|
+
this.browserOnly =
|
|
174
|
+
config.browserOnly !== false ? config.browserOnly || false : false;
|
|
175
|
+
this.terminalOnly =
|
|
176
|
+
config.terminalOnly !== false
|
|
177
|
+
? config.terminalOnly || false
|
|
178
|
+
: false;
|
|
179
|
+
this.requestSignature =
|
|
180
|
+
config.requestSignature !== false
|
|
181
|
+
? config.requestSignature || false
|
|
182
|
+
: false;
|
|
183
|
+
this.mobileOnly =
|
|
184
|
+
config.mobileOnly !== false ? config.mobileOnly || false : false;
|
|
185
|
+
this.deviceAccess = config.deviceAccess;
|
|
186
|
+
|
|
187
|
+
// If deviceAccess is provided, override individual settings
|
|
188
|
+
if (this.deviceAccess) {
|
|
189
|
+
this.browserOnly = this.deviceAccess.browserOnly || false;
|
|
190
|
+
this.terminalOnly = this.deviceAccess.terminalOnly || false;
|
|
191
|
+
this.mobileOnly = this.deviceAccess.mobileOnly || false;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
// Validate device access configuration
|
|
195
|
+
this.validateDeviceAccessConfig();
|
|
196
|
+
|
|
197
|
+
this.encryption = {
|
|
198
|
+
algorithm: "AES-256-GCM",
|
|
199
|
+
keySize: 32,
|
|
200
|
+
...config.encryption,
|
|
201
|
+
};
|
|
202
|
+
|
|
203
|
+
this.authentication = {
|
|
204
|
+
jwt: {
|
|
205
|
+
secret:
|
|
206
|
+
config.authentication?.jwt?.secret ||
|
|
207
|
+
XyPrissJS.generateSecureToken({
|
|
208
|
+
length: 32,
|
|
209
|
+
entropy: "high",
|
|
210
|
+
}),
|
|
211
|
+
expiresIn: config.authentication?.jwt?.expiresIn || "1h",
|
|
212
|
+
algorithm: config.authentication?.jwt?.algorithm || "HS256",
|
|
213
|
+
},
|
|
214
|
+
session: {
|
|
215
|
+
secret:
|
|
216
|
+
config.authentication?.session?.secret ||
|
|
217
|
+
XyPrissJS.generateSecureToken({
|
|
218
|
+
length: 32,
|
|
219
|
+
entropy: "high",
|
|
220
|
+
}),
|
|
221
|
+
name:
|
|
222
|
+
config.authentication?.session?.name ||
|
|
223
|
+
"xypriss.nehonix.sid",
|
|
224
|
+
cookie: {
|
|
225
|
+
maxAge: 24 * 60 * 60 * 1000, // 24 hours
|
|
226
|
+
secure: true,
|
|
227
|
+
httpOnly: true,
|
|
228
|
+
sameSite: "strict",
|
|
229
|
+
...config.authentication?.session?.cookie,
|
|
230
|
+
},
|
|
231
|
+
},
|
|
232
|
+
...config.authentication,
|
|
233
|
+
};
|
|
234
|
+
|
|
235
|
+
// Store route configuration
|
|
236
|
+
this.routeConfig = config.routeConfig;
|
|
237
|
+
|
|
238
|
+
// Initialize security detectors
|
|
239
|
+
this.sqlInjectionDetector = new SQLInjectionDetector({
|
|
240
|
+
strictMode:
|
|
241
|
+
typeof this.sqlInjection === "object"
|
|
242
|
+
? this.sqlInjection.strictMode
|
|
243
|
+
: false,
|
|
244
|
+
contextualAnalysis:
|
|
245
|
+
typeof this.sqlInjection === "object"
|
|
246
|
+
? this.sqlInjection.contextualAnalysis
|
|
247
|
+
: true,
|
|
248
|
+
logAttempts:
|
|
249
|
+
typeof this.sqlInjection === "object"
|
|
250
|
+
? this.sqlInjection.logAttempts
|
|
251
|
+
: true,
|
|
252
|
+
falsePositiveThreshold:
|
|
253
|
+
typeof this.sqlInjection === "object"
|
|
254
|
+
? this.sqlInjection.falsePositiveThreshold
|
|
255
|
+
: 0.6,
|
|
256
|
+
});
|
|
257
|
+
|
|
258
|
+
this.pathTraversalDetector = new PathTraversalDetector({
|
|
259
|
+
enabled: !!this.pathTraversal,
|
|
260
|
+
strictMode:
|
|
261
|
+
typeof this.pathTraversal === "object"
|
|
262
|
+
? this.pathTraversal.strictMode
|
|
263
|
+
: false,
|
|
264
|
+
logAttempts:
|
|
265
|
+
typeof this.pathTraversal === "object"
|
|
266
|
+
? this.pathTraversal.logAttempts
|
|
267
|
+
: true,
|
|
268
|
+
blockOnDetection:
|
|
269
|
+
typeof this.pathTraversal === "object"
|
|
270
|
+
? this.pathTraversal.blockOnDetection
|
|
271
|
+
: true,
|
|
272
|
+
allowedPaths:
|
|
273
|
+
typeof this.pathTraversal === "object"
|
|
274
|
+
? this.pathTraversal.allowedPaths
|
|
275
|
+
: [],
|
|
276
|
+
allowedExtensions:
|
|
277
|
+
typeof this.pathTraversal === "object"
|
|
278
|
+
? this.pathTraversal.allowedExtensions
|
|
279
|
+
: [".jpg", ".png", ".pdf", ".txt"],
|
|
280
|
+
maxDepth:
|
|
281
|
+
typeof this.pathTraversal === "object"
|
|
282
|
+
? this.pathTraversal.maxDepth
|
|
283
|
+
: 3,
|
|
284
|
+
falsePositiveThreshold:
|
|
285
|
+
typeof this.pathTraversal === "object"
|
|
286
|
+
? this.pathTraversal.falsePositiveThreshold
|
|
287
|
+
: 0.6,
|
|
288
|
+
});
|
|
289
|
+
|
|
290
|
+
this.commandInjectionDetector = new CommandInjectionDetector({
|
|
291
|
+
enabled: !!this.commandInjection,
|
|
292
|
+
strictMode:
|
|
293
|
+
typeof this.commandInjection === "object"
|
|
294
|
+
? this.commandInjection.strictMode
|
|
295
|
+
: false,
|
|
296
|
+
logAttempts:
|
|
297
|
+
typeof this.commandInjection === "object"
|
|
298
|
+
? this.commandInjection.logAttempts
|
|
299
|
+
: true,
|
|
300
|
+
blockOnDetection:
|
|
301
|
+
typeof this.commandInjection === "object"
|
|
302
|
+
? this.commandInjection.blockOnDetection
|
|
303
|
+
: true,
|
|
304
|
+
contextualAnalysis:
|
|
305
|
+
typeof this.commandInjection === "object"
|
|
306
|
+
? this.commandInjection.contextualAnalysis
|
|
307
|
+
: true,
|
|
308
|
+
allowedCommands:
|
|
309
|
+
typeof this.commandInjection === "object"
|
|
310
|
+
? this.commandInjection.allowedCommands
|
|
311
|
+
: [],
|
|
312
|
+
falsePositiveThreshold:
|
|
313
|
+
typeof this.commandInjection === "object"
|
|
314
|
+
? this.commandInjection.falsePositiveThreshold
|
|
315
|
+
: 0.7,
|
|
316
|
+
});
|
|
317
|
+
|
|
318
|
+
this.xxeProtector = new XXEProtector({
|
|
319
|
+
enabled: !!this.xxe,
|
|
320
|
+
strictMode:
|
|
321
|
+
typeof this.xxe === "object" ? this.xxe.strictMode : true,
|
|
322
|
+
logAttempts:
|
|
323
|
+
typeof this.xxe === "object" ? this.xxe.logAttempts : true,
|
|
324
|
+
blockOnDetection:
|
|
325
|
+
typeof this.xxe === "object" ? this.xxe.blockOnDetection : true,
|
|
326
|
+
allowDTD: typeof this.xxe === "object" ? this.xxe.allowDTD : false,
|
|
327
|
+
allowExternalEntities:
|
|
328
|
+
typeof this.xxe === "object"
|
|
329
|
+
? this.xxe.allowExternalEntities
|
|
330
|
+
: false,
|
|
331
|
+
maxEntityExpansions:
|
|
332
|
+
typeof this.xxe === "object" ? this.xxe.maxEntityExpansions : 0,
|
|
333
|
+
});
|
|
334
|
+
|
|
335
|
+
this.ldapInjectionDetector = new LDAPInjectionDetector({
|
|
336
|
+
enabled: !!this.ldapInjection,
|
|
337
|
+
strictMode:
|
|
338
|
+
typeof this.ldapInjection === "object"
|
|
339
|
+
? this.ldapInjection.strictMode
|
|
340
|
+
: false,
|
|
341
|
+
logAttempts:
|
|
342
|
+
typeof this.ldapInjection === "object"
|
|
343
|
+
? this.ldapInjection.logAttempts
|
|
344
|
+
: true,
|
|
345
|
+
blockOnDetection:
|
|
346
|
+
typeof this.ldapInjection === "object"
|
|
347
|
+
? this.ldapInjection.blockOnDetection
|
|
348
|
+
: true,
|
|
349
|
+
falsePositiveThreshold:
|
|
350
|
+
typeof this.ldapInjection === "object"
|
|
351
|
+
? this.ldapInjection.falsePositiveThreshold
|
|
352
|
+
: 0.6,
|
|
353
|
+
});
|
|
354
|
+
|
|
355
|
+
// Initialize all middleware instances
|
|
356
|
+
this.initializeMiddleware();
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
/**
|
|
360
|
+
* Initialize all security middleware instances using BuiltInMiddleware
|
|
361
|
+
* BuiltInMiddleware is the single source of truth for all middleware wrappers
|
|
362
|
+
*/
|
|
363
|
+
private initializeMiddleware(): void {
|
|
364
|
+
// Helmet for security headers
|
|
365
|
+
if (this.helmet) {
|
|
366
|
+
const helmetConfig: HelmetConfig =
|
|
367
|
+
typeof this.helmet === "object" ? this.helmet : {};
|
|
368
|
+
|
|
369
|
+
// Prepare CSP configuration with proper merging
|
|
370
|
+
let cspConfig: any = false;
|
|
371
|
+
if (this.level === "maximum") {
|
|
372
|
+
cspConfig = {
|
|
373
|
+
directives: {
|
|
374
|
+
defaultSrc: ["'self'"],
|
|
375
|
+
styleSrc: ["'self'", "'unsafe-inline'"],
|
|
376
|
+
scriptSrc: ["'self'"],
|
|
377
|
+
imgSrc: ["'self'", "data:", "https:"],
|
|
378
|
+
},
|
|
379
|
+
};
|
|
380
|
+
} else if (helmetConfig.contentSecurityPolicy) {
|
|
381
|
+
// Merge user CSP config with defaults from BuiltInMiddleware
|
|
382
|
+
cspConfig = helmetConfig.contentSecurityPolicy; // BuiltInMiddleware will handle merging
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
this.logger.debug("security", "Final cspConfig:", cspConfig);
|
|
386
|
+
this.helmetMiddleware = BuiltInMiddleware.helmet({
|
|
387
|
+
contentSecurityPolicy: cspConfig,
|
|
388
|
+
hsts:
|
|
389
|
+
this.level !== "basic" || helmetConfig.hsts
|
|
390
|
+
? helmetConfig.hsts
|
|
391
|
+
: undefined,
|
|
392
|
+
crossOriginEmbedderPolicy: this.level === "maximum",
|
|
393
|
+
});
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
// CORS middleware - use config if provided, otherwise use defaults
|
|
397
|
+
if (this.cors !== false) {
|
|
398
|
+
const corsConfig =
|
|
399
|
+
typeof this.cors === "object"
|
|
400
|
+
? this.cors
|
|
401
|
+
: {
|
|
402
|
+
origin: this.level === "maximum" ? false : true,
|
|
403
|
+
credentials: true,
|
|
404
|
+
optionsSuccessStatus: 200,
|
|
405
|
+
};
|
|
406
|
+
this.logger.debug(
|
|
407
|
+
"security",
|
|
408
|
+
`Initializing CORS with config: ${JSON.stringify(corsConfig)}`
|
|
409
|
+
);
|
|
410
|
+
this.corsMiddleware = BuiltInMiddleware.cors(corsConfig);
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
// Rate limiting for brute force protection (stricter limits)
|
|
414
|
+
if (this.bruteForce) {
|
|
415
|
+
const rateLimitConfig: RateLimitConfig =
|
|
416
|
+
typeof this.bruteForce === "object" ? this.bruteForce : {};
|
|
417
|
+
const maxRequests =
|
|
418
|
+
rateLimitConfig.max ||
|
|
419
|
+
(this.level === "maximum"
|
|
420
|
+
? 50
|
|
421
|
+
: this.level === "enhanced"
|
|
422
|
+
? 100
|
|
423
|
+
: 200);
|
|
424
|
+
|
|
425
|
+
this.bruteForceMiddleware = BuiltInMiddleware.brute();
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
// General rate limiting (separate from brute force protection)
|
|
429
|
+
if (this.rateLimit) {
|
|
430
|
+
const rateLimitConfig: RateLimitConfig =
|
|
431
|
+
typeof this.rateLimit === "object" ? this.rateLimit : {};
|
|
432
|
+
const maxRequests = rateLimitConfig.max || 100; // Default 100 requests
|
|
433
|
+
|
|
434
|
+
this.rateLimitMiddleware = BuiltInMiddleware.rateLimit({
|
|
435
|
+
windowMs: rateLimitConfig.windowMs || 15 * 60 * 1000, // 15 minutes
|
|
436
|
+
max: maxRequests,
|
|
437
|
+
message: rateLimitConfig.message, // BuiltInMiddleware will handle format conversion
|
|
438
|
+
standardHeaders: rateLimitConfig.standardHeaders !== false,
|
|
439
|
+
legacyHeaders: false,
|
|
440
|
+
skip: (req: any, res: any) => {
|
|
441
|
+
// Custom skip function
|
|
442
|
+
if (typeof rateLimitConfig.skip === "function") {
|
|
443
|
+
// If a skip function is provided, it takes full control
|
|
444
|
+
return rateLimitConfig.skip(req, res);
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
// Excluded paths (only used if no skip function is provided)
|
|
448
|
+
if (
|
|
449
|
+
rateLimitConfig.excludePaths &&
|
|
450
|
+
Array.isArray(rateLimitConfig.excludePaths)
|
|
451
|
+
) {
|
|
452
|
+
return rateLimitConfig.excludePaths.some(
|
|
453
|
+
(p: string | RegExp) => {
|
|
454
|
+
if (typeof p === "string") {
|
|
455
|
+
return (
|
|
456
|
+
req.path === p || req.path.startsWith(p)
|
|
457
|
+
);
|
|
458
|
+
}
|
|
459
|
+
if (p instanceof RegExp) {
|
|
460
|
+
return p.test(req.path);
|
|
461
|
+
}
|
|
462
|
+
return false;
|
|
463
|
+
}
|
|
464
|
+
);
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
return false;
|
|
468
|
+
},
|
|
469
|
+
});
|
|
470
|
+
this.logger.debug(
|
|
471
|
+
"security",
|
|
472
|
+
`General rate limiting initialized with max: ${maxRequests} requests per ${Math.ceil(
|
|
473
|
+
(rateLimitConfig.windowMs || 15 * 60 * 1000) / 1000
|
|
474
|
+
)}s window`
|
|
475
|
+
);
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
// CSRF protection using BuiltInMiddleware
|
|
479
|
+
if (this.csrf) {
|
|
480
|
+
const csrfConfig: CSRFConfig =
|
|
481
|
+
typeof this.csrf === "object" ? this.csrf : {};
|
|
482
|
+
this.csrfMiddleware = BuiltInMiddleware.csrf({
|
|
483
|
+
getSecret: (req: any) =>
|
|
484
|
+
this.authentication.session?.secret ||
|
|
485
|
+
"ac934dfcffc9e037b6921b6d4e874e788bfba7c5f48d17332ef92c9c67450000",
|
|
486
|
+
getSessionIdentifier: (req: any) => req.session?.id,
|
|
487
|
+
cookieName: csrfConfig.cookieName || "__Host-csrf-token",
|
|
488
|
+
cookieOptions: {
|
|
489
|
+
httpOnly: true,
|
|
490
|
+
sameSite: "strict",
|
|
491
|
+
secure: process.env.NODE_ENV === "production",
|
|
492
|
+
maxAge: 24 * 60 * 60 * 1000, // 24 hours
|
|
493
|
+
...(csrfConfig.cookieOptions || {}),
|
|
494
|
+
},
|
|
495
|
+
});
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
// Browser-only protection
|
|
499
|
+
if (this.isBrowserOnlyEnabled()) {
|
|
500
|
+
const browserOnlyConfig: BrowserOnlyConfig =
|
|
501
|
+
typeof this.browserOnly === "object" ? this.browserOnly : {};
|
|
502
|
+
this.browserOnlyMiddleware =
|
|
503
|
+
BuiltInMiddleware.browserOnly(browserOnlyConfig);
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
// Terminal-only protection
|
|
507
|
+
if (this.isTerminalOnlyEnabled()) {
|
|
508
|
+
const terminalOnlyConfig: TerminalOnlyConfig =
|
|
509
|
+
typeof this.terminalOnly === "object" ? this.terminalOnly : {};
|
|
510
|
+
this.terminalOnlyMiddleware =
|
|
511
|
+
BuiltInMiddleware.terminalOnly(terminalOnlyConfig);
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
// Mobile-only protection
|
|
515
|
+
if (this.isMobileOnlyEnabled()) {
|
|
516
|
+
const mobileOnlyConfig: MobileOnlyConfig =
|
|
517
|
+
typeof this.mobileOnly === "object" ? this.mobileOnly : {};
|
|
518
|
+
this.mobileOnlyMiddleware =
|
|
519
|
+
BuiltInMiddleware.mobileOnly(mobileOnlyConfig);
|
|
520
|
+
|
|
521
|
+
// Also create the protector instance for mobile detection
|
|
522
|
+
this.mobileOnlyProtector = new MobileOnlyProtector(
|
|
523
|
+
mobileOnlyConfig,
|
|
524
|
+
this.logger
|
|
525
|
+
);
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
// Request signature protection (API authentication)
|
|
529
|
+
if (this.requestSignature) {
|
|
530
|
+
const requestSignatureConfig: RequestSignatureConfig =
|
|
531
|
+
typeof this.requestSignature === "object" &&
|
|
532
|
+
this.requestSignature !== null
|
|
533
|
+
? this.requestSignature
|
|
534
|
+
: { secret: "default-secret" }; // This will be overridden by user config
|
|
535
|
+
this.requestSignatureMiddleware =
|
|
536
|
+
BuiltInMiddleware.requestSignature(requestSignatureConfig);
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
// Compression middleware
|
|
540
|
+
if (this.compression) {
|
|
541
|
+
const compressionConfig: CompressionConfig =
|
|
542
|
+
typeof this.compression === "object" ? this.compression : {};
|
|
543
|
+
this.compressionMiddleware = BuiltInMiddleware.compression({
|
|
544
|
+
level: compressionConfig.level || 6,
|
|
545
|
+
threshold: compressionConfig.threshold || 1024,
|
|
546
|
+
filter: compressionConfig.filter,
|
|
547
|
+
});
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
// HTTP Parameter Pollution protection
|
|
551
|
+
if (this.hpp) {
|
|
552
|
+
const hppConfig: HPPConfig =
|
|
553
|
+
typeof this.hpp === "object" ? this.hpp : {};
|
|
554
|
+
this.hppMiddleware = BuiltInMiddleware.hpp({
|
|
555
|
+
whitelist: hppConfig.whitelist || ["tags", "categories"],
|
|
556
|
+
checkQuery: hppConfig.checkQuery !== false,
|
|
557
|
+
checkBody: hppConfig.checkBody !== false,
|
|
558
|
+
});
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
// MongoDB injection protection
|
|
562
|
+
if (this.mongoSanitize) {
|
|
563
|
+
const mongoConfig: MongoSanitizeConfig =
|
|
564
|
+
typeof this.mongoSanitize === "object"
|
|
565
|
+
? this.mongoSanitize
|
|
566
|
+
: {};
|
|
567
|
+
this.mongoSanitizeMiddleware = BuiltInMiddleware.mongoSanitize({
|
|
568
|
+
replaceWith: mongoConfig.replaceWith || "_",
|
|
569
|
+
onSanitize:
|
|
570
|
+
mongoConfig.onSanitize ||
|
|
571
|
+
(({ req, key }: any) => {
|
|
572
|
+
this.logger.warn(
|
|
573
|
+
"security",
|
|
574
|
+
`Sanitized key ${key} in request from ${req.ip}`
|
|
575
|
+
);
|
|
576
|
+
}),
|
|
577
|
+
});
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
// Morgan logging middleware
|
|
581
|
+
if (this.morgan) {
|
|
582
|
+
const morganConfig: MorganConfig =
|
|
583
|
+
typeof this.morgan === "object" ? this.morgan : {};
|
|
584
|
+
this.morganMiddleware = BuiltInMiddleware.morgan({
|
|
585
|
+
skip:
|
|
586
|
+
morganConfig.skip ||
|
|
587
|
+
((req: any, res: any) => res.statusCode < 400),
|
|
588
|
+
stream: morganConfig.stream,
|
|
589
|
+
});
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
// Slow down middleware for rate limiting
|
|
593
|
+
if (this.slowDown) {
|
|
594
|
+
const slowDownConfig: SlowDownConfig =
|
|
595
|
+
typeof this.slowDown === "object" ? this.slowDown : {};
|
|
596
|
+
this.slowDownMiddleware = BuiltInMiddleware.slowDown({
|
|
597
|
+
windowMs: slowDownConfig.windowMs || 15 * 60 * 1000, // 15 minutes
|
|
598
|
+
delayAfter: slowDownConfig.delayAfter || 100,
|
|
599
|
+
delayMs:
|
|
600
|
+
slowDownConfig.delayMs ||
|
|
601
|
+
((used: any, req: any) => {
|
|
602
|
+
const delayAfter = req.slowDown?.limit || 100;
|
|
603
|
+
return (used - delayAfter) * 500;
|
|
604
|
+
}),
|
|
605
|
+
});
|
|
606
|
+
}
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
/**
|
|
610
|
+
* Get the main security middleware stack
|
|
611
|
+
* Returns a single middleware function that applies all security measures
|
|
612
|
+
*/
|
|
613
|
+
public getMiddleware() {
|
|
614
|
+
return (
|
|
615
|
+
req: XyPrisRequest,
|
|
616
|
+
res: XyPrisResponse,
|
|
617
|
+
next: NextFunction
|
|
618
|
+
) => {
|
|
619
|
+
this.applySecurityStack(req, res, next);
|
|
620
|
+
};
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
/**
|
|
624
|
+
* Apply all security middleware in the correct order
|
|
625
|
+
*/
|
|
626
|
+
private applySecurityStack(
|
|
627
|
+
req: XyPrisRequest,
|
|
628
|
+
res: XyPrisResponse,
|
|
629
|
+
next: NextFunction
|
|
630
|
+
): void {
|
|
631
|
+
this.logger.debug("security", "Starting security middleware stack");
|
|
632
|
+
const middlewareStack: Array<(req: any, res: any, next: any) => void> =
|
|
633
|
+
[];
|
|
634
|
+
|
|
635
|
+
// 🚨 CRITICAL: Access control middlewares FIRST (before any other processing)
|
|
636
|
+
// These must run before route resolution to block unwanted requests
|
|
637
|
+
|
|
638
|
+
// Handle device access controls
|
|
639
|
+
const browserEnabled = this.isBrowserOnlyEnabled();
|
|
640
|
+
const terminalEnabled = this.isTerminalOnlyEnabled();
|
|
641
|
+
const mobileEnabled = this.isMobileOnlyEnabled();
|
|
642
|
+
|
|
643
|
+
// 1. Terminal-only protection (blocks browser requests) - cannot be combined with others
|
|
644
|
+
if (terminalEnabled && this.terminalOnlyMiddleware) {
|
|
645
|
+
this.logger.debug(
|
|
646
|
+
"security",
|
|
647
|
+
"Adding terminal-only middleware (FIRST)"
|
|
648
|
+
);
|
|
649
|
+
middlewareStack.push(this.terminalOnlyMiddleware);
|
|
650
|
+
}
|
|
651
|
+
// 2. Browser-only and/or mobile-only protection
|
|
652
|
+
else if (browserEnabled || mobileEnabled) {
|
|
653
|
+
// Create combined middleware for browser and mobile access control
|
|
654
|
+
const combinedDeviceMiddleware =
|
|
655
|
+
this.createCombinedDeviceMiddleware(
|
|
656
|
+
browserEnabled,
|
|
657
|
+
mobileEnabled
|
|
658
|
+
);
|
|
659
|
+
if (combinedDeviceMiddleware) {
|
|
660
|
+
this.logger.debug(
|
|
661
|
+
"security",
|
|
662
|
+
`Adding combined device middleware (browser: ${browserEnabled}, mobile: ${mobileEnabled})`
|
|
663
|
+
);
|
|
664
|
+
middlewareStack.push(combinedDeviceMiddleware);
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
// 3. Request signature protection (API authentication)
|
|
669
|
+
if (this.requestSignature && this.requestSignatureMiddleware) {
|
|
670
|
+
this.logger.debug(
|
|
671
|
+
"security",
|
|
672
|
+
"Adding request signature middleware (FIRST)"
|
|
673
|
+
);
|
|
674
|
+
middlewareStack.push(this.requestSignatureMiddleware);
|
|
675
|
+
}
|
|
676
|
+
|
|
677
|
+
// 4. Compression (should be early but after access control)
|
|
678
|
+
if (this.compression && this.compressionMiddleware) {
|
|
679
|
+
this.logger.debug("security", "Adding compression middleware");
|
|
680
|
+
middlewareStack.push(this.compressionMiddleware);
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
// 5. Security headers (Helmet)
|
|
684
|
+
if (this.helmet && this.helmetMiddleware) {
|
|
685
|
+
this.logger.debug("security", "Adding helmet middleware");
|
|
686
|
+
middlewareStack.push(this.helmetMiddleware);
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
// 6. CORS
|
|
690
|
+
if (this.cors !== false && this.corsMiddleware) {
|
|
691
|
+
this.logger.debug("security", "Adding CORS middleware");
|
|
692
|
+
middlewareStack.push(this.corsMiddleware);
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
// 7. Rate limiting (brute force protection - stricter)
|
|
696
|
+
if (this.bruteForce && this.bruteForceMiddleware) {
|
|
697
|
+
this.logger.debug(
|
|
698
|
+
"security",
|
|
699
|
+
"Adding brute force protection middleware"
|
|
700
|
+
);
|
|
701
|
+
middlewareStack.push(this.bruteForceMiddleware);
|
|
702
|
+
}
|
|
703
|
+
|
|
704
|
+
// 8. General rate limiting (less strict)
|
|
705
|
+
if (this.rateLimit && this.rateLimitMiddleware) {
|
|
706
|
+
this.logger.debug(
|
|
707
|
+
"security",
|
|
708
|
+
"Adding general rate limiting middleware"
|
|
709
|
+
);
|
|
710
|
+
middlewareStack.push(this.rateLimitMiddleware);
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
// 9. HTTP Parameter Pollution protection
|
|
714
|
+
if (this.hpp && this.hppMiddleware) {
|
|
715
|
+
this.logger.debug("security", "Adding HPP middleware");
|
|
716
|
+
middlewareStack.push(this.hppMiddleware);
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
// 10. MongoDB sanitization
|
|
720
|
+
if (this.mongoSanitize && this.mongoSanitizeMiddleware) {
|
|
721
|
+
this.logger.debug("security", "Adding mongo sanitize middleware");
|
|
722
|
+
middlewareStack.push(this.mongoSanitizeMiddleware);
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
// 11. Morgan logging
|
|
726
|
+
if (this.morgan && this.morganMiddleware) {
|
|
727
|
+
this.logger.debug("security", "Adding morgan middleware");
|
|
728
|
+
middlewareStack.push(this.morganMiddleware);
|
|
729
|
+
}
|
|
730
|
+
|
|
731
|
+
// 12. Slow down middleware
|
|
732
|
+
if (this.slowDown && this.slowDownMiddleware) {
|
|
733
|
+
this.logger.debug("security", "Adding slow down middleware");
|
|
734
|
+
middlewareStack.push(this.slowDownMiddleware);
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
// 13. XSS protection (custom implementation)
|
|
738
|
+
if (this.xss) {
|
|
739
|
+
this.logger.debug("security", "Adding XSS protection middleware");
|
|
740
|
+
middlewareStack.push(this.xssProtection.bind(this));
|
|
741
|
+
}
|
|
742
|
+
|
|
743
|
+
// 14. CSRF protection (should be after body parsing)
|
|
744
|
+
if (this.csrf && this.csrfMiddleware) {
|
|
745
|
+
this.logger.debug("security", "Adding CSRF middleware");
|
|
746
|
+
middlewareStack.push(this.csrfMiddleware);
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
this.logger.debug(
|
|
750
|
+
"security",
|
|
751
|
+
`Total middleware in stack: ${middlewareStack.length}`
|
|
752
|
+
);
|
|
753
|
+
// Execute middleware stack
|
|
754
|
+
this.executeMiddlewareStack(middlewareStack, req, res, next);
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
/**
|
|
758
|
+
* Execute middleware stack sequentially with proper async handling
|
|
759
|
+
*/
|
|
760
|
+
private executeMiddlewareStack(
|
|
761
|
+
stack: Array<(req: any, res: any, next: any) => void>,
|
|
762
|
+
req: XyPrisRequest,
|
|
763
|
+
res: XyPrisResponse,
|
|
764
|
+
finalNext: NextFunction
|
|
765
|
+
): void {
|
|
766
|
+
let index = 0;
|
|
767
|
+
let nextCalled = false;
|
|
768
|
+
|
|
769
|
+
this.logger.debug(
|
|
770
|
+
"security",
|
|
771
|
+
`Executing middleware stack with ${stack.length} middleware`
|
|
772
|
+
);
|
|
773
|
+
|
|
774
|
+
const next = (error?: any) => {
|
|
775
|
+
if (nextCalled) {
|
|
776
|
+
this.logger.debug(
|
|
777
|
+
"security",
|
|
778
|
+
"next() already called, ignoring duplicate call"
|
|
779
|
+
);
|
|
780
|
+
return;
|
|
781
|
+
}
|
|
782
|
+
|
|
783
|
+
if (error) {
|
|
784
|
+
nextCalled = true;
|
|
785
|
+
this.logger.debug(
|
|
786
|
+
"security",
|
|
787
|
+
`Error in middleware at index ${index - 1}:`,
|
|
788
|
+
error
|
|
789
|
+
);
|
|
790
|
+
return finalNext(error);
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
if (index >= stack.length) {
|
|
794
|
+
nextCalled = true;
|
|
795
|
+
this.logger.debug(
|
|
796
|
+
"security",
|
|
797
|
+
"All middleware completed, calling final next"
|
|
798
|
+
);
|
|
799
|
+
return finalNext();
|
|
800
|
+
}
|
|
801
|
+
|
|
802
|
+
const currentIndex = index;
|
|
803
|
+
this.logger.debug(
|
|
804
|
+
"security",
|
|
805
|
+
`Executing middleware ${currentIndex + 1}/${stack.length}`
|
|
806
|
+
);
|
|
807
|
+
|
|
808
|
+
const middleware = stack[index++];
|
|
809
|
+
|
|
810
|
+
try {
|
|
811
|
+
// Set a timeout to detect if middleware doesn't call next()
|
|
812
|
+
let timeoutId: NodeJS.Timeout | null = null;
|
|
813
|
+
let middlewareCompleted = false;
|
|
814
|
+
|
|
815
|
+
const middlewareNext = (err?: any) => {
|
|
816
|
+
if (middlewareCompleted) return;
|
|
817
|
+
middlewareCompleted = true;
|
|
818
|
+
|
|
819
|
+
if (timeoutId) {
|
|
820
|
+
clearTimeout(timeoutId);
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
this.logger.debug(
|
|
824
|
+
"security",
|
|
825
|
+
`Middleware ${currentIndex + 1} completed`
|
|
826
|
+
);
|
|
827
|
+
|
|
828
|
+
next(err);
|
|
829
|
+
};
|
|
830
|
+
|
|
831
|
+
// Set timeout to detect hanging middleware
|
|
832
|
+
timeoutId = setTimeout(() => {
|
|
833
|
+
if (!middlewareCompleted) {
|
|
834
|
+
// If headers were already sent, it means the middleware blocked the request
|
|
835
|
+
// and sent a response, so we should NOT continue the chain.
|
|
836
|
+
if (res.headersSent) {
|
|
837
|
+
this.logger.debug(
|
|
838
|
+
"security",
|
|
839
|
+
`Middleware ${
|
|
840
|
+
currentIndex + 1
|
|
841
|
+
} blocked the request (headers sent), stopping chain`
|
|
842
|
+
);
|
|
843
|
+
middlewareCompleted = true;
|
|
844
|
+
return;
|
|
845
|
+
}
|
|
846
|
+
|
|
847
|
+
this.logger.debug(
|
|
848
|
+
"security",
|
|
849
|
+
`Middleware ${
|
|
850
|
+
currentIndex + 1
|
|
851
|
+
} timed out, continuing anyway`
|
|
852
|
+
);
|
|
853
|
+
middlewareCompleted = true;
|
|
854
|
+
next();
|
|
855
|
+
}
|
|
856
|
+
}, 100); // 100ms timeout
|
|
857
|
+
|
|
858
|
+
// Execute the middleware
|
|
859
|
+
middleware(req, res, middlewareNext);
|
|
860
|
+
} catch (error) {
|
|
861
|
+
this.logger.debug(
|
|
862
|
+
"security",
|
|
863
|
+
`Exception in middleware at index ${currentIndex}:`,
|
|
864
|
+
error
|
|
865
|
+
);
|
|
866
|
+
finalNext(error);
|
|
867
|
+
}
|
|
868
|
+
};
|
|
869
|
+
|
|
870
|
+
// Start the middleware chain
|
|
871
|
+
this.logger.debug("security", "Starting middleware chain");
|
|
872
|
+
next();
|
|
873
|
+
}
|
|
874
|
+
|
|
875
|
+
/**
|
|
876
|
+
* Custom XSS protection middleware
|
|
877
|
+
*/
|
|
878
|
+
private xssProtection(
|
|
879
|
+
req: XyPrisRequest,
|
|
880
|
+
res: XyPrisResponse,
|
|
881
|
+
next: NextFunction
|
|
882
|
+
): void {
|
|
883
|
+
this.logger.debug("security", `Running XSS protection on ${req.path}`);
|
|
884
|
+
let maliciousContentDetected = false;
|
|
885
|
+
const detectedThreats: string[] = [];
|
|
886
|
+
|
|
887
|
+
// Check and sanitize request body
|
|
888
|
+
if (req.body && typeof req.body === "object") {
|
|
889
|
+
const { sanitized, threats } = this.sanitizeObjectWithDetection(
|
|
890
|
+
req.body,
|
|
891
|
+
"",
|
|
892
|
+
req
|
|
893
|
+
);
|
|
894
|
+
if (threats.length > 0) {
|
|
895
|
+
maliciousContentDetected = true;
|
|
896
|
+
threats.forEach((t) => {
|
|
897
|
+
detectedThreats.push(
|
|
898
|
+
...t.types.map((type) => `body.${t.path}:${type}`)
|
|
899
|
+
);
|
|
900
|
+
});
|
|
901
|
+
}
|
|
902
|
+
|
|
903
|
+
try {
|
|
904
|
+
req.body = sanitized;
|
|
905
|
+
} catch (error) {
|
|
906
|
+
// Handle readonly property - create new object
|
|
907
|
+
Object.defineProperty(req, "body", {
|
|
908
|
+
value: sanitized,
|
|
909
|
+
writable: true,
|
|
910
|
+
configurable: true,
|
|
911
|
+
});
|
|
912
|
+
}
|
|
913
|
+
}
|
|
914
|
+
|
|
915
|
+
// Check and sanitize query parameters
|
|
916
|
+
if (req.query && typeof req.query === "object") {
|
|
917
|
+
const { sanitized, threats } = this.sanitizeObjectWithDetection(
|
|
918
|
+
req.query,
|
|
919
|
+
"",
|
|
920
|
+
req
|
|
921
|
+
);
|
|
922
|
+
if (threats.length > 0) {
|
|
923
|
+
maliciousContentDetected = true;
|
|
924
|
+
threats.forEach((t) => {
|
|
925
|
+
detectedThreats.push(
|
|
926
|
+
...t.types.map((type) => `query.${t.path}:${type}`)
|
|
927
|
+
);
|
|
928
|
+
});
|
|
929
|
+
}
|
|
930
|
+
|
|
931
|
+
try {
|
|
932
|
+
req.query = sanitized;
|
|
933
|
+
} catch (error) {
|
|
934
|
+
// Handle readonly property - create new object
|
|
935
|
+
Object.defineProperty(req, "query", {
|
|
936
|
+
value: sanitized,
|
|
937
|
+
writable: true,
|
|
938
|
+
configurable: true,
|
|
939
|
+
});
|
|
940
|
+
}
|
|
941
|
+
}
|
|
942
|
+
|
|
943
|
+
// Check and sanitize URL parameters
|
|
944
|
+
if (req.params && typeof req.params === "object") {
|
|
945
|
+
const { sanitized, threats } = this.sanitizeObjectWithDetection(
|
|
946
|
+
req.params,
|
|
947
|
+
"",
|
|
948
|
+
req
|
|
949
|
+
);
|
|
950
|
+
if (threats.length > 0) {
|
|
951
|
+
maliciousContentDetected = true;
|
|
952
|
+
threats.forEach((t) => {
|
|
953
|
+
detectedThreats.push(
|
|
954
|
+
...t.types.map((type) => `params.${t.path}:${type}`)
|
|
955
|
+
);
|
|
956
|
+
});
|
|
957
|
+
}
|
|
958
|
+
|
|
959
|
+
try {
|
|
960
|
+
req.params = sanitized;
|
|
961
|
+
} catch (error) {
|
|
962
|
+
// Handle readonly property - create new object
|
|
963
|
+
Object.defineProperty(req, "params", {
|
|
964
|
+
value: sanitized,
|
|
965
|
+
writable: true,
|
|
966
|
+
configurable: true,
|
|
967
|
+
});
|
|
968
|
+
}
|
|
969
|
+
}
|
|
970
|
+
|
|
971
|
+
// Block request if malicious content was detected
|
|
972
|
+
if (maliciousContentDetected) {
|
|
973
|
+
this.logger.warn(
|
|
974
|
+
"security",
|
|
975
|
+
`Security threat blocked from ${
|
|
976
|
+
req.ip
|
|
977
|
+
}. Threats detected: ${detectedThreats.join(", ")}`
|
|
978
|
+
);
|
|
979
|
+
|
|
980
|
+
// Determine primary attack type
|
|
981
|
+
let primaryType = "Security Attack";
|
|
982
|
+
if (detectedThreats.some((t) => t.includes("SQL Injection")))
|
|
983
|
+
primaryType = "SQL Injection";
|
|
984
|
+
else if (detectedThreats.some((t) => t.includes("XSS")))
|
|
985
|
+
primaryType = "XSS";
|
|
986
|
+
else if (detectedThreats.some((t) => t.includes("Path Traversal")))
|
|
987
|
+
primaryType = "Path Traversal";
|
|
988
|
+
else if (
|
|
989
|
+
detectedThreats.some((t) => t.includes("Command Injection"))
|
|
990
|
+
)
|
|
991
|
+
primaryType = "Command Injection";
|
|
992
|
+
else if (detectedThreats.some((t) => t.includes("XXE")))
|
|
993
|
+
primaryType = "XXE Attack";
|
|
994
|
+
else if (detectedThreats.some((t) => t.includes("LDAP")))
|
|
995
|
+
primaryType = "LDAP Injection";
|
|
996
|
+
|
|
997
|
+
// Trigger security attack hook
|
|
998
|
+
this.reportAttack(req, res, {
|
|
999
|
+
type: primaryType,
|
|
1000
|
+
threats: detectedThreats,
|
|
1001
|
+
ip: req.ip,
|
|
1002
|
+
path: req.path,
|
|
1003
|
+
});
|
|
1004
|
+
|
|
1005
|
+
res.status(400).json({
|
|
1006
|
+
error: "Malicious content detected",
|
|
1007
|
+
message: "Request blocked due to potential XSS attack",
|
|
1008
|
+
threats: detectedThreats,
|
|
1009
|
+
timestamp: new Date().toISOString(),
|
|
1010
|
+
});
|
|
1011
|
+
return; // Don't call next() - block the request
|
|
1012
|
+
}
|
|
1013
|
+
|
|
1014
|
+
next();
|
|
1015
|
+
}
|
|
1016
|
+
|
|
1017
|
+
/**
|
|
1018
|
+
* Recursively sanitize object properties
|
|
1019
|
+
*/
|
|
1020
|
+
private sanitizeObject(obj: any): any {
|
|
1021
|
+
if (typeof obj === "string") {
|
|
1022
|
+
return xss(obj);
|
|
1023
|
+
}
|
|
1024
|
+
|
|
1025
|
+
if (Array.isArray(obj)) {
|
|
1026
|
+
return obj.map((item) => this.sanitizeObject(item));
|
|
1027
|
+
}
|
|
1028
|
+
|
|
1029
|
+
if (obj && typeof obj === "object") {
|
|
1030
|
+
const sanitized: any = {};
|
|
1031
|
+
for (const [key, value] of Object.entries(obj)) {
|
|
1032
|
+
sanitized[key] = this.sanitizeObject(value);
|
|
1033
|
+
}
|
|
1034
|
+
return sanitized;
|
|
1035
|
+
}
|
|
1036
|
+
|
|
1037
|
+
return obj;
|
|
1038
|
+
}
|
|
1039
|
+
|
|
1040
|
+
/**
|
|
1041
|
+
* Sanitize object and detect threats
|
|
1042
|
+
*/
|
|
1043
|
+
private sanitizeObjectWithDetection(
|
|
1044
|
+
obj: any,
|
|
1045
|
+
path: string = "",
|
|
1046
|
+
req?: XyPrisRequest
|
|
1047
|
+
): { sanitized: any; threats: Array<{ path: string; types: string[] }> } {
|
|
1048
|
+
const threats: Array<{ path: string; types: string[] }> = [];
|
|
1049
|
+
|
|
1050
|
+
const sanitizeWithDetection = (
|
|
1051
|
+
value: any,
|
|
1052
|
+
currentPath: string
|
|
1053
|
+
): any => {
|
|
1054
|
+
if (typeof value === "string") {
|
|
1055
|
+
const original = value;
|
|
1056
|
+
let sanitized = xss(value);
|
|
1057
|
+
this.logger.debug(
|
|
1058
|
+
"security",
|
|
1059
|
+
`Sanitizing: "${original}" -> "${sanitized}"`
|
|
1060
|
+
);
|
|
1061
|
+
let threatDetected = false;
|
|
1062
|
+
const detectedPatterns: string[] = [];
|
|
1063
|
+
|
|
1064
|
+
// Check if XSS library sanitization changed the content
|
|
1065
|
+
if (original !== sanitized) {
|
|
1066
|
+
threatDetected = true;
|
|
1067
|
+
detectedPatterns.push("XSS");
|
|
1068
|
+
}
|
|
1069
|
+
|
|
1070
|
+
// SQL Injection Detection
|
|
1071
|
+
if (
|
|
1072
|
+
this.sqlInjection &&
|
|
1073
|
+
this.shouldApplySecurityModule(
|
|
1074
|
+
req!,
|
|
1075
|
+
this.routeConfig?.sqlInjection
|
|
1076
|
+
)
|
|
1077
|
+
) {
|
|
1078
|
+
const sqlResult = this.sqlInjectionDetector.detect(
|
|
1079
|
+
original,
|
|
1080
|
+
currentPath
|
|
1081
|
+
);
|
|
1082
|
+
if (sqlResult.isMalicious) {
|
|
1083
|
+
threatDetected = true;
|
|
1084
|
+
detectedPatterns.push(
|
|
1085
|
+
`SQL Injection (${sqlResult.riskLevel})`
|
|
1086
|
+
);
|
|
1087
|
+
// Use the SQL detector's sanitized version if available
|
|
1088
|
+
if (sqlResult.sanitizedInput) {
|
|
1089
|
+
sanitized = sqlResult.sanitizedInput;
|
|
1090
|
+
}
|
|
1091
|
+
}
|
|
1092
|
+
}
|
|
1093
|
+
|
|
1094
|
+
// Path Traversal Detection
|
|
1095
|
+
if (
|
|
1096
|
+
this.pathTraversal &&
|
|
1097
|
+
this.shouldApplySecurityModule(
|
|
1098
|
+
req!,
|
|
1099
|
+
this.routeConfig?.pathTraversal
|
|
1100
|
+
)
|
|
1101
|
+
) {
|
|
1102
|
+
const pathResult =
|
|
1103
|
+
this.pathTraversalDetector.detect(original);
|
|
1104
|
+
if (pathResult.isMalicious) {
|
|
1105
|
+
threatDetected = true;
|
|
1106
|
+
detectedPatterns.push(
|
|
1107
|
+
`Path Traversal (${pathResult.riskLevel})`
|
|
1108
|
+
);
|
|
1109
|
+
if (pathResult.sanitizedInput) {
|
|
1110
|
+
sanitized = pathResult.sanitizedInput;
|
|
1111
|
+
}
|
|
1112
|
+
}
|
|
1113
|
+
}
|
|
1114
|
+
|
|
1115
|
+
// Command Injection Detection
|
|
1116
|
+
if (
|
|
1117
|
+
this.commandInjection &&
|
|
1118
|
+
this.shouldApplySecurityModule(
|
|
1119
|
+
req!,
|
|
1120
|
+
this.routeConfig?.commandInjection
|
|
1121
|
+
)
|
|
1122
|
+
) {
|
|
1123
|
+
const cmdResult =
|
|
1124
|
+
this.commandInjectionDetector.detect(original);
|
|
1125
|
+
if (cmdResult.isMalicious) {
|
|
1126
|
+
threatDetected = true;
|
|
1127
|
+
detectedPatterns.push(
|
|
1128
|
+
`Command Injection (${cmdResult.riskLevel})`
|
|
1129
|
+
);
|
|
1130
|
+
if (cmdResult.sanitizedInput) {
|
|
1131
|
+
sanitized = cmdResult.sanitizedInput;
|
|
1132
|
+
}
|
|
1133
|
+
}
|
|
1134
|
+
}
|
|
1135
|
+
|
|
1136
|
+
// XXE Detection (for XML content)
|
|
1137
|
+
if (
|
|
1138
|
+
this.xxe &&
|
|
1139
|
+
this.shouldApplySecurityModule(
|
|
1140
|
+
req!,
|
|
1141
|
+
this.routeConfig?.xxe
|
|
1142
|
+
) &&
|
|
1143
|
+
(original.includes("<?xml") ||
|
|
1144
|
+
original.includes("<!DOCTYPE"))
|
|
1145
|
+
) {
|
|
1146
|
+
const xxeResult = this.xxeProtector.detect(original);
|
|
1147
|
+
if (xxeResult.isMalicious) {
|
|
1148
|
+
threatDetected = true;
|
|
1149
|
+
detectedPatterns.push(
|
|
1150
|
+
`XXE Attack (${xxeResult.riskLevel})`
|
|
1151
|
+
);
|
|
1152
|
+
if (xxeResult.sanitizedInput) {
|
|
1153
|
+
sanitized = xxeResult.sanitizedInput;
|
|
1154
|
+
}
|
|
1155
|
+
}
|
|
1156
|
+
}
|
|
1157
|
+
|
|
1158
|
+
// LDAP Injection Detection
|
|
1159
|
+
if (
|
|
1160
|
+
this.ldapInjection &&
|
|
1161
|
+
this.shouldApplySecurityModule(
|
|
1162
|
+
req!,
|
|
1163
|
+
this.routeConfig?.ldapInjection
|
|
1164
|
+
)
|
|
1165
|
+
) {
|
|
1166
|
+
const ldapResult =
|
|
1167
|
+
this.ldapInjectionDetector.detect(original);
|
|
1168
|
+
if (ldapResult.isMalicious) {
|
|
1169
|
+
threatDetected = true;
|
|
1170
|
+
detectedPatterns.push(
|
|
1171
|
+
`LDAP Injection (${ldapResult.riskLevel})`
|
|
1172
|
+
);
|
|
1173
|
+
if (ldapResult.sanitizedInput) {
|
|
1174
|
+
sanitized = ldapResult.sanitizedInput;
|
|
1175
|
+
}
|
|
1176
|
+
}
|
|
1177
|
+
}
|
|
1178
|
+
|
|
1179
|
+
// Additional threat detection for patterns XSS library might miss
|
|
1180
|
+
const additionalThreats = [
|
|
1181
|
+
/javascript:/i,
|
|
1182
|
+
/vbscript:/i,
|
|
1183
|
+
/data:/i,
|
|
1184
|
+
/on\w+\s*=/i, // event handlers like onclick=, onload=
|
|
1185
|
+
/<iframe/i,
|
|
1186
|
+
/<object/i,
|
|
1187
|
+
/<embed/i,
|
|
1188
|
+
/<link/i,
|
|
1189
|
+
/<meta/i,
|
|
1190
|
+
/expression\s*\(/i, // CSS expression()
|
|
1191
|
+
/url\s*\(\s*javascript:/i,
|
|
1192
|
+
];
|
|
1193
|
+
|
|
1194
|
+
for (const pattern of additionalThreats) {
|
|
1195
|
+
if (pattern.test(original)) {
|
|
1196
|
+
threatDetected = true;
|
|
1197
|
+
detectedPatterns.push("Enhanced XSS");
|
|
1198
|
+
// Sanitize these additional threats
|
|
1199
|
+
sanitized = original.replace(pattern, "[BLOCKED]");
|
|
1200
|
+
break;
|
|
1201
|
+
}
|
|
1202
|
+
}
|
|
1203
|
+
|
|
1204
|
+
if (threatDetected) {
|
|
1205
|
+
threats.push({
|
|
1206
|
+
path: currentPath || "root",
|
|
1207
|
+
types: detectedPatterns,
|
|
1208
|
+
});
|
|
1209
|
+
// Log the specific threats detected
|
|
1210
|
+
this.logger.warn(
|
|
1211
|
+
"security",
|
|
1212
|
+
`Security threat detected in ${
|
|
1213
|
+
currentPath || "root"
|
|
1214
|
+
}: ${detectedPatterns.join(", ")}`
|
|
1215
|
+
);
|
|
1216
|
+
}
|
|
1217
|
+
|
|
1218
|
+
return sanitized;
|
|
1219
|
+
}
|
|
1220
|
+
|
|
1221
|
+
if (Array.isArray(value)) {
|
|
1222
|
+
return value.map((item, index) =>
|
|
1223
|
+
sanitizeWithDetection(item, `${currentPath}[${index}]`)
|
|
1224
|
+
);
|
|
1225
|
+
}
|
|
1226
|
+
|
|
1227
|
+
if (value && typeof value === "object") {
|
|
1228
|
+
const sanitized: any = {};
|
|
1229
|
+
for (const [key, val] of Object.entries(value)) {
|
|
1230
|
+
const newPath = currentPath ? `${currentPath}.${key}` : key;
|
|
1231
|
+
sanitized[key] = sanitizeWithDetection(val, newPath);
|
|
1232
|
+
}
|
|
1233
|
+
return sanitized;
|
|
1234
|
+
}
|
|
1235
|
+
|
|
1236
|
+
return value;
|
|
1237
|
+
};
|
|
1238
|
+
|
|
1239
|
+
const sanitized = sanitizeWithDetection(obj, path);
|
|
1240
|
+
return { sanitized, threats };
|
|
1241
|
+
}
|
|
1242
|
+
|
|
1243
|
+
/**
|
|
1244
|
+
* Get CSRF token for client-side usage
|
|
1245
|
+
*/
|
|
1246
|
+
public generateCsrfToken(req: XyPrisRequest): string | null {
|
|
1247
|
+
if (this.csrf && (req as any).csrfToken) {
|
|
1248
|
+
return (req as any).csrfToken();
|
|
1249
|
+
}
|
|
1250
|
+
return null;
|
|
1251
|
+
}
|
|
1252
|
+
|
|
1253
|
+
/**
|
|
1254
|
+
* Check if browser-only protection is enabled
|
|
1255
|
+
*/
|
|
1256
|
+
private isBrowserOnlyEnabled(): boolean {
|
|
1257
|
+
if (this.browserOnly === true) return true;
|
|
1258
|
+
if (typeof this.browserOnly === "object" && this.browserOnly !== null) {
|
|
1259
|
+
return this.browserOnly.enable !== false; // Default to true when config provided
|
|
1260
|
+
}
|
|
1261
|
+
return false;
|
|
1262
|
+
}
|
|
1263
|
+
|
|
1264
|
+
/**
|
|
1265
|
+
* Check if terminal-only protection is enabled
|
|
1266
|
+
*/
|
|
1267
|
+
private isTerminalOnlyEnabled(): boolean {
|
|
1268
|
+
if (this.terminalOnly === true) return true;
|
|
1269
|
+
if (
|
|
1270
|
+
typeof this.terminalOnly === "object" &&
|
|
1271
|
+
this.terminalOnly !== null
|
|
1272
|
+
) {
|
|
1273
|
+
return this.terminalOnly.enable !== false; // Default to true when config provided
|
|
1274
|
+
}
|
|
1275
|
+
return false;
|
|
1276
|
+
}
|
|
1277
|
+
|
|
1278
|
+
/**
|
|
1279
|
+
* Check if mobile-only protection is enabled
|
|
1280
|
+
*/
|
|
1281
|
+
private isMobileOnlyEnabled(): boolean {
|
|
1282
|
+
if (this.mobileOnly === true) return true;
|
|
1283
|
+
if (typeof this.mobileOnly === "object" && this.mobileOnly !== null) {
|
|
1284
|
+
return this.mobileOnly.enable !== false; // Check enable property, default to true when config provided
|
|
1285
|
+
}
|
|
1286
|
+
return false;
|
|
1287
|
+
}
|
|
1288
|
+
|
|
1289
|
+
/**
|
|
1290
|
+
* Validate device access configuration
|
|
1291
|
+
*/
|
|
1292
|
+
private validateDeviceAccessConfig(): void {
|
|
1293
|
+
// Check enabled device access controls
|
|
1294
|
+
const browserEnabled = this.isBrowserOnlyEnabled();
|
|
1295
|
+
const terminalEnabled = this.isTerminalOnlyEnabled();
|
|
1296
|
+
const mobileEnabled = this.isMobileOnlyEnabled();
|
|
1297
|
+
|
|
1298
|
+
// Terminal-only cannot be combined with browser-only or mobile-only
|
|
1299
|
+
if (terminalEnabled && (browserEnabled || mobileEnabled)) {
|
|
1300
|
+
throw new Error(
|
|
1301
|
+
"Security configuration error: terminalOnly cannot be enabled simultaneously with browserOnly or mobileOnly. " +
|
|
1302
|
+
"Choose terminalOnly alone, or browserOnly and/or mobileOnly."
|
|
1303
|
+
);
|
|
1304
|
+
}
|
|
1305
|
+
|
|
1306
|
+
// Browser-only and mobile-only can be enabled together (they will be applied based on request characteristics)
|
|
1307
|
+
// No other restrictions needed
|
|
1308
|
+
}
|
|
1309
|
+
|
|
1310
|
+
/**
|
|
1311
|
+
* Create combined middleware for browser and mobile access control
|
|
1312
|
+
*/
|
|
1313
|
+
private createCombinedDeviceMiddleware(
|
|
1314
|
+
browserEnabled: boolean,
|
|
1315
|
+
mobileEnabled: boolean
|
|
1316
|
+
): ((req: any, res: any, next: any) => void) | null {
|
|
1317
|
+
// If neither is enabled, return null
|
|
1318
|
+
if (!browserEnabled && !mobileEnabled) {
|
|
1319
|
+
return null;
|
|
1320
|
+
}
|
|
1321
|
+
|
|
1322
|
+
// If only one is enabled, return that middleware directly
|
|
1323
|
+
if (browserEnabled && !mobileEnabled && this.browserOnlyMiddleware) {
|
|
1324
|
+
return this.browserOnlyMiddleware;
|
|
1325
|
+
}
|
|
1326
|
+
if (mobileEnabled && !browserEnabled && this.mobileOnlyMiddleware) {
|
|
1327
|
+
return this.mobileOnlyMiddleware;
|
|
1328
|
+
}
|
|
1329
|
+
|
|
1330
|
+
// Both are enabled - create combined logic
|
|
1331
|
+
if (!this.browserOnlyMiddleware || !this.mobileOnlyMiddleware) {
|
|
1332
|
+
return null; // Should not happen if validation passed
|
|
1333
|
+
}
|
|
1334
|
+
|
|
1335
|
+
return (req: any, res: any, next: any) => {
|
|
1336
|
+
// First check if it's a mobile request
|
|
1337
|
+
const isMobileRequest = this.isMobileRequest(req);
|
|
1338
|
+
|
|
1339
|
+
if (isMobileRequest) {
|
|
1340
|
+
// Apply mobile-only rules
|
|
1341
|
+
this.logger.debug(
|
|
1342
|
+
"security",
|
|
1343
|
+
"Applying mobile-only rules for mobile request"
|
|
1344
|
+
);
|
|
1345
|
+
return this.mobileOnlyMiddleware(req, res, next);
|
|
1346
|
+
} else {
|
|
1347
|
+
// Apply browser-only rules
|
|
1348
|
+
this.logger.debug(
|
|
1349
|
+
"security",
|
|
1350
|
+
"Applying browser-only rules for non-mobile request"
|
|
1351
|
+
);
|
|
1352
|
+
return this.browserOnlyMiddleware(req, res, next);
|
|
1353
|
+
}
|
|
1354
|
+
};
|
|
1355
|
+
}
|
|
1356
|
+
|
|
1357
|
+
/**
|
|
1358
|
+
* Check if request is from a mobile device (using MobileOnlyProtector logic)
|
|
1359
|
+
*/
|
|
1360
|
+
private isMobileRequest(req: any): boolean {
|
|
1361
|
+
if (!this.mobileOnlyProtector) {
|
|
1362
|
+
// If no mobile protector, assume not mobile
|
|
1363
|
+
return false;
|
|
1364
|
+
}
|
|
1365
|
+
return this.mobileOnlyProtector.isMobileRequest(req);
|
|
1366
|
+
}
|
|
1367
|
+
|
|
1368
|
+
/**
|
|
1369
|
+
* Get security configuration
|
|
1370
|
+
*/
|
|
1371
|
+
public getConfig(): SecurityConfig {
|
|
1372
|
+
return {
|
|
1373
|
+
level: this.level,
|
|
1374
|
+
csrf: this.csrf,
|
|
1375
|
+
helmet: this.helmet,
|
|
1376
|
+
browserOnly: this.browserOnly,
|
|
1377
|
+
terminalOnly: this.terminalOnly,
|
|
1378
|
+
mobileOnly: this.mobileOnly,
|
|
1379
|
+
deviceAccess: this.deviceAccess,
|
|
1380
|
+
requestSignature: this.requestSignature,
|
|
1381
|
+
xss: this.xss,
|
|
1382
|
+
sqlInjection: this.sqlInjection,
|
|
1383
|
+
pathTraversal: this.pathTraversal,
|
|
1384
|
+
commandInjection: this.commandInjection,
|
|
1385
|
+
xxe: this.xxe,
|
|
1386
|
+
ldapInjection: this.ldapInjection,
|
|
1387
|
+
bruteForce: this.bruteForce,
|
|
1388
|
+
rateLimit: this.rateLimit,
|
|
1389
|
+
cors: this.cors,
|
|
1390
|
+
compression: this.compression,
|
|
1391
|
+
hpp: this.hpp,
|
|
1392
|
+
mongoSanitize: this.mongoSanitize,
|
|
1393
|
+
morgan: this.morgan,
|
|
1394
|
+
slowDown: this.slowDown,
|
|
1395
|
+
encryption: this.encryption,
|
|
1396
|
+
authentication: this.authentication,
|
|
1397
|
+
routeConfig: this.routeConfig,
|
|
1398
|
+
};
|
|
1399
|
+
}
|
|
1400
|
+
|
|
1401
|
+
/**
|
|
1402
|
+
* Check if a route matches a pattern
|
|
1403
|
+
*/
|
|
1404
|
+
private matchesRoute(
|
|
1405
|
+
requestPath: string,
|
|
1406
|
+
requestMethod: string,
|
|
1407
|
+
pattern: string | RegExp | RoutePattern
|
|
1408
|
+
): boolean {
|
|
1409
|
+
// Handle RoutePattern object
|
|
1410
|
+
if (typeof pattern === "object" && "path" in pattern) {
|
|
1411
|
+
const routePattern = pattern as RoutePattern;
|
|
1412
|
+
// Check method if specified
|
|
1413
|
+
if (routePattern.methods && routePattern.methods.length > 0) {
|
|
1414
|
+
if (
|
|
1415
|
+
!routePattern.methods.includes(requestMethod.toUpperCase())
|
|
1416
|
+
) {
|
|
1417
|
+
return false;
|
|
1418
|
+
}
|
|
1419
|
+
}
|
|
1420
|
+
return this.matchesRoute(
|
|
1421
|
+
requestPath,
|
|
1422
|
+
requestMethod,
|
|
1423
|
+
routePattern.path
|
|
1424
|
+
);
|
|
1425
|
+
}
|
|
1426
|
+
|
|
1427
|
+
// Handle RegExp
|
|
1428
|
+
if (pattern instanceof RegExp) {
|
|
1429
|
+
return pattern.test(requestPath);
|
|
1430
|
+
}
|
|
1431
|
+
|
|
1432
|
+
// Handle string patterns with wildcards
|
|
1433
|
+
const patternStr = pattern as string;
|
|
1434
|
+
|
|
1435
|
+
// Normalize paths by removing trailing slashes for comparison
|
|
1436
|
+
const normalizedRequestPath = requestPath.replace(/\/$/, "");
|
|
1437
|
+
const normalizedPattern = patternStr.replace(/\/$/, "");
|
|
1438
|
+
|
|
1439
|
+
// Exact match (after normalization)
|
|
1440
|
+
if (normalizedPattern === normalizedRequestPath) {
|
|
1441
|
+
return true;
|
|
1442
|
+
}
|
|
1443
|
+
|
|
1444
|
+
// Wildcard matching (e.g., /api/* matches /api/anything)
|
|
1445
|
+
if (patternStr.includes("*")) {
|
|
1446
|
+
// Handle trailing /* specially to match with or without trailing slash
|
|
1447
|
+
if (patternStr.endsWith("/*")) {
|
|
1448
|
+
const prefix = patternStr.slice(0, -2); // Remove /*
|
|
1449
|
+
// Match if requestPath starts with prefix, optionally followed by /
|
|
1450
|
+
const regex = new RegExp(
|
|
1451
|
+
`^${prefix.replace(/[.+?^${}()|[\]\\]/g, "\\$&")}(?:/.*)?$`
|
|
1452
|
+
);
|
|
1453
|
+
return regex.test(requestPath);
|
|
1454
|
+
} else {
|
|
1455
|
+
const regexPattern = patternStr
|
|
1456
|
+
.replace(/[.+?^${}()|[\]\\]/g, "\\$&") // Escape special regex chars except *
|
|
1457
|
+
.replace(/\*/g, ".*"); // Convert * to .*
|
|
1458
|
+
const regex = new RegExp(`^${regexPattern}$`);
|
|
1459
|
+
return regex.test(requestPath);
|
|
1460
|
+
}
|
|
1461
|
+
}
|
|
1462
|
+
|
|
1463
|
+
// Path prefix matching (for patterns without wildcards)
|
|
1464
|
+
if (normalizedRequestPath.startsWith(normalizedPattern)) {
|
|
1465
|
+
return true;
|
|
1466
|
+
}
|
|
1467
|
+
|
|
1468
|
+
return false;
|
|
1469
|
+
}
|
|
1470
|
+
|
|
1471
|
+
/**
|
|
1472
|
+
* Check if a security module should be applied to a route
|
|
1473
|
+
*/
|
|
1474
|
+
private shouldApplySecurityModule(
|
|
1475
|
+
req: XyPrisRequest,
|
|
1476
|
+
moduleConfig?: SecurityModuleRouteConfig
|
|
1477
|
+
): boolean {
|
|
1478
|
+
if (!moduleConfig) {
|
|
1479
|
+
return true; // Apply by default if no route config
|
|
1480
|
+
}
|
|
1481
|
+
|
|
1482
|
+
const requestPath = req.path || req.url || "";
|
|
1483
|
+
const requestMethod = req.method || "GET";
|
|
1484
|
+
|
|
1485
|
+
// Check includeRoutes first (whitelist approach)
|
|
1486
|
+
if (
|
|
1487
|
+
moduleConfig.includeRoutes &&
|
|
1488
|
+
moduleConfig.includeRoutes.length > 0
|
|
1489
|
+
) {
|
|
1490
|
+
// Only apply if route is in the include list
|
|
1491
|
+
return moduleConfig.includeRoutes.some((pattern) =>
|
|
1492
|
+
this.matchesRoute(requestPath, requestMethod, pattern)
|
|
1493
|
+
);
|
|
1494
|
+
}
|
|
1495
|
+
|
|
1496
|
+
// Check excludeRoutes (blacklist approach)
|
|
1497
|
+
if (
|
|
1498
|
+
moduleConfig.excludeRoutes &&
|
|
1499
|
+
moduleConfig.excludeRoutes.length > 0
|
|
1500
|
+
) {
|
|
1501
|
+
// Don't apply if route is in the exclude list
|
|
1502
|
+
const isExcluded = moduleConfig.excludeRoutes.some((pattern) =>
|
|
1503
|
+
this.matchesRoute(requestPath, requestMethod, pattern)
|
|
1504
|
+
);
|
|
1505
|
+
return !isExcluded;
|
|
1506
|
+
}
|
|
1507
|
+
|
|
1508
|
+
return true; // Apply by default
|
|
1509
|
+
}
|
|
1510
|
+
|
|
1511
|
+
/**
|
|
1512
|
+
* Report a security attack to the plugin manager
|
|
1513
|
+
*/
|
|
1514
|
+
private reportAttack(req: any, res: any, attackData: any): void {
|
|
1515
|
+
const pluginManager = (req.app as any)?.pluginManager;
|
|
1516
|
+
this.logger.debug(
|
|
1517
|
+
"security",
|
|
1518
|
+
`Reporting attack. PluginManager found: ${!!pluginManager}`
|
|
1519
|
+
);
|
|
1520
|
+
if (
|
|
1521
|
+
pluginManager &&
|
|
1522
|
+
typeof pluginManager.triggerSecurityAttack === "function"
|
|
1523
|
+
) {
|
|
1524
|
+
pluginManager.triggerSecurityAttack(attackData, req, res);
|
|
1525
|
+
}
|
|
1526
|
+
}
|
|
1527
|
+
|
|
1528
|
+
/**
|
|
1529
|
+
* Report a rate limit hit to the plugin manager
|
|
1530
|
+
*/
|
|
1531
|
+
private reportRateLimit(req: any, res: any, limitData: any): void {
|
|
1532
|
+
const pluginManager = (req.app as any)?.pluginManager;
|
|
1533
|
+
if (
|
|
1534
|
+
pluginManager &&
|
|
1535
|
+
typeof pluginManager.triggerRateLimit === "function"
|
|
1536
|
+
) {
|
|
1537
|
+
pluginManager.triggerRateLimit(limitData, req, res);
|
|
1538
|
+
}
|
|
1539
|
+
}
|
|
1540
|
+
}
|
|
1541
|
+
|