@vorionsys/platform-core 0.1.0
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/LICENSE +190 -0
- package/README.md +88 -0
- package/dist/a2a/attestation.d.ts +145 -0
- package/dist/a2a/attestation.d.ts.map +1 -0
- package/dist/a2a/attestation.js +353 -0
- package/dist/a2a/attestation.js.map +1 -0
- package/dist/a2a/chain-of-trust.d.ts +143 -0
- package/dist/a2a/chain-of-trust.d.ts.map +1 -0
- package/dist/a2a/chain-of-trust.js +422 -0
- package/dist/a2a/chain-of-trust.js.map +1 -0
- package/dist/a2a/index.d.ts +15 -0
- package/dist/a2a/index.d.ts.map +1 -0
- package/dist/a2a/index.js +23 -0
- package/dist/a2a/index.js.map +1 -0
- package/dist/a2a/openapi.d.ts +22 -0
- package/dist/a2a/openapi.d.ts.map +1 -0
- package/dist/a2a/openapi.js +1133 -0
- package/dist/a2a/openapi.js.map +1 -0
- package/dist/a2a/router.d.ts +167 -0
- package/dist/a2a/router.d.ts.map +1 -0
- package/dist/a2a/router.js +454 -0
- package/dist/a2a/router.js.map +1 -0
- package/dist/a2a/routes.d.ts +11 -0
- package/dist/a2a/routes.d.ts.map +1 -0
- package/dist/a2a/routes.js +442 -0
- package/dist/a2a/routes.js.map +1 -0
- package/dist/a2a/trust-negotiation.d.ts +119 -0
- package/dist/a2a/trust-negotiation.d.ts.map +1 -0
- package/dist/a2a/trust-negotiation.js +425 -0
- package/dist/a2a/trust-negotiation.js.map +1 -0
- package/dist/a2a/types.d.ts +413 -0
- package/dist/a2a/types.d.ts.map +1 -0
- package/dist/a2a/types.js +38 -0
- package/dist/a2a/types.js.map +1 -0
- package/dist/agent-registry/a3i-cache.d.ts +113 -0
- package/dist/agent-registry/a3i-cache.d.ts.map +1 -0
- package/dist/agent-registry/a3i-cache.js +305 -0
- package/dist/agent-registry/a3i-cache.js.map +1 -0
- package/dist/agent-registry/index.d.ts +14 -0
- package/dist/agent-registry/index.d.ts.map +1 -0
- package/dist/agent-registry/index.js +17 -0
- package/dist/agent-registry/index.js.map +1 -0
- package/dist/agent-registry/openapi.d.ts +23 -0
- package/dist/agent-registry/openapi.d.ts.map +1 -0
- package/dist/agent-registry/openapi.js +1377 -0
- package/dist/agent-registry/openapi.js.map +1 -0
- package/dist/agent-registry/routes.d.ts +10 -0
- package/dist/agent-registry/routes.d.ts.map +1 -0
- package/dist/agent-registry/routes.js +485 -0
- package/dist/agent-registry/routes.js.map +1 -0
- package/dist/agent-registry/service.d.ts +159 -0
- package/dist/agent-registry/service.d.ts.map +1 -0
- package/dist/agent-registry/service.js +652 -0
- package/dist/agent-registry/service.js.map +1 -0
- package/dist/agent-registry/tenant-service.d.ts +104 -0
- package/dist/agent-registry/tenant-service.d.ts.map +1 -0
- package/dist/agent-registry/tenant-service.js +313 -0
- package/dist/agent-registry/tenant-service.js.map +1 -0
- package/dist/api/auth.d.ts +55 -0
- package/dist/api/auth.d.ts.map +1 -0
- package/dist/api/auth.js +322 -0
- package/dist/api/auth.js.map +1 -0
- package/dist/api/errors.d.ts +146 -0
- package/dist/api/errors.d.ts.map +1 -0
- package/dist/api/errors.js +464 -0
- package/dist/api/errors.js.map +1 -0
- package/dist/api/index.d.ts +15 -0
- package/dist/api/index.d.ts.map +1 -0
- package/dist/api/index.js +19 -0
- package/dist/api/index.js.map +1 -0
- package/dist/api/middleware/api-key-enforcement.d.ts +131 -0
- package/dist/api/middleware/api-key-enforcement.d.ts.map +1 -0
- package/dist/api/middleware/api-key-enforcement.js +674 -0
- package/dist/api/middleware/api-key-enforcement.js.map +1 -0
- package/dist/api/middleware/audit.d.ts +151 -0
- package/dist/api/middleware/audit.d.ts.map +1 -0
- package/dist/api/middleware/audit.js +384 -0
- package/dist/api/middleware/audit.js.map +1 -0
- package/dist/api/middleware/dpop-enforcement.d.ts +176 -0
- package/dist/api/middleware/dpop-enforcement.d.ts.map +1 -0
- package/dist/api/middleware/dpop-enforcement.js +596 -0
- package/dist/api/middleware/dpop-enforcement.js.map +1 -0
- package/dist/api/middleware/index.d.ts +24 -0
- package/dist/api/middleware/index.d.ts.map +1 -0
- package/dist/api/middleware/index.js +43 -0
- package/dist/api/middleware/index.js.map +1 -0
- package/dist/api/middleware/metrics.d.ts +41 -0
- package/dist/api/middleware/metrics.d.ts.map +1 -0
- package/dist/api/middleware/metrics.js +150 -0
- package/dist/api/middleware/metrics.js.map +1 -0
- package/dist/api/middleware/rate-limits.d.ts +224 -0
- package/dist/api/middleware/rate-limits.d.ts.map +1 -0
- package/dist/api/middleware/rate-limits.js +686 -0
- package/dist/api/middleware/rate-limits.js.map +1 -0
- package/dist/api/middleware/rateLimit.d.ts +165 -0
- package/dist/api/middleware/rateLimit.d.ts.map +1 -0
- package/dist/api/middleware/rateLimit.js +477 -0
- package/dist/api/middleware/rateLimit.js.map +1 -0
- package/dist/api/middleware/redis-rate-limiter.d.ts +279 -0
- package/dist/api/middleware/redis-rate-limiter.d.ts.map +1 -0
- package/dist/api/middleware/redis-rate-limiter.js +1074 -0
- package/dist/api/middleware/redis-rate-limiter.js.map +1 -0
- package/dist/api/middleware/security-headers.d.ts +248 -0
- package/dist/api/middleware/security-headers.d.ts.map +1 -0
- package/dist/api/middleware/security-headers.js +410 -0
- package/dist/api/middleware/security-headers.js.map +1 -0
- package/dist/api/middleware/security.d.ts +156 -0
- package/dist/api/middleware/security.d.ts.map +1 -0
- package/dist/api/middleware/security.js +412 -0
- package/dist/api/middleware/security.js.map +1 -0
- package/dist/api/middleware/validation.d.ts +132 -0
- package/dist/api/middleware/validation.d.ts.map +1 -0
- package/dist/api/middleware/validation.js +363 -0
- package/dist/api/middleware/validation.js.map +1 -0
- package/dist/api/middleware/webhook-verify.d.ts +130 -0
- package/dist/api/middleware/webhook-verify.d.ts.map +1 -0
- package/dist/api/middleware/webhook-verify.js +366 -0
- package/dist/api/middleware/webhook-verify.js.map +1 -0
- package/dist/api/rate-limit.d.ts +115 -0
- package/dist/api/rate-limit.d.ts.map +1 -0
- package/dist/api/rate-limit.js +335 -0
- package/dist/api/rate-limit.js.map +1 -0
- package/dist/api/server.d.ts +37 -0
- package/dist/api/server.d.ts.map +1 -0
- package/dist/api/server.js +2086 -0
- package/dist/api/server.js.map +1 -0
- package/dist/api/validation.d.ts +243 -0
- package/dist/api/validation.d.ts.map +1 -0
- package/dist/api/validation.js +247 -0
- package/dist/api/validation.js.map +1 -0
- package/dist/audit/compliance-reporter.d.ts +271 -0
- package/dist/audit/compliance-reporter.d.ts.map +1 -0
- package/dist/audit/compliance-reporter.js +587 -0
- package/dist/audit/compliance-reporter.js.map +1 -0
- package/dist/audit/db-store.d.ts +689 -0
- package/dist/audit/db-store.d.ts.map +1 -0
- package/dist/audit/db-store.js +589 -0
- package/dist/audit/db-store.js.map +1 -0
- package/dist/audit/event-schema.d.ts +605 -0
- package/dist/audit/event-schema.d.ts.map +1 -0
- package/dist/audit/event-schema.js +566 -0
- package/dist/audit/event-schema.js.map +1 -0
- package/dist/audit/index.d.ts +16 -0
- package/dist/audit/index.d.ts.map +1 -0
- package/dist/audit/index.js +44 -0
- package/dist/audit/index.js.map +1 -0
- package/dist/audit/security-events.d.ts +1624 -0
- package/dist/audit/security-events.d.ts.map +1 -0
- package/dist/audit/security-events.js +775 -0
- package/dist/audit/security-events.js.map +1 -0
- package/dist/audit/security-logger.d.ts +288 -0
- package/dist/audit/security-logger.d.ts.map +1 -0
- package/dist/audit/security-logger.js +820 -0
- package/dist/audit/security-logger.js.map +1 -0
- package/dist/audit/service.d.ts +206 -0
- package/dist/audit/service.d.ts.map +1 -0
- package/dist/audit/service.js +756 -0
- package/dist/audit/service.js.map +1 -0
- package/dist/audit/siem/elastic.d.ts +94 -0
- package/dist/audit/siem/elastic.d.ts.map +1 -0
- package/dist/audit/siem/elastic.js +412 -0
- package/dist/audit/siem/elastic.js.map +1 -0
- package/dist/audit/siem/index.d.ts +179 -0
- package/dist/audit/siem/index.d.ts.map +1 -0
- package/dist/audit/siem/index.js +368 -0
- package/dist/audit/siem/index.js.map +1 -0
- package/dist/audit/siem/loki.d.ts +100 -0
- package/dist/audit/siem/loki.d.ts.map +1 -0
- package/dist/audit/siem/loki.js +406 -0
- package/dist/audit/siem/loki.js.map +1 -0
- package/dist/audit/siem/splunk.d.ts +91 -0
- package/dist/audit/siem/splunk.d.ts.map +1 -0
- package/dist/audit/siem/splunk.js +375 -0
- package/dist/audit/siem/splunk.js.map +1 -0
- package/dist/audit/siem/types.d.ts +547 -0
- package/dist/audit/siem/types.d.ts.map +1 -0
- package/dist/audit/siem/types.js +270 -0
- package/dist/audit/siem/types.js.map +1 -0
- package/dist/audit/types.d.ts +410 -0
- package/dist/audit/types.d.ts.map +1 -0
- package/dist/audit/types.js +130 -0
- package/dist/audit/types.js.map +1 -0
- package/dist/auth/index.d.ts +10 -0
- package/dist/auth/index.d.ts.map +1 -0
- package/dist/auth/index.js +10 -0
- package/dist/auth/index.js.map +1 -0
- package/dist/auth/mfa/index.d.ts +9 -0
- package/dist/auth/mfa/index.d.ts.map +1 -0
- package/dist/auth/mfa/index.js +9 -0
- package/dist/auth/mfa/index.js.map +1 -0
- package/dist/auth/mfa/totp.d.ts +222 -0
- package/dist/auth/mfa/totp.d.ts.map +1 -0
- package/dist/auth/mfa/totp.js +329 -0
- package/dist/auth/mfa/totp.js.map +1 -0
- package/dist/auth/piv-cac/card-removal-handler.d.ts +197 -0
- package/dist/auth/piv-cac/card-removal-handler.d.ts.map +1 -0
- package/dist/auth/piv-cac/card-removal-handler.js +560 -0
- package/dist/auth/piv-cac/card-removal-handler.js.map +1 -0
- package/dist/auth/piv-cac/certificate-auth.d.ts +117 -0
- package/dist/auth/piv-cac/certificate-auth.d.ts.map +1 -0
- package/dist/auth/piv-cac/certificate-auth.js +727 -0
- package/dist/auth/piv-cac/certificate-auth.js.map +1 -0
- package/dist/auth/piv-cac/certificate-mapper.d.ts +141 -0
- package/dist/auth/piv-cac/certificate-mapper.d.ts.map +1 -0
- package/dist/auth/piv-cac/certificate-mapper.js +569 -0
- package/dist/auth/piv-cac/certificate-mapper.js.map +1 -0
- package/dist/auth/piv-cac/crl-validator.d.ts +195 -0
- package/dist/auth/piv-cac/crl-validator.d.ts.map +1 -0
- package/dist/auth/piv-cac/crl-validator.js +824 -0
- package/dist/auth/piv-cac/crl-validator.js.map +1 -0
- package/dist/auth/piv-cac/index.d.ts +72 -0
- package/dist/auth/piv-cac/index.d.ts.map +1 -0
- package/dist/auth/piv-cac/index.js +172 -0
- package/dist/auth/piv-cac/index.js.map +1 -0
- package/dist/auth/piv-cac/ocsp-validator.d.ts +183 -0
- package/dist/auth/piv-cac/ocsp-validator.d.ts.map +1 -0
- package/dist/auth/piv-cac/ocsp-validator.js +657 -0
- package/dist/auth/piv-cac/ocsp-validator.js.map +1 -0
- package/dist/auth/piv-cac/piv-middleware.d.ts +95 -0
- package/dist/auth/piv-cac/piv-middleware.d.ts.map +1 -0
- package/dist/auth/piv-cac/piv-middleware.js +524 -0
- package/dist/auth/piv-cac/piv-middleware.js.map +1 -0
- package/dist/auth/piv-cac/piv-routes.d.ts +29 -0
- package/dist/auth/piv-cac/piv-routes.d.ts.map +1 -0
- package/dist/auth/piv-cac/piv-routes.js +534 -0
- package/dist/auth/piv-cac/piv-routes.js.map +1 -0
- package/dist/auth/piv-cac/pkcs11-provider.d.ts +280 -0
- package/dist/auth/piv-cac/pkcs11-provider.d.ts.map +1 -0
- package/dist/auth/piv-cac/pkcs11-provider.js +535 -0
- package/dist/auth/piv-cac/pkcs11-provider.js.map +1 -0
- package/dist/auth/piv-cac/types.d.ts +4098 -0
- package/dist/auth/piv-cac/types.d.ts.map +1 -0
- package/dist/auth/piv-cac/types.js +495 -0
- package/dist/auth/piv-cac/types.js.map +1 -0
- package/dist/basis/evaluator.d.ts +72 -0
- package/dist/basis/evaluator.d.ts.map +1 -0
- package/dist/basis/evaluator.js +275 -0
- package/dist/basis/evaluator.js.map +1 -0
- package/dist/basis/expression-evaluator.d.ts +77 -0
- package/dist/basis/expression-evaluator.d.ts.map +1 -0
- package/dist/basis/expression-evaluator.js +826 -0
- package/dist/basis/expression-evaluator.js.map +1 -0
- package/dist/basis/index.d.ts +13 -0
- package/dist/basis/index.d.ts.map +1 -0
- package/dist/basis/index.js +13 -0
- package/dist/basis/index.js.map +1 -0
- package/dist/basis/parser.d.ts +376 -0
- package/dist/basis/parser.d.ts.map +1 -0
- package/dist/basis/parser.js +178 -0
- package/dist/basis/parser.js.map +1 -0
- package/dist/basis/types.d.ts +115 -0
- package/dist/basis/types.d.ts.map +1 -0
- package/dist/basis/types.js +5 -0
- package/dist/basis/types.js.map +1 -0
- package/dist/car-extensions/aci-string-extensions.d.ts +10 -0
- package/dist/car-extensions/aci-string-extensions.d.ts.map +1 -0
- package/dist/car-extensions/aci-string-extensions.js +24 -0
- package/dist/car-extensions/aci-string-extensions.js.map +1 -0
- package/dist/car-extensions/builtin-extensions/audit.d.ts +88 -0
- package/dist/car-extensions/builtin-extensions/audit.d.ts.map +1 -0
- package/dist/car-extensions/builtin-extensions/audit.js +445 -0
- package/dist/car-extensions/builtin-extensions/audit.js.map +1 -0
- package/dist/car-extensions/builtin-extensions/governance.d.ts +32 -0
- package/dist/car-extensions/builtin-extensions/governance.d.ts.map +1 -0
- package/dist/car-extensions/builtin-extensions/governance.js +534 -0
- package/dist/car-extensions/builtin-extensions/governance.js.map +1 -0
- package/dist/car-extensions/builtin-extensions/monitoring.d.ts +43 -0
- package/dist/car-extensions/builtin-extensions/monitoring.d.ts.map +1 -0
- package/dist/car-extensions/builtin-extensions/monitoring.js +416 -0
- package/dist/car-extensions/builtin-extensions/monitoring.js.map +1 -0
- package/dist/car-extensions/car-string-extensions.d.ts +355 -0
- package/dist/car-extensions/car-string-extensions.d.ts.map +1 -0
- package/dist/car-extensions/car-string-extensions.js +473 -0
- package/dist/car-extensions/car-string-extensions.js.map +1 -0
- package/dist/car-extensions/executor.d.ts +208 -0
- package/dist/car-extensions/executor.d.ts.map +1 -0
- package/dist/car-extensions/executor.js +789 -0
- package/dist/car-extensions/executor.js.map +1 -0
- package/dist/car-extensions/index.d.ts +94 -0
- package/dist/car-extensions/index.d.ts.map +1 -0
- package/dist/car-extensions/index.js +159 -0
- package/dist/car-extensions/index.js.map +1 -0
- package/dist/car-extensions/registry.d.ts +217 -0
- package/dist/car-extensions/registry.d.ts.map +1 -0
- package/dist/car-extensions/registry.js +450 -0
- package/dist/car-extensions/registry.js.map +1 -0
- package/dist/car-extensions/service.d.ts +220 -0
- package/dist/car-extensions/service.d.ts.map +1 -0
- package/dist/car-extensions/service.js +486 -0
- package/dist/car-extensions/service.js.map +1 -0
- package/dist/car-extensions/types.d.ts +2269 -0
- package/dist/car-extensions/types.d.ts.map +1 -0
- package/dist/car-extensions/types.js +389 -0
- package/dist/car-extensions/types.js.map +1 -0
- package/dist/cognigate/index.d.ts +192 -0
- package/dist/cognigate/index.d.ts.map +1 -0
- package/dist/cognigate/index.js +435 -0
- package/dist/cognigate/index.js.map +1 -0
- package/dist/cognigate/sandbox/capability-broker.d.ts +166 -0
- package/dist/cognigate/sandbox/capability-broker.d.ts.map +1 -0
- package/dist/cognigate/sandbox/capability-broker.js +461 -0
- package/dist/cognigate/sandbox/capability-broker.js.map +1 -0
- package/dist/cognigate/sandbox/filesystem-policy.d.ts +139 -0
- package/dist/cognigate/sandbox/filesystem-policy.d.ts.map +1 -0
- package/dist/cognigate/sandbox/filesystem-policy.js +426 -0
- package/dist/cognigate/sandbox/filesystem-policy.js.map +1 -0
- package/dist/cognigate/sandbox/index.d.ts +17 -0
- package/dist/cognigate/sandbox/index.d.ts.map +1 -0
- package/dist/cognigate/sandbox/index.js +24 -0
- package/dist/cognigate/sandbox/index.js.map +1 -0
- package/dist/cognigate/sandbox/network-policy.d.ts +126 -0
- package/dist/cognigate/sandbox/network-policy.d.ts.map +1 -0
- package/dist/cognigate/sandbox/network-policy.js +382 -0
- package/dist/cognigate/sandbox/network-policy.js.map +1 -0
- package/dist/cognigate/sandbox/sandbox-service.d.ts +70 -0
- package/dist/cognigate/sandbox/sandbox-service.d.ts.map +1 -0
- package/dist/cognigate/sandbox/sandbox-service.js +472 -0
- package/dist/cognigate/sandbox/sandbox-service.js.map +1 -0
- package/dist/cognigate/sandbox/types.d.ts +376 -0
- package/dist/cognigate/sandbox/types.d.ts.map +1 -0
- package/dist/cognigate/sandbox/types.js +179 -0
- package/dist/cognigate/sandbox/types.js.map +1 -0
- package/dist/common/adapters/index.d.ts +34 -0
- package/dist/common/adapters/index.d.ts.map +1 -0
- package/dist/common/adapters/index.js +46 -0
- package/dist/common/adapters/index.js.map +1 -0
- package/dist/common/adapters/memory-cache.d.ts +91 -0
- package/dist/common/adapters/memory-cache.d.ts.map +1 -0
- package/dist/common/adapters/memory-cache.js +201 -0
- package/dist/common/adapters/memory-cache.js.map +1 -0
- package/dist/common/adapters/memory-lock.d.ts +75 -0
- package/dist/common/adapters/memory-lock.d.ts.map +1 -0
- package/dist/common/adapters/memory-lock.js +219 -0
- package/dist/common/adapters/memory-lock.js.map +1 -0
- package/dist/common/adapters/memory-queue.d.ts +64 -0
- package/dist/common/adapters/memory-queue.d.ts.map +1 -0
- package/dist/common/adapters/memory-queue.js +233 -0
- package/dist/common/adapters/memory-queue.js.map +1 -0
- package/dist/common/adapters/memory-ratelimit.d.ts +78 -0
- package/dist/common/adapters/memory-ratelimit.d.ts.map +1 -0
- package/dist/common/adapters/memory-ratelimit.js +196 -0
- package/dist/common/adapters/memory-ratelimit.js.map +1 -0
- package/dist/common/adapters/memory-session.d.ts +105 -0
- package/dist/common/adapters/memory-session.d.ts.map +1 -0
- package/dist/common/adapters/memory-session.js +302 -0
- package/dist/common/adapters/memory-session.js.map +1 -0
- package/dist/common/adapters/provider.d.ts +47 -0
- package/dist/common/adapters/provider.d.ts.map +1 -0
- package/dist/common/adapters/provider.js +347 -0
- package/dist/common/adapters/provider.js.map +1 -0
- package/dist/common/adapters/types.d.ts +247 -0
- package/dist/common/adapters/types.d.ts.map +1 -0
- package/dist/common/adapters/types.js +11 -0
- package/dist/common/adapters/types.js.map +1 -0
- package/dist/common/alerts.d.ts +57 -0
- package/dist/common/alerts.d.ts.map +1 -0
- package/dist/common/alerts.js +216 -0
- package/dist/common/alerts.js.map +1 -0
- package/dist/common/authorization.d.ts +137 -0
- package/dist/common/authorization.d.ts.map +1 -0
- package/dist/common/authorization.js +270 -0
- package/dist/common/authorization.js.map +1 -0
- package/dist/common/canonical-bridge.d.ts +153 -0
- package/dist/common/canonical-bridge.d.ts.map +1 -0
- package/dist/common/canonical-bridge.js +236 -0
- package/dist/common/canonical-bridge.js.map +1 -0
- package/dist/common/canonical-json.d.ts +64 -0
- package/dist/common/canonical-json.d.ts.map +1 -0
- package/dist/common/canonical-json.js +95 -0
- package/dist/common/canonical-json.js.map +1 -0
- package/dist/common/circuit-breaker.d.ts +320 -0
- package/dist/common/circuit-breaker.d.ts.map +1 -0
- package/dist/common/circuit-breaker.js +887 -0
- package/dist/common/circuit-breaker.js.map +1 -0
- package/dist/common/config.d.ts +2053 -0
- package/dist/common/config.d.ts.map +1 -0
- package/dist/common/config.js +1314 -0
- package/dist/common/config.js.map +1 -0
- package/dist/common/contracts/index.d.ts +2 -0
- package/dist/common/contracts/index.d.ts.map +1 -0
- package/dist/common/contracts/index.js +2 -0
- package/dist/common/contracts/index.js.map +1 -0
- package/dist/common/contracts/output.d.ts +81 -0
- package/dist/common/contracts/output.d.ts.map +1 -0
- package/dist/common/contracts/output.js +38 -0
- package/dist/common/contracts/output.js.map +1 -0
- package/dist/common/crypto-utils.d.ts +103 -0
- package/dist/common/crypto-utils.d.ts.map +1 -0
- package/dist/common/crypto-utils.js +275 -0
- package/dist/common/crypto-utils.js.map +1 -0
- package/dist/common/crypto.d.ts +70 -0
- package/dist/common/crypto.d.ts.map +1 -0
- package/dist/common/crypto.js +201 -0
- package/dist/common/crypto.js.map +1 -0
- package/dist/common/database-resilience.d.ts +156 -0
- package/dist/common/database-resilience.d.ts.map +1 -0
- package/dist/common/database-resilience.js +269 -0
- package/dist/common/database-resilience.js.map +1 -0
- package/dist/common/db-metrics.d.ts +90 -0
- package/dist/common/db-metrics.d.ts.map +1 -0
- package/dist/common/db-metrics.js +219 -0
- package/dist/common/db-metrics.js.map +1 -0
- package/dist/common/db-pool.d.ts +307 -0
- package/dist/common/db-pool.d.ts.map +1 -0
- package/dist/common/db-pool.js +879 -0
- package/dist/common/db-pool.js.map +1 -0
- package/dist/common/db.d.ts +105 -0
- package/dist/common/db.d.ts.map +1 -0
- package/dist/common/db.js +216 -0
- package/dist/common/db.js.map +1 -0
- package/dist/common/debug-auth-middleware.d.ts +111 -0
- package/dist/common/debug-auth-middleware.d.ts.map +1 -0
- package/dist/common/debug-auth-middleware.js +285 -0
- package/dist/common/debug-auth-middleware.js.map +1 -0
- package/dist/common/di.d.ts +202 -0
- package/dist/common/di.d.ts.map +1 -0
- package/dist/common/di.js +219 -0
- package/dist/common/di.js.map +1 -0
- package/dist/common/encryption.d.ts +233 -0
- package/dist/common/encryption.d.ts.map +1 -0
- package/dist/common/encryption.js +527 -0
- package/dist/common/encryption.js.map +1 -0
- package/dist/common/error-sanitizer.d.ts +67 -0
- package/dist/common/error-sanitizer.d.ts.map +1 -0
- package/dist/common/error-sanitizer.js +298 -0
- package/dist/common/error-sanitizer.js.map +1 -0
- package/dist/common/errors.d.ts +229 -0
- package/dist/common/errors.d.ts.map +1 -0
- package/dist/common/errors.js +349 -0
- package/dist/common/errors.js.map +1 -0
- package/dist/common/expression/evaluator.d.ts +58 -0
- package/dist/common/expression/evaluator.d.ts.map +1 -0
- package/dist/common/expression/evaluator.js +326 -0
- package/dist/common/expression/evaluator.js.map +1 -0
- package/dist/common/expression/index.d.ts +180 -0
- package/dist/common/expression/index.d.ts.map +1 -0
- package/dist/common/expression/index.js +198 -0
- package/dist/common/expression/index.js.map +1 -0
- package/dist/common/expression/lexer.d.ts +69 -0
- package/dist/common/expression/lexer.d.ts.map +1 -0
- package/dist/common/expression/lexer.js +255 -0
- package/dist/common/expression/lexer.js.map +1 -0
- package/dist/common/expression/parser.d.ts +133 -0
- package/dist/common/expression/parser.d.ts.map +1 -0
- package/dist/common/expression/parser.js +293 -0
- package/dist/common/expression/parser.js.map +1 -0
- package/dist/common/group-membership.d.ts +119 -0
- package/dist/common/group-membership.d.ts.map +1 -0
- package/dist/common/group-membership.js +250 -0
- package/dist/common/group-membership.js.map +1 -0
- package/dist/common/index.d.ts +14 -0
- package/dist/common/index.d.ts.map +1 -0
- package/dist/common/index.js +15 -0
- package/dist/common/index.js.map +1 -0
- package/dist/common/leader-election.d.ts +40 -0
- package/dist/common/leader-election.d.ts.map +1 -0
- package/dist/common/leader-election.js +232 -0
- package/dist/common/leader-election.js.map +1 -0
- package/dist/common/lock.d.ts +77 -0
- package/dist/common/lock.d.ts.map +1 -0
- package/dist/common/lock.js +167 -0
- package/dist/common/lock.js.map +1 -0
- package/dist/common/logger.d.ts +19 -0
- package/dist/common/logger.d.ts.map +1 -0
- package/dist/common/logger.js +80 -0
- package/dist/common/logger.js.map +1 -0
- package/dist/common/metrics-registry.d.ts +48 -0
- package/dist/common/metrics-registry.d.ts.map +1 -0
- package/dist/common/metrics-registry.js +77 -0
- package/dist/common/metrics-registry.js.map +1 -0
- package/dist/common/metrics.d.ts +204 -0
- package/dist/common/metrics.d.ts.map +1 -0
- package/dist/common/metrics.js +497 -0
- package/dist/common/metrics.js.map +1 -0
- package/dist/common/operation-tracker.d.ts +137 -0
- package/dist/common/operation-tracker.d.ts.map +1 -0
- package/dist/common/operation-tracker.js +366 -0
- package/dist/common/operation-tracker.js.map +1 -0
- package/dist/common/provenance/chain.d.ts +54 -0
- package/dist/common/provenance/chain.d.ts.map +1 -0
- package/dist/common/provenance/chain.js +252 -0
- package/dist/common/provenance/chain.js.map +1 -0
- package/dist/common/provenance/index.d.ts +14 -0
- package/dist/common/provenance/index.d.ts.map +1 -0
- package/dist/common/provenance/index.js +19 -0
- package/dist/common/provenance/index.js.map +1 -0
- package/dist/common/provenance/query.d.ts +111 -0
- package/dist/common/provenance/query.d.ts.map +1 -0
- package/dist/common/provenance/query.js +310 -0
- package/dist/common/provenance/query.js.map +1 -0
- package/dist/common/provenance/storage.d.ts +297 -0
- package/dist/common/provenance/storage.d.ts.map +1 -0
- package/dist/common/provenance/storage.js +436 -0
- package/dist/common/provenance/storage.js.map +1 -0
- package/dist/common/provenance/tracker.d.ts +57 -0
- package/dist/common/provenance/tracker.d.ts.map +1 -0
- package/dist/common/provenance/tracker.js +209 -0
- package/dist/common/provenance/tracker.js.map +1 -0
- package/dist/common/provenance/types.d.ts +146 -0
- package/dist/common/provenance/types.d.ts.map +1 -0
- package/dist/common/provenance/types.js +10 -0
- package/dist/common/provenance/types.js.map +1 -0
- package/dist/common/random.d.ts +84 -0
- package/dist/common/random.d.ts.map +1 -0
- package/dist/common/random.js +130 -0
- package/dist/common/random.js.map +1 -0
- package/dist/common/redaction.d.ts +49 -0
- package/dist/common/redaction.d.ts.map +1 -0
- package/dist/common/redaction.js +217 -0
- package/dist/common/redaction.js.map +1 -0
- package/dist/common/redis-cluster.d.ts +538 -0
- package/dist/common/redis-cluster.d.ts.map +1 -0
- package/dist/common/redis-cluster.js +1539 -0
- package/dist/common/redis-cluster.js.map +1 -0
- package/dist/common/redis-resilience.d.ts +270 -0
- package/dist/common/redis-resilience.d.ts.map +1 -0
- package/dist/common/redis-resilience.js +586 -0
- package/dist/common/redis-resilience.js.map +1 -0
- package/dist/common/redis.d.ts +19 -0
- package/dist/common/redis.d.ts.map +1 -0
- package/dist/common/redis.js +73 -0
- package/dist/common/redis.js.map +1 -0
- package/dist/common/safe-json.d.ts +246 -0
- package/dist/common/safe-json.d.ts.map +1 -0
- package/dist/common/safe-json.js +442 -0
- package/dist/common/safe-json.js.map +1 -0
- package/dist/common/secret-generator.d.ts +142 -0
- package/dist/common/secret-generator.d.ts.map +1 -0
- package/dist/common/secret-generator.js +286 -0
- package/dist/common/secret-generator.js.map +1 -0
- package/dist/common/secure-fetch.d.ts +182 -0
- package/dist/common/secure-fetch.d.ts.map +1 -0
- package/dist/common/secure-fetch.js +657 -0
- package/dist/common/secure-fetch.js.map +1 -0
- package/dist/common/security-mode.d.ts +151 -0
- package/dist/common/security-mode.d.ts.map +1 -0
- package/dist/common/security-mode.js +482 -0
- package/dist/common/security-mode.js.map +1 -0
- package/dist/common/telemetry/index.d.ts +82 -0
- package/dist/common/telemetry/index.d.ts.map +1 -0
- package/dist/common/telemetry/index.js +198 -0
- package/dist/common/telemetry/index.js.map +1 -0
- package/dist/common/telemetry/instrumentation.d.ts +167 -0
- package/dist/common/telemetry/instrumentation.d.ts.map +1 -0
- package/dist/common/telemetry/instrumentation.js +492 -0
- package/dist/common/telemetry/instrumentation.js.map +1 -0
- package/dist/common/telemetry/metrics-bridge.d.ts +227 -0
- package/dist/common/telemetry/metrics-bridge.d.ts.map +1 -0
- package/dist/common/telemetry/metrics-bridge.js +437 -0
- package/dist/common/telemetry/metrics-bridge.js.map +1 -0
- package/dist/common/telemetry/middleware.d.ts +114 -0
- package/dist/common/telemetry/middleware.d.ts.map +1 -0
- package/dist/common/telemetry/middleware.js +353 -0
- package/dist/common/telemetry/middleware.js.map +1 -0
- package/dist/common/telemetry/propagation.d.ts +221 -0
- package/dist/common/telemetry/propagation.d.ts.map +1 -0
- package/dist/common/telemetry/propagation.js +409 -0
- package/dist/common/telemetry/propagation.js.map +1 -0
- package/dist/common/telemetry/spans.d.ts +295 -0
- package/dist/common/telemetry/spans.d.ts.map +1 -0
- package/dist/common/telemetry/spans.js +439 -0
- package/dist/common/telemetry/spans.js.map +1 -0
- package/dist/common/telemetry/tracer.d.ts +155 -0
- package/dist/common/telemetry/tracer.d.ts.map +1 -0
- package/dist/common/telemetry/tracer.js +343 -0
- package/dist/common/telemetry/tracer.js.map +1 -0
- package/dist/common/telemetry.d.ts +15 -0
- package/dist/common/telemetry.d.ts.map +1 -0
- package/dist/common/telemetry.js +61 -0
- package/dist/common/telemetry.js.map +1 -0
- package/dist/common/tenant-context.d.ts +253 -0
- package/dist/common/tenant-context.d.ts.map +1 -0
- package/dist/common/tenant-context.js +259 -0
- package/dist/common/tenant-context.js.map +1 -0
- package/dist/common/tenant-verification.d.ts +86 -0
- package/dist/common/tenant-verification.d.ts.map +1 -0
- package/dist/common/tenant-verification.js +184 -0
- package/dist/common/tenant-verification.js.map +1 -0
- package/dist/common/timeout.d.ts +40 -0
- package/dist/common/timeout.d.ts.map +1 -0
- package/dist/common/timeout.js +82 -0
- package/dist/common/timeout.js.map +1 -0
- package/dist/common/token-revocation.d.ts +44 -0
- package/dist/common/token-revocation.d.ts.map +1 -0
- package/dist/common/token-revocation.js +169 -0
- package/dist/common/token-revocation.js.map +1 -0
- package/dist/common/trace.d.ts +149 -0
- package/dist/common/trace.d.ts.map +1 -0
- package/dist/common/trace.js +328 -0
- package/dist/common/trace.js.map +1 -0
- package/dist/common/trust-cache.d.ts +263 -0
- package/dist/common/trust-cache.d.ts.map +1 -0
- package/dist/common/trust-cache.js +670 -0
- package/dist/common/trust-cache.js.map +1 -0
- package/dist/common/types.d.ts +351 -0
- package/dist/common/types.d.ts.map +1 -0
- package/dist/common/types.js +55 -0
- package/dist/common/types.js.map +1 -0
- package/dist/common/validation.d.ts +113 -0
- package/dist/common/validation.d.ts.map +1 -0
- package/dist/common/validation.js +221 -0
- package/dist/common/validation.js.map +1 -0
- package/dist/db/client.d.ts +72 -0
- package/dist/db/client.d.ts.map +1 -0
- package/dist/db/client.js +110 -0
- package/dist/db/client.js.map +1 -0
- package/dist/db/index.d.ts +9 -0
- package/dist/db/index.d.ts.map +1 -0
- package/dist/db/index.js +9 -0
- package/dist/db/index.js.map +1 -0
- package/dist/db/schema/merkle.d.ts +475 -0
- package/dist/db/schema/merkle.d.ts.map +1 -0
- package/dist/db/schema/merkle.js +100 -0
- package/dist/db/schema/merkle.js.map +1 -0
- package/dist/db/schema/proofs.d.ts +412 -0
- package/dist/db/schema/proofs.d.ts.map +1 -0
- package/dist/db/schema/proofs.js +63 -0
- package/dist/db/schema/proofs.js.map +1 -0
- package/dist/enforce/adapters.d.ts +73 -0
- package/dist/enforce/adapters.d.ts.map +1 -0
- package/dist/enforce/adapters.js +293 -0
- package/dist/enforce/adapters.js.map +1 -0
- package/dist/enforce/index.d.ts +213 -0
- package/dist/enforce/index.d.ts.map +1 -0
- package/dist/enforce/index.js +630 -0
- package/dist/enforce/index.js.map +1 -0
- package/dist/enforce/repository.d.ts +203 -0
- package/dist/enforce/repository.d.ts.map +1 -0
- package/dist/enforce/repository.js +359 -0
- package/dist/enforce/repository.js.map +1 -0
- package/dist/enforce/schema.d.ts +1198 -0
- package/dist/enforce/schema.d.ts.map +1 -0
- package/dist/enforce/schema.js +257 -0
- package/dist/enforce/schema.js.map +1 -0
- package/dist/friction/index.d.ts +235 -0
- package/dist/friction/index.d.ts.map +1 -0
- package/dist/friction/index.js +636 -0
- package/dist/friction/index.js.map +1 -0
- package/dist/friction/openapi.d.ts +23 -0
- package/dist/friction/openapi.d.ts.map +1 -0
- package/dist/friction/openapi.js +883 -0
- package/dist/friction/openapi.js.map +1 -0
- package/dist/friction/routes.d.ts +14 -0
- package/dist/friction/routes.d.ts.map +1 -0
- package/dist/friction/routes.js +206 -0
- package/dist/friction/routes.js.map +1 -0
- package/dist/governance/engine.d.ts +158 -0
- package/dist/governance/engine.d.ts.map +1 -0
- package/dist/governance/engine.js +248 -0
- package/dist/governance/engine.js.map +1 -0
- package/dist/governance/evaluator.d.ts +106 -0
- package/dist/governance/evaluator.d.ts.map +1 -0
- package/dist/governance/evaluator.js +277 -0
- package/dist/governance/evaluator.js.map +1 -0
- package/dist/governance/index.d.ts +11 -0
- package/dist/governance/index.d.ts.map +1 -0
- package/dist/governance/index.js +14 -0
- package/dist/governance/index.js.map +1 -0
- package/dist/governance/policy.d.ts +152 -0
- package/dist/governance/policy.d.ts.map +1 -0
- package/dist/governance/policy.js +152 -0
- package/dist/governance/policy.js.map +1 -0
- package/dist/index.d.ts +50 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +61 -0
- package/dist/index.js.map +1 -0
- package/dist/intent/adapters.d.ts +101 -0
- package/dist/intent/adapters.d.ts.map +1 -0
- package/dist/intent/adapters.js +250 -0
- package/dist/intent/adapters.js.map +1 -0
- package/dist/intent/audit.d.ts +119 -0
- package/dist/intent/audit.d.ts.map +1 -0
- package/dist/intent/audit.js +463 -0
- package/dist/intent/audit.js.map +1 -0
- package/dist/intent/classifier/index.d.ts +121 -0
- package/dist/intent/classifier/index.d.ts.map +1 -0
- package/dist/intent/classifier/index.js +232 -0
- package/dist/intent/classifier/index.js.map +1 -0
- package/dist/intent/classifier/patterns.d.ts +129 -0
- package/dist/intent/classifier/patterns.d.ts.map +1 -0
- package/dist/intent/classifier/patterns.js +471 -0
- package/dist/intent/classifier/patterns.js.map +1 -0
- package/dist/intent/classifier/risk.d.ts +177 -0
- package/dist/intent/classifier/risk.d.ts.map +1 -0
- package/dist/intent/classifier/risk.js +335 -0
- package/dist/intent/classifier/risk.js.map +1 -0
- package/dist/intent/cleanup.d.ts +24 -0
- package/dist/intent/cleanup.d.ts.map +1 -0
- package/dist/intent/cleanup.js +104 -0
- package/dist/intent/cleanup.js.map +1 -0
- package/dist/intent/consent.d.ts +238 -0
- package/dist/intent/consent.d.ts.map +1 -0
- package/dist/intent/consent.js +427 -0
- package/dist/intent/consent.js.map +1 -0
- package/dist/intent/escalation.d.ts +284 -0
- package/dist/intent/escalation.d.ts.map +1 -0
- package/dist/intent/escalation.js +618 -0
- package/dist/intent/escalation.js.map +1 -0
- package/dist/intent/gdpr-rate-limiter.d.ts +170 -0
- package/dist/intent/gdpr-rate-limiter.d.ts.map +1 -0
- package/dist/intent/gdpr-rate-limiter.js +385 -0
- package/dist/intent/gdpr-rate-limiter.js.map +1 -0
- package/dist/intent/gdpr.d.ts +323 -0
- package/dist/intent/gdpr.d.ts.map +1 -0
- package/dist/intent/gdpr.js +1013 -0
- package/dist/intent/gdpr.js.map +1 -0
- package/dist/intent/health.d.ts +214 -0
- package/dist/intent/health.d.ts.map +1 -0
- package/dist/intent/health.js +526 -0
- package/dist/intent/health.js.map +1 -0
- package/dist/intent/index.d.ts +565 -0
- package/dist/intent/index.d.ts.map +1 -0
- package/dist/intent/index.js +756 -0
- package/dist/intent/index.js.map +1 -0
- package/dist/intent/metrics.d.ts +399 -0
- package/dist/intent/metrics.d.ts.map +1 -0
- package/dist/intent/metrics.js +886 -0
- package/dist/intent/metrics.js.map +1 -0
- package/dist/intent/openapi.d.ts +22 -0
- package/dist/intent/openapi.d.ts.map +1 -0
- package/dist/intent/openapi.js +1674 -0
- package/dist/intent/openapi.js.map +1 -0
- package/dist/intent/planner/dependency.d.ts +78 -0
- package/dist/intent/planner/dependency.d.ts.map +1 -0
- package/dist/intent/planner/dependency.js +334 -0
- package/dist/intent/planner/dependency.js.map +1 -0
- package/dist/intent/planner/index.d.ts +130 -0
- package/dist/intent/planner/index.d.ts.map +1 -0
- package/dist/intent/planner/index.js +372 -0
- package/dist/intent/planner/index.js.map +1 -0
- package/dist/intent/planner/rollback.d.ts +92 -0
- package/dist/intent/planner/rollback.d.ts.map +1 -0
- package/dist/intent/planner/rollback.js +326 -0
- package/dist/intent/planner/rollback.js.map +1 -0
- package/dist/intent/planner/templates.d.ts +81 -0
- package/dist/intent/planner/templates.d.ts.map +1 -0
- package/dist/intent/planner/templates.js +560 -0
- package/dist/intent/planner/templates.js.map +1 -0
- package/dist/intent/planner/types.d.ts +38 -0
- package/dist/intent/planner/types.d.ts.map +1 -0
- package/dist/intent/planner/types.js +10 -0
- package/dist/intent/planner/types.js.map +1 -0
- package/dist/intent/queue.d.ts +150 -0
- package/dist/intent/queue.d.ts.map +1 -0
- package/dist/intent/queue.js +339 -0
- package/dist/intent/queue.js.map +1 -0
- package/dist/intent/queues.d.ts +176 -0
- package/dist/intent/queues.d.ts.map +1 -0
- package/dist/intent/queues.js +1393 -0
- package/dist/intent/queues.js.map +1 -0
- package/dist/intent/ratelimit.d.ts +147 -0
- package/dist/intent/ratelimit.d.ts.map +1 -0
- package/dist/intent/ratelimit.js +301 -0
- package/dist/intent/ratelimit.js.map +1 -0
- package/dist/intent/replay/comparator.d.ts +73 -0
- package/dist/intent/replay/comparator.d.ts.map +1 -0
- package/dist/intent/replay/comparator.js +320 -0
- package/dist/intent/replay/comparator.js.map +1 -0
- package/dist/intent/replay/index.d.ts +104 -0
- package/dist/intent/replay/index.d.ts.map +1 -0
- package/dist/intent/replay/index.js +487 -0
- package/dist/intent/replay/index.js.map +1 -0
- package/dist/intent/replay/simulator.d.ts +184 -0
- package/dist/intent/replay/simulator.d.ts.map +1 -0
- package/dist/intent/replay/simulator.js +512 -0
- package/dist/intent/replay/simulator.js.map +1 -0
- package/dist/intent/replay/snapshot.d.ts +149 -0
- package/dist/intent/replay/snapshot.d.ts.map +1 -0
- package/dist/intent/replay/snapshot.js +245 -0
- package/dist/intent/replay/snapshot.js.map +1 -0
- package/dist/intent/replay/types.d.ts +143 -0
- package/dist/intent/replay/types.d.ts.map +1 -0
- package/dist/intent/replay/types.js +10 -0
- package/dist/intent/replay/types.js.map +1 -0
- package/dist/intent/repository.d.ts +198 -0
- package/dist/intent/repository.d.ts.map +1 -0
- package/dist/intent/repository.js +538 -0
- package/dist/intent/repository.js.map +1 -0
- package/dist/intent/response-middleware.d.ts +156 -0
- package/dist/intent/response-middleware.d.ts.map +1 -0
- package/dist/intent/response-middleware.js +346 -0
- package/dist/intent/response-middleware.js.map +1 -0
- package/dist/intent/response.d.ts +267 -0
- package/dist/intent/response.d.ts.map +1 -0
- package/dist/intent/response.js +402 -0
- package/dist/intent/response.js.map +1 -0
- package/dist/intent/routes.d.ts +35 -0
- package/dist/intent/routes.d.ts.map +1 -0
- package/dist/intent/routes.js +1023 -0
- package/dist/intent/routes.js.map +1 -0
- package/dist/intent/scheduler.d.ts +45 -0
- package/dist/intent/scheduler.d.ts.map +1 -0
- package/dist/intent/scheduler.js +221 -0
- package/dist/intent/scheduler.js.map +1 -0
- package/dist/intent/schema.d.ts +3817 -0
- package/dist/intent/schema.d.ts.map +1 -0
- package/dist/intent/schema.js +631 -0
- package/dist/intent/schema.js.map +1 -0
- package/dist/intent/shutdown.d.ts +145 -0
- package/dist/intent/shutdown.d.ts.map +1 -0
- package/dist/intent/shutdown.js +468 -0
- package/dist/intent/shutdown.js.map +1 -0
- package/dist/intent/state-machine.d.ts +111 -0
- package/dist/intent/state-machine.d.ts.map +1 -0
- package/dist/intent/state-machine.js +242 -0
- package/dist/intent/state-machine.js.map +1 -0
- package/dist/intent/tracing.d.ts +152 -0
- package/dist/intent/tracing.d.ts.map +1 -0
- package/dist/intent/tracing.js +658 -0
- package/dist/intent/tracing.js.map +1 -0
- package/dist/intent/types.d.ts +188 -0
- package/dist/intent/types.d.ts.map +1 -0
- package/dist/intent/types.js +25 -0
- package/dist/intent/types.js.map +1 -0
- package/dist/intent/webhooks/delivery-repository.d.ts +80 -0
- package/dist/intent/webhooks/delivery-repository.d.ts.map +1 -0
- package/dist/intent/webhooks/delivery-repository.js +251 -0
- package/dist/intent/webhooks/delivery-repository.js.map +1 -0
- package/dist/intent/webhooks/dns-pinning.d.ts +30 -0
- package/dist/intent/webhooks/dns-pinning.d.ts.map +1 -0
- package/dist/intent/webhooks/dns-pinning.js +69 -0
- package/dist/intent/webhooks/dns-pinning.js.map +1 -0
- package/dist/intent/webhooks/index.d.ts +14 -0
- package/dist/intent/webhooks/index.d.ts.map +1 -0
- package/dist/intent/webhooks/index.js +17 -0
- package/dist/intent/webhooks/index.js.map +1 -0
- package/dist/intent/webhooks/signature.d.ts +47 -0
- package/dist/intent/webhooks/signature.d.ts.map +1 -0
- package/dist/intent/webhooks/signature.js +80 -0
- package/dist/intent/webhooks/signature.js.map +1 -0
- package/dist/intent/webhooks/ssrf-protection.d.ts +29 -0
- package/dist/intent/webhooks/ssrf-protection.d.ts.map +1 -0
- package/dist/intent/webhooks/ssrf-protection.js +161 -0
- package/dist/intent/webhooks/ssrf-protection.js.map +1 -0
- package/dist/intent/webhooks/types.d.ts +132 -0
- package/dist/intent/webhooks/types.d.ts.map +1 -0
- package/dist/intent/webhooks/types.js +14 -0
- package/dist/intent/webhooks/types.js.map +1 -0
- package/dist/intent/webhooks.d.ts +618 -0
- package/dist/intent/webhooks.d.ts.map +1 -0
- package/dist/intent/webhooks.js +1836 -0
- package/dist/intent/webhooks.js.map +1 -0
- package/dist/intent-gateway/ai-act-classifier.d.ts +18 -0
- package/dist/intent-gateway/ai-act-classifier.d.ts.map +1 -0
- package/dist/intent-gateway/ai-act-classifier.js +296 -0
- package/dist/intent-gateway/ai-act-classifier.js.map +1 -0
- package/dist/intent-gateway/index.d.ts +43 -0
- package/dist/intent-gateway/index.d.ts.map +1 -0
- package/dist/intent-gateway/index.js +236 -0
- package/dist/intent-gateway/index.js.map +1 -0
- package/dist/intent-gateway/jurisdiction-resolver.d.ts +19 -0
- package/dist/intent-gateway/jurisdiction-resolver.d.ts.map +1 -0
- package/dist/intent-gateway/jurisdiction-resolver.js +236 -0
- package/dist/intent-gateway/jurisdiction-resolver.js.map +1 -0
- package/dist/intent-gateway/policy-composer.d.ts +27 -0
- package/dist/intent-gateway/policy-composer.d.ts.map +1 -0
- package/dist/intent-gateway/policy-composer.js +418 -0
- package/dist/intent-gateway/policy-composer.js.map +1 -0
- package/dist/intent-gateway/regime-selector.d.ts +26 -0
- package/dist/intent-gateway/regime-selector.d.ts.map +1 -0
- package/dist/intent-gateway/regime-selector.js +185 -0
- package/dist/intent-gateway/regime-selector.js.map +1 -0
- package/dist/intent-gateway/types.d.ts +103 -0
- package/dist/intent-gateway/types.d.ts.map +1 -0
- package/dist/intent-gateway/types.js +85 -0
- package/dist/intent-gateway/types.js.map +1 -0
- package/dist/observability/alerts.d.ts +136 -0
- package/dist/observability/alerts.d.ts.map +1 -0
- package/dist/observability/alerts.js +485 -0
- package/dist/observability/alerts.js.map +1 -0
- package/dist/observability/health.d.ts +102 -0
- package/dist/observability/health.d.ts.map +1 -0
- package/dist/observability/health.js +415 -0
- package/dist/observability/health.js.map +1 -0
- package/dist/observability/index.d.ts +29 -0
- package/dist/observability/index.d.ts.map +1 -0
- package/dist/observability/index.js +72 -0
- package/dist/observability/index.js.map +1 -0
- package/dist/observability/logging.d.ts +90 -0
- package/dist/observability/logging.d.ts.map +1 -0
- package/dist/observability/logging.js +260 -0
- package/dist/observability/logging.js.map +1 -0
- package/dist/observability/metrics.d.ts +226 -0
- package/dist/observability/metrics.d.ts.map +1 -0
- package/dist/observability/metrics.js +527 -0
- package/dist/observability/metrics.js.map +1 -0
- package/dist/observability/tracing.d.ts +120 -0
- package/dist/observability/tracing.d.ts.map +1 -0
- package/dist/observability/tracing.js +285 -0
- package/dist/observability/tracing.js.map +1 -0
- package/dist/persistence/audit.d.ts +169 -0
- package/dist/persistence/audit.d.ts.map +1 -0
- package/dist/persistence/audit.js +342 -0
- package/dist/persistence/audit.js.map +1 -0
- package/dist/persistence/index.d.ts +13 -0
- package/dist/persistence/index.d.ts.map +1 -0
- package/dist/persistence/index.js +15 -0
- package/dist/persistence/index.js.map +1 -0
- package/dist/persistence/repository.d.ts +192 -0
- package/dist/persistence/repository.d.ts.map +1 -0
- package/dist/persistence/repository.js +223 -0
- package/dist/persistence/repository.js.map +1 -0
- package/dist/policy/diff.d.ts +88 -0
- package/dist/policy/diff.d.ts.map +1 -0
- package/dist/policy/diff.js +325 -0
- package/dist/policy/diff.js.map +1 -0
- package/dist/policy/distributed-cache.d.ts +205 -0
- package/dist/policy/distributed-cache.d.ts.map +1 -0
- package/dist/policy/distributed-cache.js +683 -0
- package/dist/policy/distributed-cache.js.map +1 -0
- package/dist/policy/evaluator.d.ts +102 -0
- package/dist/policy/evaluator.d.ts.map +1 -0
- package/dist/policy/evaluator.js +648 -0
- package/dist/policy/evaluator.js.map +1 -0
- package/dist/policy/index.d.ts +24 -0
- package/dist/policy/index.d.ts.map +1 -0
- package/dist/policy/index.js +27 -0
- package/dist/policy/index.js.map +1 -0
- package/dist/policy/loader.d.ts +63 -0
- package/dist/policy/loader.d.ts.map +1 -0
- package/dist/policy/loader.js +176 -0
- package/dist/policy/loader.js.map +1 -0
- package/dist/policy/service.d.ts +240 -0
- package/dist/policy/service.d.ts.map +1 -0
- package/dist/policy/service.js +1032 -0
- package/dist/policy/service.js.map +1 -0
- package/dist/policy/types.d.ts +220 -0
- package/dist/policy/types.d.ts.map +1 -0
- package/dist/policy/types.js +36 -0
- package/dist/policy/types.js.map +1 -0
- package/dist/policy/visual-builder/index.d.ts +201 -0
- package/dist/policy/visual-builder/index.d.ts.map +1 -0
- package/dist/policy/visual-builder/index.js +727 -0
- package/dist/policy/visual-builder/index.js.map +1 -0
- package/dist/policy/visual-builder/inheritance.d.ts +151 -0
- package/dist/policy/visual-builder/inheritance.d.ts.map +1 -0
- package/dist/policy/visual-builder/inheritance.js +314 -0
- package/dist/policy/visual-builder/inheritance.js.map +1 -0
- package/dist/policy/visual-builder/propagation.d.ts +146 -0
- package/dist/policy/visual-builder/propagation.d.ts.map +1 -0
- package/dist/policy/visual-builder/propagation.js +299 -0
- package/dist/policy/visual-builder/propagation.js.map +1 -0
- package/dist/policy/visual-builder/routes.d.ts +14 -0
- package/dist/policy/visual-builder/routes.d.ts.map +1 -0
- package/dist/policy/visual-builder/routes.js +528 -0
- package/dist/policy/visual-builder/routes.js.map +1 -0
- package/dist/policy/visual-builder/simulator.d.ts +161 -0
- package/dist/policy/visual-builder/simulator.d.ts.map +1 -0
- package/dist/policy/visual-builder/simulator.js +413 -0
- package/dist/policy/visual-builder/simulator.js.map +1 -0
- package/dist/policy/visual-builder/templates.d.ts +119 -0
- package/dist/policy/visual-builder/templates.d.ts.map +1 -0
- package/dist/policy/visual-builder/templates.js +627 -0
- package/dist/policy/visual-builder/templates.js.map +1 -0
- package/dist/proof/chain/index.d.ts +271 -0
- package/dist/proof/chain/index.d.ts.map +1 -0
- package/dist/proof/chain/index.js +483 -0
- package/dist/proof/chain/index.js.map +1 -0
- package/dist/proof/index.d.ts +206 -0
- package/dist/proof/index.d.ts.map +1 -0
- package/dist/proof/index.js +597 -0
- package/dist/proof/index.js.map +1 -0
- package/dist/proof/merkle-service.d.ts +194 -0
- package/dist/proof/merkle-service.d.ts.map +1 -0
- package/dist/proof/merkle-service.js +463 -0
- package/dist/proof/merkle-service.js.map +1 -0
- package/dist/proof/merkle.d.ts +118 -0
- package/dist/proof/merkle.d.ts.map +1 -0
- package/dist/proof/merkle.js +265 -0
- package/dist/proof/merkle.js.map +1 -0
- package/dist/security/ai-governance/access-policy.d.ts +197 -0
- package/dist/security/ai-governance/access-policy.d.ts.map +1 -0
- package/dist/security/ai-governance/access-policy.js +522 -0
- package/dist/security/ai-governance/access-policy.js.map +1 -0
- package/dist/security/ai-governance/audit-trail.d.ts +241 -0
- package/dist/security/ai-governance/audit-trail.d.ts.map +1 -0
- package/dist/security/ai-governance/audit-trail.js +645 -0
- package/dist/security/ai-governance/audit-trail.js.map +1 -0
- package/dist/security/ai-governance/bias-detection.d.ts +221 -0
- package/dist/security/ai-governance/bias-detection.d.ts.map +1 -0
- package/dist/security/ai-governance/bias-detection.js +615 -0
- package/dist/security/ai-governance/bias-detection.js.map +1 -0
- package/dist/security/ai-governance/index.d.ts +92 -0
- package/dist/security/ai-governance/index.d.ts.map +1 -0
- package/dist/security/ai-governance/index.js +184 -0
- package/dist/security/ai-governance/index.js.map +1 -0
- package/dist/security/ai-governance/middleware.d.ts +110 -0
- package/dist/security/ai-governance/middleware.d.ts.map +1 -0
- package/dist/security/ai-governance/middleware.js +359 -0
- package/dist/security/ai-governance/middleware.js.map +1 -0
- package/dist/security/ai-governance/model-registry.d.ts +229 -0
- package/dist/security/ai-governance/model-registry.d.ts.map +1 -0
- package/dist/security/ai-governance/model-registry.js +535 -0
- package/dist/security/ai-governance/model-registry.js.map +1 -0
- package/dist/security/ai-governance/output-filter.d.ts +150 -0
- package/dist/security/ai-governance/output-filter.d.ts.map +1 -0
- package/dist/security/ai-governance/output-filter.js +561 -0
- package/dist/security/ai-governance/output-filter.js.map +1 -0
- package/dist/security/ai-governance/prompt-injection.d.ts +153 -0
- package/dist/security/ai-governance/prompt-injection.d.ts.map +1 -0
- package/dist/security/ai-governance/prompt-injection.js +614 -0
- package/dist/security/ai-governance/prompt-injection.js.map +1 -0
- package/dist/security/ai-governance/rate-limiter.d.ts +156 -0
- package/dist/security/ai-governance/rate-limiter.d.ts.map +1 -0
- package/dist/security/ai-governance/rate-limiter.js +541 -0
- package/dist/security/ai-governance/rate-limiter.js.map +1 -0
- package/dist/security/ai-governance/types.d.ts +594 -0
- package/dist/security/ai-governance/types.d.ts.map +1 -0
- package/dist/security/ai-governance/types.js +6 -0
- package/dist/security/ai-governance/types.js.map +1 -0
- package/dist/security/alerting/channels/base.d.ts +91 -0
- package/dist/security/alerting/channels/base.d.ts.map +1 -0
- package/dist/security/alerting/channels/base.js +128 -0
- package/dist/security/alerting/channels/base.js.map +1 -0
- package/dist/security/alerting/channels/email.d.ts +92 -0
- package/dist/security/alerting/channels/email.d.ts.map +1 -0
- package/dist/security/alerting/channels/email.js +418 -0
- package/dist/security/alerting/channels/email.js.map +1 -0
- package/dist/security/alerting/channels/http-base.d.ts +86 -0
- package/dist/security/alerting/channels/http-base.d.ts.map +1 -0
- package/dist/security/alerting/channels/http-base.js +133 -0
- package/dist/security/alerting/channels/http-base.js.map +1 -0
- package/dist/security/alerting/channels/index.d.ts +30 -0
- package/dist/security/alerting/channels/index.d.ts.map +1 -0
- package/dist/security/alerting/channels/index.js +22 -0
- package/dist/security/alerting/channels/index.js.map +1 -0
- package/dist/security/alerting/channels/pagerduty.d.ts +70 -0
- package/dist/security/alerting/channels/pagerduty.d.ts.map +1 -0
- package/dist/security/alerting/channels/pagerduty.js +248 -0
- package/dist/security/alerting/channels/pagerduty.js.map +1 -0
- package/dist/security/alerting/channels/slack.d.ts +55 -0
- package/dist/security/alerting/channels/slack.d.ts.map +1 -0
- package/dist/security/alerting/channels/slack.js +215 -0
- package/dist/security/alerting/channels/slack.js.map +1 -0
- package/dist/security/alerting/channels/sns.d.ts +87 -0
- package/dist/security/alerting/channels/sns.d.ts.map +1 -0
- package/dist/security/alerting/channels/sns.js +251 -0
- package/dist/security/alerting/channels/sns.js.map +1 -0
- package/dist/security/alerting/channels/webhook.d.ts +92 -0
- package/dist/security/alerting/channels/webhook.d.ts.map +1 -0
- package/dist/security/alerting/channels/webhook.js +203 -0
- package/dist/security/alerting/channels/webhook.js.map +1 -0
- package/dist/security/alerting/detector.d.ts +217 -0
- package/dist/security/alerting/detector.d.ts.map +1 -0
- package/dist/security/alerting/detector.js +725 -0
- package/dist/security/alerting/detector.js.map +1 -0
- package/dist/security/alerting/index.d.ts +57 -0
- package/dist/security/alerting/index.d.ts.map +1 -0
- package/dist/security/alerting/index.js +214 -0
- package/dist/security/alerting/index.js.map +1 -0
- package/dist/security/alerting/service.d.ts +190 -0
- package/dist/security/alerting/service.d.ts.map +1 -0
- package/dist/security/alerting/service.js +815 -0
- package/dist/security/alerting/service.js.map +1 -0
- package/dist/security/alerting/types.d.ts +2165 -0
- package/dist/security/alerting/types.d.ts.map +1 -0
- package/dist/security/alerting/types.js +278 -0
- package/dist/security/alerting/types.js.map +1 -0
- package/dist/security/anomaly/detectors/account-compromise.d.ts +198 -0
- package/dist/security/anomaly/detectors/account-compromise.d.ts.map +1 -0
- package/dist/security/anomaly/detectors/account-compromise.js +815 -0
- package/dist/security/anomaly/detectors/account-compromise.js.map +1 -0
- package/dist/security/anomaly/detectors/data-exfiltration.d.ts +175 -0
- package/dist/security/anomaly/detectors/data-exfiltration.d.ts.map +1 -0
- package/dist/security/anomaly/detectors/data-exfiltration.js +733 -0
- package/dist/security/anomaly/detectors/data-exfiltration.js.map +1 -0
- package/dist/security/anomaly/detectors/geographic.d.ts +100 -0
- package/dist/security/anomaly/detectors/geographic.d.ts.map +1 -0
- package/dist/security/anomaly/detectors/geographic.js +348 -0
- package/dist/security/anomaly/detectors/geographic.js.map +1 -0
- package/dist/security/anomaly/detectors/index.d.ts +86 -0
- package/dist/security/anomaly/detectors/index.d.ts.map +1 -0
- package/dist/security/anomaly/detectors/index.js +118 -0
- package/dist/security/anomaly/detectors/index.js.map +1 -0
- package/dist/security/anomaly/detectors/lateral-movement.d.ts +168 -0
- package/dist/security/anomaly/detectors/lateral-movement.d.ts.map +1 -0
- package/dist/security/anomaly/detectors/lateral-movement.js +795 -0
- package/dist/security/anomaly/detectors/lateral-movement.js.map +1 -0
- package/dist/security/anomaly/detectors/privilege-escalation.d.ts +177 -0
- package/dist/security/anomaly/detectors/privilege-escalation.d.ts.map +1 -0
- package/dist/security/anomaly/detectors/privilege-escalation.js +741 -0
- package/dist/security/anomaly/detectors/privilege-escalation.js.map +1 -0
- package/dist/security/anomaly/detectors/temporal.d.ts +71 -0
- package/dist/security/anomaly/detectors/temporal.d.ts.map +1 -0
- package/dist/security/anomaly/detectors/temporal.js +398 -0
- package/dist/security/anomaly/detectors/temporal.js.map +1 -0
- package/dist/security/anomaly/detectors/volume.d.ts +97 -0
- package/dist/security/anomaly/detectors/volume.d.ts.map +1 -0
- package/dist/security/anomaly/detectors/volume.js +424 -0
- package/dist/security/anomaly/detectors/volume.js.map +1 -0
- package/dist/security/anomaly/index.d.ts +128 -0
- package/dist/security/anomaly/index.d.ts.map +1 -0
- package/dist/security/anomaly/index.js +378 -0
- package/dist/security/anomaly/index.js.map +1 -0
- package/dist/security/anomaly/types.d.ts +1209 -0
- package/dist/security/anomaly/types.d.ts.map +1 -0
- package/dist/security/anomaly/types.js +193 -0
- package/dist/security/anomaly/types.js.map +1 -0
- package/dist/security/api-keys/cache.d.ts +255 -0
- package/dist/security/api-keys/cache.d.ts.map +1 -0
- package/dist/security/api-keys/cache.js +595 -0
- package/dist/security/api-keys/cache.js.map +1 -0
- package/dist/security/api-keys/db-store.d.ts +150 -0
- package/dist/security/api-keys/db-store.d.ts.map +1 -0
- package/dist/security/api-keys/db-store.js +694 -0
- package/dist/security/api-keys/db-store.js.map +1 -0
- package/dist/security/api-keys/index.d.ts +29 -0
- package/dist/security/api-keys/index.d.ts.map +1 -0
- package/dist/security/api-keys/index.js +81 -0
- package/dist/security/api-keys/index.js.map +1 -0
- package/dist/security/api-keys/middleware.d.ts +164 -0
- package/dist/security/api-keys/middleware.d.ts.map +1 -0
- package/dist/security/api-keys/middleware.js +392 -0
- package/dist/security/api-keys/middleware.js.map +1 -0
- package/dist/security/api-keys/service.d.ts +226 -0
- package/dist/security/api-keys/service.d.ts.map +1 -0
- package/dist/security/api-keys/service.js +861 -0
- package/dist/security/api-keys/service.js.map +1 -0
- package/dist/security/api-keys/store.d.ts +241 -0
- package/dist/security/api-keys/store.d.ts.map +1 -0
- package/dist/security/api-keys/store.js +360 -0
- package/dist/security/api-keys/store.js.map +1 -0
- package/dist/security/api-keys/types.d.ts +718 -0
- package/dist/security/api-keys/types.d.ts.map +1 -0
- package/dist/security/api-keys/types.js +162 -0
- package/dist/security/api-keys/types.js.map +1 -0
- package/dist/security/brute-force.d.ts +390 -0
- package/dist/security/brute-force.d.ts.map +1 -0
- package/dist/security/brute-force.js +677 -0
- package/dist/security/brute-force.js.map +1 -0
- package/dist/security/config-validator.d.ts +152 -0
- package/dist/security/config-validator.d.ts.map +1 -0
- package/dist/security/config-validator.js +667 -0
- package/dist/security/config-validator.js.map +1 -0
- package/dist/security/crypto/fips-mode.d.ts +726 -0
- package/dist/security/crypto/fips-mode.d.ts.map +1 -0
- package/dist/security/crypto/fips-mode.js +1297 -0
- package/dist/security/crypto/fips-mode.js.map +1 -0
- package/dist/security/crypto/index.d.ts +203 -0
- package/dist/security/crypto/index.d.ts.map +1 -0
- package/dist/security/crypto/index.js +293 -0
- package/dist/security/crypto/index.js.map +1 -0
- package/dist/security/crypto/post-quantum/benchmark.d.ts +125 -0
- package/dist/security/crypto/post-quantum/benchmark.d.ts.map +1 -0
- package/dist/security/crypto/post-quantum/benchmark.js +530 -0
- package/dist/security/crypto/post-quantum/benchmark.js.map +1 -0
- package/dist/security/crypto/post-quantum/dilithium.d.ts +146 -0
- package/dist/security/crypto/post-quantum/dilithium.d.ts.map +1 -0
- package/dist/security/crypto/post-quantum/dilithium.js +662 -0
- package/dist/security/crypto/post-quantum/dilithium.js.map +1 -0
- package/dist/security/crypto/post-quantum/hybrid.d.ts +267 -0
- package/dist/security/crypto/post-quantum/hybrid.d.ts.map +1 -0
- package/dist/security/crypto/post-quantum/hybrid.js +457 -0
- package/dist/security/crypto/post-quantum/hybrid.js.map +1 -0
- package/dist/security/crypto/post-quantum/index.d.ts +166 -0
- package/dist/security/crypto/post-quantum/index.d.ts.map +1 -0
- package/dist/security/crypto/post-quantum/index.js +236 -0
- package/dist/security/crypto/post-quantum/index.js.map +1 -0
- package/dist/security/crypto/post-quantum/kyber.d.ts +131 -0
- package/dist/security/crypto/post-quantum/kyber.d.ts.map +1 -0
- package/dist/security/crypto/post-quantum/kyber.js +640 -0
- package/dist/security/crypto/post-quantum/kyber.js.map +1 -0
- package/dist/security/crypto/post-quantum/migration.d.ts +230 -0
- package/dist/security/crypto/post-quantum/migration.d.ts.map +1 -0
- package/dist/security/crypto/post-quantum/migration.js +563 -0
- package/dist/security/crypto/post-quantum/migration.js.map +1 -0
- package/dist/security/crypto/post-quantum/types.d.ts +1056 -0
- package/dist/security/crypto/post-quantum/types.d.ts.map +1 -0
- package/dist/security/crypto/post-quantum/types.js +350 -0
- package/dist/security/crypto/post-quantum/types.js.map +1 -0
- package/dist/security/crypto/shamir/comparison.d.ts +128 -0
- package/dist/security/crypto/shamir/comparison.d.ts.map +1 -0
- package/dist/security/crypto/shamir/comparison.js +423 -0
- package/dist/security/crypto/shamir/comparison.js.map +1 -0
- package/dist/security/crypto/shamir/index.d.ts +76 -0
- package/dist/security/crypto/shamir/index.d.ts.map +1 -0
- package/dist/security/crypto/shamir/index.js +155 -0
- package/dist/security/crypto/shamir/index.js.map +1 -0
- package/dist/security/crypto/shamir/proofs.d.ts +259 -0
- package/dist/security/crypto/shamir/proofs.d.ts.map +1 -0
- package/dist/security/crypto/shamir/proofs.js +605 -0
- package/dist/security/crypto/shamir/proofs.js.map +1 -0
- package/dist/security/crypto/shamir/property-tests.d.ts +104 -0
- package/dist/security/crypto/shamir/property-tests.d.ts.map +1 -0
- package/dist/security/crypto/shamir/property-tests.js +480 -0
- package/dist/security/crypto/shamir/property-tests.js.map +1 -0
- package/dist/security/crypto/shamir/security-analysis.d.ts +97 -0
- package/dist/security/crypto/shamir/security-analysis.d.ts.map +1 -0
- package/dist/security/crypto/shamir/security-analysis.js +503 -0
- package/dist/security/crypto/shamir/security-analysis.js.map +1 -0
- package/dist/security/crypto/shamir/test-vectors.d.ts +116 -0
- package/dist/security/crypto/shamir/test-vectors.d.ts.map +1 -0
- package/dist/security/crypto/shamir/test-vectors.js +377 -0
- package/dist/security/crypto/shamir/test-vectors.js.map +1 -0
- package/dist/security/crypto/shamir/types.d.ts +281 -0
- package/dist/security/crypto/shamir/types.d.ts.map +1 -0
- package/dist/security/crypto/shamir/types.js +82 -0
- package/dist/security/crypto/shamir/types.js.map +1 -0
- package/dist/security/crypto/shamir/verified-shamir.d.ts +170 -0
- package/dist/security/crypto/shamir/verified-shamir.d.ts.map +1 -0
- package/dist/security/crypto/shamir/verified-shamir.js +624 -0
- package/dist/security/crypto/shamir/verified-shamir.js.map +1 -0
- package/dist/security/csrf.d.ts +215 -0
- package/dist/security/csrf.d.ts.map +1 -0
- package/dist/security/csrf.js +467 -0
- package/dist/security/csrf.js.map +1 -0
- package/dist/security/distributed-state.d.ts +331 -0
- package/dist/security/distributed-state.d.ts.map +1 -0
- package/dist/security/distributed-state.js +768 -0
- package/dist/security/distributed-state.js.map +1 -0
- package/dist/security/dlp/index.d.ts +27 -0
- package/dist/security/dlp/index.d.ts.map +1 -0
- package/dist/security/dlp/index.js +54 -0
- package/dist/security/dlp/index.js.map +1 -0
- package/dist/security/dlp/scanner.d.ts +451 -0
- package/dist/security/dlp/scanner.d.ts.map +1 -0
- package/dist/security/dlp/scanner.js +1241 -0
- package/dist/security/dlp/scanner.js.map +1 -0
- package/dist/security/dpop.d.ts +260 -0
- package/dist/security/dpop.d.ts.map +1 -0
- package/dist/security/dpop.js +1058 -0
- package/dist/security/dpop.js.map +1 -0
- package/dist/security/encryption/decorators.d.ts +263 -0
- package/dist/security/encryption/decorators.d.ts.map +1 -0
- package/dist/security/encryption/decorators.js +359 -0
- package/dist/security/encryption/decorators.js.map +1 -0
- package/dist/security/encryption/index.d.ts +83 -0
- package/dist/security/encryption/index.d.ts.map +1 -0
- package/dist/security/encryption/index.js +140 -0
- package/dist/security/encryption/index.js.map +1 -0
- package/dist/security/encryption/key-provider.d.ts +335 -0
- package/dist/security/encryption/key-provider.d.ts.map +1 -0
- package/dist/security/encryption/key-provider.js +853 -0
- package/dist/security/encryption/key-provider.js.map +1 -0
- package/dist/security/encryption/middleware.d.ts +279 -0
- package/dist/security/encryption/middleware.d.ts.map +1 -0
- package/dist/security/encryption/middleware.js +493 -0
- package/dist/security/encryption/middleware.js.map +1 -0
- package/dist/security/encryption/service.d.ts +164 -0
- package/dist/security/encryption/service.d.ts.map +1 -0
- package/dist/security/encryption/service.js +623 -0
- package/dist/security/encryption/service.js.map +1 -0
- package/dist/security/encryption/types.d.ts +745 -0
- package/dist/security/encryption/types.d.ts.map +1 -0
- package/dist/security/encryption/types.js +229 -0
- package/dist/security/encryption/types.js.map +1 -0
- package/dist/security/error-sanitizer.d.ts +329 -0
- package/dist/security/error-sanitizer.d.ts.map +1 -0
- package/dist/security/error-sanitizer.js +700 -0
- package/dist/security/error-sanitizer.js.map +1 -0
- package/dist/security/fingerprint-service.d.ts +139 -0
- package/dist/security/fingerprint-service.d.ts.map +1 -0
- package/dist/security/fingerprint-service.js +240 -0
- package/dist/security/fingerprint-service.js.map +1 -0
- package/dist/security/headers/csp.d.ts +270 -0
- package/dist/security/headers/csp.d.ts.map +1 -0
- package/dist/security/headers/csp.js +655 -0
- package/dist/security/headers/csp.js.map +1 -0
- package/dist/security/headers/hsts.d.ts +161 -0
- package/dist/security/headers/hsts.d.ts.map +1 -0
- package/dist/security/headers/hsts.js +346 -0
- package/dist/security/headers/hsts.js.map +1 -0
- package/dist/security/headers/index.d.ts +47 -0
- package/dist/security/headers/index.d.ts.map +1 -0
- package/dist/security/headers/index.js +110 -0
- package/dist/security/headers/index.js.map +1 -0
- package/dist/security/headers/middleware.d.ts +70 -0
- package/dist/security/headers/middleware.d.ts.map +1 -0
- package/dist/security/headers/middleware.js +549 -0
- package/dist/security/headers/middleware.js.map +1 -0
- package/dist/security/headers/permissions-policy.d.ts +189 -0
- package/dist/security/headers/permissions-policy.d.ts.map +1 -0
- package/dist/security/headers/permissions-policy.js +508 -0
- package/dist/security/headers/permissions-policy.js.map +1 -0
- package/dist/security/headers/types.d.ts +1570 -0
- package/dist/security/headers/types.d.ts.map +1 -0
- package/dist/security/headers/types.js +281 -0
- package/dist/security/headers/types.js.map +1 -0
- package/dist/security/headers/validator.d.ts +36 -0
- package/dist/security/headers/validator.d.ts.map +1 -0
- package/dist/security/headers/validator.js +616 -0
- package/dist/security/headers/validator.js.map +1 -0
- package/dist/security/hsm/aws-cloudhsm.d.ts +157 -0
- package/dist/security/hsm/aws-cloudhsm.d.ts.map +1 -0
- package/dist/security/hsm/aws-cloudhsm.js +712 -0
- package/dist/security/hsm/aws-cloudhsm.js.map +1 -0
- package/dist/security/hsm/azure-hsm.d.ts +174 -0
- package/dist/security/hsm/azure-hsm.d.ts.map +1 -0
- package/dist/security/hsm/azure-hsm.js +792 -0
- package/dist/security/hsm/azure-hsm.js.map +1 -0
- package/dist/security/hsm/gcp-hsm.d.ts +184 -0
- package/dist/security/hsm/gcp-hsm.d.ts.map +1 -0
- package/dist/security/hsm/gcp-hsm.js +817 -0
- package/dist/security/hsm/gcp-hsm.js.map +1 -0
- package/dist/security/hsm/hsm-service.d.ts +264 -0
- package/dist/security/hsm/hsm-service.d.ts.map +1 -0
- package/dist/security/hsm/hsm-service.js +772 -0
- package/dist/security/hsm/hsm-service.js.map +1 -0
- package/dist/security/hsm/index.d.ts +248 -0
- package/dist/security/hsm/index.d.ts.map +1 -0
- package/dist/security/hsm/index.js +329 -0
- package/dist/security/hsm/index.js.map +1 -0
- package/dist/security/hsm/key-ceremony.d.ts +214 -0
- package/dist/security/hsm/key-ceremony.d.ts.map +1 -0
- package/dist/security/hsm/key-ceremony.js +636 -0
- package/dist/security/hsm/key-ceremony.js.map +1 -0
- package/dist/security/hsm/key-operations.d.ts +218 -0
- package/dist/security/hsm/key-operations.d.ts.map +1 -0
- package/dist/security/hsm/key-operations.js +625 -0
- package/dist/security/hsm/key-operations.js.map +1 -0
- package/dist/security/hsm/local-softHSM.d.ts +122 -0
- package/dist/security/hsm/local-softHSM.d.ts.map +1 -0
- package/dist/security/hsm/local-softHSM.js +786 -0
- package/dist/security/hsm/local-softHSM.js.map +1 -0
- package/dist/security/hsm/pkcs11-wrapper.d.ts +386 -0
- package/dist/security/hsm/pkcs11-wrapper.d.ts.map +1 -0
- package/dist/security/hsm/pkcs11-wrapper.js +1149 -0
- package/dist/security/hsm/pkcs11-wrapper.js.map +1 -0
- package/dist/security/hsm/provider.d.ts +333 -0
- package/dist/security/hsm/provider.d.ts.map +1 -0
- package/dist/security/hsm/provider.js +264 -0
- package/dist/security/hsm/provider.js.map +1 -0
- package/dist/security/hsm/thales-luna.d.ts +209 -0
- package/dist/security/hsm/thales-luna.d.ts.map +1 -0
- package/dist/security/hsm/thales-luna.js +820 -0
- package/dist/security/hsm/thales-luna.js.map +1 -0
- package/dist/security/incident/actions/block-ip.d.ts +82 -0
- package/dist/security/incident/actions/block-ip.d.ts.map +1 -0
- package/dist/security/incident/actions/block-ip.js +454 -0
- package/dist/security/incident/actions/block-ip.js.map +1 -0
- package/dist/security/incident/actions/collect-evidence.d.ts +93 -0
- package/dist/security/incident/actions/collect-evidence.d.ts.map +1 -0
- package/dist/security/incident/actions/collect-evidence.js +449 -0
- package/dist/security/incident/actions/collect-evidence.js.map +1 -0
- package/dist/security/incident/actions/index.d.ts +39 -0
- package/dist/security/incident/actions/index.d.ts.map +1 -0
- package/dist/security/incident/actions/index.js +52 -0
- package/dist/security/incident/actions/index.js.map +1 -0
- package/dist/security/incident/actions/isolate-system.d.ts +61 -0
- package/dist/security/incident/actions/isolate-system.d.ts.map +1 -0
- package/dist/security/incident/actions/isolate-system.js +369 -0
- package/dist/security/incident/actions/isolate-system.js.map +1 -0
- package/dist/security/incident/actions/notify-stakeholders.d.ts +70 -0
- package/dist/security/incident/actions/notify-stakeholders.d.ts.map +1 -0
- package/dist/security/incident/actions/notify-stakeholders.js +377 -0
- package/dist/security/incident/actions/notify-stakeholders.js.map +1 -0
- package/dist/security/incident/actions/revoke-credentials.d.ts +75 -0
- package/dist/security/incident/actions/revoke-credentials.d.ts.map +1 -0
- package/dist/security/incident/actions/revoke-credentials.js +320 -0
- package/dist/security/incident/actions/revoke-credentials.js.map +1 -0
- package/dist/security/incident/actions/scale-monitoring.d.ts +88 -0
- package/dist/security/incident/actions/scale-monitoring.d.ts.map +1 -0
- package/dist/security/incident/actions/scale-monitoring.js +473 -0
- package/dist/security/incident/actions/scale-monitoring.js.map +1 -0
- package/dist/security/incident/executor.d.ts +128 -0
- package/dist/security/incident/executor.d.ts.map +1 -0
- package/dist/security/incident/executor.js +695 -0
- package/dist/security/incident/executor.js.map +1 -0
- package/dist/security/incident/index.d.ts +220 -0
- package/dist/security/incident/index.d.ts.map +1 -0
- package/dist/security/incident/index.js +1284 -0
- package/dist/security/incident/index.js.map +1 -0
- package/dist/security/incident/notification.d.ts +68 -0
- package/dist/security/incident/notification.d.ts.map +1 -0
- package/dist/security/incident/notification.js +512 -0
- package/dist/security/incident/notification.js.map +1 -0
- package/dist/security/incident/playbooks/account-compromise.d.ts +13 -0
- package/dist/security/incident/playbooks/account-compromise.d.ts.map +1 -0
- package/dist/security/incident/playbooks/account-compromise.js +379 -0
- package/dist/security/incident/playbooks/account-compromise.js.map +1 -0
- package/dist/security/incident/playbooks/configuration-error.d.ts +17 -0
- package/dist/security/incident/playbooks/configuration-error.d.ts.map +1 -0
- package/dist/security/incident/playbooks/configuration-error.js +340 -0
- package/dist/security/incident/playbooks/configuration-error.js.map +1 -0
- package/dist/security/incident/playbooks/data-breach.d.ts +13 -0
- package/dist/security/incident/playbooks/data-breach.d.ts.map +1 -0
- package/dist/security/incident/playbooks/data-breach.js +394 -0
- package/dist/security/incident/playbooks/data-breach.js.map +1 -0
- package/dist/security/incident/playbooks/denial-of-service.d.ts +13 -0
- package/dist/security/incident/playbooks/denial-of-service.d.ts.map +1 -0
- package/dist/security/incident/playbooks/denial-of-service.js +540 -0
- package/dist/security/incident/playbooks/denial-of-service.js.map +1 -0
- package/dist/security/incident/playbooks/index.d.ts +36 -0
- package/dist/security/incident/playbooks/index.d.ts.map +1 -0
- package/dist/security/incident/playbooks/index.js +56 -0
- package/dist/security/incident/playbooks/index.js.map +1 -0
- package/dist/security/incident/playbooks/insider-threat.d.ts +18 -0
- package/dist/security/incident/playbooks/insider-threat.d.ts.map +1 -0
- package/dist/security/incident/playbooks/insider-threat.js +600 -0
- package/dist/security/incident/playbooks/insider-threat.js.map +1 -0
- package/dist/security/incident/playbooks/malware.d.ts +13 -0
- package/dist/security/incident/playbooks/malware.d.ts.map +1 -0
- package/dist/security/incident/playbooks/malware.js +515 -0
- package/dist/security/incident/playbooks/malware.js.map +1 -0
- package/dist/security/incident/playbooks/ransomware.d.ts +14 -0
- package/dist/security/incident/playbooks/ransomware.d.ts.map +1 -0
- package/dist/security/incident/playbooks/ransomware.js +693 -0
- package/dist/security/incident/playbooks/ransomware.js.map +1 -0
- package/dist/security/incident/playbooks/unauthorized-access.d.ts +13 -0
- package/dist/security/incident/playbooks/unauthorized-access.d.ts.map +1 -0
- package/dist/security/incident/playbooks/unauthorized-access.js +412 -0
- package/dist/security/incident/playbooks/unauthorized-access.js.map +1 -0
- package/dist/security/incident/triggers.d.ts +120 -0
- package/dist/security/incident/triggers.d.ts.map +1 -0
- package/dist/security/incident/triggers.js +708 -0
- package/dist/security/incident/triggers.js.map +1 -0
- package/dist/security/incident/types.d.ts +1517 -0
- package/dist/security/incident/types.d.ts.map +1 -0
- package/dist/security/incident/types.js +222 -0
- package/dist/security/incident/types.js.map +1 -0
- package/dist/security/index.d.ts +59 -0
- package/dist/security/index.d.ts.map +1 -0
- package/dist/security/index.js +295 -0
- package/dist/security/index.js.map +1 -0
- package/dist/security/injection-detector.d.ts +510 -0
- package/dist/security/injection-detector.d.ts.map +1 -0
- package/dist/security/injection-detector.js +1325 -0
- package/dist/security/injection-detector.js.map +1 -0
- package/dist/security/introspection.d.ts +137 -0
- package/dist/security/introspection.d.ts.map +1 -0
- package/dist/security/introspection.js +451 -0
- package/dist/security/introspection.js.map +1 -0
- package/dist/security/key-rotation.d.ts +213 -0
- package/dist/security/key-rotation.d.ts.map +1 -0
- package/dist/security/key-rotation.js +530 -0
- package/dist/security/key-rotation.js.map +1 -0
- package/dist/security/kms/aws-kms.d.ts +152 -0
- package/dist/security/kms/aws-kms.d.ts.map +1 -0
- package/dist/security/kms/aws-kms.js +808 -0
- package/dist/security/kms/aws-kms.js.map +1 -0
- package/dist/security/kms/index.d.ts +165 -0
- package/dist/security/kms/index.d.ts.map +1 -0
- package/dist/security/kms/index.js +351 -0
- package/dist/security/kms/index.js.map +1 -0
- package/dist/security/kms/local.d.ts +127 -0
- package/dist/security/kms/local.d.ts.map +1 -0
- package/dist/security/kms/local.js +682 -0
- package/dist/security/kms/local.js.map +1 -0
- package/dist/security/kms/types.d.ts +1000 -0
- package/dist/security/kms/types.d.ts.map +1 -0
- package/dist/security/kms/types.js +167 -0
- package/dist/security/kms/types.js.map +1 -0
- package/dist/security/kms/vault.d.ts +165 -0
- package/dist/security/kms/vault.d.ts.map +1 -0
- package/dist/security/kms/vault.js +820 -0
- package/dist/security/kms/vault.js.map +1 -0
- package/dist/security/mfa/index.d.ts +17 -0
- package/dist/security/mfa/index.d.ts.map +1 -0
- package/dist/security/mfa/index.js +37 -0
- package/dist/security/mfa/index.js.map +1 -0
- package/dist/security/mfa/mfa-middleware.d.ts +74 -0
- package/dist/security/mfa/mfa-middleware.d.ts.map +1 -0
- package/dist/security/mfa/mfa-middleware.js +244 -0
- package/dist/security/mfa/mfa-middleware.js.map +1 -0
- package/dist/security/mfa/mfa-service.d.ts +115 -0
- package/dist/security/mfa/mfa-service.d.ts.map +1 -0
- package/dist/security/mfa/mfa-service.js +509 -0
- package/dist/security/mfa/mfa-service.js.map +1 -0
- package/dist/security/mfa/mfa-store.d.ts +615 -0
- package/dist/security/mfa/mfa-store.d.ts.map +1 -0
- package/dist/security/mfa/mfa-store.js +431 -0
- package/dist/security/mfa/mfa-store.js.map +1 -0
- package/dist/security/mfa/types.d.ts +417 -0
- package/dist/security/mfa/types.d.ts.map +1 -0
- package/dist/security/mfa/types.js +123 -0
- package/dist/security/mfa/types.js.map +1 -0
- package/dist/security/middleware.d.ts +179 -0
- package/dist/security/middleware.d.ts.map +1 -0
- package/dist/security/middleware.js +534 -0
- package/dist/security/middleware.js.map +1 -0
- package/dist/security/pairwise-did.d.ts +157 -0
- package/dist/security/pairwise-did.d.ts.map +1 -0
- package/dist/security/pairwise-did.js +450 -0
- package/dist/security/pairwise-did.js.map +1 -0
- package/dist/security/pam/break-glass.d.ts +776 -0
- package/dist/security/pam/break-glass.d.ts.map +1 -0
- package/dist/security/pam/break-glass.js +1137 -0
- package/dist/security/pam/break-glass.js.map +1 -0
- package/dist/security/pam/index.d.ts +120 -0
- package/dist/security/pam/index.d.ts.map +1 -0
- package/dist/security/pam/index.js +179 -0
- package/dist/security/pam/index.js.map +1 -0
- package/dist/security/pam/jit-access.d.ts +482 -0
- package/dist/security/pam/jit-access.d.ts.map +1 -0
- package/dist/security/pam/jit-access.js +1030 -0
- package/dist/security/pam/jit-access.js.map +1 -0
- package/dist/security/pam/session-recording.d.ts +1007 -0
- package/dist/security/pam/session-recording.d.ts.map +1 -0
- package/dist/security/pam/session-recording.js +1047 -0
- package/dist/security/pam/session-recording.js.map +1 -0
- package/dist/security/password-hashing.d.ts +199 -0
- package/dist/security/password-hashing.d.ts.map +1 -0
- package/dist/security/password-hashing.js +366 -0
- package/dist/security/password-hashing.js.map +1 -0
- package/dist/security/password-policy.d.ts +304 -0
- package/dist/security/password-policy.d.ts.map +1 -0
- package/dist/security/password-policy.js +730 -0
- package/dist/security/password-policy.js.map +1 -0
- package/dist/security/pkce.d.ts +269 -0
- package/dist/security/pkce.d.ts.map +1 -0
- package/dist/security/pkce.js +408 -0
- package/dist/security/pkce.js.map +1 -0
- package/dist/security/policy-engine/built-in-policies.d.ts +90 -0
- package/dist/security/policy-engine/built-in-policies.d.ts.map +1 -0
- package/dist/security/policy-engine/built-in-policies.js +627 -0
- package/dist/security/policy-engine/built-in-policies.js.map +1 -0
- package/dist/security/policy-engine/condition-evaluator.d.ts +129 -0
- package/dist/security/policy-engine/condition-evaluator.d.ts.map +1 -0
- package/dist/security/policy-engine/condition-evaluator.js +647 -0
- package/dist/security/policy-engine/condition-evaluator.js.map +1 -0
- package/dist/security/policy-engine/engine.d.ts +200 -0
- package/dist/security/policy-engine/engine.d.ts.map +1 -0
- package/dist/security/policy-engine/engine.js +752 -0
- package/dist/security/policy-engine/engine.js.map +1 -0
- package/dist/security/policy-engine/index.d.ts +58 -0
- package/dist/security/policy-engine/index.d.ts.map +1 -0
- package/dist/security/policy-engine/index.js +80 -0
- package/dist/security/policy-engine/index.js.map +1 -0
- package/dist/security/policy-engine/middleware.d.ts +77 -0
- package/dist/security/policy-engine/middleware.d.ts.map +1 -0
- package/dist/security/policy-engine/middleware.js +375 -0
- package/dist/security/policy-engine/middleware.js.map +1 -0
- package/dist/security/policy-engine/rule-evaluator.d.ts +140 -0
- package/dist/security/policy-engine/rule-evaluator.d.ts.map +1 -0
- package/dist/security/policy-engine/rule-evaluator.js +593 -0
- package/dist/security/policy-engine/rule-evaluator.js.map +1 -0
- package/dist/security/policy-engine/types.d.ts +2855 -0
- package/dist/security/policy-engine/types.d.ts.map +1 -0
- package/dist/security/policy-engine/types.js +443 -0
- package/dist/security/policy-engine/types.js.map +1 -0
- package/dist/security/rbac/index.d.ts +317 -0
- package/dist/security/rbac/index.d.ts.map +1 -0
- package/dist/security/rbac/index.js +618 -0
- package/dist/security/rbac/index.js.map +1 -0
- package/dist/security/rbac/permissions.d.ts +305 -0
- package/dist/security/rbac/permissions.d.ts.map +1 -0
- package/dist/security/rbac/permissions.js +947 -0
- package/dist/security/rbac/permissions.js.map +1 -0
- package/dist/security/rbac/policy-engine.d.ts +542 -0
- package/dist/security/rbac/policy-engine.d.ts.map +1 -0
- package/dist/security/rbac/policy-engine.js +1244 -0
- package/dist/security/rbac/policy-engine.js.map +1 -0
- package/dist/security/rbac/roles.d.ts +478 -0
- package/dist/security/rbac/roles.d.ts.map +1 -0
- package/dist/security/rbac/roles.js +363 -0
- package/dist/security/rbac/roles.js.map +1 -0
- package/dist/security/refresh-token.d.ts +305 -0
- package/dist/security/refresh-token.d.ts.map +1 -0
- package/dist/security/refresh-token.js +674 -0
- package/dist/security/refresh-token.js.map +1 -0
- package/dist/security/request-integrity.d.ts +289 -0
- package/dist/security/request-integrity.d.ts.map +1 -0
- package/dist/security/request-integrity.js +663 -0
- package/dist/security/request-integrity.js.map +1 -0
- package/dist/security/revocation-check.d.ts +188 -0
- package/dist/security/revocation-check.d.ts.map +1 -0
- package/dist/security/revocation-check.js +606 -0
- package/dist/security/revocation-check.js.map +1 -0
- package/dist/security/revocation.d.ts +191 -0
- package/dist/security/revocation.d.ts.map +1 -0
- package/dist/security/revocation.js +522 -0
- package/dist/security/revocation.js.map +1 -0
- package/dist/security/secrets-rotation.d.ts +501 -0
- package/dist/security/secrets-rotation.d.ts.map +1 -0
- package/dist/security/secrets-rotation.js +934 -0
- package/dist/security/secrets-rotation.js.map +1 -0
- package/dist/security/secure-memory.d.ts +325 -0
- package/dist/security/secure-memory.d.ts.map +1 -0
- package/dist/security/secure-memory.js +595 -0
- package/dist/security/secure-memory.js.map +1 -0
- package/dist/security/security-service.d.ts +186 -0
- package/dist/security/security-service.d.ts.map +1 -0
- package/dist/security/security-service.js +531 -0
- package/dist/security/security-service.js.map +1 -0
- package/dist/security/service-auth/index.d.ts +20 -0
- package/dist/security/service-auth/index.d.ts.map +1 -0
- package/dist/security/service-auth/index.js +61 -0
- package/dist/security/service-auth/index.js.map +1 -0
- package/dist/security/service-auth/service-account.d.ts +357 -0
- package/dist/security/service-auth/service-account.d.ts.map +1 -0
- package/dist/security/service-auth/service-account.js +475 -0
- package/dist/security/service-auth/service-account.js.map +1 -0
- package/dist/security/service-auth/service-auth-middleware.d.ts +174 -0
- package/dist/security/service-auth/service-auth-middleware.d.ts.map +1 -0
- package/dist/security/service-auth/service-auth-middleware.js +461 -0
- package/dist/security/service-auth/service-auth-middleware.js.map +1 -0
- package/dist/security/service-auth/service-token.d.ts +391 -0
- package/dist/security/service-auth/service-token.d.ts.map +1 -0
- package/dist/security/service-auth/service-token.js +472 -0
- package/dist/security/service-auth/service-token.js.map +1 -0
- package/dist/security/session-manager.d.ts +177 -0
- package/dist/security/session-manager.d.ts.map +1 -0
- package/dist/security/session-manager.js +353 -0
- package/dist/security/session-manager.js.map +1 -0
- package/dist/security/session-store.d.ts +205 -0
- package/dist/security/session-store.d.ts.map +1 -0
- package/dist/security/session-store.js +581 -0
- package/dist/security/session-store.js.map +1 -0
- package/dist/security/siem/connector.d.ts +147 -0
- package/dist/security/siem/connector.d.ts.map +1 -0
- package/dist/security/siem/connector.js +254 -0
- package/dist/security/siem/connector.js.map +1 -0
- package/dist/security/siem/datadog.d.ts +81 -0
- package/dist/security/siem/datadog.d.ts.map +1 -0
- package/dist/security/siem/datadog.js +362 -0
- package/dist/security/siem/datadog.js.map +1 -0
- package/dist/security/siem/elastic.d.ts +83 -0
- package/dist/security/siem/elastic.d.ts.map +1 -0
- package/dist/security/siem/elastic.js +514 -0
- package/dist/security/siem/elastic.js.map +1 -0
- package/dist/security/siem/enrichment.d.ts +133 -0
- package/dist/security/siem/enrichment.d.ts.map +1 -0
- package/dist/security/siem/enrichment.js +434 -0
- package/dist/security/siem/enrichment.js.map +1 -0
- package/dist/security/siem/formatter.d.ts +118 -0
- package/dist/security/siem/formatter.d.ts.map +1 -0
- package/dist/security/siem/formatter.js +381 -0
- package/dist/security/siem/formatter.js.map +1 -0
- package/dist/security/siem/hooks.d.ts +107 -0
- package/dist/security/siem/hooks.d.ts.map +1 -0
- package/dist/security/siem/hooks.js +459 -0
- package/dist/security/siem/hooks.js.map +1 -0
- package/dist/security/siem/index.d.ts +83 -0
- package/dist/security/siem/index.d.ts.map +1 -0
- package/dist/security/siem/index.js +95 -0
- package/dist/security/siem/index.js.map +1 -0
- package/dist/security/siem/service.d.ts +153 -0
- package/dist/security/siem/service.d.ts.map +1 -0
- package/dist/security/siem/service.js +615 -0
- package/dist/security/siem/service.js.map +1 -0
- package/dist/security/siem/splunk.d.ts +76 -0
- package/dist/security/siem/splunk.d.ts.map +1 -0
- package/dist/security/siem/splunk.js +283 -0
- package/dist/security/siem/splunk.js.map +1 -0
- package/dist/security/siem/types.d.ts +1980 -0
- package/dist/security/siem/types.d.ts.map +1 -0
- package/dist/security/siem/types.js +268 -0
- package/dist/security/siem/types.js.map +1 -0
- package/dist/security/tee-production.d.ts +157 -0
- package/dist/security/tee-production.d.ts.map +1 -0
- package/dist/security/tee-production.js +792 -0
- package/dist/security/tee-production.js.map +1 -0
- package/dist/security/tee.d.ts +182 -0
- package/dist/security/tee.d.ts.map +1 -0
- package/dist/security/tee.js +1031 -0
- package/dist/security/tee.js.map +1 -0
- package/dist/security/threat-intel/bot-detection.d.ts +275 -0
- package/dist/security/threat-intel/bot-detection.d.ts.map +1 -0
- package/dist/security/threat-intel/bot-detection.js +890 -0
- package/dist/security/threat-intel/bot-detection.js.map +1 -0
- package/dist/security/threat-intel/credential-stuffing.d.ts +368 -0
- package/dist/security/threat-intel/credential-stuffing.d.ts.map +1 -0
- package/dist/security/threat-intel/credential-stuffing.js +957 -0
- package/dist/security/threat-intel/credential-stuffing.js.map +1 -0
- package/dist/security/threat-intel/index.d.ts +10 -0
- package/dist/security/threat-intel/index.d.ts.map +1 -0
- package/dist/security/threat-intel/index.js +18 -0
- package/dist/security/threat-intel/index.js.map +1 -0
- package/dist/security/threat-intel/ip-reputation.d.ts +323 -0
- package/dist/security/threat-intel/ip-reputation.d.ts.map +1 -0
- package/dist/security/threat-intel/ip-reputation.js +923 -0
- package/dist/security/threat-intel/ip-reputation.js.map +1 -0
- package/dist/security/token-lifecycle.d.ts +272 -0
- package/dist/security/token-lifecycle.d.ts.map +1 -0
- package/dist/security/token-lifecycle.js +732 -0
- package/dist/security/token-lifecycle.js.map +1 -0
- package/dist/security/token-lifetime.d.ts +206 -0
- package/dist/security/token-lifetime.d.ts.map +1 -0
- package/dist/security/token-lifetime.js +388 -0
- package/dist/security/token-lifetime.js.map +1 -0
- package/dist/security/trust-oracle/alerts.d.ts +202 -0
- package/dist/security/trust-oracle/alerts.d.ts.map +1 -0
- package/dist/security/trust-oracle/alerts.js +763 -0
- package/dist/security/trust-oracle/alerts.js.map +1 -0
- package/dist/security/trust-oracle/api.d.ts +116 -0
- package/dist/security/trust-oracle/api.d.ts.map +1 -0
- package/dist/security/trust-oracle/api.js +721 -0
- package/dist/security/trust-oracle/api.js.map +1 -0
- package/dist/security/trust-oracle/continuous-monitoring.d.ts +105 -0
- package/dist/security/trust-oracle/continuous-monitoring.d.ts.map +1 -0
- package/dist/security/trust-oracle/continuous-monitoring.js +696 -0
- package/dist/security/trust-oracle/continuous-monitoring.js.map +1 -0
- package/dist/security/trust-oracle/data-sources.d.ts +126 -0
- package/dist/security/trust-oracle/data-sources.d.ts.map +1 -0
- package/dist/security/trust-oracle/data-sources.js +867 -0
- package/dist/security/trust-oracle/data-sources.js.map +1 -0
- package/dist/security/trust-oracle/index.d.ts +79 -0
- package/dist/security/trust-oracle/index.d.ts.map +1 -0
- package/dist/security/trust-oracle/index.js +206 -0
- package/dist/security/trust-oracle/index.js.map +1 -0
- package/dist/security/trust-oracle/oracle.d.ts +125 -0
- package/dist/security/trust-oracle/oracle.d.ts.map +1 -0
- package/dist/security/trust-oracle/oracle.js +489 -0
- package/dist/security/trust-oracle/oracle.js.map +1 -0
- package/dist/security/trust-oracle/reporting.d.ts +145 -0
- package/dist/security/trust-oracle/reporting.d.ts.map +1 -0
- package/dist/security/trust-oracle/reporting.js +1098 -0
- package/dist/security/trust-oracle/reporting.js.map +1 -0
- package/dist/security/trust-oracle/risk-scorer.d.ts +207 -0
- package/dist/security/trust-oracle/risk-scorer.d.ts.map +1 -0
- package/dist/security/trust-oracle/risk-scorer.js +1033 -0
- package/dist/security/trust-oracle/risk-scorer.js.map +1 -0
- package/dist/security/trust-oracle/types.d.ts +444 -0
- package/dist/security/trust-oracle/types.d.ts.map +1 -0
- package/dist/security/trust-oracle/types.js +6 -0
- package/dist/security/trust-oracle/types.js.map +1 -0
- package/dist/security/trust-oracle/vendor-registry.d.ts +228 -0
- package/dist/security/trust-oracle/vendor-registry.d.ts.map +1 -0
- package/dist/security/trust-oracle/vendor-registry.js +727 -0
- package/dist/security/trust-oracle/vendor-registry.js.map +1 -0
- package/dist/security/types.d.ts +1777 -0
- package/dist/security/types.d.ts.map +1 -0
- package/dist/security/types.js +388 -0
- package/dist/security/types.js.map +1 -0
- package/dist/security/webauthn/index.d.ts +47 -0
- package/dist/security/webauthn/index.d.ts.map +1 -0
- package/dist/security/webauthn/index.js +48 -0
- package/dist/security/webauthn/index.js.map +1 -0
- package/dist/security/webauthn/middleware.d.ts +109 -0
- package/dist/security/webauthn/middleware.d.ts.map +1 -0
- package/dist/security/webauthn/middleware.js +629 -0
- package/dist/security/webauthn/middleware.js.map +1 -0
- package/dist/security/webauthn/service.d.ts +179 -0
- package/dist/security/webauthn/service.d.ts.map +1 -0
- package/dist/security/webauthn/service.js +758 -0
- package/dist/security/webauthn/service.js.map +1 -0
- package/dist/security/webauthn/store.d.ts +240 -0
- package/dist/security/webauthn/store.d.ts.map +1 -0
- package/dist/security/webauthn/store.js +505 -0
- package/dist/security/webauthn/store.js.map +1 -0
- package/dist/security/webauthn/types.d.ts +678 -0
- package/dist/security/webauthn/types.d.ts.map +1 -0
- package/dist/security/webauthn/types.js +176 -0
- package/dist/security/webauthn/types.js.map +1 -0
- package/dist/security/zkp/circuits.d.ts +296 -0
- package/dist/security/zkp/circuits.d.ts.map +1 -0
- package/dist/security/zkp/circuits.js +771 -0
- package/dist/security/zkp/circuits.js.map +1 -0
- package/dist/security/zkp/commitment.d.ts +319 -0
- package/dist/security/zkp/commitment.d.ts.map +1 -0
- package/dist/security/zkp/commitment.js +591 -0
- package/dist/security/zkp/commitment.js.map +1 -0
- package/dist/security/zkp/compliance.d.ts +251 -0
- package/dist/security/zkp/compliance.d.ts.map +1 -0
- package/dist/security/zkp/compliance.js +734 -0
- package/dist/security/zkp/compliance.js.map +1 -0
- package/dist/security/zkp/index.d.ts +184 -0
- package/dist/security/zkp/index.d.ts.map +1 -0
- package/dist/security/zkp/index.js +285 -0
- package/dist/security/zkp/index.js.map +1 -0
- package/dist/security/zkp/integration.d.ts +289 -0
- package/dist/security/zkp/integration.d.ts.map +1 -0
- package/dist/security/zkp/integration.js +571 -0
- package/dist/security/zkp/integration.js.map +1 -0
- package/dist/security/zkp/prover.d.ts +158 -0
- package/dist/security/zkp/prover.d.ts.map +1 -0
- package/dist/security/zkp/prover.js +465 -0
- package/dist/security/zkp/prover.js.map +1 -0
- package/dist/security/zkp/snark-utils.d.ts +321 -0
- package/dist/security/zkp/snark-utils.d.ts.map +1 -0
- package/dist/security/zkp/snark-utils.js +640 -0
- package/dist/security/zkp/snark-utils.js.map +1 -0
- package/dist/security/zkp/types.d.ts +1192 -0
- package/dist/security/zkp/types.d.ts.map +1 -0
- package/dist/security/zkp/types.js +264 -0
- package/dist/security/zkp/types.js.map +1 -0
- package/dist/security/zkp/verifier.d.ts +111 -0
- package/dist/security/zkp/verifier.d.ts.map +1 -0
- package/dist/security/zkp/verifier.js +554 -0
- package/dist/security/zkp/verifier.js.map +1 -0
- package/dist/semantic-governance/context-validator.d.ts +158 -0
- package/dist/semantic-governance/context-validator.d.ts.map +1 -0
- package/dist/semantic-governance/context-validator.js +598 -0
- package/dist/semantic-governance/context-validator.js.map +1 -0
- package/dist/semantic-governance/credential-manager.d.ts +156 -0
- package/dist/semantic-governance/credential-manager.d.ts.map +1 -0
- package/dist/semantic-governance/credential-manager.js +438 -0
- package/dist/semantic-governance/credential-manager.js.map +1 -0
- package/dist/semantic-governance/dual-channel.d.ts +138 -0
- package/dist/semantic-governance/dual-channel.d.ts.map +1 -0
- package/dist/semantic-governance/dual-channel.js +333 -0
- package/dist/semantic-governance/dual-channel.js.map +1 -0
- package/dist/semantic-governance/index.d.ts +107 -0
- package/dist/semantic-governance/index.d.ts.map +1 -0
- package/dist/semantic-governance/index.js +141 -0
- package/dist/semantic-governance/index.js.map +1 -0
- package/dist/semantic-governance/inference-validator.d.ts +114 -0
- package/dist/semantic-governance/inference-validator.d.ts.map +1 -0
- package/dist/semantic-governance/inference-validator.js +390 -0
- package/dist/semantic-governance/inference-validator.js.map +1 -0
- package/dist/semantic-governance/instruction-validator.d.ts +146 -0
- package/dist/semantic-governance/instruction-validator.d.ts.map +1 -0
- package/dist/semantic-governance/instruction-validator.js +363 -0
- package/dist/semantic-governance/instruction-validator.js.map +1 -0
- package/dist/semantic-governance/integration.d.ts +253 -0
- package/dist/semantic-governance/integration.d.ts.map +1 -0
- package/dist/semantic-governance/integration.js +658 -0
- package/dist/semantic-governance/integration.js.map +1 -0
- package/dist/semantic-governance/output-validator.d.ts +135 -0
- package/dist/semantic-governance/output-validator.d.ts.map +1 -0
- package/dist/semantic-governance/output-validator.js +448 -0
- package/dist/semantic-governance/output-validator.js.map +1 -0
- package/dist/semantic-governance/service.d.ts +120 -0
- package/dist/semantic-governance/service.d.ts.map +1 -0
- package/dist/semantic-governance/service.js +527 -0
- package/dist/semantic-governance/service.js.map +1 -0
- package/dist/semantic-governance/types.d.ts +3925 -0
- package/dist/semantic-governance/types.d.ts.map +1 -0
- package/dist/semantic-governance/types.js +471 -0
- package/dist/semantic-governance/types.js.map +1 -0
- package/dist/trust-engine/car-integration.d.ts +263 -0
- package/dist/trust-engine/car-integration.d.ts.map +1 -0
- package/dist/trust-engine/car-integration.js +320 -0
- package/dist/trust-engine/car-integration.js.map +1 -0
- package/dist/trust-engine/context.d.ts +198 -0
- package/dist/trust-engine/context.d.ts.map +1 -0
- package/dist/trust-engine/context.js +308 -0
- package/dist/trust-engine/context.js.map +1 -0
- package/dist/trust-engine/diminishing-returns.d.ts +123 -0
- package/dist/trust-engine/diminishing-returns.d.ts.map +1 -0
- package/dist/trust-engine/diminishing-returns.js +197 -0
- package/dist/trust-engine/diminishing-returns.js.map +1 -0
- package/dist/trust-engine/index.d.ts +433 -0
- package/dist/trust-engine/index.d.ts.map +1 -0
- package/dist/trust-engine/index.js +1241 -0
- package/dist/trust-engine/index.js.map +1 -0
- package/dist/trust-engine/observability.d.ts +175 -0
- package/dist/trust-engine/observability.d.ts.map +1 -0
- package/dist/trust-engine/observability.js +246 -0
- package/dist/trust-engine/observability.js.map +1 -0
- package/dist/trust-engine/signal-diversity.d.ts +130 -0
- package/dist/trust-engine/signal-diversity.d.ts.map +1 -0
- package/dist/trust-engine/signal-diversity.js +238 -0
- package/dist/trust-engine/signal-diversity.js.map +1 -0
- package/dist/versioning/deprecation.d.ts +65 -0
- package/dist/versioning/deprecation.d.ts.map +1 -0
- package/dist/versioning/deprecation.js +199 -0
- package/dist/versioning/deprecation.js.map +1 -0
- package/dist/versioning/index.d.ts +46 -0
- package/dist/versioning/index.d.ts.map +1 -0
- package/dist/versioning/index.js +76 -0
- package/dist/versioning/index.js.map +1 -0
- package/dist/versioning/semver.d.ts +116 -0
- package/dist/versioning/semver.d.ts.map +1 -0
- package/dist/versioning/semver.js +321 -0
- package/dist/versioning/semver.js.map +1 -0
- package/package.json +161 -0
|
@@ -0,0 +1,1241 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Trust Engine - Behavioral Trust Scoring
|
|
3
|
+
*
|
|
4
|
+
* Calculates and maintains trust scores for entities based on behavioral signals.
|
|
5
|
+
* Persists to PostgreSQL for durability.
|
|
6
|
+
*
|
|
7
|
+
* Supports the dual-layer certification/runtime model:
|
|
8
|
+
* - Certification Layer (CAR): Portable attestations that travel with agents
|
|
9
|
+
* - Runtime Layer (Vorion): Deployment-specific trust enforcement
|
|
10
|
+
*
|
|
11
|
+
* CAR = Categorical Agentic Registry (formerly ACI - Categorical Agentic Registry)
|
|
12
|
+
* Backwards-compatible ACI aliases are provided for migration.
|
|
13
|
+
*
|
|
14
|
+
* @packageDocumentation
|
|
15
|
+
*/
|
|
16
|
+
import { eq, and, gte, desc, sql } from 'drizzle-orm';
|
|
17
|
+
import { createLogger } from '../common/logger.js';
|
|
18
|
+
import { getDatabase } from '../common/db.js';
|
|
19
|
+
import { trustRecords, trustSignals, trustHistory, } from '@vorionsys/contracts/db';
|
|
20
|
+
import { TrustEngineError, isVorionError } from '../common/errors.js';
|
|
21
|
+
import { extractTenantId } from '../common/tenant-context.js';
|
|
22
|
+
import { trustSignalsRecordedTotal, trustScoreDistribution, recordTrustCalculationMetric, } from '../common/metrics.js';
|
|
23
|
+
/**
|
|
24
|
+
* Helper to extract tenantId from either TenantContext or legacy TrustOperationOptions
|
|
25
|
+
*
|
|
26
|
+
* @internal
|
|
27
|
+
*/
|
|
28
|
+
function getTenantIdFromOptions(options) {
|
|
29
|
+
if (!options)
|
|
30
|
+
return undefined;
|
|
31
|
+
// Check if it's a TenantContext (has userId property)
|
|
32
|
+
if ('userId' in options && 'createdAt' in options) {
|
|
33
|
+
return extractTenantId(options);
|
|
34
|
+
}
|
|
35
|
+
// Legacy TrustOperationOptions
|
|
36
|
+
return options.tenantId;
|
|
37
|
+
}
|
|
38
|
+
// CAR Integration imports (with ACI backwards-compatible aliases)
|
|
39
|
+
import { CapabilityLevel, parseCAR, parseACI, } from '@vorionsys/contracts/car';
|
|
40
|
+
import { attestationToTrustSignal, calculateEffectiveTier, calculateEffectiveScore, scoreToTier, calculateEffectiveFromACI, applyACIFloor, } from './car-integration.js';
|
|
41
|
+
import { ObservabilityClass, getObservabilityCeiling, determineObservabilityClass, } from './observability.js';
|
|
42
|
+
import { getContextCeiling, detectDeploymentContext, } from './context.js';
|
|
43
|
+
import { FACTOR_CODE_LIST, DEFAULT_FACTOR_WEIGHTS, SIGNAL_PREFIX_TO_FACTORS as BASIS_SIGNAL_PREFIX_MAP, initialFactorScores, } from '@vorionsys/basis';
|
|
44
|
+
const logger = createLogger({ component: 'trust-engine' });
|
|
45
|
+
/**
|
|
46
|
+
* Trust level thresholds (T0-T7) — canonical 8-tier model
|
|
47
|
+
*/
|
|
48
|
+
export const TRUST_THRESHOLDS = {
|
|
49
|
+
0: { min: 0, max: 199 },
|
|
50
|
+
1: { min: 200, max: 349 },
|
|
51
|
+
2: { min: 350, max: 499 },
|
|
52
|
+
3: { min: 500, max: 649 },
|
|
53
|
+
4: { min: 650, max: 799 },
|
|
54
|
+
5: { min: 800, max: 875 },
|
|
55
|
+
6: { min: 876, max: 950 },
|
|
56
|
+
7: { min: 951, max: 1000 },
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* Trust level names (T0-T7)
|
|
60
|
+
*/
|
|
61
|
+
export const TRUST_LEVEL_NAMES = {
|
|
62
|
+
0: 'Sandbox',
|
|
63
|
+
1: 'Observed',
|
|
64
|
+
2: 'Provisional',
|
|
65
|
+
3: 'Monitored',
|
|
66
|
+
4: 'Standard',
|
|
67
|
+
5: 'Trusted',
|
|
68
|
+
6: 'Certified',
|
|
69
|
+
7: 'Autonomous',
|
|
70
|
+
};
|
|
71
|
+
// Re-export canonical factor constants from @vorionsys/basis
|
|
72
|
+
export const FACTOR_CODES = FACTOR_CODE_LIST;
|
|
73
|
+
export const FACTOR_WEIGHTS = DEFAULT_FACTOR_WEIGHTS;
|
|
74
|
+
export { initialFactorScores };
|
|
75
|
+
// Re-export legacy signal prefix mapping from @vorionsys/basis
|
|
76
|
+
export const SIGNAL_PREFIX_TO_FACTORS = BASIS_SIGNAL_PREFIX_MAP;
|
|
77
|
+
/**
|
|
78
|
+
* @deprecated Use FACTOR_WEIGHTS for 16-factor scoring. Kept for backwards compatibility.
|
|
79
|
+
* Signal weights for score calculation
|
|
80
|
+
*/
|
|
81
|
+
export const SIGNAL_WEIGHTS = {
|
|
82
|
+
behavioral: 0.4,
|
|
83
|
+
compliance: 0.25,
|
|
84
|
+
identity: 0.2,
|
|
85
|
+
context: 0.15,
|
|
86
|
+
};
|
|
87
|
+
/**
|
|
88
|
+
* Stepped decay milestones
|
|
89
|
+
*
|
|
90
|
+
* Trust decays incrementally based on days since last activity.
|
|
91
|
+
* 182-day half-life: after 182 days of inactivity, score is 50% of original.
|
|
92
|
+
*
|
|
93
|
+
* Steps 1-5: 6% drop each (100% → 70%)
|
|
94
|
+
* Steps 6-9: 5% drop each (70% → 50%)
|
|
95
|
+
*
|
|
96
|
+
* 9 milestones, simple and predictable.
|
|
97
|
+
*/
|
|
98
|
+
export const DECAY_MILESTONES = [
|
|
99
|
+
{ days: 0, multiplier: 1.00 },
|
|
100
|
+
{ days: 7, multiplier: 0.94 },
|
|
101
|
+
{ days: 14, multiplier: 0.88 },
|
|
102
|
+
{ days: 28, multiplier: 0.82 },
|
|
103
|
+
{ days: 42, multiplier: 0.76 },
|
|
104
|
+
{ days: 56, multiplier: 0.70 },
|
|
105
|
+
{ days: 84, multiplier: 0.65 },
|
|
106
|
+
{ days: 112, multiplier: 0.60 },
|
|
107
|
+
{ days: 140, multiplier: 0.55 },
|
|
108
|
+
{ days: 182, multiplier: 0.50 },
|
|
109
|
+
];
|
|
110
|
+
/**
|
|
111
|
+
* Trust Engine service with PostgreSQL persistence
|
|
112
|
+
*
|
|
113
|
+
* Uses stepped decay milestones (182-day half-life) for trust score degradation.
|
|
114
|
+
*
|
|
115
|
+
* SECURITY: All trust operations now require TenantContext for multi-tenant isolation.
|
|
116
|
+
* TenantContext can only be created from validated JWT tokens, preventing
|
|
117
|
+
* tenant ID injection attacks. Cross-tenant queries are prevented by validating
|
|
118
|
+
* entity ownership.
|
|
119
|
+
*
|
|
120
|
+
* @see DECAY_MILESTONES
|
|
121
|
+
* @see TenantContext in ../common/tenant-context.ts
|
|
122
|
+
*/
|
|
123
|
+
export class TrustEngine {
|
|
124
|
+
db = null;
|
|
125
|
+
initialized = false;
|
|
126
|
+
injectedDb = null;
|
|
127
|
+
/**
|
|
128
|
+
* Entity-to-tenant mapping cache (in production, use Redis or dedicated table)
|
|
129
|
+
* This maps entityId -> tenantId for ownership validation
|
|
130
|
+
*/
|
|
131
|
+
entityTenantCache = new Map();
|
|
132
|
+
/**
|
|
133
|
+
* Create a new TrustEngine instance.
|
|
134
|
+
*
|
|
135
|
+
* @param deps - Optional dependencies for dependency injection.
|
|
136
|
+
* If database is provided, it will be used immediately without lazy init.
|
|
137
|
+
*
|
|
138
|
+
* @example
|
|
139
|
+
* // Default usage (lazy initialization)
|
|
140
|
+
* const engine = new TrustEngine();
|
|
141
|
+
* await engine.initialize();
|
|
142
|
+
*
|
|
143
|
+
* @example
|
|
144
|
+
* // With dependency injection (for testing)
|
|
145
|
+
* const engine = new TrustEngine({ database: mockDb });
|
|
146
|
+
*/
|
|
147
|
+
constructor(deps = {}) {
|
|
148
|
+
// If database is injected, mark as initialized
|
|
149
|
+
if (deps.database) {
|
|
150
|
+
this.injectedDb = deps.database;
|
|
151
|
+
this.db = deps.database;
|
|
152
|
+
this.initialized = true;
|
|
153
|
+
}
|
|
154
|
+
// Decay is now handled via DECAY_MILESTONES (stepped decay)
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Validate that an entity belongs to the specified tenant
|
|
158
|
+
*
|
|
159
|
+
* SECURITY: This prevents cross-tenant data access by ensuring
|
|
160
|
+
* the requesting tenant owns the entity being accessed.
|
|
161
|
+
*
|
|
162
|
+
* @throws TrustEngineError if entity does not belong to tenant
|
|
163
|
+
*/
|
|
164
|
+
async validateTenantOwnership(entityId, tenantId) {
|
|
165
|
+
// Check cache first
|
|
166
|
+
const cachedTenant = this.entityTenantCache.get(entityId);
|
|
167
|
+
if (cachedTenant) {
|
|
168
|
+
if (cachedTenant !== tenantId) {
|
|
169
|
+
logger.warn({ entityId, requestedTenantId: tenantId, actualTenantId: cachedTenant }, 'SECURITY: Cross-tenant trust query attempt blocked');
|
|
170
|
+
throw new TrustEngineError('Entity does not belong to the specified tenant', 'validateTenantOwnership', entityId, { tenantId, reason: 'CROSS_TENANT_ACCESS_DENIED' });
|
|
171
|
+
}
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
// In production, query the entity registry or a dedicated mapping table
|
|
175
|
+
// For now, we register entities on first access with their tenant
|
|
176
|
+
// This is a security-first approach: unknown entities are associated with the first tenant that accesses them
|
|
177
|
+
logger.debug({ entityId, tenantId }, 'Entity-tenant mapping not cached, registering association');
|
|
178
|
+
this.entityTenantCache.set(entityId, tenantId);
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Register entity-tenant association
|
|
182
|
+
* Call this when creating or importing entities
|
|
183
|
+
*/
|
|
184
|
+
registerEntityTenant(entityId, tenantId) {
|
|
185
|
+
this.entityTenantCache.set(entityId, tenantId);
|
|
186
|
+
logger.debug({ entityId, tenantId }, 'Entity-tenant association registered');
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Initialize the service
|
|
190
|
+
*/
|
|
191
|
+
async initialize() {
|
|
192
|
+
if (this.initialized)
|
|
193
|
+
return;
|
|
194
|
+
// Use injected database if available, otherwise get from singleton
|
|
195
|
+
this.db = this.injectedDb ?? getDatabase();
|
|
196
|
+
this.initialized = true;
|
|
197
|
+
logger.info('Trust engine initialized with database persistence');
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Ensure service is initialized
|
|
201
|
+
*/
|
|
202
|
+
async ensureInitialized() {
|
|
203
|
+
if (!this.initialized || !this.db) {
|
|
204
|
+
await this.initialize();
|
|
205
|
+
}
|
|
206
|
+
return this.db;
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Calculate trust score for an entity
|
|
210
|
+
*
|
|
211
|
+
* SECURITY: Requires TenantContext for multi-tenant isolation.
|
|
212
|
+
* TenantContext can only be created from validated JWT tokens.
|
|
213
|
+
*
|
|
214
|
+
* @param entityId - The entity to calculate trust for
|
|
215
|
+
* @param ctx - Validated tenant context from JWT (REQUIRED for security)
|
|
216
|
+
*/
|
|
217
|
+
async calculate(entityId, ctx) {
|
|
218
|
+
const startTime = performance.now();
|
|
219
|
+
const tenantId = extractTenantId(ctx);
|
|
220
|
+
try {
|
|
221
|
+
const db = await this.ensureInitialized();
|
|
222
|
+
// SECURITY: Always validate tenant ownership
|
|
223
|
+
await this.validateTenantOwnership(entityId, tenantId);
|
|
224
|
+
// Get recent signals for the entity (last 7 days for weighted calculation)
|
|
225
|
+
const sevenDaysAgo = new Date(Date.now() - 7 * 24 * 60 * 60 * 1000);
|
|
226
|
+
const signals = await db
|
|
227
|
+
.select()
|
|
228
|
+
.from(trustSignals)
|
|
229
|
+
.where(and(eq(trustSignals.entityId, entityId), gte(trustSignals.timestamp, sevenDaysAgo)))
|
|
230
|
+
.orderBy(desc(trustSignals.timestamp))
|
|
231
|
+
.limit(1000);
|
|
232
|
+
// Convert to domain signals
|
|
233
|
+
const domainSignals = signals.map((s) => ({
|
|
234
|
+
id: s.id,
|
|
235
|
+
entityId: s.entityId,
|
|
236
|
+
type: s.type,
|
|
237
|
+
value: s.value,
|
|
238
|
+
weight: s.weight,
|
|
239
|
+
source: s.source ?? '',
|
|
240
|
+
metadata: s.metadata ?? {},
|
|
241
|
+
timestamp: s.timestamp.toISOString(),
|
|
242
|
+
}));
|
|
243
|
+
// Calculate factor scores (16-factor model)
|
|
244
|
+
const factorScores = this.calculateFactorScores(domainSignals);
|
|
245
|
+
// Calculate weighted total using factor weights
|
|
246
|
+
let score = 0;
|
|
247
|
+
for (const code of FACTOR_CODES) {
|
|
248
|
+
score += factorScores[code] * FACTOR_WEIGHTS[code] * 1000;
|
|
249
|
+
}
|
|
250
|
+
score = Math.round(score);
|
|
251
|
+
// Clamp to valid range
|
|
252
|
+
const clampedScore = Math.max(0, Math.min(1000, score));
|
|
253
|
+
const level = this.scoreToLevel(clampedScore);
|
|
254
|
+
// Backwards compat: also compute legacy 4-bucket components
|
|
255
|
+
const components = this.calculateComponents(domainSignals);
|
|
256
|
+
const factors = this.getSignificantFactors(components);
|
|
257
|
+
logger.debug({ entityId, score: clampedScore, level, factorScores }, 'Trust calculated');
|
|
258
|
+
// Record metrics
|
|
259
|
+
const durationSeconds = (performance.now() - startTime) / 1000;
|
|
260
|
+
recordTrustCalculationMetric(tenantId, 'agent', durationSeconds);
|
|
261
|
+
trustScoreDistribution.observe({ tenant_id: tenantId, trust_level: level.toString() }, clampedScore);
|
|
262
|
+
return {
|
|
263
|
+
score: clampedScore,
|
|
264
|
+
level,
|
|
265
|
+
components,
|
|
266
|
+
factorScores,
|
|
267
|
+
factors,
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
catch (error) {
|
|
271
|
+
if (isVorionError(error)) {
|
|
272
|
+
throw error;
|
|
273
|
+
}
|
|
274
|
+
logger.error({ error, entityId }, 'Failed to calculate trust score');
|
|
275
|
+
throw new TrustEngineError(`Failed to calculate trust score: ${error instanceof Error ? error.message : 'Unknown error'}`, 'calculate', entityId, { originalError: error instanceof Error ? error.name : 'Unknown' });
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* Get trust score for an entity
|
|
280
|
+
*
|
|
281
|
+
* SECURITY: Requires TenantContext for multi-tenant isolation.
|
|
282
|
+
* TenantContext can only be created from validated JWT tokens.
|
|
283
|
+
*
|
|
284
|
+
* @param entityId - The entity to get trust score for
|
|
285
|
+
* @param ctx - Validated tenant context from JWT (REQUIRED for security)
|
|
286
|
+
*/
|
|
287
|
+
async getScore(entityId, ctx) {
|
|
288
|
+
const tenantId = extractTenantId(ctx);
|
|
289
|
+
try {
|
|
290
|
+
const db = await this.ensureInitialized();
|
|
291
|
+
// SECURITY: Always validate tenant ownership
|
|
292
|
+
await this.validateTenantOwnership(entityId, tenantId);
|
|
293
|
+
const result = await db
|
|
294
|
+
.select()
|
|
295
|
+
.from(trustRecords)
|
|
296
|
+
.where(eq(trustRecords.entityId, entityId))
|
|
297
|
+
.limit(1);
|
|
298
|
+
if (result.length === 0)
|
|
299
|
+
return undefined;
|
|
300
|
+
const record = result[0];
|
|
301
|
+
// Check if recalculation is needed (older than 1 minute)
|
|
302
|
+
const staleness = Date.now() - record.lastCalculatedAt.getTime();
|
|
303
|
+
if (staleness > 60000) {
|
|
304
|
+
// Recalculate
|
|
305
|
+
const calculation = await this.calculate(entityId, ctx);
|
|
306
|
+
// Update record
|
|
307
|
+
await db
|
|
308
|
+
.update(trustRecords)
|
|
309
|
+
.set({
|
|
310
|
+
score: calculation.score,
|
|
311
|
+
level: calculation.level.toString(),
|
|
312
|
+
behavioralScore: calculation.components.behavioral,
|
|
313
|
+
complianceScore: calculation.components.compliance,
|
|
314
|
+
identityScore: calculation.components.identity,
|
|
315
|
+
contextScore: calculation.components.context,
|
|
316
|
+
lastCalculatedAt: new Date(),
|
|
317
|
+
updatedAt: new Date(),
|
|
318
|
+
})
|
|
319
|
+
.where(eq(trustRecords.entityId, entityId));
|
|
320
|
+
record.score = calculation.score;
|
|
321
|
+
record.level = calculation.level.toString();
|
|
322
|
+
record.behavioralScore = calculation.components.behavioral;
|
|
323
|
+
record.complianceScore = calculation.components.compliance;
|
|
324
|
+
record.identityScore = calculation.components.identity;
|
|
325
|
+
record.contextScore = calculation.components.context;
|
|
326
|
+
record.lastCalculatedAt = new Date();
|
|
327
|
+
}
|
|
328
|
+
// Get recent signals
|
|
329
|
+
const signals = await db
|
|
330
|
+
.select()
|
|
331
|
+
.from(trustSignals)
|
|
332
|
+
.where(eq(trustSignals.entityId, entityId))
|
|
333
|
+
.orderBy(desc(trustSignals.timestamp))
|
|
334
|
+
.limit(100);
|
|
335
|
+
// Get history
|
|
336
|
+
const history = await db
|
|
337
|
+
.select()
|
|
338
|
+
.from(trustHistory)
|
|
339
|
+
.where(eq(trustHistory.entityId, entityId))
|
|
340
|
+
.orderBy(desc(trustHistory.timestamp))
|
|
341
|
+
.limit(100);
|
|
342
|
+
// Apply stepped decay based on inactivity
|
|
343
|
+
const lastActivityAt = record.lastActivityAt ?? record.lastCalculatedAt;
|
|
344
|
+
const daysSinceActivity = this.calculateInactiveDays(lastActivityAt);
|
|
345
|
+
const decayMultiplier = this.calculateDecayMultiplier(daysSinceActivity);
|
|
346
|
+
const baseScore = record.score;
|
|
347
|
+
const decayedScore = this.applyDecay(baseScore, daysSinceActivity);
|
|
348
|
+
const decayApplied = daysSinceActivity > 0;
|
|
349
|
+
// Recalculate level based on decayed score
|
|
350
|
+
const decayedLevel = this.scoreToLevel(decayedScore);
|
|
351
|
+
logger.debug({
|
|
352
|
+
entityId,
|
|
353
|
+
baseScore,
|
|
354
|
+
decayedScore,
|
|
355
|
+
daysSinceActivity,
|
|
356
|
+
decayMultiplier,
|
|
357
|
+
}, 'Decay applied to trust score');
|
|
358
|
+
// Build factor scores from domain signals (or defaults if none)
|
|
359
|
+
const domainSignalsList = signals.map((s) => ({
|
|
360
|
+
id: s.id,
|
|
361
|
+
entityId: s.entityId,
|
|
362
|
+
type: s.type,
|
|
363
|
+
value: s.value,
|
|
364
|
+
weight: s.weight,
|
|
365
|
+
source: s.source ?? '',
|
|
366
|
+
metadata: s.metadata ?? {},
|
|
367
|
+
timestamp: s.timestamp.toISOString(),
|
|
368
|
+
}));
|
|
369
|
+
const factorScores = domainSignalsList.length > 0
|
|
370
|
+
? this.calculateFactorScores(domainSignalsList)
|
|
371
|
+
: this.initialFactorScores();
|
|
372
|
+
return {
|
|
373
|
+
entityId: record.entityId,
|
|
374
|
+
score: decayedScore,
|
|
375
|
+
level: decayedLevel,
|
|
376
|
+
components: {
|
|
377
|
+
behavioral: record.behavioralScore,
|
|
378
|
+
compliance: record.complianceScore,
|
|
379
|
+
identity: record.identityScore,
|
|
380
|
+
context: record.contextScore,
|
|
381
|
+
},
|
|
382
|
+
factorScores,
|
|
383
|
+
signals: domainSignalsList,
|
|
384
|
+
lastCalculatedAt: record.lastCalculatedAt.toISOString(),
|
|
385
|
+
lastActivityAt: lastActivityAt.toISOString(),
|
|
386
|
+
history: history.map((h) => ({
|
|
387
|
+
score: h.score,
|
|
388
|
+
level: parseInt(h.level),
|
|
389
|
+
reason: h.reason,
|
|
390
|
+
timestamp: h.timestamp.toISOString(),
|
|
391
|
+
})),
|
|
392
|
+
// Decay information
|
|
393
|
+
decayApplied,
|
|
394
|
+
decayMultiplier,
|
|
395
|
+
baseScore,
|
|
396
|
+
nextMilestone: this.getNextMilestone(daysSinceActivity),
|
|
397
|
+
};
|
|
398
|
+
}
|
|
399
|
+
catch (error) {
|
|
400
|
+
if (isVorionError(error)) {
|
|
401
|
+
throw error;
|
|
402
|
+
}
|
|
403
|
+
logger.error({ error, entityId }, 'Failed to get trust score');
|
|
404
|
+
throw new TrustEngineError(`Failed to get trust score: ${error instanceof Error ? error.message : 'Unknown error'}`, 'getScore', entityId);
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
/**
|
|
408
|
+
* Record a trust signal
|
|
409
|
+
*
|
|
410
|
+
* SECURITY: Requires TenantContext for multi-tenant isolation.
|
|
411
|
+
* TenantContext can only be created from validated JWT tokens.
|
|
412
|
+
*
|
|
413
|
+
* @param signal - The trust signal to record
|
|
414
|
+
* @param ctx - Validated tenant context from JWT (REQUIRED for security)
|
|
415
|
+
*/
|
|
416
|
+
async recordSignal(signal, ctx) {
|
|
417
|
+
const tenantId = extractTenantId(ctx);
|
|
418
|
+
try {
|
|
419
|
+
const db = await this.ensureInitialized();
|
|
420
|
+
// SECURITY: Always validate tenant ownership
|
|
421
|
+
await this.validateTenantOwnership(signal.entityId, tenantId);
|
|
422
|
+
// Insert the signal
|
|
423
|
+
const newSignal = {
|
|
424
|
+
entityId: signal.entityId,
|
|
425
|
+
type: signal.type,
|
|
426
|
+
value: signal.value,
|
|
427
|
+
weight: signal.weight ?? 1.0,
|
|
428
|
+
source: signal.source ?? null,
|
|
429
|
+
metadata: signal.metadata ?? null,
|
|
430
|
+
timestamp: signal.timestamp ? new Date(signal.timestamp) : new Date(),
|
|
431
|
+
};
|
|
432
|
+
const [insertedSignal] = await db
|
|
433
|
+
.insert(trustSignals)
|
|
434
|
+
.values(newSignal)
|
|
435
|
+
.returning();
|
|
436
|
+
// Get or create trust record
|
|
437
|
+
let record = await db
|
|
438
|
+
.select()
|
|
439
|
+
.from(trustRecords)
|
|
440
|
+
.where(eq(trustRecords.entityId, signal.entityId))
|
|
441
|
+
.limit(1);
|
|
442
|
+
if (record.length === 0) {
|
|
443
|
+
// Create initial record with lastActivityAt for decay tracking
|
|
444
|
+
const nowDate = new Date();
|
|
445
|
+
const initialRecord = {
|
|
446
|
+
entityId: signal.entityId,
|
|
447
|
+
score: 200,
|
|
448
|
+
level: '1',
|
|
449
|
+
behavioralScore: 0.5,
|
|
450
|
+
complianceScore: 0.5,
|
|
451
|
+
identityScore: 0.5,
|
|
452
|
+
contextScore: 0.5,
|
|
453
|
+
signalCount: 1,
|
|
454
|
+
lastCalculatedAt: nowDate,
|
|
455
|
+
lastActivityAt: nowDate,
|
|
456
|
+
};
|
|
457
|
+
await db.insert(trustRecords).values(initialRecord);
|
|
458
|
+
const newRecord = {
|
|
459
|
+
...initialRecord,
|
|
460
|
+
id: crypto.randomUUID(),
|
|
461
|
+
score: initialRecord.score ?? 200,
|
|
462
|
+
level: initialRecord.level ?? '0',
|
|
463
|
+
behavioralScore: initialRecord.behavioralScore ?? 50,
|
|
464
|
+
complianceScore: initialRecord.complianceScore ?? 50,
|
|
465
|
+
identityScore: initialRecord.identityScore ?? 50,
|
|
466
|
+
contextScore: initialRecord.contextScore ?? 50,
|
|
467
|
+
signalCount: initialRecord.signalCount ?? 0,
|
|
468
|
+
lastCalculatedAt: initialRecord.lastCalculatedAt ?? nowDate,
|
|
469
|
+
createdAt: nowDate,
|
|
470
|
+
updatedAt: nowDate,
|
|
471
|
+
lastActivityAt: nowDate,
|
|
472
|
+
metadata: null,
|
|
473
|
+
};
|
|
474
|
+
record = [newRecord];
|
|
475
|
+
}
|
|
476
|
+
const currentRecord = record[0];
|
|
477
|
+
const previousScore = currentRecord.score;
|
|
478
|
+
const previousLevel = parseInt(currentRecord.level);
|
|
479
|
+
// Recalculate
|
|
480
|
+
const calculation = await this.calculate(signal.entityId, ctx);
|
|
481
|
+
// Update record - reset decay clock with lastActivityAt
|
|
482
|
+
const now = new Date();
|
|
483
|
+
await db
|
|
484
|
+
.update(trustRecords)
|
|
485
|
+
.set({
|
|
486
|
+
score: calculation.score,
|
|
487
|
+
level: calculation.level.toString(),
|
|
488
|
+
behavioralScore: calculation.components.behavioral,
|
|
489
|
+
complianceScore: calculation.components.compliance,
|
|
490
|
+
identityScore: calculation.components.identity,
|
|
491
|
+
contextScore: calculation.components.context,
|
|
492
|
+
signalCount: sql `${trustRecords.signalCount} + 1`,
|
|
493
|
+
lastCalculatedAt: now,
|
|
494
|
+
lastActivityAt: now, // Reset decay clock on trust-positive activity
|
|
495
|
+
updatedAt: now,
|
|
496
|
+
})
|
|
497
|
+
.where(eq(trustRecords.entityId, signal.entityId));
|
|
498
|
+
// Record history if significant change
|
|
499
|
+
if (Math.abs(calculation.score - previousScore) >= 10) {
|
|
500
|
+
const historyEntry = {
|
|
501
|
+
entityId: signal.entityId,
|
|
502
|
+
score: calculation.score,
|
|
503
|
+
previousScore,
|
|
504
|
+
level: calculation.level.toString(),
|
|
505
|
+
previousLevel: previousLevel.toString(),
|
|
506
|
+
reason: `Signal: ${signal.type}`,
|
|
507
|
+
signalId: insertedSignal?.id,
|
|
508
|
+
timestamp: new Date(),
|
|
509
|
+
};
|
|
510
|
+
await db.insert(trustHistory).values(historyEntry);
|
|
511
|
+
}
|
|
512
|
+
// Record metrics for signal recording
|
|
513
|
+
trustSignalsRecordedTotal.inc({
|
|
514
|
+
signal_type: signal.type,
|
|
515
|
+
tenant_id: tenantId,
|
|
516
|
+
});
|
|
517
|
+
logger.debug({
|
|
518
|
+
entityId: signal.entityId,
|
|
519
|
+
signalType: signal.type,
|
|
520
|
+
newScore: calculation.score,
|
|
521
|
+
}, 'Signal recorded');
|
|
522
|
+
}
|
|
523
|
+
catch (error) {
|
|
524
|
+
if (isVorionError(error)) {
|
|
525
|
+
throw error;
|
|
526
|
+
}
|
|
527
|
+
logger.error({ error, entityId: signal.entityId, signalType: signal.type }, 'Failed to record trust signal');
|
|
528
|
+
throw new TrustEngineError(`Failed to record trust signal: ${error instanceof Error ? error.message : 'Unknown error'}`, 'recordSignal', signal.entityId, { signalType: signal.type });
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
/**
|
|
532
|
+
* Get trust history for an entity
|
|
533
|
+
*
|
|
534
|
+
* SECURITY: Requires TenantContext for multi-tenant isolation.
|
|
535
|
+
* TenantContext can only be created from validated JWT tokens.
|
|
536
|
+
*
|
|
537
|
+
* @param entityId - The entity to get history for
|
|
538
|
+
* @param ctx - Validated tenant context from JWT (REQUIRED for security)
|
|
539
|
+
* @param limit - Maximum number of history entries to return (default: 100)
|
|
540
|
+
*/
|
|
541
|
+
async getHistory(entityId, ctx, limit = 100) {
|
|
542
|
+
const tenantId = extractTenantId(ctx);
|
|
543
|
+
try {
|
|
544
|
+
const db = await this.ensureInitialized();
|
|
545
|
+
// SECURITY: Validate tenant ownership (REQUIRED)
|
|
546
|
+
await this.validateTenantOwnership(entityId, tenantId);
|
|
547
|
+
const history = await db
|
|
548
|
+
.select()
|
|
549
|
+
.from(trustHistory)
|
|
550
|
+
.where(eq(trustHistory.entityId, entityId))
|
|
551
|
+
.orderBy(desc(trustHistory.timestamp))
|
|
552
|
+
.limit(limit);
|
|
553
|
+
return history.map((h) => ({
|
|
554
|
+
score: h.score,
|
|
555
|
+
level: parseInt(h.level),
|
|
556
|
+
reason: h.reason,
|
|
557
|
+
timestamp: h.timestamp.toISOString(),
|
|
558
|
+
}));
|
|
559
|
+
}
|
|
560
|
+
catch (error) {
|
|
561
|
+
if (isVorionError(error)) {
|
|
562
|
+
throw error;
|
|
563
|
+
}
|
|
564
|
+
logger.error({ error, entityId }, 'Failed to get trust history');
|
|
565
|
+
throw new TrustEngineError(`Failed to get trust history: ${error instanceof Error ? error.message : 'Unknown error'}`, 'getHistory', entityId);
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
/**
|
|
569
|
+
* Initialize trust for a new entity
|
|
570
|
+
*
|
|
571
|
+
* SECURITY: Requires TenantContext for multi-tenant isolation.
|
|
572
|
+
* TenantContext can only be created from validated JWT tokens.
|
|
573
|
+
*
|
|
574
|
+
* @param entityId - The entity to initialize
|
|
575
|
+
* @param ctx - Validated tenant context from JWT (REQUIRED for security)
|
|
576
|
+
* @param initialLevel - Initial trust level (default: 1)
|
|
577
|
+
*/
|
|
578
|
+
async initializeEntity(entityId, ctx, initialLevel = 1) {
|
|
579
|
+
const tenantId = extractTenantId(ctx);
|
|
580
|
+
try {
|
|
581
|
+
const db = await this.ensureInitialized();
|
|
582
|
+
// SECURITY: Register entity-tenant association
|
|
583
|
+
this.registerEntityTenant(entityId, tenantId);
|
|
584
|
+
const score = TRUST_THRESHOLDS[initialLevel].min;
|
|
585
|
+
const now = new Date();
|
|
586
|
+
const newRecord = {
|
|
587
|
+
entityId,
|
|
588
|
+
score,
|
|
589
|
+
level: initialLevel.toString(),
|
|
590
|
+
behavioralScore: 0.5,
|
|
591
|
+
complianceScore: 0.5,
|
|
592
|
+
identityScore: 0.5,
|
|
593
|
+
contextScore: 0.5,
|
|
594
|
+
signalCount: 0,
|
|
595
|
+
lastCalculatedAt: now,
|
|
596
|
+
lastActivityAt: now,
|
|
597
|
+
};
|
|
598
|
+
await db.insert(trustRecords).values(newRecord);
|
|
599
|
+
// Record initial history
|
|
600
|
+
const historyEntry = {
|
|
601
|
+
entityId,
|
|
602
|
+
score,
|
|
603
|
+
level: initialLevel.toString(),
|
|
604
|
+
reason: 'Initial registration',
|
|
605
|
+
timestamp: now,
|
|
606
|
+
};
|
|
607
|
+
await db.insert(trustHistory).values(historyEntry);
|
|
608
|
+
logger.info({ entityId, initialLevel }, 'Entity trust initialized');
|
|
609
|
+
return {
|
|
610
|
+
entityId,
|
|
611
|
+
score,
|
|
612
|
+
level: initialLevel,
|
|
613
|
+
components: {
|
|
614
|
+
behavioral: 0.5,
|
|
615
|
+
compliance: 0.5,
|
|
616
|
+
identity: 0.5,
|
|
617
|
+
context: 0.5,
|
|
618
|
+
},
|
|
619
|
+
factorScores: this.initialFactorScores(),
|
|
620
|
+
signals: [],
|
|
621
|
+
lastCalculatedAt: now.toISOString(),
|
|
622
|
+
lastActivityAt: now.toISOString(),
|
|
623
|
+
history: [
|
|
624
|
+
{
|
|
625
|
+
score,
|
|
626
|
+
level: initialLevel,
|
|
627
|
+
reason: 'Initial registration',
|
|
628
|
+
timestamp: now.toISOString(),
|
|
629
|
+
},
|
|
630
|
+
],
|
|
631
|
+
// New entity has no decay
|
|
632
|
+
decayApplied: false,
|
|
633
|
+
decayMultiplier: 1.0,
|
|
634
|
+
baseScore: score,
|
|
635
|
+
nextMilestone: DECAY_MILESTONES[1] ?? null,
|
|
636
|
+
};
|
|
637
|
+
}
|
|
638
|
+
catch (error) {
|
|
639
|
+
if (isVorionError(error)) {
|
|
640
|
+
throw error;
|
|
641
|
+
}
|
|
642
|
+
logger.error({ error, entityId, initialLevel }, 'Failed to initialize entity trust');
|
|
643
|
+
throw new TrustEngineError(`Failed to initialize entity trust: ${error instanceof Error ? error.message : 'Unknown error'}`, 'initializeEntity', entityId, { initialLevel });
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
/**
|
|
647
|
+
* Convert score to trust level
|
|
648
|
+
*/
|
|
649
|
+
scoreToLevel(score) {
|
|
650
|
+
for (const [level, { min, max }] of Object.entries(TRUST_THRESHOLDS)) {
|
|
651
|
+
if (score >= min && score <= max) {
|
|
652
|
+
return parseInt(level);
|
|
653
|
+
}
|
|
654
|
+
}
|
|
655
|
+
return 0;
|
|
656
|
+
}
|
|
657
|
+
/**
|
|
658
|
+
* @deprecated Use calculateFactorScores for 16-factor model. Kept for backwards compatibility.
|
|
659
|
+
* Calculate component scores from signals
|
|
660
|
+
*/
|
|
661
|
+
calculateComponents(signals) {
|
|
662
|
+
// Group signals by type
|
|
663
|
+
const behavioral = signals.filter((s) => s.type.startsWith('behavioral.'));
|
|
664
|
+
const compliance = signals.filter((s) => s.type.startsWith('compliance.'));
|
|
665
|
+
const identity = signals.filter((s) => s.type.startsWith('identity.'));
|
|
666
|
+
const context = signals.filter((s) => s.type.startsWith('context.'));
|
|
667
|
+
return {
|
|
668
|
+
behavioral: this.averageSignalValue(behavioral, 0.5),
|
|
669
|
+
compliance: this.averageSignalValue(compliance, 0.5),
|
|
670
|
+
identity: this.averageSignalValue(identity, 0.5),
|
|
671
|
+
context: this.averageSignalValue(context, 0.5),
|
|
672
|
+
};
|
|
673
|
+
}
|
|
674
|
+
/**
|
|
675
|
+
* Calculate per-factor scores from signals.
|
|
676
|
+
* Signals can use either:
|
|
677
|
+
* - Factor code prefix (e.g. 'CT-COMP.success')
|
|
678
|
+
* - Legacy bucket prefix (e.g. 'behavioral.success') — mapped to factors via SIGNAL_PREFIX_TO_FACTORS
|
|
679
|
+
*/
|
|
680
|
+
calculateFactorScores(signals) {
|
|
681
|
+
const factorSignals = {};
|
|
682
|
+
// Initialize all factors
|
|
683
|
+
for (const code of FACTOR_CODES) {
|
|
684
|
+
factorSignals[code] = [];
|
|
685
|
+
}
|
|
686
|
+
for (const signal of signals) {
|
|
687
|
+
const prefix = signal.type.split('.')[0];
|
|
688
|
+
// Check if it's a direct factor code
|
|
689
|
+
if (FACTOR_CODES.includes(prefix)) {
|
|
690
|
+
factorSignals[prefix].push(signal);
|
|
691
|
+
continue;
|
|
692
|
+
}
|
|
693
|
+
// Check if it's a legacy bucket prefix
|
|
694
|
+
const mappedFactors = SIGNAL_PREFIX_TO_FACTORS[prefix];
|
|
695
|
+
if (mappedFactors) {
|
|
696
|
+
// Distribute signal across mapped factors
|
|
697
|
+
for (const factorCode of mappedFactors) {
|
|
698
|
+
factorSignals[factorCode].push(signal);
|
|
699
|
+
}
|
|
700
|
+
}
|
|
701
|
+
}
|
|
702
|
+
// Calculate average score for each factor
|
|
703
|
+
const scores = {};
|
|
704
|
+
for (const code of FACTOR_CODES) {
|
|
705
|
+
scores[code] = this.averageSignalValue(factorSignals[code], 0.5);
|
|
706
|
+
}
|
|
707
|
+
return scores;
|
|
708
|
+
}
|
|
709
|
+
/**
|
|
710
|
+
* Calculate average signal value with default
|
|
711
|
+
*/
|
|
712
|
+
averageSignalValue(signals, defaultValue) {
|
|
713
|
+
if (signals.length === 0)
|
|
714
|
+
return defaultValue;
|
|
715
|
+
// Weight recent signals more heavily
|
|
716
|
+
const now = Date.now();
|
|
717
|
+
let weightedSum = 0;
|
|
718
|
+
let totalWeight = 0;
|
|
719
|
+
for (const signal of signals) {
|
|
720
|
+
const age = now - new Date(signal.timestamp).getTime();
|
|
721
|
+
const timeWeight = Math.exp(-age / (182 * 24 * 60 * 60 * 1000)); // 182-day half-life
|
|
722
|
+
const signalWeight = signal.weight ?? 1.0;
|
|
723
|
+
const combinedWeight = timeWeight * signalWeight;
|
|
724
|
+
weightedSum += signal.value * combinedWeight;
|
|
725
|
+
totalWeight += combinedWeight;
|
|
726
|
+
}
|
|
727
|
+
return totalWeight > 0 ? weightedSum / totalWeight : defaultValue;
|
|
728
|
+
}
|
|
729
|
+
/**
|
|
730
|
+
* Get significant factors affecting the score
|
|
731
|
+
*/
|
|
732
|
+
getSignificantFactors(components) {
|
|
733
|
+
const factors = [];
|
|
734
|
+
if (components.behavioral < 0.3) {
|
|
735
|
+
factors.push('Low behavioral trust');
|
|
736
|
+
}
|
|
737
|
+
if (components.compliance < 0.3) {
|
|
738
|
+
factors.push('Low compliance score');
|
|
739
|
+
}
|
|
740
|
+
if (components.identity < 0.3) {
|
|
741
|
+
factors.push('Weak identity verification');
|
|
742
|
+
}
|
|
743
|
+
if (components.context < 0.3) {
|
|
744
|
+
factors.push('Unusual context signals');
|
|
745
|
+
}
|
|
746
|
+
return factors;
|
|
747
|
+
}
|
|
748
|
+
/**
|
|
749
|
+
* Create initial factor scores with all 16 factors at 0.5 (neutral)
|
|
750
|
+
*/
|
|
751
|
+
initialFactorScores() {
|
|
752
|
+
const scores = {};
|
|
753
|
+
for (const code of FACTOR_CODES) {
|
|
754
|
+
scores[code] = 0.5;
|
|
755
|
+
}
|
|
756
|
+
return scores;
|
|
757
|
+
}
|
|
758
|
+
/**
|
|
759
|
+
* Calculate decay multiplier based on days since last activity
|
|
760
|
+
*
|
|
761
|
+
* Uses stepped milestones with interpolation for smooth decay.
|
|
762
|
+
* 182-day half-life: after 182 days of inactivity, score is 50% of original.
|
|
763
|
+
*/
|
|
764
|
+
calculateDecayMultiplier(daysSinceLastActivity) {
|
|
765
|
+
// Find the applicable milestone and next milestone
|
|
766
|
+
let applicableMilestone = DECAY_MILESTONES[0];
|
|
767
|
+
let nextMilestone = null;
|
|
768
|
+
for (let i = 0; i < DECAY_MILESTONES.length; i++) {
|
|
769
|
+
if (daysSinceLastActivity >= DECAY_MILESTONES[i].days) {
|
|
770
|
+
applicableMilestone = DECAY_MILESTONES[i];
|
|
771
|
+
nextMilestone = DECAY_MILESTONES[i + 1] ?? null;
|
|
772
|
+
}
|
|
773
|
+
}
|
|
774
|
+
// If beyond final milestone, use final multiplier
|
|
775
|
+
if (!nextMilestone) {
|
|
776
|
+
return applicableMilestone.multiplier;
|
|
777
|
+
}
|
|
778
|
+
// Interpolate between milestones for smooth decay
|
|
779
|
+
const daysIntoMilestone = daysSinceLastActivity - applicableMilestone.days;
|
|
780
|
+
const milestoneDuration = nextMilestone.days - applicableMilestone.days;
|
|
781
|
+
const progress = daysIntoMilestone / milestoneDuration;
|
|
782
|
+
const decayRange = applicableMilestone.multiplier - nextMilestone.multiplier;
|
|
783
|
+
return applicableMilestone.multiplier - decayRange * progress;
|
|
784
|
+
}
|
|
785
|
+
/**
|
|
786
|
+
* Apply decay to a base score
|
|
787
|
+
*/
|
|
788
|
+
applyDecay(baseScore, daysSinceLastActivity) {
|
|
789
|
+
const multiplier = this.calculateDecayMultiplier(daysSinceLastActivity);
|
|
790
|
+
return Math.round(baseScore * multiplier);
|
|
791
|
+
}
|
|
792
|
+
/**
|
|
793
|
+
* Calculate days since last activity from a date
|
|
794
|
+
*/
|
|
795
|
+
calculateInactiveDays(lastActivityAt) {
|
|
796
|
+
const now = Date.now();
|
|
797
|
+
const lastActivity = lastActivityAt.getTime();
|
|
798
|
+
const msPerDay = 24 * 60 * 60 * 1000;
|
|
799
|
+
return Math.floor((now - lastActivity) / msPerDay);
|
|
800
|
+
}
|
|
801
|
+
/**
|
|
802
|
+
* Get the next decay milestone for an entity
|
|
803
|
+
*/
|
|
804
|
+
getNextMilestone(daysSinceLastActivity) {
|
|
805
|
+
for (const milestone of DECAY_MILESTONES) {
|
|
806
|
+
if (milestone.days > daysSinceLastActivity) {
|
|
807
|
+
return milestone;
|
|
808
|
+
}
|
|
809
|
+
}
|
|
810
|
+
return null; // Already at or past final milestone
|
|
811
|
+
}
|
|
812
|
+
// ==========================================================================
|
|
813
|
+
// ACI Integration Methods
|
|
814
|
+
// ==========================================================================
|
|
815
|
+
/**
|
|
816
|
+
* Get trust context with ACI integration
|
|
817
|
+
*
|
|
818
|
+
* Combines ACI identity with attestation-based certification and Vorion
|
|
819
|
+
* runtime layer to produce a complete trust context. The effective tier/score
|
|
820
|
+
* is the minimum of all contributing factors.
|
|
821
|
+
*
|
|
822
|
+
* IMPORTANT: Trust tier comes from attestations, NOT the CAR ID itself.
|
|
823
|
+
* The CAR ID is just an identifier; trust is computed at runtime.
|
|
824
|
+
*
|
|
825
|
+
* @param entityId - The entity to get trust context for
|
|
826
|
+
* @param carId - The CAR ID string for the entity
|
|
827
|
+
* @param attestation - Optional attestation for this entity
|
|
828
|
+
* @returns Complete CAR trust context with effective permissions
|
|
829
|
+
*/
|
|
830
|
+
async getACITrustContext(entityId, carId, ctx, attestation) {
|
|
831
|
+
const parsedACI = parseACI(carId);
|
|
832
|
+
const trustRecord = await this.getScore(entityId, ctx);
|
|
833
|
+
const runtimeScore = trustRecord?.score ?? 200;
|
|
834
|
+
const runtimeTier = scoreToTier(runtimeScore);
|
|
835
|
+
// Get observability and context from entity metadata or config
|
|
836
|
+
const observability = await this.getObservabilityClass(entityId);
|
|
837
|
+
const context = await this.getDeploymentContext(entityId);
|
|
838
|
+
const observabilityCeiling = getObservabilityCeiling(observability);
|
|
839
|
+
const contextPolicyCeiling = getContextCeiling(context);
|
|
840
|
+
// Certification tier comes from attestation, NOT the CAR ID
|
|
841
|
+
const certificationTier = attestation?.certificationTier ?? 0;
|
|
842
|
+
const hasValidAttestation = attestation !== null && attestation !== undefined &&
|
|
843
|
+
attestation.expiresAt > new Date();
|
|
844
|
+
// Build proper CARTrustContext for effective calculations
|
|
845
|
+
const trustContext = {
|
|
846
|
+
car: carId,
|
|
847
|
+
trustScore: runtimeScore,
|
|
848
|
+
trustTier: runtimeTier,
|
|
849
|
+
certificationTier,
|
|
850
|
+
capabilityLevel: parsedACI.level,
|
|
851
|
+
attestations: attestation ? [attestation] : [],
|
|
852
|
+
observabilityCeiling,
|
|
853
|
+
contextPolicyCeiling,
|
|
854
|
+
};
|
|
855
|
+
const effectiveTier = calculateEffectiveTier(trustContext);
|
|
856
|
+
const effectiveScore = calculateEffectiveScore(trustContext);
|
|
857
|
+
logger.debug({
|
|
858
|
+
entityId,
|
|
859
|
+
identity: `${parsedACI.registry}.${parsedACI.organization}.${parsedACI.agentClass}`,
|
|
860
|
+
certificationTier,
|
|
861
|
+
hasValidAttestation,
|
|
862
|
+
runtimeTier,
|
|
863
|
+
observabilityCeiling,
|
|
864
|
+
contextPolicyCeiling,
|
|
865
|
+
effectiveTier,
|
|
866
|
+
effectiveScore,
|
|
867
|
+
}, 'Built ACI trust context');
|
|
868
|
+
return trustContext;
|
|
869
|
+
}
|
|
870
|
+
/**
|
|
871
|
+
* Apply ACI attestation as trust signal
|
|
872
|
+
*
|
|
873
|
+
* Converts an ACI attestation into a trust signal and applies it to
|
|
874
|
+
* the entity's trust record. Also enforces the certification floor -
|
|
875
|
+
* the entity's score cannot fall below their certified tier minimum.
|
|
876
|
+
*
|
|
877
|
+
* @param entityId - The entity to apply attestation to
|
|
878
|
+
* @param attestation - The ACI attestation record
|
|
879
|
+
*/
|
|
880
|
+
async applyAttestation(entityId, attestation, ctx) {
|
|
881
|
+
const signalData = attestationToTrustSignal(attestation);
|
|
882
|
+
// Record the attestation as a trust signal
|
|
883
|
+
await this.recordSignal({
|
|
884
|
+
id: crypto.randomUUID(),
|
|
885
|
+
entityId,
|
|
886
|
+
type: `attestation:${attestation.scope}`,
|
|
887
|
+
value: signalData.score,
|
|
888
|
+
weight: signalData.weight,
|
|
889
|
+
source: signalData.source,
|
|
890
|
+
timestamp: signalData.timestamp.toISOString(),
|
|
891
|
+
}, ctx);
|
|
892
|
+
// Apply floor from certification using a trust context
|
|
893
|
+
const trustRecord = await this.getScore(entityId, ctx);
|
|
894
|
+
if (trustRecord) {
|
|
895
|
+
const runtimeTier = scoreToTier(trustRecord.score);
|
|
896
|
+
const floorContext = {
|
|
897
|
+
car: '',
|
|
898
|
+
trustScore: trustRecord.score,
|
|
899
|
+
trustTier: runtimeTier,
|
|
900
|
+
certificationTier: attestation.certificationTier,
|
|
901
|
+
capabilityLevel: CapabilityLevel.L0_OBSERVE,
|
|
902
|
+
attestations: [attestation],
|
|
903
|
+
};
|
|
904
|
+
const flooredScore = applyACIFloor(floorContext, trustRecord.score);
|
|
905
|
+
if (flooredScore > trustRecord.score) {
|
|
906
|
+
await this.setScore(entityId, flooredScore, 'ACI attestation floor', ctx);
|
|
907
|
+
}
|
|
908
|
+
}
|
|
909
|
+
logger.info({
|
|
910
|
+
entityId,
|
|
911
|
+
attestationId: attestation.id,
|
|
912
|
+
certificationTier: attestation.certificationTier,
|
|
913
|
+
issuer: attestation.issuer,
|
|
914
|
+
}, 'Applied ACI attestation');
|
|
915
|
+
}
|
|
916
|
+
/**
|
|
917
|
+
* Check if action is allowed under effective permission
|
|
918
|
+
*
|
|
919
|
+
* Evaluates whether an entity has sufficient effective trust to perform
|
|
920
|
+
* an action requiring a specific tier and domains.
|
|
921
|
+
*
|
|
922
|
+
* @param entityId - The entity requesting the action
|
|
923
|
+
* @param carId - The entity's CAR ID string
|
|
924
|
+
* @param requiredTier - Minimum tier required for the action
|
|
925
|
+
* @param requiredDomains - Domains required for the action
|
|
926
|
+
* @returns Permission check result with reason if denied
|
|
927
|
+
*/
|
|
928
|
+
async checkEffectivePermission(entityId, carId, tenantCtx, requiredTier, requiredDomains) {
|
|
929
|
+
const aciCtx = await this.getACITrustContext(entityId, carId, tenantCtx);
|
|
930
|
+
const effective = calculateEffectiveFromACI(aciCtx);
|
|
931
|
+
// EffectivePermission uses `level` (CapabilityLevel 0-7)
|
|
932
|
+
const effectiveLevel = effective.level;
|
|
933
|
+
const levelAllowed = effectiveLevel >= requiredTier;
|
|
934
|
+
// Domain check from parsed CAR context
|
|
935
|
+
const parsedCAR = parseCAR(carId);
|
|
936
|
+
const contextDomains = [...(parsedCAR.domains ?? [])];
|
|
937
|
+
const domainsAllowed = requiredDomains.every((d) => contextDomains.includes(d));
|
|
938
|
+
const allowed = levelAllowed && domainsAllowed;
|
|
939
|
+
let reason;
|
|
940
|
+
if (!levelAllowed) {
|
|
941
|
+
reason = `Requires T${requiredTier}, effective level is L${effectiveLevel}`;
|
|
942
|
+
}
|
|
943
|
+
else if (!domainsAllowed) {
|
|
944
|
+
const missingDomains = requiredDomains.filter((d) => !contextDomains.includes(d));
|
|
945
|
+
reason = `Missing required domains: ${missingDomains.join(', ')}`;
|
|
946
|
+
}
|
|
947
|
+
logger.debug({
|
|
948
|
+
entityId,
|
|
949
|
+
requiredTier,
|
|
950
|
+
requiredDomains,
|
|
951
|
+
effectiveLevel,
|
|
952
|
+
certifiedDomains: contextDomains,
|
|
953
|
+
allowed,
|
|
954
|
+
reason,
|
|
955
|
+
constrainingFactor: effective.constrainingFactor,
|
|
956
|
+
}, 'Checked effective permission');
|
|
957
|
+
return {
|
|
958
|
+
allowed,
|
|
959
|
+
effectiveLevel,
|
|
960
|
+
reason,
|
|
961
|
+
};
|
|
962
|
+
}
|
|
963
|
+
/**
|
|
964
|
+
* Set trust score directly with reason
|
|
965
|
+
*
|
|
966
|
+
* Used internally for applying floors and ceilings from ACI.
|
|
967
|
+
*
|
|
968
|
+
* @param entityId - The entity to update
|
|
969
|
+
* @param score - The new trust score
|
|
970
|
+
* @param reason - Reason for the change
|
|
971
|
+
* @param ctx - Validated tenant context from JWT (REQUIRED for security)
|
|
972
|
+
*/
|
|
973
|
+
async setScore(entityId, score, reason, ctx) {
|
|
974
|
+
const db = await this.ensureInitialized();
|
|
975
|
+
const level = this.scoreToLevel(score);
|
|
976
|
+
const now = new Date();
|
|
977
|
+
// Get current record for history
|
|
978
|
+
const current = await db
|
|
979
|
+
.select()
|
|
980
|
+
.from(trustRecords)
|
|
981
|
+
.where(eq(trustRecords.entityId, entityId))
|
|
982
|
+
.limit(1);
|
|
983
|
+
if (current.length === 0) {
|
|
984
|
+
// Entity doesn't exist, create it
|
|
985
|
+
await this.initializeEntity(entityId, ctx, level);
|
|
986
|
+
return;
|
|
987
|
+
}
|
|
988
|
+
const previousScore = current[0].score;
|
|
989
|
+
const previousLevel = parseInt(current[0].level);
|
|
990
|
+
// Update record
|
|
991
|
+
await db
|
|
992
|
+
.update(trustRecords)
|
|
993
|
+
.set({
|
|
994
|
+
score,
|
|
995
|
+
level: level.toString(),
|
|
996
|
+
lastCalculatedAt: now,
|
|
997
|
+
updatedAt: now,
|
|
998
|
+
})
|
|
999
|
+
.where(eq(trustRecords.entityId, entityId));
|
|
1000
|
+
// Record history
|
|
1001
|
+
const historyEntry = {
|
|
1002
|
+
entityId,
|
|
1003
|
+
score,
|
|
1004
|
+
previousScore,
|
|
1005
|
+
level: level.toString(),
|
|
1006
|
+
previousLevel: previousLevel.toString(),
|
|
1007
|
+
reason,
|
|
1008
|
+
timestamp: now,
|
|
1009
|
+
};
|
|
1010
|
+
await db.insert(trustHistory).values(historyEntry);
|
|
1011
|
+
logger.info({ entityId, previousScore, newScore: score, reason }, 'Trust score updated');
|
|
1012
|
+
}
|
|
1013
|
+
/**
|
|
1014
|
+
* Get observability class for an entity
|
|
1015
|
+
*
|
|
1016
|
+
* Retrieves or determines the observability class from entity metadata.
|
|
1017
|
+
*
|
|
1018
|
+
* @param entityId - The entity to check
|
|
1019
|
+
* @returns The entity's observability class
|
|
1020
|
+
*/
|
|
1021
|
+
async getObservabilityClass(entityId) {
|
|
1022
|
+
const db = await this.ensureInitialized();
|
|
1023
|
+
// Try to get from entity metadata stored in trust_records
|
|
1024
|
+
const record = await db
|
|
1025
|
+
.select()
|
|
1026
|
+
.from(trustRecords)
|
|
1027
|
+
.where(eq(trustRecords.entityId, entityId))
|
|
1028
|
+
.limit(1);
|
|
1029
|
+
if (record.length > 0) {
|
|
1030
|
+
const rawMetadata = record[0].metadata;
|
|
1031
|
+
if (rawMetadata) {
|
|
1032
|
+
// Convert JSONB stored metadata to ObservabilityMetadata type
|
|
1033
|
+
// The database stores dates as ISO strings, so convert if present
|
|
1034
|
+
const metadata = {
|
|
1035
|
+
class: rawMetadata.observabilityClass,
|
|
1036
|
+
attestationProvider: rawMetadata.attestationProvider,
|
|
1037
|
+
verificationProof: rawMetadata.verificationProof,
|
|
1038
|
+
sourceCodeUrl: rawMetadata.sourceCodeUrl,
|
|
1039
|
+
lastAuditDate: rawMetadata.lastAuditDate
|
|
1040
|
+
? new Date(rawMetadata.lastAuditDate)
|
|
1041
|
+
: undefined,
|
|
1042
|
+
};
|
|
1043
|
+
// Use determineObservabilityClass to infer from metadata
|
|
1044
|
+
return determineObservabilityClass(metadata);
|
|
1045
|
+
}
|
|
1046
|
+
}
|
|
1047
|
+
// Default to most restrictive if unknown
|
|
1048
|
+
return ObservabilityClass.BLACK_BOX;
|
|
1049
|
+
}
|
|
1050
|
+
/**
|
|
1051
|
+
* Set observability metadata for an entity
|
|
1052
|
+
*
|
|
1053
|
+
* Updates the trust record with observability information that determines
|
|
1054
|
+
* the entity's trust ceiling.
|
|
1055
|
+
*
|
|
1056
|
+
* @param entityId - The entity to update
|
|
1057
|
+
* @param metadata - Observability metadata (class, attestation info, etc.)
|
|
1058
|
+
* @returns True if update was successful
|
|
1059
|
+
*/
|
|
1060
|
+
async setObservabilityMetadata(entityId, metadata) {
|
|
1061
|
+
const db = await this.ensureInitialized();
|
|
1062
|
+
// Convert ObservabilityMetadata to JSONB-compatible format
|
|
1063
|
+
// Dates must be stored as ISO strings in JSONB
|
|
1064
|
+
const jsonbMetadata = {
|
|
1065
|
+
observabilityClass: metadata.class,
|
|
1066
|
+
attestationProvider: metadata.attestationProvider,
|
|
1067
|
+
verificationProof: metadata.verificationProof,
|
|
1068
|
+
sourceCodeUrl: metadata.sourceCodeUrl,
|
|
1069
|
+
lastAuditDate: metadata.lastAuditDate?.toISOString(),
|
|
1070
|
+
};
|
|
1071
|
+
try {
|
|
1072
|
+
// Try to update existing record
|
|
1073
|
+
const result = await db
|
|
1074
|
+
.update(trustRecords)
|
|
1075
|
+
.set({
|
|
1076
|
+
metadata: jsonbMetadata,
|
|
1077
|
+
updatedAt: new Date(),
|
|
1078
|
+
})
|
|
1079
|
+
.where(eq(trustRecords.entityId, entityId));
|
|
1080
|
+
if (result.rowCount === 0) {
|
|
1081
|
+
// No existing record, create one with default values
|
|
1082
|
+
await db.insert(trustRecords).values({
|
|
1083
|
+
entityId,
|
|
1084
|
+
score: 200, // Default score for new entities
|
|
1085
|
+
level: '1', // Supervised level
|
|
1086
|
+
metadata: jsonbMetadata,
|
|
1087
|
+
});
|
|
1088
|
+
}
|
|
1089
|
+
logger.info({
|
|
1090
|
+
entityId,
|
|
1091
|
+
observabilityClass: metadata.class,
|
|
1092
|
+
hasAttestation: !!metadata.attestationProvider,
|
|
1093
|
+
hasVerification: !!metadata.verificationProof,
|
|
1094
|
+
}, 'Updated observability metadata for entity');
|
|
1095
|
+
return true;
|
|
1096
|
+
}
|
|
1097
|
+
catch (error) {
|
|
1098
|
+
logger.error({
|
|
1099
|
+
entityId,
|
|
1100
|
+
error: error instanceof Error ? error.message : String(error),
|
|
1101
|
+
}, 'Failed to update observability metadata');
|
|
1102
|
+
return false;
|
|
1103
|
+
}
|
|
1104
|
+
}
|
|
1105
|
+
/**
|
|
1106
|
+
* Get full observability metadata for an entity
|
|
1107
|
+
*
|
|
1108
|
+
* @param entityId - The entity to query
|
|
1109
|
+
* @returns The observability metadata or undefined if not set
|
|
1110
|
+
*/
|
|
1111
|
+
async getObservabilityMetadata(entityId) {
|
|
1112
|
+
const db = await this.ensureInitialized();
|
|
1113
|
+
const record = await db
|
|
1114
|
+
.select({ metadata: trustRecords.metadata })
|
|
1115
|
+
.from(trustRecords)
|
|
1116
|
+
.where(eq(trustRecords.entityId, entityId))
|
|
1117
|
+
.limit(1);
|
|
1118
|
+
if (record.length > 0 && record[0].metadata) {
|
|
1119
|
+
const rawMetadata = record[0].metadata;
|
|
1120
|
+
// Convert JSONB stored metadata to ObservabilityMetadata type
|
|
1121
|
+
// The database stores dates as ISO strings, so convert if present
|
|
1122
|
+
return {
|
|
1123
|
+
class: rawMetadata.observabilityClass ?? ObservabilityClass.BLACK_BOX,
|
|
1124
|
+
attestationProvider: rawMetadata.attestationProvider,
|
|
1125
|
+
verificationProof: rawMetadata.verificationProof,
|
|
1126
|
+
sourceCodeUrl: rawMetadata.sourceCodeUrl,
|
|
1127
|
+
lastAuditDate: rawMetadata.lastAuditDate
|
|
1128
|
+
? new Date(rawMetadata.lastAuditDate)
|
|
1129
|
+
: undefined,
|
|
1130
|
+
};
|
|
1131
|
+
}
|
|
1132
|
+
return undefined;
|
|
1133
|
+
}
|
|
1134
|
+
/**
|
|
1135
|
+
* Get deployment context for an entity
|
|
1136
|
+
*
|
|
1137
|
+
* Retrieves or determines the deployment context for trust calculations.
|
|
1138
|
+
*
|
|
1139
|
+
* @param entityId - The entity to check (may have context override)
|
|
1140
|
+
* @returns The applicable deployment context
|
|
1141
|
+
*/
|
|
1142
|
+
async getDeploymentContext(_entityId) {
|
|
1143
|
+
// First check for entity-specific context override
|
|
1144
|
+
// (could be stored in entity metadata or configuration)
|
|
1145
|
+
// For now, detect from environment
|
|
1146
|
+
return detectDeploymentContext();
|
|
1147
|
+
}
|
|
1148
|
+
}
|
|
1149
|
+
/**
|
|
1150
|
+
* Create a new Trust Engine instance with dependency injection.
|
|
1151
|
+
*
|
|
1152
|
+
* This is the preferred way to create trust engines in production code
|
|
1153
|
+
* as it makes dependencies explicit and testable.
|
|
1154
|
+
*
|
|
1155
|
+
* @param deps - Optional dependencies. If database provided, skips lazy init.
|
|
1156
|
+
* @returns Configured TrustEngine instance
|
|
1157
|
+
*
|
|
1158
|
+
* @example
|
|
1159
|
+
* // Default usage (lazy initialization)
|
|
1160
|
+
* const engine = createTrustEngine();
|
|
1161
|
+
* await engine.initialize();
|
|
1162
|
+
*
|
|
1163
|
+
* @example
|
|
1164
|
+
* // With custom dependencies (pre-initialized)
|
|
1165
|
+
* const engine = createTrustEngine({ database: customDb });
|
|
1166
|
+
*/
|
|
1167
|
+
export function createTrustEngine(deps = {}) {
|
|
1168
|
+
return new TrustEngine(deps);
|
|
1169
|
+
}
|
|
1170
|
+
// ============================================================================
|
|
1171
|
+
// Standalone decay functions (exported for unit testing)
|
|
1172
|
+
// ============================================================================
|
|
1173
|
+
/**
|
|
1174
|
+
* Calculate decay multiplier based on days since last activity
|
|
1175
|
+
*
|
|
1176
|
+
* Uses stepped milestones with linear interpolation for smooth decay.
|
|
1177
|
+
*
|
|
1178
|
+
* @param daysSinceLastActivity - Number of days since last trust-positive activity
|
|
1179
|
+
* @returns Decay multiplier between 0.5 and 1.0
|
|
1180
|
+
*/
|
|
1181
|
+
export function calculateDecayMultiplier(daysSinceLastActivity) {
|
|
1182
|
+
// Find the applicable milestone and next milestone
|
|
1183
|
+
let applicableMilestone = DECAY_MILESTONES[0];
|
|
1184
|
+
let nextMilestone = null;
|
|
1185
|
+
for (let i = 0; i < DECAY_MILESTONES.length; i++) {
|
|
1186
|
+
if (daysSinceLastActivity >= DECAY_MILESTONES[i].days) {
|
|
1187
|
+
applicableMilestone = DECAY_MILESTONES[i];
|
|
1188
|
+
nextMilestone = DECAY_MILESTONES[i + 1] ?? null;
|
|
1189
|
+
}
|
|
1190
|
+
}
|
|
1191
|
+
// If beyond final milestone, use final multiplier
|
|
1192
|
+
if (!nextMilestone) {
|
|
1193
|
+
return applicableMilestone.multiplier;
|
|
1194
|
+
}
|
|
1195
|
+
// Interpolate between milestones for smooth decay
|
|
1196
|
+
const daysIntoMilestone = daysSinceLastActivity - applicableMilestone.days;
|
|
1197
|
+
const milestoneDuration = nextMilestone.days - applicableMilestone.days;
|
|
1198
|
+
const progress = daysIntoMilestone / milestoneDuration;
|
|
1199
|
+
const decayRange = applicableMilestone.multiplier - nextMilestone.multiplier;
|
|
1200
|
+
return applicableMilestone.multiplier - decayRange * progress;
|
|
1201
|
+
}
|
|
1202
|
+
/**
|
|
1203
|
+
* Apply decay multiplier to a base score
|
|
1204
|
+
*
|
|
1205
|
+
* @param baseScore - The undecayed trust score
|
|
1206
|
+
* @param daysSinceLastActivity - Number of days since last activity
|
|
1207
|
+
* @returns Decayed score (rounded to nearest integer)
|
|
1208
|
+
*/
|
|
1209
|
+
export function applyDecay(baseScore, daysSinceLastActivity) {
|
|
1210
|
+
const multiplier = calculateDecayMultiplier(daysSinceLastActivity);
|
|
1211
|
+
return Math.round(baseScore * multiplier);
|
|
1212
|
+
}
|
|
1213
|
+
/**
|
|
1214
|
+
* Get the next decay milestone for a given number of inactive days
|
|
1215
|
+
*
|
|
1216
|
+
* @param daysSinceLastActivity - Current days of inactivity
|
|
1217
|
+
* @returns Next milestone or null if past final milestone
|
|
1218
|
+
*/
|
|
1219
|
+
export function getNextDecayMilestone(daysSinceLastActivity) {
|
|
1220
|
+
for (const milestone of DECAY_MILESTONES) {
|
|
1221
|
+
if (milestone.days > daysSinceLastActivity) {
|
|
1222
|
+
return milestone;
|
|
1223
|
+
}
|
|
1224
|
+
}
|
|
1225
|
+
return null;
|
|
1226
|
+
}
|
|
1227
|
+
export { parseCAR };
|
|
1228
|
+
export { parseACI };
|
|
1229
|
+
// CAR functions (primary) with backwards-compatible ACI aliases
|
|
1230
|
+
export { AttestationSchema,
|
|
1231
|
+
// CAR functions (primary)
|
|
1232
|
+
calculateEffectiveFromCAR, applyCARFloor, enforceCARCeiling, createCARTrustContext,
|
|
1233
|
+
// Backwards-compatible ACI aliases
|
|
1234
|
+
calculateEffectiveFromACI, applyACIFloor, enforceACICeiling, createACITrustContext,
|
|
1235
|
+
// Common functions
|
|
1236
|
+
attestationToTrustSignal, calculateEffectiveTier, calculateEffectiveScore, scoreToTier, certificationTierToMinScore, certificationTierToMaxScore, certificationTierToScore, tierToMinScore, competenceLevelToCeiling, determineCeilingReason, lookupCertificationTier, } from './car-integration.js';
|
|
1237
|
+
// Re-export from observability.ts
|
|
1238
|
+
export { ObservabilityClass, OBSERVABILITY_CEILINGS, OBSERVABILITY_CLASS_NAMES, ObservabilityClassSchema, ObservabilityMetadataSchema, getObservabilityCeiling, getObservabilityMaxScore, applyObservabilityCeiling, isTierAllowedForObservability, getRequiredObservabilityForTier, determineObservabilityClass, describeObservabilityConstraints, } from './observability.js';
|
|
1239
|
+
// Re-export from context.ts
|
|
1240
|
+
export { DeploymentContext, CONTEXT_CEILINGS, CONTEXT_NAMES, DeploymentContextSchema, ContextConfigSchema, getContextCeiling, getContextMaxScore, applyContextCeiling, requiresHumanApproval, requiresAttestation, evaluateContextPolicy, describeContextConstraints, detectDeploymentContext, } from './context.js';
|
|
1241
|
+
//# sourceMappingURL=index.js.map
|