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