@vorionsys/platform-core 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +190 -0
- package/README.md +88 -0
- package/dist/a2a/attestation.d.ts +145 -0
- package/dist/a2a/attestation.d.ts.map +1 -0
- package/dist/a2a/attestation.js +353 -0
- package/dist/a2a/attestation.js.map +1 -0
- package/dist/a2a/chain-of-trust.d.ts +143 -0
- package/dist/a2a/chain-of-trust.d.ts.map +1 -0
- package/dist/a2a/chain-of-trust.js +422 -0
- package/dist/a2a/chain-of-trust.js.map +1 -0
- package/dist/a2a/index.d.ts +15 -0
- package/dist/a2a/index.d.ts.map +1 -0
- package/dist/a2a/index.js +23 -0
- package/dist/a2a/index.js.map +1 -0
- package/dist/a2a/openapi.d.ts +22 -0
- package/dist/a2a/openapi.d.ts.map +1 -0
- package/dist/a2a/openapi.js +1133 -0
- package/dist/a2a/openapi.js.map +1 -0
- package/dist/a2a/router.d.ts +167 -0
- package/dist/a2a/router.d.ts.map +1 -0
- package/dist/a2a/router.js +454 -0
- package/dist/a2a/router.js.map +1 -0
- package/dist/a2a/routes.d.ts +11 -0
- package/dist/a2a/routes.d.ts.map +1 -0
- package/dist/a2a/routes.js +442 -0
- package/dist/a2a/routes.js.map +1 -0
- package/dist/a2a/trust-negotiation.d.ts +119 -0
- package/dist/a2a/trust-negotiation.d.ts.map +1 -0
- package/dist/a2a/trust-negotiation.js +425 -0
- package/dist/a2a/trust-negotiation.js.map +1 -0
- package/dist/a2a/types.d.ts +413 -0
- package/dist/a2a/types.d.ts.map +1 -0
- package/dist/a2a/types.js +38 -0
- package/dist/a2a/types.js.map +1 -0
- package/dist/agent-registry/a3i-cache.d.ts +113 -0
- package/dist/agent-registry/a3i-cache.d.ts.map +1 -0
- package/dist/agent-registry/a3i-cache.js +305 -0
- package/dist/agent-registry/a3i-cache.js.map +1 -0
- package/dist/agent-registry/index.d.ts +14 -0
- package/dist/agent-registry/index.d.ts.map +1 -0
- package/dist/agent-registry/index.js +17 -0
- package/dist/agent-registry/index.js.map +1 -0
- package/dist/agent-registry/openapi.d.ts +23 -0
- package/dist/agent-registry/openapi.d.ts.map +1 -0
- package/dist/agent-registry/openapi.js +1377 -0
- package/dist/agent-registry/openapi.js.map +1 -0
- package/dist/agent-registry/routes.d.ts +10 -0
- package/dist/agent-registry/routes.d.ts.map +1 -0
- package/dist/agent-registry/routes.js +485 -0
- package/dist/agent-registry/routes.js.map +1 -0
- package/dist/agent-registry/service.d.ts +159 -0
- package/dist/agent-registry/service.d.ts.map +1 -0
- package/dist/agent-registry/service.js +652 -0
- package/dist/agent-registry/service.js.map +1 -0
- package/dist/agent-registry/tenant-service.d.ts +104 -0
- package/dist/agent-registry/tenant-service.d.ts.map +1 -0
- package/dist/agent-registry/tenant-service.js +313 -0
- package/dist/agent-registry/tenant-service.js.map +1 -0
- package/dist/api/auth.d.ts +55 -0
- package/dist/api/auth.d.ts.map +1 -0
- package/dist/api/auth.js +322 -0
- package/dist/api/auth.js.map +1 -0
- package/dist/api/errors.d.ts +146 -0
- package/dist/api/errors.d.ts.map +1 -0
- package/dist/api/errors.js +464 -0
- package/dist/api/errors.js.map +1 -0
- package/dist/api/index.d.ts +15 -0
- package/dist/api/index.d.ts.map +1 -0
- package/dist/api/index.js +19 -0
- package/dist/api/index.js.map +1 -0
- package/dist/api/middleware/api-key-enforcement.d.ts +131 -0
- package/dist/api/middleware/api-key-enforcement.d.ts.map +1 -0
- package/dist/api/middleware/api-key-enforcement.js +674 -0
- package/dist/api/middleware/api-key-enforcement.js.map +1 -0
- package/dist/api/middleware/audit.d.ts +151 -0
- package/dist/api/middleware/audit.d.ts.map +1 -0
- package/dist/api/middleware/audit.js +384 -0
- package/dist/api/middleware/audit.js.map +1 -0
- package/dist/api/middleware/dpop-enforcement.d.ts +176 -0
- package/dist/api/middleware/dpop-enforcement.d.ts.map +1 -0
- package/dist/api/middleware/dpop-enforcement.js +596 -0
- package/dist/api/middleware/dpop-enforcement.js.map +1 -0
- package/dist/api/middleware/index.d.ts +24 -0
- package/dist/api/middleware/index.d.ts.map +1 -0
- package/dist/api/middleware/index.js +43 -0
- package/dist/api/middleware/index.js.map +1 -0
- package/dist/api/middleware/metrics.d.ts +41 -0
- package/dist/api/middleware/metrics.d.ts.map +1 -0
- package/dist/api/middleware/metrics.js +150 -0
- package/dist/api/middleware/metrics.js.map +1 -0
- package/dist/api/middleware/rate-limits.d.ts +224 -0
- package/dist/api/middleware/rate-limits.d.ts.map +1 -0
- package/dist/api/middleware/rate-limits.js +686 -0
- package/dist/api/middleware/rate-limits.js.map +1 -0
- package/dist/api/middleware/rateLimit.d.ts +165 -0
- package/dist/api/middleware/rateLimit.d.ts.map +1 -0
- package/dist/api/middleware/rateLimit.js +477 -0
- package/dist/api/middleware/rateLimit.js.map +1 -0
- package/dist/api/middleware/redis-rate-limiter.d.ts +279 -0
- package/dist/api/middleware/redis-rate-limiter.d.ts.map +1 -0
- package/dist/api/middleware/redis-rate-limiter.js +1074 -0
- package/dist/api/middleware/redis-rate-limiter.js.map +1 -0
- package/dist/api/middleware/security-headers.d.ts +248 -0
- package/dist/api/middleware/security-headers.d.ts.map +1 -0
- package/dist/api/middleware/security-headers.js +410 -0
- package/dist/api/middleware/security-headers.js.map +1 -0
- package/dist/api/middleware/security.d.ts +156 -0
- package/dist/api/middleware/security.d.ts.map +1 -0
- package/dist/api/middleware/security.js +412 -0
- package/dist/api/middleware/security.js.map +1 -0
- package/dist/api/middleware/validation.d.ts +132 -0
- package/dist/api/middleware/validation.d.ts.map +1 -0
- package/dist/api/middleware/validation.js +363 -0
- package/dist/api/middleware/validation.js.map +1 -0
- package/dist/api/middleware/webhook-verify.d.ts +130 -0
- package/dist/api/middleware/webhook-verify.d.ts.map +1 -0
- package/dist/api/middleware/webhook-verify.js +366 -0
- package/dist/api/middleware/webhook-verify.js.map +1 -0
- package/dist/api/rate-limit.d.ts +115 -0
- package/dist/api/rate-limit.d.ts.map +1 -0
- package/dist/api/rate-limit.js +335 -0
- package/dist/api/rate-limit.js.map +1 -0
- package/dist/api/server.d.ts +37 -0
- package/dist/api/server.d.ts.map +1 -0
- package/dist/api/server.js +2086 -0
- package/dist/api/server.js.map +1 -0
- package/dist/api/validation.d.ts +243 -0
- package/dist/api/validation.d.ts.map +1 -0
- package/dist/api/validation.js +247 -0
- package/dist/api/validation.js.map +1 -0
- package/dist/audit/compliance-reporter.d.ts +271 -0
- package/dist/audit/compliance-reporter.d.ts.map +1 -0
- package/dist/audit/compliance-reporter.js +587 -0
- package/dist/audit/compliance-reporter.js.map +1 -0
- package/dist/audit/db-store.d.ts +689 -0
- package/dist/audit/db-store.d.ts.map +1 -0
- package/dist/audit/db-store.js +589 -0
- package/dist/audit/db-store.js.map +1 -0
- package/dist/audit/event-schema.d.ts +605 -0
- package/dist/audit/event-schema.d.ts.map +1 -0
- package/dist/audit/event-schema.js +566 -0
- package/dist/audit/event-schema.js.map +1 -0
- package/dist/audit/index.d.ts +16 -0
- package/dist/audit/index.d.ts.map +1 -0
- package/dist/audit/index.js +44 -0
- package/dist/audit/index.js.map +1 -0
- package/dist/audit/security-events.d.ts +1624 -0
- package/dist/audit/security-events.d.ts.map +1 -0
- package/dist/audit/security-events.js +775 -0
- package/dist/audit/security-events.js.map +1 -0
- package/dist/audit/security-logger.d.ts +288 -0
- package/dist/audit/security-logger.d.ts.map +1 -0
- package/dist/audit/security-logger.js +820 -0
- package/dist/audit/security-logger.js.map +1 -0
- package/dist/audit/service.d.ts +206 -0
- package/dist/audit/service.d.ts.map +1 -0
- package/dist/audit/service.js +756 -0
- package/dist/audit/service.js.map +1 -0
- package/dist/audit/siem/elastic.d.ts +94 -0
- package/dist/audit/siem/elastic.d.ts.map +1 -0
- package/dist/audit/siem/elastic.js +412 -0
- package/dist/audit/siem/elastic.js.map +1 -0
- package/dist/audit/siem/index.d.ts +179 -0
- package/dist/audit/siem/index.d.ts.map +1 -0
- package/dist/audit/siem/index.js +368 -0
- package/dist/audit/siem/index.js.map +1 -0
- package/dist/audit/siem/loki.d.ts +100 -0
- package/dist/audit/siem/loki.d.ts.map +1 -0
- package/dist/audit/siem/loki.js +406 -0
- package/dist/audit/siem/loki.js.map +1 -0
- package/dist/audit/siem/splunk.d.ts +91 -0
- package/dist/audit/siem/splunk.d.ts.map +1 -0
- package/dist/audit/siem/splunk.js +375 -0
- package/dist/audit/siem/splunk.js.map +1 -0
- package/dist/audit/siem/types.d.ts +547 -0
- package/dist/audit/siem/types.d.ts.map +1 -0
- package/dist/audit/siem/types.js +270 -0
- package/dist/audit/siem/types.js.map +1 -0
- package/dist/audit/types.d.ts +410 -0
- package/dist/audit/types.d.ts.map +1 -0
- package/dist/audit/types.js +130 -0
- package/dist/audit/types.js.map +1 -0
- package/dist/auth/index.d.ts +10 -0
- package/dist/auth/index.d.ts.map +1 -0
- package/dist/auth/index.js +10 -0
- package/dist/auth/index.js.map +1 -0
- package/dist/auth/mfa/index.d.ts +9 -0
- package/dist/auth/mfa/index.d.ts.map +1 -0
- package/dist/auth/mfa/index.js +9 -0
- package/dist/auth/mfa/index.js.map +1 -0
- package/dist/auth/mfa/totp.d.ts +222 -0
- package/dist/auth/mfa/totp.d.ts.map +1 -0
- package/dist/auth/mfa/totp.js +329 -0
- package/dist/auth/mfa/totp.js.map +1 -0
- package/dist/auth/piv-cac/card-removal-handler.d.ts +197 -0
- package/dist/auth/piv-cac/card-removal-handler.d.ts.map +1 -0
- package/dist/auth/piv-cac/card-removal-handler.js +560 -0
- package/dist/auth/piv-cac/card-removal-handler.js.map +1 -0
- package/dist/auth/piv-cac/certificate-auth.d.ts +117 -0
- package/dist/auth/piv-cac/certificate-auth.d.ts.map +1 -0
- package/dist/auth/piv-cac/certificate-auth.js +727 -0
- package/dist/auth/piv-cac/certificate-auth.js.map +1 -0
- package/dist/auth/piv-cac/certificate-mapper.d.ts +141 -0
- package/dist/auth/piv-cac/certificate-mapper.d.ts.map +1 -0
- package/dist/auth/piv-cac/certificate-mapper.js +569 -0
- package/dist/auth/piv-cac/certificate-mapper.js.map +1 -0
- package/dist/auth/piv-cac/crl-validator.d.ts +195 -0
- package/dist/auth/piv-cac/crl-validator.d.ts.map +1 -0
- package/dist/auth/piv-cac/crl-validator.js +824 -0
- package/dist/auth/piv-cac/crl-validator.js.map +1 -0
- package/dist/auth/piv-cac/index.d.ts +72 -0
- package/dist/auth/piv-cac/index.d.ts.map +1 -0
- package/dist/auth/piv-cac/index.js +172 -0
- package/dist/auth/piv-cac/index.js.map +1 -0
- package/dist/auth/piv-cac/ocsp-validator.d.ts +183 -0
- package/dist/auth/piv-cac/ocsp-validator.d.ts.map +1 -0
- package/dist/auth/piv-cac/ocsp-validator.js +657 -0
- package/dist/auth/piv-cac/ocsp-validator.js.map +1 -0
- package/dist/auth/piv-cac/piv-middleware.d.ts +95 -0
- package/dist/auth/piv-cac/piv-middleware.d.ts.map +1 -0
- package/dist/auth/piv-cac/piv-middleware.js +524 -0
- package/dist/auth/piv-cac/piv-middleware.js.map +1 -0
- package/dist/auth/piv-cac/piv-routes.d.ts +29 -0
- package/dist/auth/piv-cac/piv-routes.d.ts.map +1 -0
- package/dist/auth/piv-cac/piv-routes.js +534 -0
- package/dist/auth/piv-cac/piv-routes.js.map +1 -0
- package/dist/auth/piv-cac/pkcs11-provider.d.ts +280 -0
- package/dist/auth/piv-cac/pkcs11-provider.d.ts.map +1 -0
- package/dist/auth/piv-cac/pkcs11-provider.js +535 -0
- package/dist/auth/piv-cac/pkcs11-provider.js.map +1 -0
- package/dist/auth/piv-cac/types.d.ts +4098 -0
- package/dist/auth/piv-cac/types.d.ts.map +1 -0
- package/dist/auth/piv-cac/types.js +495 -0
- package/dist/auth/piv-cac/types.js.map +1 -0
- package/dist/basis/evaluator.d.ts +72 -0
- package/dist/basis/evaluator.d.ts.map +1 -0
- package/dist/basis/evaluator.js +275 -0
- package/dist/basis/evaluator.js.map +1 -0
- package/dist/basis/expression-evaluator.d.ts +77 -0
- package/dist/basis/expression-evaluator.d.ts.map +1 -0
- package/dist/basis/expression-evaluator.js +826 -0
- package/dist/basis/expression-evaluator.js.map +1 -0
- package/dist/basis/index.d.ts +13 -0
- package/dist/basis/index.d.ts.map +1 -0
- package/dist/basis/index.js +13 -0
- package/dist/basis/index.js.map +1 -0
- package/dist/basis/parser.d.ts +376 -0
- package/dist/basis/parser.d.ts.map +1 -0
- package/dist/basis/parser.js +178 -0
- package/dist/basis/parser.js.map +1 -0
- package/dist/basis/types.d.ts +115 -0
- package/dist/basis/types.d.ts.map +1 -0
- package/dist/basis/types.js +5 -0
- package/dist/basis/types.js.map +1 -0
- package/dist/car-extensions/aci-string-extensions.d.ts +10 -0
- package/dist/car-extensions/aci-string-extensions.d.ts.map +1 -0
- package/dist/car-extensions/aci-string-extensions.js +24 -0
- package/dist/car-extensions/aci-string-extensions.js.map +1 -0
- package/dist/car-extensions/builtin-extensions/audit.d.ts +88 -0
- package/dist/car-extensions/builtin-extensions/audit.d.ts.map +1 -0
- package/dist/car-extensions/builtin-extensions/audit.js +445 -0
- package/dist/car-extensions/builtin-extensions/audit.js.map +1 -0
- package/dist/car-extensions/builtin-extensions/governance.d.ts +32 -0
- package/dist/car-extensions/builtin-extensions/governance.d.ts.map +1 -0
- package/dist/car-extensions/builtin-extensions/governance.js +534 -0
- package/dist/car-extensions/builtin-extensions/governance.js.map +1 -0
- package/dist/car-extensions/builtin-extensions/monitoring.d.ts +43 -0
- package/dist/car-extensions/builtin-extensions/monitoring.d.ts.map +1 -0
- package/dist/car-extensions/builtin-extensions/monitoring.js +416 -0
- package/dist/car-extensions/builtin-extensions/monitoring.js.map +1 -0
- package/dist/car-extensions/car-string-extensions.d.ts +355 -0
- package/dist/car-extensions/car-string-extensions.d.ts.map +1 -0
- package/dist/car-extensions/car-string-extensions.js +473 -0
- package/dist/car-extensions/car-string-extensions.js.map +1 -0
- package/dist/car-extensions/executor.d.ts +208 -0
- package/dist/car-extensions/executor.d.ts.map +1 -0
- package/dist/car-extensions/executor.js +789 -0
- package/dist/car-extensions/executor.js.map +1 -0
- package/dist/car-extensions/index.d.ts +94 -0
- package/dist/car-extensions/index.d.ts.map +1 -0
- package/dist/car-extensions/index.js +159 -0
- package/dist/car-extensions/index.js.map +1 -0
- package/dist/car-extensions/registry.d.ts +217 -0
- package/dist/car-extensions/registry.d.ts.map +1 -0
- package/dist/car-extensions/registry.js +450 -0
- package/dist/car-extensions/registry.js.map +1 -0
- package/dist/car-extensions/service.d.ts +220 -0
- package/dist/car-extensions/service.d.ts.map +1 -0
- package/dist/car-extensions/service.js +486 -0
- package/dist/car-extensions/service.js.map +1 -0
- package/dist/car-extensions/types.d.ts +2269 -0
- package/dist/car-extensions/types.d.ts.map +1 -0
- package/dist/car-extensions/types.js +389 -0
- package/dist/car-extensions/types.js.map +1 -0
- package/dist/cognigate/index.d.ts +192 -0
- package/dist/cognigate/index.d.ts.map +1 -0
- package/dist/cognigate/index.js +435 -0
- package/dist/cognigate/index.js.map +1 -0
- package/dist/cognigate/sandbox/capability-broker.d.ts +166 -0
- package/dist/cognigate/sandbox/capability-broker.d.ts.map +1 -0
- package/dist/cognigate/sandbox/capability-broker.js +461 -0
- package/dist/cognigate/sandbox/capability-broker.js.map +1 -0
- package/dist/cognigate/sandbox/filesystem-policy.d.ts +139 -0
- package/dist/cognigate/sandbox/filesystem-policy.d.ts.map +1 -0
- package/dist/cognigate/sandbox/filesystem-policy.js +426 -0
- package/dist/cognigate/sandbox/filesystem-policy.js.map +1 -0
- package/dist/cognigate/sandbox/index.d.ts +17 -0
- package/dist/cognigate/sandbox/index.d.ts.map +1 -0
- package/dist/cognigate/sandbox/index.js +24 -0
- package/dist/cognigate/sandbox/index.js.map +1 -0
- package/dist/cognigate/sandbox/network-policy.d.ts +126 -0
- package/dist/cognigate/sandbox/network-policy.d.ts.map +1 -0
- package/dist/cognigate/sandbox/network-policy.js +382 -0
- package/dist/cognigate/sandbox/network-policy.js.map +1 -0
- package/dist/cognigate/sandbox/sandbox-service.d.ts +70 -0
- package/dist/cognigate/sandbox/sandbox-service.d.ts.map +1 -0
- package/dist/cognigate/sandbox/sandbox-service.js +472 -0
- package/dist/cognigate/sandbox/sandbox-service.js.map +1 -0
- package/dist/cognigate/sandbox/types.d.ts +376 -0
- package/dist/cognigate/sandbox/types.d.ts.map +1 -0
- package/dist/cognigate/sandbox/types.js +179 -0
- package/dist/cognigate/sandbox/types.js.map +1 -0
- package/dist/common/adapters/index.d.ts +34 -0
- package/dist/common/adapters/index.d.ts.map +1 -0
- package/dist/common/adapters/index.js +46 -0
- package/dist/common/adapters/index.js.map +1 -0
- package/dist/common/adapters/memory-cache.d.ts +91 -0
- package/dist/common/adapters/memory-cache.d.ts.map +1 -0
- package/dist/common/adapters/memory-cache.js +201 -0
- package/dist/common/adapters/memory-cache.js.map +1 -0
- package/dist/common/adapters/memory-lock.d.ts +75 -0
- package/dist/common/adapters/memory-lock.d.ts.map +1 -0
- package/dist/common/adapters/memory-lock.js +219 -0
- package/dist/common/adapters/memory-lock.js.map +1 -0
- package/dist/common/adapters/memory-queue.d.ts +64 -0
- package/dist/common/adapters/memory-queue.d.ts.map +1 -0
- package/dist/common/adapters/memory-queue.js +233 -0
- package/dist/common/adapters/memory-queue.js.map +1 -0
- package/dist/common/adapters/memory-ratelimit.d.ts +78 -0
- package/dist/common/adapters/memory-ratelimit.d.ts.map +1 -0
- package/dist/common/adapters/memory-ratelimit.js +196 -0
- package/dist/common/adapters/memory-ratelimit.js.map +1 -0
- package/dist/common/adapters/memory-session.d.ts +105 -0
- package/dist/common/adapters/memory-session.d.ts.map +1 -0
- package/dist/common/adapters/memory-session.js +302 -0
- package/dist/common/adapters/memory-session.js.map +1 -0
- package/dist/common/adapters/provider.d.ts +47 -0
- package/dist/common/adapters/provider.d.ts.map +1 -0
- package/dist/common/adapters/provider.js +347 -0
- package/dist/common/adapters/provider.js.map +1 -0
- package/dist/common/adapters/types.d.ts +247 -0
- package/dist/common/adapters/types.d.ts.map +1 -0
- package/dist/common/adapters/types.js +11 -0
- package/dist/common/adapters/types.js.map +1 -0
- package/dist/common/alerts.d.ts +57 -0
- package/dist/common/alerts.d.ts.map +1 -0
- package/dist/common/alerts.js +216 -0
- package/dist/common/alerts.js.map +1 -0
- package/dist/common/authorization.d.ts +137 -0
- package/dist/common/authorization.d.ts.map +1 -0
- package/dist/common/authorization.js +270 -0
- package/dist/common/authorization.js.map +1 -0
- package/dist/common/canonical-bridge.d.ts +153 -0
- package/dist/common/canonical-bridge.d.ts.map +1 -0
- package/dist/common/canonical-bridge.js +236 -0
- package/dist/common/canonical-bridge.js.map +1 -0
- package/dist/common/canonical-json.d.ts +64 -0
- package/dist/common/canonical-json.d.ts.map +1 -0
- package/dist/common/canonical-json.js +95 -0
- package/dist/common/canonical-json.js.map +1 -0
- package/dist/common/circuit-breaker.d.ts +320 -0
- package/dist/common/circuit-breaker.d.ts.map +1 -0
- package/dist/common/circuit-breaker.js +887 -0
- package/dist/common/circuit-breaker.js.map +1 -0
- package/dist/common/config.d.ts +2053 -0
- package/dist/common/config.d.ts.map +1 -0
- package/dist/common/config.js +1314 -0
- package/dist/common/config.js.map +1 -0
- package/dist/common/contracts/index.d.ts +2 -0
- package/dist/common/contracts/index.d.ts.map +1 -0
- package/dist/common/contracts/index.js +2 -0
- package/dist/common/contracts/index.js.map +1 -0
- package/dist/common/contracts/output.d.ts +81 -0
- package/dist/common/contracts/output.d.ts.map +1 -0
- package/dist/common/contracts/output.js +38 -0
- package/dist/common/contracts/output.js.map +1 -0
- package/dist/common/crypto-utils.d.ts +103 -0
- package/dist/common/crypto-utils.d.ts.map +1 -0
- package/dist/common/crypto-utils.js +275 -0
- package/dist/common/crypto-utils.js.map +1 -0
- package/dist/common/crypto.d.ts +70 -0
- package/dist/common/crypto.d.ts.map +1 -0
- package/dist/common/crypto.js +201 -0
- package/dist/common/crypto.js.map +1 -0
- package/dist/common/database-resilience.d.ts +156 -0
- package/dist/common/database-resilience.d.ts.map +1 -0
- package/dist/common/database-resilience.js +269 -0
- package/dist/common/database-resilience.js.map +1 -0
- package/dist/common/db-metrics.d.ts +90 -0
- package/dist/common/db-metrics.d.ts.map +1 -0
- package/dist/common/db-metrics.js +219 -0
- package/dist/common/db-metrics.js.map +1 -0
- package/dist/common/db-pool.d.ts +307 -0
- package/dist/common/db-pool.d.ts.map +1 -0
- package/dist/common/db-pool.js +879 -0
- package/dist/common/db-pool.js.map +1 -0
- package/dist/common/db.d.ts +105 -0
- package/dist/common/db.d.ts.map +1 -0
- package/dist/common/db.js +216 -0
- package/dist/common/db.js.map +1 -0
- package/dist/common/debug-auth-middleware.d.ts +111 -0
- package/dist/common/debug-auth-middleware.d.ts.map +1 -0
- package/dist/common/debug-auth-middleware.js +285 -0
- package/dist/common/debug-auth-middleware.js.map +1 -0
- package/dist/common/di.d.ts +202 -0
- package/dist/common/di.d.ts.map +1 -0
- package/dist/common/di.js +219 -0
- package/dist/common/di.js.map +1 -0
- package/dist/common/encryption.d.ts +233 -0
- package/dist/common/encryption.d.ts.map +1 -0
- package/dist/common/encryption.js +527 -0
- package/dist/common/encryption.js.map +1 -0
- package/dist/common/error-sanitizer.d.ts +67 -0
- package/dist/common/error-sanitizer.d.ts.map +1 -0
- package/dist/common/error-sanitizer.js +298 -0
- package/dist/common/error-sanitizer.js.map +1 -0
- package/dist/common/errors.d.ts +229 -0
- package/dist/common/errors.d.ts.map +1 -0
- package/dist/common/errors.js +349 -0
- package/dist/common/errors.js.map +1 -0
- package/dist/common/expression/evaluator.d.ts +58 -0
- package/dist/common/expression/evaluator.d.ts.map +1 -0
- package/dist/common/expression/evaluator.js +326 -0
- package/dist/common/expression/evaluator.js.map +1 -0
- package/dist/common/expression/index.d.ts +180 -0
- package/dist/common/expression/index.d.ts.map +1 -0
- package/dist/common/expression/index.js +198 -0
- package/dist/common/expression/index.js.map +1 -0
- package/dist/common/expression/lexer.d.ts +69 -0
- package/dist/common/expression/lexer.d.ts.map +1 -0
- package/dist/common/expression/lexer.js +255 -0
- package/dist/common/expression/lexer.js.map +1 -0
- package/dist/common/expression/parser.d.ts +133 -0
- package/dist/common/expression/parser.d.ts.map +1 -0
- package/dist/common/expression/parser.js +293 -0
- package/dist/common/expression/parser.js.map +1 -0
- package/dist/common/group-membership.d.ts +119 -0
- package/dist/common/group-membership.d.ts.map +1 -0
- package/dist/common/group-membership.js +250 -0
- package/dist/common/group-membership.js.map +1 -0
- package/dist/common/index.d.ts +14 -0
- package/dist/common/index.d.ts.map +1 -0
- package/dist/common/index.js +15 -0
- package/dist/common/index.js.map +1 -0
- package/dist/common/leader-election.d.ts +40 -0
- package/dist/common/leader-election.d.ts.map +1 -0
- package/dist/common/leader-election.js +232 -0
- package/dist/common/leader-election.js.map +1 -0
- package/dist/common/lock.d.ts +77 -0
- package/dist/common/lock.d.ts.map +1 -0
- package/dist/common/lock.js +167 -0
- package/dist/common/lock.js.map +1 -0
- package/dist/common/logger.d.ts +19 -0
- package/dist/common/logger.d.ts.map +1 -0
- package/dist/common/logger.js +80 -0
- package/dist/common/logger.js.map +1 -0
- package/dist/common/metrics-registry.d.ts +48 -0
- package/dist/common/metrics-registry.d.ts.map +1 -0
- package/dist/common/metrics-registry.js +77 -0
- package/dist/common/metrics-registry.js.map +1 -0
- package/dist/common/metrics.d.ts +204 -0
- package/dist/common/metrics.d.ts.map +1 -0
- package/dist/common/metrics.js +497 -0
- package/dist/common/metrics.js.map +1 -0
- package/dist/common/operation-tracker.d.ts +137 -0
- package/dist/common/operation-tracker.d.ts.map +1 -0
- package/dist/common/operation-tracker.js +366 -0
- package/dist/common/operation-tracker.js.map +1 -0
- package/dist/common/provenance/chain.d.ts +54 -0
- package/dist/common/provenance/chain.d.ts.map +1 -0
- package/dist/common/provenance/chain.js +252 -0
- package/dist/common/provenance/chain.js.map +1 -0
- package/dist/common/provenance/index.d.ts +14 -0
- package/dist/common/provenance/index.d.ts.map +1 -0
- package/dist/common/provenance/index.js +19 -0
- package/dist/common/provenance/index.js.map +1 -0
- package/dist/common/provenance/query.d.ts +111 -0
- package/dist/common/provenance/query.d.ts.map +1 -0
- package/dist/common/provenance/query.js +310 -0
- package/dist/common/provenance/query.js.map +1 -0
- package/dist/common/provenance/storage.d.ts +297 -0
- package/dist/common/provenance/storage.d.ts.map +1 -0
- package/dist/common/provenance/storage.js +436 -0
- package/dist/common/provenance/storage.js.map +1 -0
- package/dist/common/provenance/tracker.d.ts +57 -0
- package/dist/common/provenance/tracker.d.ts.map +1 -0
- package/dist/common/provenance/tracker.js +209 -0
- package/dist/common/provenance/tracker.js.map +1 -0
- package/dist/common/provenance/types.d.ts +146 -0
- package/dist/common/provenance/types.d.ts.map +1 -0
- package/dist/common/provenance/types.js +10 -0
- package/dist/common/provenance/types.js.map +1 -0
- package/dist/common/random.d.ts +84 -0
- package/dist/common/random.d.ts.map +1 -0
- package/dist/common/random.js +130 -0
- package/dist/common/random.js.map +1 -0
- package/dist/common/redaction.d.ts +49 -0
- package/dist/common/redaction.d.ts.map +1 -0
- package/dist/common/redaction.js +217 -0
- package/dist/common/redaction.js.map +1 -0
- package/dist/common/redis-cluster.d.ts +538 -0
- package/dist/common/redis-cluster.d.ts.map +1 -0
- package/dist/common/redis-cluster.js +1539 -0
- package/dist/common/redis-cluster.js.map +1 -0
- package/dist/common/redis-resilience.d.ts +270 -0
- package/dist/common/redis-resilience.d.ts.map +1 -0
- package/dist/common/redis-resilience.js +586 -0
- package/dist/common/redis-resilience.js.map +1 -0
- package/dist/common/redis.d.ts +19 -0
- package/dist/common/redis.d.ts.map +1 -0
- package/dist/common/redis.js +73 -0
- package/dist/common/redis.js.map +1 -0
- package/dist/common/safe-json.d.ts +246 -0
- package/dist/common/safe-json.d.ts.map +1 -0
- package/dist/common/safe-json.js +442 -0
- package/dist/common/safe-json.js.map +1 -0
- package/dist/common/secret-generator.d.ts +142 -0
- package/dist/common/secret-generator.d.ts.map +1 -0
- package/dist/common/secret-generator.js +286 -0
- package/dist/common/secret-generator.js.map +1 -0
- package/dist/common/secure-fetch.d.ts +182 -0
- package/dist/common/secure-fetch.d.ts.map +1 -0
- package/dist/common/secure-fetch.js +657 -0
- package/dist/common/secure-fetch.js.map +1 -0
- package/dist/common/security-mode.d.ts +151 -0
- package/dist/common/security-mode.d.ts.map +1 -0
- package/dist/common/security-mode.js +482 -0
- package/dist/common/security-mode.js.map +1 -0
- package/dist/common/telemetry/index.d.ts +82 -0
- package/dist/common/telemetry/index.d.ts.map +1 -0
- package/dist/common/telemetry/index.js +198 -0
- package/dist/common/telemetry/index.js.map +1 -0
- package/dist/common/telemetry/instrumentation.d.ts +167 -0
- package/dist/common/telemetry/instrumentation.d.ts.map +1 -0
- package/dist/common/telemetry/instrumentation.js +492 -0
- package/dist/common/telemetry/instrumentation.js.map +1 -0
- package/dist/common/telemetry/metrics-bridge.d.ts +227 -0
- package/dist/common/telemetry/metrics-bridge.d.ts.map +1 -0
- package/dist/common/telemetry/metrics-bridge.js +437 -0
- package/dist/common/telemetry/metrics-bridge.js.map +1 -0
- package/dist/common/telemetry/middleware.d.ts +114 -0
- package/dist/common/telemetry/middleware.d.ts.map +1 -0
- package/dist/common/telemetry/middleware.js +353 -0
- package/dist/common/telemetry/middleware.js.map +1 -0
- package/dist/common/telemetry/propagation.d.ts +221 -0
- package/dist/common/telemetry/propagation.d.ts.map +1 -0
- package/dist/common/telemetry/propagation.js +409 -0
- package/dist/common/telemetry/propagation.js.map +1 -0
- package/dist/common/telemetry/spans.d.ts +295 -0
- package/dist/common/telemetry/spans.d.ts.map +1 -0
- package/dist/common/telemetry/spans.js +439 -0
- package/dist/common/telemetry/spans.js.map +1 -0
- package/dist/common/telemetry/tracer.d.ts +155 -0
- package/dist/common/telemetry/tracer.d.ts.map +1 -0
- package/dist/common/telemetry/tracer.js +343 -0
- package/dist/common/telemetry/tracer.js.map +1 -0
- package/dist/common/telemetry.d.ts +15 -0
- package/dist/common/telemetry.d.ts.map +1 -0
- package/dist/common/telemetry.js +61 -0
- package/dist/common/telemetry.js.map +1 -0
- package/dist/common/tenant-context.d.ts +253 -0
- package/dist/common/tenant-context.d.ts.map +1 -0
- package/dist/common/tenant-context.js +259 -0
- package/dist/common/tenant-context.js.map +1 -0
- package/dist/common/tenant-verification.d.ts +86 -0
- package/dist/common/tenant-verification.d.ts.map +1 -0
- package/dist/common/tenant-verification.js +184 -0
- package/dist/common/tenant-verification.js.map +1 -0
- package/dist/common/timeout.d.ts +40 -0
- package/dist/common/timeout.d.ts.map +1 -0
- package/dist/common/timeout.js +82 -0
- package/dist/common/timeout.js.map +1 -0
- package/dist/common/token-revocation.d.ts +44 -0
- package/dist/common/token-revocation.d.ts.map +1 -0
- package/dist/common/token-revocation.js +169 -0
- package/dist/common/token-revocation.js.map +1 -0
- package/dist/common/trace.d.ts +149 -0
- package/dist/common/trace.d.ts.map +1 -0
- package/dist/common/trace.js +328 -0
- package/dist/common/trace.js.map +1 -0
- package/dist/common/trust-cache.d.ts +263 -0
- package/dist/common/trust-cache.d.ts.map +1 -0
- package/dist/common/trust-cache.js +670 -0
- package/dist/common/trust-cache.js.map +1 -0
- package/dist/common/types.d.ts +351 -0
- package/dist/common/types.d.ts.map +1 -0
- package/dist/common/types.js +55 -0
- package/dist/common/types.js.map +1 -0
- package/dist/common/validation.d.ts +113 -0
- package/dist/common/validation.d.ts.map +1 -0
- package/dist/common/validation.js +221 -0
- package/dist/common/validation.js.map +1 -0
- package/dist/db/client.d.ts +72 -0
- package/dist/db/client.d.ts.map +1 -0
- package/dist/db/client.js +110 -0
- package/dist/db/client.js.map +1 -0
- package/dist/db/index.d.ts +9 -0
- package/dist/db/index.d.ts.map +1 -0
- package/dist/db/index.js +9 -0
- package/dist/db/index.js.map +1 -0
- package/dist/db/schema/merkle.d.ts +475 -0
- package/dist/db/schema/merkle.d.ts.map +1 -0
- package/dist/db/schema/merkle.js +100 -0
- package/dist/db/schema/merkle.js.map +1 -0
- package/dist/db/schema/proofs.d.ts +412 -0
- package/dist/db/schema/proofs.d.ts.map +1 -0
- package/dist/db/schema/proofs.js +63 -0
- package/dist/db/schema/proofs.js.map +1 -0
- package/dist/enforce/adapters.d.ts +73 -0
- package/dist/enforce/adapters.d.ts.map +1 -0
- package/dist/enforce/adapters.js +293 -0
- package/dist/enforce/adapters.js.map +1 -0
- package/dist/enforce/index.d.ts +213 -0
- package/dist/enforce/index.d.ts.map +1 -0
- package/dist/enforce/index.js +630 -0
- package/dist/enforce/index.js.map +1 -0
- package/dist/enforce/repository.d.ts +203 -0
- package/dist/enforce/repository.d.ts.map +1 -0
- package/dist/enforce/repository.js +359 -0
- package/dist/enforce/repository.js.map +1 -0
- package/dist/enforce/schema.d.ts +1198 -0
- package/dist/enforce/schema.d.ts.map +1 -0
- package/dist/enforce/schema.js +257 -0
- package/dist/enforce/schema.js.map +1 -0
- package/dist/friction/index.d.ts +235 -0
- package/dist/friction/index.d.ts.map +1 -0
- package/dist/friction/index.js +636 -0
- package/dist/friction/index.js.map +1 -0
- package/dist/friction/openapi.d.ts +23 -0
- package/dist/friction/openapi.d.ts.map +1 -0
- package/dist/friction/openapi.js +883 -0
- package/dist/friction/openapi.js.map +1 -0
- package/dist/friction/routes.d.ts +14 -0
- package/dist/friction/routes.d.ts.map +1 -0
- package/dist/friction/routes.js +206 -0
- package/dist/friction/routes.js.map +1 -0
- package/dist/governance/engine.d.ts +158 -0
- package/dist/governance/engine.d.ts.map +1 -0
- package/dist/governance/engine.js +248 -0
- package/dist/governance/engine.js.map +1 -0
- package/dist/governance/evaluator.d.ts +106 -0
- package/dist/governance/evaluator.d.ts.map +1 -0
- package/dist/governance/evaluator.js +277 -0
- package/dist/governance/evaluator.js.map +1 -0
- package/dist/governance/index.d.ts +11 -0
- package/dist/governance/index.d.ts.map +1 -0
- package/dist/governance/index.js +14 -0
- package/dist/governance/index.js.map +1 -0
- package/dist/governance/policy.d.ts +152 -0
- package/dist/governance/policy.d.ts.map +1 -0
- package/dist/governance/policy.js +152 -0
- package/dist/governance/policy.js.map +1 -0
- package/dist/index.d.ts +50 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +61 -0
- package/dist/index.js.map +1 -0
- package/dist/intent/adapters.d.ts +101 -0
- package/dist/intent/adapters.d.ts.map +1 -0
- package/dist/intent/adapters.js +250 -0
- package/dist/intent/adapters.js.map +1 -0
- package/dist/intent/audit.d.ts +119 -0
- package/dist/intent/audit.d.ts.map +1 -0
- package/dist/intent/audit.js +463 -0
- package/dist/intent/audit.js.map +1 -0
- package/dist/intent/classifier/index.d.ts +121 -0
- package/dist/intent/classifier/index.d.ts.map +1 -0
- package/dist/intent/classifier/index.js +232 -0
- package/dist/intent/classifier/index.js.map +1 -0
- package/dist/intent/classifier/patterns.d.ts +129 -0
- package/dist/intent/classifier/patterns.d.ts.map +1 -0
- package/dist/intent/classifier/patterns.js +471 -0
- package/dist/intent/classifier/patterns.js.map +1 -0
- package/dist/intent/classifier/risk.d.ts +177 -0
- package/dist/intent/classifier/risk.d.ts.map +1 -0
- package/dist/intent/classifier/risk.js +335 -0
- package/dist/intent/classifier/risk.js.map +1 -0
- package/dist/intent/cleanup.d.ts +24 -0
- package/dist/intent/cleanup.d.ts.map +1 -0
- package/dist/intent/cleanup.js +104 -0
- package/dist/intent/cleanup.js.map +1 -0
- package/dist/intent/consent.d.ts +238 -0
- package/dist/intent/consent.d.ts.map +1 -0
- package/dist/intent/consent.js +427 -0
- package/dist/intent/consent.js.map +1 -0
- package/dist/intent/escalation.d.ts +284 -0
- package/dist/intent/escalation.d.ts.map +1 -0
- package/dist/intent/escalation.js +618 -0
- package/dist/intent/escalation.js.map +1 -0
- package/dist/intent/gdpr-rate-limiter.d.ts +170 -0
- package/dist/intent/gdpr-rate-limiter.d.ts.map +1 -0
- package/dist/intent/gdpr-rate-limiter.js +385 -0
- package/dist/intent/gdpr-rate-limiter.js.map +1 -0
- package/dist/intent/gdpr.d.ts +323 -0
- package/dist/intent/gdpr.d.ts.map +1 -0
- package/dist/intent/gdpr.js +1013 -0
- package/dist/intent/gdpr.js.map +1 -0
- package/dist/intent/health.d.ts +214 -0
- package/dist/intent/health.d.ts.map +1 -0
- package/dist/intent/health.js +526 -0
- package/dist/intent/health.js.map +1 -0
- package/dist/intent/index.d.ts +565 -0
- package/dist/intent/index.d.ts.map +1 -0
- package/dist/intent/index.js +756 -0
- package/dist/intent/index.js.map +1 -0
- package/dist/intent/metrics.d.ts +399 -0
- package/dist/intent/metrics.d.ts.map +1 -0
- package/dist/intent/metrics.js +886 -0
- package/dist/intent/metrics.js.map +1 -0
- package/dist/intent/openapi.d.ts +22 -0
- package/dist/intent/openapi.d.ts.map +1 -0
- package/dist/intent/openapi.js +1674 -0
- package/dist/intent/openapi.js.map +1 -0
- package/dist/intent/planner/dependency.d.ts +78 -0
- package/dist/intent/planner/dependency.d.ts.map +1 -0
- package/dist/intent/planner/dependency.js +334 -0
- package/dist/intent/planner/dependency.js.map +1 -0
- package/dist/intent/planner/index.d.ts +130 -0
- package/dist/intent/planner/index.d.ts.map +1 -0
- package/dist/intent/planner/index.js +372 -0
- package/dist/intent/planner/index.js.map +1 -0
- package/dist/intent/planner/rollback.d.ts +92 -0
- package/dist/intent/planner/rollback.d.ts.map +1 -0
- package/dist/intent/planner/rollback.js +326 -0
- package/dist/intent/planner/rollback.js.map +1 -0
- package/dist/intent/planner/templates.d.ts +81 -0
- package/dist/intent/planner/templates.d.ts.map +1 -0
- package/dist/intent/planner/templates.js +560 -0
- package/dist/intent/planner/templates.js.map +1 -0
- package/dist/intent/planner/types.d.ts +38 -0
- package/dist/intent/planner/types.d.ts.map +1 -0
- package/dist/intent/planner/types.js +10 -0
- package/dist/intent/planner/types.js.map +1 -0
- package/dist/intent/queue.d.ts +150 -0
- package/dist/intent/queue.d.ts.map +1 -0
- package/dist/intent/queue.js +339 -0
- package/dist/intent/queue.js.map +1 -0
- package/dist/intent/queues.d.ts +176 -0
- package/dist/intent/queues.d.ts.map +1 -0
- package/dist/intent/queues.js +1393 -0
- package/dist/intent/queues.js.map +1 -0
- package/dist/intent/ratelimit.d.ts +147 -0
- package/dist/intent/ratelimit.d.ts.map +1 -0
- package/dist/intent/ratelimit.js +301 -0
- package/dist/intent/ratelimit.js.map +1 -0
- package/dist/intent/replay/comparator.d.ts +73 -0
- package/dist/intent/replay/comparator.d.ts.map +1 -0
- package/dist/intent/replay/comparator.js +320 -0
- package/dist/intent/replay/comparator.js.map +1 -0
- package/dist/intent/replay/index.d.ts +104 -0
- package/dist/intent/replay/index.d.ts.map +1 -0
- package/dist/intent/replay/index.js +487 -0
- package/dist/intent/replay/index.js.map +1 -0
- package/dist/intent/replay/simulator.d.ts +184 -0
- package/dist/intent/replay/simulator.d.ts.map +1 -0
- package/dist/intent/replay/simulator.js +512 -0
- package/dist/intent/replay/simulator.js.map +1 -0
- package/dist/intent/replay/snapshot.d.ts +149 -0
- package/dist/intent/replay/snapshot.d.ts.map +1 -0
- package/dist/intent/replay/snapshot.js +245 -0
- package/dist/intent/replay/snapshot.js.map +1 -0
- package/dist/intent/replay/types.d.ts +143 -0
- package/dist/intent/replay/types.d.ts.map +1 -0
- package/dist/intent/replay/types.js +10 -0
- package/dist/intent/replay/types.js.map +1 -0
- package/dist/intent/repository.d.ts +198 -0
- package/dist/intent/repository.d.ts.map +1 -0
- package/dist/intent/repository.js +538 -0
- package/dist/intent/repository.js.map +1 -0
- package/dist/intent/response-middleware.d.ts +156 -0
- package/dist/intent/response-middleware.d.ts.map +1 -0
- package/dist/intent/response-middleware.js +346 -0
- package/dist/intent/response-middleware.js.map +1 -0
- package/dist/intent/response.d.ts +267 -0
- package/dist/intent/response.d.ts.map +1 -0
- package/dist/intent/response.js +402 -0
- package/dist/intent/response.js.map +1 -0
- package/dist/intent/routes.d.ts +35 -0
- package/dist/intent/routes.d.ts.map +1 -0
- package/dist/intent/routes.js +1023 -0
- package/dist/intent/routes.js.map +1 -0
- package/dist/intent/scheduler.d.ts +45 -0
- package/dist/intent/scheduler.d.ts.map +1 -0
- package/dist/intent/scheduler.js +221 -0
- package/dist/intent/scheduler.js.map +1 -0
- package/dist/intent/schema.d.ts +3817 -0
- package/dist/intent/schema.d.ts.map +1 -0
- package/dist/intent/schema.js +631 -0
- package/dist/intent/schema.js.map +1 -0
- package/dist/intent/shutdown.d.ts +145 -0
- package/dist/intent/shutdown.d.ts.map +1 -0
- package/dist/intent/shutdown.js +468 -0
- package/dist/intent/shutdown.js.map +1 -0
- package/dist/intent/state-machine.d.ts +111 -0
- package/dist/intent/state-machine.d.ts.map +1 -0
- package/dist/intent/state-machine.js +242 -0
- package/dist/intent/state-machine.js.map +1 -0
- package/dist/intent/tracing.d.ts +152 -0
- package/dist/intent/tracing.d.ts.map +1 -0
- package/dist/intent/tracing.js +658 -0
- package/dist/intent/tracing.js.map +1 -0
- package/dist/intent/types.d.ts +188 -0
- package/dist/intent/types.d.ts.map +1 -0
- package/dist/intent/types.js +25 -0
- package/dist/intent/types.js.map +1 -0
- package/dist/intent/webhooks/delivery-repository.d.ts +80 -0
- package/dist/intent/webhooks/delivery-repository.d.ts.map +1 -0
- package/dist/intent/webhooks/delivery-repository.js +251 -0
- package/dist/intent/webhooks/delivery-repository.js.map +1 -0
- package/dist/intent/webhooks/dns-pinning.d.ts +30 -0
- package/dist/intent/webhooks/dns-pinning.d.ts.map +1 -0
- package/dist/intent/webhooks/dns-pinning.js +69 -0
- package/dist/intent/webhooks/dns-pinning.js.map +1 -0
- package/dist/intent/webhooks/index.d.ts +14 -0
- package/dist/intent/webhooks/index.d.ts.map +1 -0
- package/dist/intent/webhooks/index.js +17 -0
- package/dist/intent/webhooks/index.js.map +1 -0
- package/dist/intent/webhooks/signature.d.ts +47 -0
- package/dist/intent/webhooks/signature.d.ts.map +1 -0
- package/dist/intent/webhooks/signature.js +80 -0
- package/dist/intent/webhooks/signature.js.map +1 -0
- package/dist/intent/webhooks/ssrf-protection.d.ts +29 -0
- package/dist/intent/webhooks/ssrf-protection.d.ts.map +1 -0
- package/dist/intent/webhooks/ssrf-protection.js +161 -0
- package/dist/intent/webhooks/ssrf-protection.js.map +1 -0
- package/dist/intent/webhooks/types.d.ts +132 -0
- package/dist/intent/webhooks/types.d.ts.map +1 -0
- package/dist/intent/webhooks/types.js +14 -0
- package/dist/intent/webhooks/types.js.map +1 -0
- package/dist/intent/webhooks.d.ts +618 -0
- package/dist/intent/webhooks.d.ts.map +1 -0
- package/dist/intent/webhooks.js +1836 -0
- package/dist/intent/webhooks.js.map +1 -0
- package/dist/intent-gateway/ai-act-classifier.d.ts +18 -0
- package/dist/intent-gateway/ai-act-classifier.d.ts.map +1 -0
- package/dist/intent-gateway/ai-act-classifier.js +296 -0
- package/dist/intent-gateway/ai-act-classifier.js.map +1 -0
- package/dist/intent-gateway/index.d.ts +43 -0
- package/dist/intent-gateway/index.d.ts.map +1 -0
- package/dist/intent-gateway/index.js +236 -0
- package/dist/intent-gateway/index.js.map +1 -0
- package/dist/intent-gateway/jurisdiction-resolver.d.ts +19 -0
- package/dist/intent-gateway/jurisdiction-resolver.d.ts.map +1 -0
- package/dist/intent-gateway/jurisdiction-resolver.js +236 -0
- package/dist/intent-gateway/jurisdiction-resolver.js.map +1 -0
- package/dist/intent-gateway/policy-composer.d.ts +27 -0
- package/dist/intent-gateway/policy-composer.d.ts.map +1 -0
- package/dist/intent-gateway/policy-composer.js +418 -0
- package/dist/intent-gateway/policy-composer.js.map +1 -0
- package/dist/intent-gateway/regime-selector.d.ts +26 -0
- package/dist/intent-gateway/regime-selector.d.ts.map +1 -0
- package/dist/intent-gateway/regime-selector.js +185 -0
- package/dist/intent-gateway/regime-selector.js.map +1 -0
- package/dist/intent-gateway/types.d.ts +103 -0
- package/dist/intent-gateway/types.d.ts.map +1 -0
- package/dist/intent-gateway/types.js +85 -0
- package/dist/intent-gateway/types.js.map +1 -0
- package/dist/observability/alerts.d.ts +136 -0
- package/dist/observability/alerts.d.ts.map +1 -0
- package/dist/observability/alerts.js +485 -0
- package/dist/observability/alerts.js.map +1 -0
- package/dist/observability/health.d.ts +102 -0
- package/dist/observability/health.d.ts.map +1 -0
- package/dist/observability/health.js +415 -0
- package/dist/observability/health.js.map +1 -0
- package/dist/observability/index.d.ts +29 -0
- package/dist/observability/index.d.ts.map +1 -0
- package/dist/observability/index.js +72 -0
- package/dist/observability/index.js.map +1 -0
- package/dist/observability/logging.d.ts +90 -0
- package/dist/observability/logging.d.ts.map +1 -0
- package/dist/observability/logging.js +260 -0
- package/dist/observability/logging.js.map +1 -0
- package/dist/observability/metrics.d.ts +226 -0
- package/dist/observability/metrics.d.ts.map +1 -0
- package/dist/observability/metrics.js +527 -0
- package/dist/observability/metrics.js.map +1 -0
- package/dist/observability/tracing.d.ts +120 -0
- package/dist/observability/tracing.d.ts.map +1 -0
- package/dist/observability/tracing.js +285 -0
- package/dist/observability/tracing.js.map +1 -0
- package/dist/persistence/audit.d.ts +169 -0
- package/dist/persistence/audit.d.ts.map +1 -0
- package/dist/persistence/audit.js +342 -0
- package/dist/persistence/audit.js.map +1 -0
- package/dist/persistence/index.d.ts +13 -0
- package/dist/persistence/index.d.ts.map +1 -0
- package/dist/persistence/index.js +15 -0
- package/dist/persistence/index.js.map +1 -0
- package/dist/persistence/repository.d.ts +192 -0
- package/dist/persistence/repository.d.ts.map +1 -0
- package/dist/persistence/repository.js +223 -0
- package/dist/persistence/repository.js.map +1 -0
- package/dist/policy/diff.d.ts +88 -0
- package/dist/policy/diff.d.ts.map +1 -0
- package/dist/policy/diff.js +325 -0
- package/dist/policy/diff.js.map +1 -0
- package/dist/policy/distributed-cache.d.ts +205 -0
- package/dist/policy/distributed-cache.d.ts.map +1 -0
- package/dist/policy/distributed-cache.js +683 -0
- package/dist/policy/distributed-cache.js.map +1 -0
- package/dist/policy/evaluator.d.ts +102 -0
- package/dist/policy/evaluator.d.ts.map +1 -0
- package/dist/policy/evaluator.js +648 -0
- package/dist/policy/evaluator.js.map +1 -0
- package/dist/policy/index.d.ts +24 -0
- package/dist/policy/index.d.ts.map +1 -0
- package/dist/policy/index.js +27 -0
- package/dist/policy/index.js.map +1 -0
- package/dist/policy/loader.d.ts +63 -0
- package/dist/policy/loader.d.ts.map +1 -0
- package/dist/policy/loader.js +176 -0
- package/dist/policy/loader.js.map +1 -0
- package/dist/policy/service.d.ts +240 -0
- package/dist/policy/service.d.ts.map +1 -0
- package/dist/policy/service.js +1032 -0
- package/dist/policy/service.js.map +1 -0
- package/dist/policy/types.d.ts +220 -0
- package/dist/policy/types.d.ts.map +1 -0
- package/dist/policy/types.js +36 -0
- package/dist/policy/types.js.map +1 -0
- package/dist/policy/visual-builder/index.d.ts +201 -0
- package/dist/policy/visual-builder/index.d.ts.map +1 -0
- package/dist/policy/visual-builder/index.js +727 -0
- package/dist/policy/visual-builder/index.js.map +1 -0
- package/dist/policy/visual-builder/inheritance.d.ts +151 -0
- package/dist/policy/visual-builder/inheritance.d.ts.map +1 -0
- package/dist/policy/visual-builder/inheritance.js +314 -0
- package/dist/policy/visual-builder/inheritance.js.map +1 -0
- package/dist/policy/visual-builder/propagation.d.ts +146 -0
- package/dist/policy/visual-builder/propagation.d.ts.map +1 -0
- package/dist/policy/visual-builder/propagation.js +299 -0
- package/dist/policy/visual-builder/propagation.js.map +1 -0
- package/dist/policy/visual-builder/routes.d.ts +14 -0
- package/dist/policy/visual-builder/routes.d.ts.map +1 -0
- package/dist/policy/visual-builder/routes.js +528 -0
- package/dist/policy/visual-builder/routes.js.map +1 -0
- package/dist/policy/visual-builder/simulator.d.ts +161 -0
- package/dist/policy/visual-builder/simulator.d.ts.map +1 -0
- package/dist/policy/visual-builder/simulator.js +413 -0
- package/dist/policy/visual-builder/simulator.js.map +1 -0
- package/dist/policy/visual-builder/templates.d.ts +119 -0
- package/dist/policy/visual-builder/templates.d.ts.map +1 -0
- package/dist/policy/visual-builder/templates.js +627 -0
- package/dist/policy/visual-builder/templates.js.map +1 -0
- package/dist/proof/chain/index.d.ts +271 -0
- package/dist/proof/chain/index.d.ts.map +1 -0
- package/dist/proof/chain/index.js +483 -0
- package/dist/proof/chain/index.js.map +1 -0
- package/dist/proof/index.d.ts +206 -0
- package/dist/proof/index.d.ts.map +1 -0
- package/dist/proof/index.js +597 -0
- package/dist/proof/index.js.map +1 -0
- package/dist/proof/merkle-service.d.ts +194 -0
- package/dist/proof/merkle-service.d.ts.map +1 -0
- package/dist/proof/merkle-service.js +463 -0
- package/dist/proof/merkle-service.js.map +1 -0
- package/dist/proof/merkle.d.ts +118 -0
- package/dist/proof/merkle.d.ts.map +1 -0
- package/dist/proof/merkle.js +265 -0
- package/dist/proof/merkle.js.map +1 -0
- package/dist/security/ai-governance/access-policy.d.ts +197 -0
- package/dist/security/ai-governance/access-policy.d.ts.map +1 -0
- package/dist/security/ai-governance/access-policy.js +522 -0
- package/dist/security/ai-governance/access-policy.js.map +1 -0
- package/dist/security/ai-governance/audit-trail.d.ts +241 -0
- package/dist/security/ai-governance/audit-trail.d.ts.map +1 -0
- package/dist/security/ai-governance/audit-trail.js +645 -0
- package/dist/security/ai-governance/audit-trail.js.map +1 -0
- package/dist/security/ai-governance/bias-detection.d.ts +221 -0
- package/dist/security/ai-governance/bias-detection.d.ts.map +1 -0
- package/dist/security/ai-governance/bias-detection.js +615 -0
- package/dist/security/ai-governance/bias-detection.js.map +1 -0
- package/dist/security/ai-governance/index.d.ts +92 -0
- package/dist/security/ai-governance/index.d.ts.map +1 -0
- package/dist/security/ai-governance/index.js +184 -0
- package/dist/security/ai-governance/index.js.map +1 -0
- package/dist/security/ai-governance/middleware.d.ts +110 -0
- package/dist/security/ai-governance/middleware.d.ts.map +1 -0
- package/dist/security/ai-governance/middleware.js +359 -0
- package/dist/security/ai-governance/middleware.js.map +1 -0
- package/dist/security/ai-governance/model-registry.d.ts +229 -0
- package/dist/security/ai-governance/model-registry.d.ts.map +1 -0
- package/dist/security/ai-governance/model-registry.js +535 -0
- package/dist/security/ai-governance/model-registry.js.map +1 -0
- package/dist/security/ai-governance/output-filter.d.ts +150 -0
- package/dist/security/ai-governance/output-filter.d.ts.map +1 -0
- package/dist/security/ai-governance/output-filter.js +561 -0
- package/dist/security/ai-governance/output-filter.js.map +1 -0
- package/dist/security/ai-governance/prompt-injection.d.ts +153 -0
- package/dist/security/ai-governance/prompt-injection.d.ts.map +1 -0
- package/dist/security/ai-governance/prompt-injection.js +614 -0
- package/dist/security/ai-governance/prompt-injection.js.map +1 -0
- package/dist/security/ai-governance/rate-limiter.d.ts +156 -0
- package/dist/security/ai-governance/rate-limiter.d.ts.map +1 -0
- package/dist/security/ai-governance/rate-limiter.js +541 -0
- package/dist/security/ai-governance/rate-limiter.js.map +1 -0
- package/dist/security/ai-governance/types.d.ts +594 -0
- package/dist/security/ai-governance/types.d.ts.map +1 -0
- package/dist/security/ai-governance/types.js +6 -0
- package/dist/security/ai-governance/types.js.map +1 -0
- package/dist/security/alerting/channels/base.d.ts +91 -0
- package/dist/security/alerting/channels/base.d.ts.map +1 -0
- package/dist/security/alerting/channels/base.js +128 -0
- package/dist/security/alerting/channels/base.js.map +1 -0
- package/dist/security/alerting/channels/email.d.ts +92 -0
- package/dist/security/alerting/channels/email.d.ts.map +1 -0
- package/dist/security/alerting/channels/email.js +418 -0
- package/dist/security/alerting/channels/email.js.map +1 -0
- package/dist/security/alerting/channels/http-base.d.ts +86 -0
- package/dist/security/alerting/channels/http-base.d.ts.map +1 -0
- package/dist/security/alerting/channels/http-base.js +133 -0
- package/dist/security/alerting/channels/http-base.js.map +1 -0
- package/dist/security/alerting/channels/index.d.ts +30 -0
- package/dist/security/alerting/channels/index.d.ts.map +1 -0
- package/dist/security/alerting/channels/index.js +22 -0
- package/dist/security/alerting/channels/index.js.map +1 -0
- package/dist/security/alerting/channels/pagerduty.d.ts +70 -0
- package/dist/security/alerting/channels/pagerduty.d.ts.map +1 -0
- package/dist/security/alerting/channels/pagerduty.js +248 -0
- package/dist/security/alerting/channels/pagerduty.js.map +1 -0
- package/dist/security/alerting/channels/slack.d.ts +55 -0
- package/dist/security/alerting/channels/slack.d.ts.map +1 -0
- package/dist/security/alerting/channels/slack.js +215 -0
- package/dist/security/alerting/channels/slack.js.map +1 -0
- package/dist/security/alerting/channels/sns.d.ts +87 -0
- package/dist/security/alerting/channels/sns.d.ts.map +1 -0
- package/dist/security/alerting/channels/sns.js +251 -0
- package/dist/security/alerting/channels/sns.js.map +1 -0
- package/dist/security/alerting/channels/webhook.d.ts +92 -0
- package/dist/security/alerting/channels/webhook.d.ts.map +1 -0
- package/dist/security/alerting/channels/webhook.js +203 -0
- package/dist/security/alerting/channels/webhook.js.map +1 -0
- package/dist/security/alerting/detector.d.ts +217 -0
- package/dist/security/alerting/detector.d.ts.map +1 -0
- package/dist/security/alerting/detector.js +725 -0
- package/dist/security/alerting/detector.js.map +1 -0
- package/dist/security/alerting/index.d.ts +57 -0
- package/dist/security/alerting/index.d.ts.map +1 -0
- package/dist/security/alerting/index.js +214 -0
- package/dist/security/alerting/index.js.map +1 -0
- package/dist/security/alerting/service.d.ts +190 -0
- package/dist/security/alerting/service.d.ts.map +1 -0
- package/dist/security/alerting/service.js +815 -0
- package/dist/security/alerting/service.js.map +1 -0
- package/dist/security/alerting/types.d.ts +2165 -0
- package/dist/security/alerting/types.d.ts.map +1 -0
- package/dist/security/alerting/types.js +278 -0
- package/dist/security/alerting/types.js.map +1 -0
- package/dist/security/anomaly/detectors/account-compromise.d.ts +198 -0
- package/dist/security/anomaly/detectors/account-compromise.d.ts.map +1 -0
- package/dist/security/anomaly/detectors/account-compromise.js +815 -0
- package/dist/security/anomaly/detectors/account-compromise.js.map +1 -0
- package/dist/security/anomaly/detectors/data-exfiltration.d.ts +175 -0
- package/dist/security/anomaly/detectors/data-exfiltration.d.ts.map +1 -0
- package/dist/security/anomaly/detectors/data-exfiltration.js +733 -0
- package/dist/security/anomaly/detectors/data-exfiltration.js.map +1 -0
- package/dist/security/anomaly/detectors/geographic.d.ts +100 -0
- package/dist/security/anomaly/detectors/geographic.d.ts.map +1 -0
- package/dist/security/anomaly/detectors/geographic.js +348 -0
- package/dist/security/anomaly/detectors/geographic.js.map +1 -0
- package/dist/security/anomaly/detectors/index.d.ts +86 -0
- package/dist/security/anomaly/detectors/index.d.ts.map +1 -0
- package/dist/security/anomaly/detectors/index.js +118 -0
- package/dist/security/anomaly/detectors/index.js.map +1 -0
- package/dist/security/anomaly/detectors/lateral-movement.d.ts +168 -0
- package/dist/security/anomaly/detectors/lateral-movement.d.ts.map +1 -0
- package/dist/security/anomaly/detectors/lateral-movement.js +795 -0
- package/dist/security/anomaly/detectors/lateral-movement.js.map +1 -0
- package/dist/security/anomaly/detectors/privilege-escalation.d.ts +177 -0
- package/dist/security/anomaly/detectors/privilege-escalation.d.ts.map +1 -0
- package/dist/security/anomaly/detectors/privilege-escalation.js +741 -0
- package/dist/security/anomaly/detectors/privilege-escalation.js.map +1 -0
- package/dist/security/anomaly/detectors/temporal.d.ts +71 -0
- package/dist/security/anomaly/detectors/temporal.d.ts.map +1 -0
- package/dist/security/anomaly/detectors/temporal.js +398 -0
- package/dist/security/anomaly/detectors/temporal.js.map +1 -0
- package/dist/security/anomaly/detectors/volume.d.ts +97 -0
- package/dist/security/anomaly/detectors/volume.d.ts.map +1 -0
- package/dist/security/anomaly/detectors/volume.js +424 -0
- package/dist/security/anomaly/detectors/volume.js.map +1 -0
- package/dist/security/anomaly/index.d.ts +128 -0
- package/dist/security/anomaly/index.d.ts.map +1 -0
- package/dist/security/anomaly/index.js +378 -0
- package/dist/security/anomaly/index.js.map +1 -0
- package/dist/security/anomaly/types.d.ts +1209 -0
- package/dist/security/anomaly/types.d.ts.map +1 -0
- package/dist/security/anomaly/types.js +193 -0
- package/dist/security/anomaly/types.js.map +1 -0
- package/dist/security/api-keys/cache.d.ts +255 -0
- package/dist/security/api-keys/cache.d.ts.map +1 -0
- package/dist/security/api-keys/cache.js +595 -0
- package/dist/security/api-keys/cache.js.map +1 -0
- package/dist/security/api-keys/db-store.d.ts +150 -0
- package/dist/security/api-keys/db-store.d.ts.map +1 -0
- package/dist/security/api-keys/db-store.js +694 -0
- package/dist/security/api-keys/db-store.js.map +1 -0
- package/dist/security/api-keys/index.d.ts +29 -0
- package/dist/security/api-keys/index.d.ts.map +1 -0
- package/dist/security/api-keys/index.js +81 -0
- package/dist/security/api-keys/index.js.map +1 -0
- package/dist/security/api-keys/middleware.d.ts +164 -0
- package/dist/security/api-keys/middleware.d.ts.map +1 -0
- package/dist/security/api-keys/middleware.js +392 -0
- package/dist/security/api-keys/middleware.js.map +1 -0
- package/dist/security/api-keys/service.d.ts +226 -0
- package/dist/security/api-keys/service.d.ts.map +1 -0
- package/dist/security/api-keys/service.js +861 -0
- package/dist/security/api-keys/service.js.map +1 -0
- package/dist/security/api-keys/store.d.ts +241 -0
- package/dist/security/api-keys/store.d.ts.map +1 -0
- package/dist/security/api-keys/store.js +360 -0
- package/dist/security/api-keys/store.js.map +1 -0
- package/dist/security/api-keys/types.d.ts +718 -0
- package/dist/security/api-keys/types.d.ts.map +1 -0
- package/dist/security/api-keys/types.js +162 -0
- package/dist/security/api-keys/types.js.map +1 -0
- package/dist/security/brute-force.d.ts +390 -0
- package/dist/security/brute-force.d.ts.map +1 -0
- package/dist/security/brute-force.js +677 -0
- package/dist/security/brute-force.js.map +1 -0
- package/dist/security/config-validator.d.ts +152 -0
- package/dist/security/config-validator.d.ts.map +1 -0
- package/dist/security/config-validator.js +667 -0
- package/dist/security/config-validator.js.map +1 -0
- package/dist/security/crypto/fips-mode.d.ts +726 -0
- package/dist/security/crypto/fips-mode.d.ts.map +1 -0
- package/dist/security/crypto/fips-mode.js +1297 -0
- package/dist/security/crypto/fips-mode.js.map +1 -0
- package/dist/security/crypto/index.d.ts +203 -0
- package/dist/security/crypto/index.d.ts.map +1 -0
- package/dist/security/crypto/index.js +293 -0
- package/dist/security/crypto/index.js.map +1 -0
- package/dist/security/crypto/post-quantum/benchmark.d.ts +125 -0
- package/dist/security/crypto/post-quantum/benchmark.d.ts.map +1 -0
- package/dist/security/crypto/post-quantum/benchmark.js +530 -0
- package/dist/security/crypto/post-quantum/benchmark.js.map +1 -0
- package/dist/security/crypto/post-quantum/dilithium.d.ts +146 -0
- package/dist/security/crypto/post-quantum/dilithium.d.ts.map +1 -0
- package/dist/security/crypto/post-quantum/dilithium.js +662 -0
- package/dist/security/crypto/post-quantum/dilithium.js.map +1 -0
- package/dist/security/crypto/post-quantum/hybrid.d.ts +267 -0
- package/dist/security/crypto/post-quantum/hybrid.d.ts.map +1 -0
- package/dist/security/crypto/post-quantum/hybrid.js +457 -0
- package/dist/security/crypto/post-quantum/hybrid.js.map +1 -0
- package/dist/security/crypto/post-quantum/index.d.ts +166 -0
- package/dist/security/crypto/post-quantum/index.d.ts.map +1 -0
- package/dist/security/crypto/post-quantum/index.js +236 -0
- package/dist/security/crypto/post-quantum/index.js.map +1 -0
- package/dist/security/crypto/post-quantum/kyber.d.ts +131 -0
- package/dist/security/crypto/post-quantum/kyber.d.ts.map +1 -0
- package/dist/security/crypto/post-quantum/kyber.js +640 -0
- package/dist/security/crypto/post-quantum/kyber.js.map +1 -0
- package/dist/security/crypto/post-quantum/migration.d.ts +230 -0
- package/dist/security/crypto/post-quantum/migration.d.ts.map +1 -0
- package/dist/security/crypto/post-quantum/migration.js +563 -0
- package/dist/security/crypto/post-quantum/migration.js.map +1 -0
- package/dist/security/crypto/post-quantum/types.d.ts +1056 -0
- package/dist/security/crypto/post-quantum/types.d.ts.map +1 -0
- package/dist/security/crypto/post-quantum/types.js +350 -0
- package/dist/security/crypto/post-quantum/types.js.map +1 -0
- package/dist/security/crypto/shamir/comparison.d.ts +128 -0
- package/dist/security/crypto/shamir/comparison.d.ts.map +1 -0
- package/dist/security/crypto/shamir/comparison.js +423 -0
- package/dist/security/crypto/shamir/comparison.js.map +1 -0
- package/dist/security/crypto/shamir/index.d.ts +76 -0
- package/dist/security/crypto/shamir/index.d.ts.map +1 -0
- package/dist/security/crypto/shamir/index.js +155 -0
- package/dist/security/crypto/shamir/index.js.map +1 -0
- package/dist/security/crypto/shamir/proofs.d.ts +259 -0
- package/dist/security/crypto/shamir/proofs.d.ts.map +1 -0
- package/dist/security/crypto/shamir/proofs.js +605 -0
- package/dist/security/crypto/shamir/proofs.js.map +1 -0
- package/dist/security/crypto/shamir/property-tests.d.ts +104 -0
- package/dist/security/crypto/shamir/property-tests.d.ts.map +1 -0
- package/dist/security/crypto/shamir/property-tests.js +480 -0
- package/dist/security/crypto/shamir/property-tests.js.map +1 -0
- package/dist/security/crypto/shamir/security-analysis.d.ts +97 -0
- package/dist/security/crypto/shamir/security-analysis.d.ts.map +1 -0
- package/dist/security/crypto/shamir/security-analysis.js +503 -0
- package/dist/security/crypto/shamir/security-analysis.js.map +1 -0
- package/dist/security/crypto/shamir/test-vectors.d.ts +116 -0
- package/dist/security/crypto/shamir/test-vectors.d.ts.map +1 -0
- package/dist/security/crypto/shamir/test-vectors.js +377 -0
- package/dist/security/crypto/shamir/test-vectors.js.map +1 -0
- package/dist/security/crypto/shamir/types.d.ts +281 -0
- package/dist/security/crypto/shamir/types.d.ts.map +1 -0
- package/dist/security/crypto/shamir/types.js +82 -0
- package/dist/security/crypto/shamir/types.js.map +1 -0
- package/dist/security/crypto/shamir/verified-shamir.d.ts +170 -0
- package/dist/security/crypto/shamir/verified-shamir.d.ts.map +1 -0
- package/dist/security/crypto/shamir/verified-shamir.js +624 -0
- package/dist/security/crypto/shamir/verified-shamir.js.map +1 -0
- package/dist/security/csrf.d.ts +215 -0
- package/dist/security/csrf.d.ts.map +1 -0
- package/dist/security/csrf.js +467 -0
- package/dist/security/csrf.js.map +1 -0
- package/dist/security/distributed-state.d.ts +331 -0
- package/dist/security/distributed-state.d.ts.map +1 -0
- package/dist/security/distributed-state.js +768 -0
- package/dist/security/distributed-state.js.map +1 -0
- package/dist/security/dlp/index.d.ts +27 -0
- package/dist/security/dlp/index.d.ts.map +1 -0
- package/dist/security/dlp/index.js +54 -0
- package/dist/security/dlp/index.js.map +1 -0
- package/dist/security/dlp/scanner.d.ts +451 -0
- package/dist/security/dlp/scanner.d.ts.map +1 -0
- package/dist/security/dlp/scanner.js +1241 -0
- package/dist/security/dlp/scanner.js.map +1 -0
- package/dist/security/dpop.d.ts +260 -0
- package/dist/security/dpop.d.ts.map +1 -0
- package/dist/security/dpop.js +1058 -0
- package/dist/security/dpop.js.map +1 -0
- package/dist/security/encryption/decorators.d.ts +263 -0
- package/dist/security/encryption/decorators.d.ts.map +1 -0
- package/dist/security/encryption/decorators.js +359 -0
- package/dist/security/encryption/decorators.js.map +1 -0
- package/dist/security/encryption/index.d.ts +83 -0
- package/dist/security/encryption/index.d.ts.map +1 -0
- package/dist/security/encryption/index.js +140 -0
- package/dist/security/encryption/index.js.map +1 -0
- package/dist/security/encryption/key-provider.d.ts +335 -0
- package/dist/security/encryption/key-provider.d.ts.map +1 -0
- package/dist/security/encryption/key-provider.js +853 -0
- package/dist/security/encryption/key-provider.js.map +1 -0
- package/dist/security/encryption/middleware.d.ts +279 -0
- package/dist/security/encryption/middleware.d.ts.map +1 -0
- package/dist/security/encryption/middleware.js +493 -0
- package/dist/security/encryption/middleware.js.map +1 -0
- package/dist/security/encryption/service.d.ts +164 -0
- package/dist/security/encryption/service.d.ts.map +1 -0
- package/dist/security/encryption/service.js +623 -0
- package/dist/security/encryption/service.js.map +1 -0
- package/dist/security/encryption/types.d.ts +745 -0
- package/dist/security/encryption/types.d.ts.map +1 -0
- package/dist/security/encryption/types.js +229 -0
- package/dist/security/encryption/types.js.map +1 -0
- package/dist/security/error-sanitizer.d.ts +329 -0
- package/dist/security/error-sanitizer.d.ts.map +1 -0
- package/dist/security/error-sanitizer.js +700 -0
- package/dist/security/error-sanitizer.js.map +1 -0
- package/dist/security/fingerprint-service.d.ts +139 -0
- package/dist/security/fingerprint-service.d.ts.map +1 -0
- package/dist/security/fingerprint-service.js +240 -0
- package/dist/security/fingerprint-service.js.map +1 -0
- package/dist/security/headers/csp.d.ts +270 -0
- package/dist/security/headers/csp.d.ts.map +1 -0
- package/dist/security/headers/csp.js +655 -0
- package/dist/security/headers/csp.js.map +1 -0
- package/dist/security/headers/hsts.d.ts +161 -0
- package/dist/security/headers/hsts.d.ts.map +1 -0
- package/dist/security/headers/hsts.js +346 -0
- package/dist/security/headers/hsts.js.map +1 -0
- package/dist/security/headers/index.d.ts +47 -0
- package/dist/security/headers/index.d.ts.map +1 -0
- package/dist/security/headers/index.js +110 -0
- package/dist/security/headers/index.js.map +1 -0
- package/dist/security/headers/middleware.d.ts +70 -0
- package/dist/security/headers/middleware.d.ts.map +1 -0
- package/dist/security/headers/middleware.js +549 -0
- package/dist/security/headers/middleware.js.map +1 -0
- package/dist/security/headers/permissions-policy.d.ts +189 -0
- package/dist/security/headers/permissions-policy.d.ts.map +1 -0
- package/dist/security/headers/permissions-policy.js +508 -0
- package/dist/security/headers/permissions-policy.js.map +1 -0
- package/dist/security/headers/types.d.ts +1570 -0
- package/dist/security/headers/types.d.ts.map +1 -0
- package/dist/security/headers/types.js +281 -0
- package/dist/security/headers/types.js.map +1 -0
- package/dist/security/headers/validator.d.ts +36 -0
- package/dist/security/headers/validator.d.ts.map +1 -0
- package/dist/security/headers/validator.js +616 -0
- package/dist/security/headers/validator.js.map +1 -0
- package/dist/security/hsm/aws-cloudhsm.d.ts +157 -0
- package/dist/security/hsm/aws-cloudhsm.d.ts.map +1 -0
- package/dist/security/hsm/aws-cloudhsm.js +712 -0
- package/dist/security/hsm/aws-cloudhsm.js.map +1 -0
- package/dist/security/hsm/azure-hsm.d.ts +174 -0
- package/dist/security/hsm/azure-hsm.d.ts.map +1 -0
- package/dist/security/hsm/azure-hsm.js +792 -0
- package/dist/security/hsm/azure-hsm.js.map +1 -0
- package/dist/security/hsm/gcp-hsm.d.ts +184 -0
- package/dist/security/hsm/gcp-hsm.d.ts.map +1 -0
- package/dist/security/hsm/gcp-hsm.js +817 -0
- package/dist/security/hsm/gcp-hsm.js.map +1 -0
- package/dist/security/hsm/hsm-service.d.ts +264 -0
- package/dist/security/hsm/hsm-service.d.ts.map +1 -0
- package/dist/security/hsm/hsm-service.js +772 -0
- package/dist/security/hsm/hsm-service.js.map +1 -0
- package/dist/security/hsm/index.d.ts +248 -0
- package/dist/security/hsm/index.d.ts.map +1 -0
- package/dist/security/hsm/index.js +329 -0
- package/dist/security/hsm/index.js.map +1 -0
- package/dist/security/hsm/key-ceremony.d.ts +214 -0
- package/dist/security/hsm/key-ceremony.d.ts.map +1 -0
- package/dist/security/hsm/key-ceremony.js +636 -0
- package/dist/security/hsm/key-ceremony.js.map +1 -0
- package/dist/security/hsm/key-operations.d.ts +218 -0
- package/dist/security/hsm/key-operations.d.ts.map +1 -0
- package/dist/security/hsm/key-operations.js +625 -0
- package/dist/security/hsm/key-operations.js.map +1 -0
- package/dist/security/hsm/local-softHSM.d.ts +122 -0
- package/dist/security/hsm/local-softHSM.d.ts.map +1 -0
- package/dist/security/hsm/local-softHSM.js +786 -0
- package/dist/security/hsm/local-softHSM.js.map +1 -0
- package/dist/security/hsm/pkcs11-wrapper.d.ts +386 -0
- package/dist/security/hsm/pkcs11-wrapper.d.ts.map +1 -0
- package/dist/security/hsm/pkcs11-wrapper.js +1149 -0
- package/dist/security/hsm/pkcs11-wrapper.js.map +1 -0
- package/dist/security/hsm/provider.d.ts +333 -0
- package/dist/security/hsm/provider.d.ts.map +1 -0
- package/dist/security/hsm/provider.js +264 -0
- package/dist/security/hsm/provider.js.map +1 -0
- package/dist/security/hsm/thales-luna.d.ts +209 -0
- package/dist/security/hsm/thales-luna.d.ts.map +1 -0
- package/dist/security/hsm/thales-luna.js +820 -0
- package/dist/security/hsm/thales-luna.js.map +1 -0
- package/dist/security/incident/actions/block-ip.d.ts +82 -0
- package/dist/security/incident/actions/block-ip.d.ts.map +1 -0
- package/dist/security/incident/actions/block-ip.js +454 -0
- package/dist/security/incident/actions/block-ip.js.map +1 -0
- package/dist/security/incident/actions/collect-evidence.d.ts +93 -0
- package/dist/security/incident/actions/collect-evidence.d.ts.map +1 -0
- package/dist/security/incident/actions/collect-evidence.js +449 -0
- package/dist/security/incident/actions/collect-evidence.js.map +1 -0
- package/dist/security/incident/actions/index.d.ts +39 -0
- package/dist/security/incident/actions/index.d.ts.map +1 -0
- package/dist/security/incident/actions/index.js +52 -0
- package/dist/security/incident/actions/index.js.map +1 -0
- package/dist/security/incident/actions/isolate-system.d.ts +61 -0
- package/dist/security/incident/actions/isolate-system.d.ts.map +1 -0
- package/dist/security/incident/actions/isolate-system.js +369 -0
- package/dist/security/incident/actions/isolate-system.js.map +1 -0
- package/dist/security/incident/actions/notify-stakeholders.d.ts +70 -0
- package/dist/security/incident/actions/notify-stakeholders.d.ts.map +1 -0
- package/dist/security/incident/actions/notify-stakeholders.js +377 -0
- package/dist/security/incident/actions/notify-stakeholders.js.map +1 -0
- package/dist/security/incident/actions/revoke-credentials.d.ts +75 -0
- package/dist/security/incident/actions/revoke-credentials.d.ts.map +1 -0
- package/dist/security/incident/actions/revoke-credentials.js +320 -0
- package/dist/security/incident/actions/revoke-credentials.js.map +1 -0
- package/dist/security/incident/actions/scale-monitoring.d.ts +88 -0
- package/dist/security/incident/actions/scale-monitoring.d.ts.map +1 -0
- package/dist/security/incident/actions/scale-monitoring.js +473 -0
- package/dist/security/incident/actions/scale-monitoring.js.map +1 -0
- package/dist/security/incident/executor.d.ts +128 -0
- package/dist/security/incident/executor.d.ts.map +1 -0
- package/dist/security/incident/executor.js +695 -0
- package/dist/security/incident/executor.js.map +1 -0
- package/dist/security/incident/index.d.ts +220 -0
- package/dist/security/incident/index.d.ts.map +1 -0
- package/dist/security/incident/index.js +1284 -0
- package/dist/security/incident/index.js.map +1 -0
- package/dist/security/incident/notification.d.ts +68 -0
- package/dist/security/incident/notification.d.ts.map +1 -0
- package/dist/security/incident/notification.js +512 -0
- package/dist/security/incident/notification.js.map +1 -0
- package/dist/security/incident/playbooks/account-compromise.d.ts +13 -0
- package/dist/security/incident/playbooks/account-compromise.d.ts.map +1 -0
- package/dist/security/incident/playbooks/account-compromise.js +379 -0
- package/dist/security/incident/playbooks/account-compromise.js.map +1 -0
- package/dist/security/incident/playbooks/configuration-error.d.ts +17 -0
- package/dist/security/incident/playbooks/configuration-error.d.ts.map +1 -0
- package/dist/security/incident/playbooks/configuration-error.js +340 -0
- package/dist/security/incident/playbooks/configuration-error.js.map +1 -0
- package/dist/security/incident/playbooks/data-breach.d.ts +13 -0
- package/dist/security/incident/playbooks/data-breach.d.ts.map +1 -0
- package/dist/security/incident/playbooks/data-breach.js +394 -0
- package/dist/security/incident/playbooks/data-breach.js.map +1 -0
- package/dist/security/incident/playbooks/denial-of-service.d.ts +13 -0
- package/dist/security/incident/playbooks/denial-of-service.d.ts.map +1 -0
- package/dist/security/incident/playbooks/denial-of-service.js +540 -0
- package/dist/security/incident/playbooks/denial-of-service.js.map +1 -0
- package/dist/security/incident/playbooks/index.d.ts +36 -0
- package/dist/security/incident/playbooks/index.d.ts.map +1 -0
- package/dist/security/incident/playbooks/index.js +56 -0
- package/dist/security/incident/playbooks/index.js.map +1 -0
- package/dist/security/incident/playbooks/insider-threat.d.ts +18 -0
- package/dist/security/incident/playbooks/insider-threat.d.ts.map +1 -0
- package/dist/security/incident/playbooks/insider-threat.js +600 -0
- package/dist/security/incident/playbooks/insider-threat.js.map +1 -0
- package/dist/security/incident/playbooks/malware.d.ts +13 -0
- package/dist/security/incident/playbooks/malware.d.ts.map +1 -0
- package/dist/security/incident/playbooks/malware.js +515 -0
- package/dist/security/incident/playbooks/malware.js.map +1 -0
- package/dist/security/incident/playbooks/ransomware.d.ts +14 -0
- package/dist/security/incident/playbooks/ransomware.d.ts.map +1 -0
- package/dist/security/incident/playbooks/ransomware.js +693 -0
- package/dist/security/incident/playbooks/ransomware.js.map +1 -0
- package/dist/security/incident/playbooks/unauthorized-access.d.ts +13 -0
- package/dist/security/incident/playbooks/unauthorized-access.d.ts.map +1 -0
- package/dist/security/incident/playbooks/unauthorized-access.js +412 -0
- package/dist/security/incident/playbooks/unauthorized-access.js.map +1 -0
- package/dist/security/incident/triggers.d.ts +120 -0
- package/dist/security/incident/triggers.d.ts.map +1 -0
- package/dist/security/incident/triggers.js +708 -0
- package/dist/security/incident/triggers.js.map +1 -0
- package/dist/security/incident/types.d.ts +1517 -0
- package/dist/security/incident/types.d.ts.map +1 -0
- package/dist/security/incident/types.js +222 -0
- package/dist/security/incident/types.js.map +1 -0
- package/dist/security/index.d.ts +59 -0
- package/dist/security/index.d.ts.map +1 -0
- package/dist/security/index.js +295 -0
- package/dist/security/index.js.map +1 -0
- package/dist/security/injection-detector.d.ts +510 -0
- package/dist/security/injection-detector.d.ts.map +1 -0
- package/dist/security/injection-detector.js +1325 -0
- package/dist/security/injection-detector.js.map +1 -0
- package/dist/security/introspection.d.ts +137 -0
- package/dist/security/introspection.d.ts.map +1 -0
- package/dist/security/introspection.js +451 -0
- package/dist/security/introspection.js.map +1 -0
- package/dist/security/key-rotation.d.ts +213 -0
- package/dist/security/key-rotation.d.ts.map +1 -0
- package/dist/security/key-rotation.js +530 -0
- package/dist/security/key-rotation.js.map +1 -0
- package/dist/security/kms/aws-kms.d.ts +152 -0
- package/dist/security/kms/aws-kms.d.ts.map +1 -0
- package/dist/security/kms/aws-kms.js +808 -0
- package/dist/security/kms/aws-kms.js.map +1 -0
- package/dist/security/kms/index.d.ts +165 -0
- package/dist/security/kms/index.d.ts.map +1 -0
- package/dist/security/kms/index.js +351 -0
- package/dist/security/kms/index.js.map +1 -0
- package/dist/security/kms/local.d.ts +127 -0
- package/dist/security/kms/local.d.ts.map +1 -0
- package/dist/security/kms/local.js +682 -0
- package/dist/security/kms/local.js.map +1 -0
- package/dist/security/kms/types.d.ts +1000 -0
- package/dist/security/kms/types.d.ts.map +1 -0
- package/dist/security/kms/types.js +167 -0
- package/dist/security/kms/types.js.map +1 -0
- package/dist/security/kms/vault.d.ts +165 -0
- package/dist/security/kms/vault.d.ts.map +1 -0
- package/dist/security/kms/vault.js +820 -0
- package/dist/security/kms/vault.js.map +1 -0
- package/dist/security/mfa/index.d.ts +17 -0
- package/dist/security/mfa/index.d.ts.map +1 -0
- package/dist/security/mfa/index.js +37 -0
- package/dist/security/mfa/index.js.map +1 -0
- package/dist/security/mfa/mfa-middleware.d.ts +74 -0
- package/dist/security/mfa/mfa-middleware.d.ts.map +1 -0
- package/dist/security/mfa/mfa-middleware.js +244 -0
- package/dist/security/mfa/mfa-middleware.js.map +1 -0
- package/dist/security/mfa/mfa-service.d.ts +115 -0
- package/dist/security/mfa/mfa-service.d.ts.map +1 -0
- package/dist/security/mfa/mfa-service.js +509 -0
- package/dist/security/mfa/mfa-service.js.map +1 -0
- package/dist/security/mfa/mfa-store.d.ts +615 -0
- package/dist/security/mfa/mfa-store.d.ts.map +1 -0
- package/dist/security/mfa/mfa-store.js +431 -0
- package/dist/security/mfa/mfa-store.js.map +1 -0
- package/dist/security/mfa/types.d.ts +417 -0
- package/dist/security/mfa/types.d.ts.map +1 -0
- package/dist/security/mfa/types.js +123 -0
- package/dist/security/mfa/types.js.map +1 -0
- package/dist/security/middleware.d.ts +179 -0
- package/dist/security/middleware.d.ts.map +1 -0
- package/dist/security/middleware.js +534 -0
- package/dist/security/middleware.js.map +1 -0
- package/dist/security/pairwise-did.d.ts +157 -0
- package/dist/security/pairwise-did.d.ts.map +1 -0
- package/dist/security/pairwise-did.js +450 -0
- package/dist/security/pairwise-did.js.map +1 -0
- package/dist/security/pam/break-glass.d.ts +776 -0
- package/dist/security/pam/break-glass.d.ts.map +1 -0
- package/dist/security/pam/break-glass.js +1137 -0
- package/dist/security/pam/break-glass.js.map +1 -0
- package/dist/security/pam/index.d.ts +120 -0
- package/dist/security/pam/index.d.ts.map +1 -0
- package/dist/security/pam/index.js +179 -0
- package/dist/security/pam/index.js.map +1 -0
- package/dist/security/pam/jit-access.d.ts +482 -0
- package/dist/security/pam/jit-access.d.ts.map +1 -0
- package/dist/security/pam/jit-access.js +1030 -0
- package/dist/security/pam/jit-access.js.map +1 -0
- package/dist/security/pam/session-recording.d.ts +1007 -0
- package/dist/security/pam/session-recording.d.ts.map +1 -0
- package/dist/security/pam/session-recording.js +1047 -0
- package/dist/security/pam/session-recording.js.map +1 -0
- package/dist/security/password-hashing.d.ts +199 -0
- package/dist/security/password-hashing.d.ts.map +1 -0
- package/dist/security/password-hashing.js +366 -0
- package/dist/security/password-hashing.js.map +1 -0
- package/dist/security/password-policy.d.ts +304 -0
- package/dist/security/password-policy.d.ts.map +1 -0
- package/dist/security/password-policy.js +730 -0
- package/dist/security/password-policy.js.map +1 -0
- package/dist/security/pkce.d.ts +269 -0
- package/dist/security/pkce.d.ts.map +1 -0
- package/dist/security/pkce.js +408 -0
- package/dist/security/pkce.js.map +1 -0
- package/dist/security/policy-engine/built-in-policies.d.ts +90 -0
- package/dist/security/policy-engine/built-in-policies.d.ts.map +1 -0
- package/dist/security/policy-engine/built-in-policies.js +627 -0
- package/dist/security/policy-engine/built-in-policies.js.map +1 -0
- package/dist/security/policy-engine/condition-evaluator.d.ts +129 -0
- package/dist/security/policy-engine/condition-evaluator.d.ts.map +1 -0
- package/dist/security/policy-engine/condition-evaluator.js +647 -0
- package/dist/security/policy-engine/condition-evaluator.js.map +1 -0
- package/dist/security/policy-engine/engine.d.ts +200 -0
- package/dist/security/policy-engine/engine.d.ts.map +1 -0
- package/dist/security/policy-engine/engine.js +752 -0
- package/dist/security/policy-engine/engine.js.map +1 -0
- package/dist/security/policy-engine/index.d.ts +58 -0
- package/dist/security/policy-engine/index.d.ts.map +1 -0
- package/dist/security/policy-engine/index.js +80 -0
- package/dist/security/policy-engine/index.js.map +1 -0
- package/dist/security/policy-engine/middleware.d.ts +77 -0
- package/dist/security/policy-engine/middleware.d.ts.map +1 -0
- package/dist/security/policy-engine/middleware.js +375 -0
- package/dist/security/policy-engine/middleware.js.map +1 -0
- package/dist/security/policy-engine/rule-evaluator.d.ts +140 -0
- package/dist/security/policy-engine/rule-evaluator.d.ts.map +1 -0
- package/dist/security/policy-engine/rule-evaluator.js +593 -0
- package/dist/security/policy-engine/rule-evaluator.js.map +1 -0
- package/dist/security/policy-engine/types.d.ts +2855 -0
- package/dist/security/policy-engine/types.d.ts.map +1 -0
- package/dist/security/policy-engine/types.js +443 -0
- package/dist/security/policy-engine/types.js.map +1 -0
- package/dist/security/rbac/index.d.ts +317 -0
- package/dist/security/rbac/index.d.ts.map +1 -0
- package/dist/security/rbac/index.js +618 -0
- package/dist/security/rbac/index.js.map +1 -0
- package/dist/security/rbac/permissions.d.ts +305 -0
- package/dist/security/rbac/permissions.d.ts.map +1 -0
- package/dist/security/rbac/permissions.js +947 -0
- package/dist/security/rbac/permissions.js.map +1 -0
- package/dist/security/rbac/policy-engine.d.ts +542 -0
- package/dist/security/rbac/policy-engine.d.ts.map +1 -0
- package/dist/security/rbac/policy-engine.js +1244 -0
- package/dist/security/rbac/policy-engine.js.map +1 -0
- package/dist/security/rbac/roles.d.ts +478 -0
- package/dist/security/rbac/roles.d.ts.map +1 -0
- package/dist/security/rbac/roles.js +363 -0
- package/dist/security/rbac/roles.js.map +1 -0
- package/dist/security/refresh-token.d.ts +305 -0
- package/dist/security/refresh-token.d.ts.map +1 -0
- package/dist/security/refresh-token.js +674 -0
- package/dist/security/refresh-token.js.map +1 -0
- package/dist/security/request-integrity.d.ts +289 -0
- package/dist/security/request-integrity.d.ts.map +1 -0
- package/dist/security/request-integrity.js +663 -0
- package/dist/security/request-integrity.js.map +1 -0
- package/dist/security/revocation-check.d.ts +188 -0
- package/dist/security/revocation-check.d.ts.map +1 -0
- package/dist/security/revocation-check.js +606 -0
- package/dist/security/revocation-check.js.map +1 -0
- package/dist/security/revocation.d.ts +191 -0
- package/dist/security/revocation.d.ts.map +1 -0
- package/dist/security/revocation.js +522 -0
- package/dist/security/revocation.js.map +1 -0
- package/dist/security/secrets-rotation.d.ts +501 -0
- package/dist/security/secrets-rotation.d.ts.map +1 -0
- package/dist/security/secrets-rotation.js +934 -0
- package/dist/security/secrets-rotation.js.map +1 -0
- package/dist/security/secure-memory.d.ts +325 -0
- package/dist/security/secure-memory.d.ts.map +1 -0
- package/dist/security/secure-memory.js +595 -0
- package/dist/security/secure-memory.js.map +1 -0
- package/dist/security/security-service.d.ts +186 -0
- package/dist/security/security-service.d.ts.map +1 -0
- package/dist/security/security-service.js +531 -0
- package/dist/security/security-service.js.map +1 -0
- package/dist/security/service-auth/index.d.ts +20 -0
- package/dist/security/service-auth/index.d.ts.map +1 -0
- package/dist/security/service-auth/index.js +61 -0
- package/dist/security/service-auth/index.js.map +1 -0
- package/dist/security/service-auth/service-account.d.ts +357 -0
- package/dist/security/service-auth/service-account.d.ts.map +1 -0
- package/dist/security/service-auth/service-account.js +475 -0
- package/dist/security/service-auth/service-account.js.map +1 -0
- package/dist/security/service-auth/service-auth-middleware.d.ts +174 -0
- package/dist/security/service-auth/service-auth-middleware.d.ts.map +1 -0
- package/dist/security/service-auth/service-auth-middleware.js +461 -0
- package/dist/security/service-auth/service-auth-middleware.js.map +1 -0
- package/dist/security/service-auth/service-token.d.ts +391 -0
- package/dist/security/service-auth/service-token.d.ts.map +1 -0
- package/dist/security/service-auth/service-token.js +472 -0
- package/dist/security/service-auth/service-token.js.map +1 -0
- package/dist/security/session-manager.d.ts +177 -0
- package/dist/security/session-manager.d.ts.map +1 -0
- package/dist/security/session-manager.js +353 -0
- package/dist/security/session-manager.js.map +1 -0
- package/dist/security/session-store.d.ts +205 -0
- package/dist/security/session-store.d.ts.map +1 -0
- package/dist/security/session-store.js +581 -0
- package/dist/security/session-store.js.map +1 -0
- package/dist/security/siem/connector.d.ts +147 -0
- package/dist/security/siem/connector.d.ts.map +1 -0
- package/dist/security/siem/connector.js +254 -0
- package/dist/security/siem/connector.js.map +1 -0
- package/dist/security/siem/datadog.d.ts +81 -0
- package/dist/security/siem/datadog.d.ts.map +1 -0
- package/dist/security/siem/datadog.js +362 -0
- package/dist/security/siem/datadog.js.map +1 -0
- package/dist/security/siem/elastic.d.ts +83 -0
- package/dist/security/siem/elastic.d.ts.map +1 -0
- package/dist/security/siem/elastic.js +514 -0
- package/dist/security/siem/elastic.js.map +1 -0
- package/dist/security/siem/enrichment.d.ts +133 -0
- package/dist/security/siem/enrichment.d.ts.map +1 -0
- package/dist/security/siem/enrichment.js +434 -0
- package/dist/security/siem/enrichment.js.map +1 -0
- package/dist/security/siem/formatter.d.ts +118 -0
- package/dist/security/siem/formatter.d.ts.map +1 -0
- package/dist/security/siem/formatter.js +381 -0
- package/dist/security/siem/formatter.js.map +1 -0
- package/dist/security/siem/hooks.d.ts +107 -0
- package/dist/security/siem/hooks.d.ts.map +1 -0
- package/dist/security/siem/hooks.js +459 -0
- package/dist/security/siem/hooks.js.map +1 -0
- package/dist/security/siem/index.d.ts +83 -0
- package/dist/security/siem/index.d.ts.map +1 -0
- package/dist/security/siem/index.js +95 -0
- package/dist/security/siem/index.js.map +1 -0
- package/dist/security/siem/service.d.ts +153 -0
- package/dist/security/siem/service.d.ts.map +1 -0
- package/dist/security/siem/service.js +615 -0
- package/dist/security/siem/service.js.map +1 -0
- package/dist/security/siem/splunk.d.ts +76 -0
- package/dist/security/siem/splunk.d.ts.map +1 -0
- package/dist/security/siem/splunk.js +283 -0
- package/dist/security/siem/splunk.js.map +1 -0
- package/dist/security/siem/types.d.ts +1980 -0
- package/dist/security/siem/types.d.ts.map +1 -0
- package/dist/security/siem/types.js +268 -0
- package/dist/security/siem/types.js.map +1 -0
- package/dist/security/tee-production.d.ts +157 -0
- package/dist/security/tee-production.d.ts.map +1 -0
- package/dist/security/tee-production.js +792 -0
- package/dist/security/tee-production.js.map +1 -0
- package/dist/security/tee.d.ts +182 -0
- package/dist/security/tee.d.ts.map +1 -0
- package/dist/security/tee.js +1031 -0
- package/dist/security/tee.js.map +1 -0
- package/dist/security/threat-intel/bot-detection.d.ts +275 -0
- package/dist/security/threat-intel/bot-detection.d.ts.map +1 -0
- package/dist/security/threat-intel/bot-detection.js +890 -0
- package/dist/security/threat-intel/bot-detection.js.map +1 -0
- package/dist/security/threat-intel/credential-stuffing.d.ts +368 -0
- package/dist/security/threat-intel/credential-stuffing.d.ts.map +1 -0
- package/dist/security/threat-intel/credential-stuffing.js +957 -0
- package/dist/security/threat-intel/credential-stuffing.js.map +1 -0
- package/dist/security/threat-intel/index.d.ts +10 -0
- package/dist/security/threat-intel/index.d.ts.map +1 -0
- package/dist/security/threat-intel/index.js +18 -0
- package/dist/security/threat-intel/index.js.map +1 -0
- package/dist/security/threat-intel/ip-reputation.d.ts +323 -0
- package/dist/security/threat-intel/ip-reputation.d.ts.map +1 -0
- package/dist/security/threat-intel/ip-reputation.js +923 -0
- package/dist/security/threat-intel/ip-reputation.js.map +1 -0
- package/dist/security/token-lifecycle.d.ts +272 -0
- package/dist/security/token-lifecycle.d.ts.map +1 -0
- package/dist/security/token-lifecycle.js +732 -0
- package/dist/security/token-lifecycle.js.map +1 -0
- package/dist/security/token-lifetime.d.ts +206 -0
- package/dist/security/token-lifetime.d.ts.map +1 -0
- package/dist/security/token-lifetime.js +388 -0
- package/dist/security/token-lifetime.js.map +1 -0
- package/dist/security/trust-oracle/alerts.d.ts +202 -0
- package/dist/security/trust-oracle/alerts.d.ts.map +1 -0
- package/dist/security/trust-oracle/alerts.js +763 -0
- package/dist/security/trust-oracle/alerts.js.map +1 -0
- package/dist/security/trust-oracle/api.d.ts +116 -0
- package/dist/security/trust-oracle/api.d.ts.map +1 -0
- package/dist/security/trust-oracle/api.js +721 -0
- package/dist/security/trust-oracle/api.js.map +1 -0
- package/dist/security/trust-oracle/continuous-monitoring.d.ts +105 -0
- package/dist/security/trust-oracle/continuous-monitoring.d.ts.map +1 -0
- package/dist/security/trust-oracle/continuous-monitoring.js +696 -0
- package/dist/security/trust-oracle/continuous-monitoring.js.map +1 -0
- package/dist/security/trust-oracle/data-sources.d.ts +126 -0
- package/dist/security/trust-oracle/data-sources.d.ts.map +1 -0
- package/dist/security/trust-oracle/data-sources.js +867 -0
- package/dist/security/trust-oracle/data-sources.js.map +1 -0
- package/dist/security/trust-oracle/index.d.ts +79 -0
- package/dist/security/trust-oracle/index.d.ts.map +1 -0
- package/dist/security/trust-oracle/index.js +206 -0
- package/dist/security/trust-oracle/index.js.map +1 -0
- package/dist/security/trust-oracle/oracle.d.ts +125 -0
- package/dist/security/trust-oracle/oracle.d.ts.map +1 -0
- package/dist/security/trust-oracle/oracle.js +489 -0
- package/dist/security/trust-oracle/oracle.js.map +1 -0
- package/dist/security/trust-oracle/reporting.d.ts +145 -0
- package/dist/security/trust-oracle/reporting.d.ts.map +1 -0
- package/dist/security/trust-oracle/reporting.js +1098 -0
- package/dist/security/trust-oracle/reporting.js.map +1 -0
- package/dist/security/trust-oracle/risk-scorer.d.ts +207 -0
- package/dist/security/trust-oracle/risk-scorer.d.ts.map +1 -0
- package/dist/security/trust-oracle/risk-scorer.js +1033 -0
- package/dist/security/trust-oracle/risk-scorer.js.map +1 -0
- package/dist/security/trust-oracle/types.d.ts +444 -0
- package/dist/security/trust-oracle/types.d.ts.map +1 -0
- package/dist/security/trust-oracle/types.js +6 -0
- package/dist/security/trust-oracle/types.js.map +1 -0
- package/dist/security/trust-oracle/vendor-registry.d.ts +228 -0
- package/dist/security/trust-oracle/vendor-registry.d.ts.map +1 -0
- package/dist/security/trust-oracle/vendor-registry.js +727 -0
- package/dist/security/trust-oracle/vendor-registry.js.map +1 -0
- package/dist/security/types.d.ts +1777 -0
- package/dist/security/types.d.ts.map +1 -0
- package/dist/security/types.js +388 -0
- package/dist/security/types.js.map +1 -0
- package/dist/security/webauthn/index.d.ts +47 -0
- package/dist/security/webauthn/index.d.ts.map +1 -0
- package/dist/security/webauthn/index.js +48 -0
- package/dist/security/webauthn/index.js.map +1 -0
- package/dist/security/webauthn/middleware.d.ts +109 -0
- package/dist/security/webauthn/middleware.d.ts.map +1 -0
- package/dist/security/webauthn/middleware.js +629 -0
- package/dist/security/webauthn/middleware.js.map +1 -0
- package/dist/security/webauthn/service.d.ts +179 -0
- package/dist/security/webauthn/service.d.ts.map +1 -0
- package/dist/security/webauthn/service.js +758 -0
- package/dist/security/webauthn/service.js.map +1 -0
- package/dist/security/webauthn/store.d.ts +240 -0
- package/dist/security/webauthn/store.d.ts.map +1 -0
- package/dist/security/webauthn/store.js +505 -0
- package/dist/security/webauthn/store.js.map +1 -0
- package/dist/security/webauthn/types.d.ts +678 -0
- package/dist/security/webauthn/types.d.ts.map +1 -0
- package/dist/security/webauthn/types.js +176 -0
- package/dist/security/webauthn/types.js.map +1 -0
- package/dist/security/zkp/circuits.d.ts +296 -0
- package/dist/security/zkp/circuits.d.ts.map +1 -0
- package/dist/security/zkp/circuits.js +771 -0
- package/dist/security/zkp/circuits.js.map +1 -0
- package/dist/security/zkp/commitment.d.ts +319 -0
- package/dist/security/zkp/commitment.d.ts.map +1 -0
- package/dist/security/zkp/commitment.js +591 -0
- package/dist/security/zkp/commitment.js.map +1 -0
- package/dist/security/zkp/compliance.d.ts +251 -0
- package/dist/security/zkp/compliance.d.ts.map +1 -0
- package/dist/security/zkp/compliance.js +734 -0
- package/dist/security/zkp/compliance.js.map +1 -0
- package/dist/security/zkp/index.d.ts +184 -0
- package/dist/security/zkp/index.d.ts.map +1 -0
- package/dist/security/zkp/index.js +285 -0
- package/dist/security/zkp/index.js.map +1 -0
- package/dist/security/zkp/integration.d.ts +289 -0
- package/dist/security/zkp/integration.d.ts.map +1 -0
- package/dist/security/zkp/integration.js +571 -0
- package/dist/security/zkp/integration.js.map +1 -0
- package/dist/security/zkp/prover.d.ts +158 -0
- package/dist/security/zkp/prover.d.ts.map +1 -0
- package/dist/security/zkp/prover.js +465 -0
- package/dist/security/zkp/prover.js.map +1 -0
- package/dist/security/zkp/snark-utils.d.ts +321 -0
- package/dist/security/zkp/snark-utils.d.ts.map +1 -0
- package/dist/security/zkp/snark-utils.js +640 -0
- package/dist/security/zkp/snark-utils.js.map +1 -0
- package/dist/security/zkp/types.d.ts +1192 -0
- package/dist/security/zkp/types.d.ts.map +1 -0
- package/dist/security/zkp/types.js +264 -0
- package/dist/security/zkp/types.js.map +1 -0
- package/dist/security/zkp/verifier.d.ts +111 -0
- package/dist/security/zkp/verifier.d.ts.map +1 -0
- package/dist/security/zkp/verifier.js +554 -0
- package/dist/security/zkp/verifier.js.map +1 -0
- package/dist/semantic-governance/context-validator.d.ts +158 -0
- package/dist/semantic-governance/context-validator.d.ts.map +1 -0
- package/dist/semantic-governance/context-validator.js +598 -0
- package/dist/semantic-governance/context-validator.js.map +1 -0
- package/dist/semantic-governance/credential-manager.d.ts +156 -0
- package/dist/semantic-governance/credential-manager.d.ts.map +1 -0
- package/dist/semantic-governance/credential-manager.js +438 -0
- package/dist/semantic-governance/credential-manager.js.map +1 -0
- package/dist/semantic-governance/dual-channel.d.ts +138 -0
- package/dist/semantic-governance/dual-channel.d.ts.map +1 -0
- package/dist/semantic-governance/dual-channel.js +333 -0
- package/dist/semantic-governance/dual-channel.js.map +1 -0
- package/dist/semantic-governance/index.d.ts +107 -0
- package/dist/semantic-governance/index.d.ts.map +1 -0
- package/dist/semantic-governance/index.js +141 -0
- package/dist/semantic-governance/index.js.map +1 -0
- package/dist/semantic-governance/inference-validator.d.ts +114 -0
- package/dist/semantic-governance/inference-validator.d.ts.map +1 -0
- package/dist/semantic-governance/inference-validator.js +390 -0
- package/dist/semantic-governance/inference-validator.js.map +1 -0
- package/dist/semantic-governance/instruction-validator.d.ts +146 -0
- package/dist/semantic-governance/instruction-validator.d.ts.map +1 -0
- package/dist/semantic-governance/instruction-validator.js +363 -0
- package/dist/semantic-governance/instruction-validator.js.map +1 -0
- package/dist/semantic-governance/integration.d.ts +253 -0
- package/dist/semantic-governance/integration.d.ts.map +1 -0
- package/dist/semantic-governance/integration.js +658 -0
- package/dist/semantic-governance/integration.js.map +1 -0
- package/dist/semantic-governance/output-validator.d.ts +135 -0
- package/dist/semantic-governance/output-validator.d.ts.map +1 -0
- package/dist/semantic-governance/output-validator.js +448 -0
- package/dist/semantic-governance/output-validator.js.map +1 -0
- package/dist/semantic-governance/service.d.ts +120 -0
- package/dist/semantic-governance/service.d.ts.map +1 -0
- package/dist/semantic-governance/service.js +527 -0
- package/dist/semantic-governance/service.js.map +1 -0
- package/dist/semantic-governance/types.d.ts +3925 -0
- package/dist/semantic-governance/types.d.ts.map +1 -0
- package/dist/semantic-governance/types.js +471 -0
- package/dist/semantic-governance/types.js.map +1 -0
- package/dist/trust-engine/car-integration.d.ts +263 -0
- package/dist/trust-engine/car-integration.d.ts.map +1 -0
- package/dist/trust-engine/car-integration.js +320 -0
- package/dist/trust-engine/car-integration.js.map +1 -0
- package/dist/trust-engine/context.d.ts +198 -0
- package/dist/trust-engine/context.d.ts.map +1 -0
- package/dist/trust-engine/context.js +308 -0
- package/dist/trust-engine/context.js.map +1 -0
- package/dist/trust-engine/diminishing-returns.d.ts +123 -0
- package/dist/trust-engine/diminishing-returns.d.ts.map +1 -0
- package/dist/trust-engine/diminishing-returns.js +197 -0
- package/dist/trust-engine/diminishing-returns.js.map +1 -0
- package/dist/trust-engine/index.d.ts +433 -0
- package/dist/trust-engine/index.d.ts.map +1 -0
- package/dist/trust-engine/index.js +1241 -0
- package/dist/trust-engine/index.js.map +1 -0
- package/dist/trust-engine/observability.d.ts +175 -0
- package/dist/trust-engine/observability.d.ts.map +1 -0
- package/dist/trust-engine/observability.js +246 -0
- package/dist/trust-engine/observability.js.map +1 -0
- package/dist/trust-engine/signal-diversity.d.ts +130 -0
- package/dist/trust-engine/signal-diversity.d.ts.map +1 -0
- package/dist/trust-engine/signal-diversity.js +238 -0
- package/dist/trust-engine/signal-diversity.js.map +1 -0
- package/dist/versioning/deprecation.d.ts +65 -0
- package/dist/versioning/deprecation.d.ts.map +1 -0
- package/dist/versioning/deprecation.js +199 -0
- package/dist/versioning/deprecation.js.map +1 -0
- package/dist/versioning/index.d.ts +46 -0
- package/dist/versioning/index.d.ts.map +1 -0
- package/dist/versioning/index.js +76 -0
- package/dist/versioning/index.js.map +1 -0
- package/dist/versioning/semver.d.ts +116 -0
- package/dist/versioning/semver.d.ts.map +1 -0
- package/dist/versioning/semver.js +321 -0
- package/dist/versioning/semver.js.map +1 -0
- package/package.json +161 -0
|
@@ -0,0 +1,1244 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RBAC Policy Evaluation Engine
|
|
3
|
+
*
|
|
4
|
+
* Evaluates access control policies based on:
|
|
5
|
+
* - Role-based permissions
|
|
6
|
+
* - Resource-based access control
|
|
7
|
+
* - Trust tier requirements
|
|
8
|
+
* - Time-based and conditional policies
|
|
9
|
+
* - Tenant context isolation
|
|
10
|
+
*
|
|
11
|
+
* Integrates with TenantContext for multi-tenant authorization and
|
|
12
|
+
* Trust-engine for trust-based access decisions.
|
|
13
|
+
*
|
|
14
|
+
* @packageDocumentation
|
|
15
|
+
*/
|
|
16
|
+
import { z } from 'zod';
|
|
17
|
+
import { createLogger } from '../../common/logger.js';
|
|
18
|
+
import { withSpan } from '../../common/trace.js';
|
|
19
|
+
import { Counter, Histogram } from 'prom-client';
|
|
20
|
+
import { vorionRegistry } from '../../common/metrics-registry.js';
|
|
21
|
+
import { getEffectivePermissions, getBuiltinRoles, } from './roles.js';
|
|
22
|
+
import { hasPermission, hasAllPermissions, getBuiltinPermissions, } from './permissions.js';
|
|
23
|
+
import { getSecurityAuditLogger, } from '../../audit/security-logger.js';
|
|
24
|
+
const logger = createLogger({ component: 'rbac-policy-engine' });
|
|
25
|
+
// =============================================================================
|
|
26
|
+
// METRICS
|
|
27
|
+
// =============================================================================
|
|
28
|
+
const policyEvaluations = new Counter({
|
|
29
|
+
name: 'vorion_rbac_policy_evaluations_total',
|
|
30
|
+
help: 'Total RBAC policy evaluations',
|
|
31
|
+
labelNames: ['result', 'policy_type'],
|
|
32
|
+
registers: [vorionRegistry],
|
|
33
|
+
});
|
|
34
|
+
const policyEvaluationDuration = new Histogram({
|
|
35
|
+
name: 'vorion_rbac_policy_evaluation_duration_seconds',
|
|
36
|
+
help: 'Duration of RBAC policy evaluation',
|
|
37
|
+
labelNames: ['policy_type'],
|
|
38
|
+
buckets: [0.001, 0.005, 0.01, 0.025, 0.05, 0.1],
|
|
39
|
+
registers: [vorionRegistry],
|
|
40
|
+
});
|
|
41
|
+
const permissionChecks = new Counter({
|
|
42
|
+
name: 'vorion_rbac_permission_checks_total',
|
|
43
|
+
help: 'Total RBAC permission checks',
|
|
44
|
+
labelNames: ['result', 'resource_type'],
|
|
45
|
+
registers: [vorionRegistry],
|
|
46
|
+
});
|
|
47
|
+
// =============================================================================
|
|
48
|
+
// TYPES
|
|
49
|
+
// =============================================================================
|
|
50
|
+
/**
|
|
51
|
+
* Access control policy types
|
|
52
|
+
*/
|
|
53
|
+
export const PolicyTypes = {
|
|
54
|
+
/** Role-based permission check */
|
|
55
|
+
ROLE_BASED: 'role_based',
|
|
56
|
+
/** Resource-based permission check */
|
|
57
|
+
RESOURCE_BASED: 'resource_based',
|
|
58
|
+
/** Trust-tier requirement */
|
|
59
|
+
TRUST_BASED: 'trust_based',
|
|
60
|
+
/** Time-based restriction */
|
|
61
|
+
TIME_BASED: 'time_based',
|
|
62
|
+
/** Conditional policy */
|
|
63
|
+
CONDITIONAL: 'conditional',
|
|
64
|
+
/** Composite (multiple policies) */
|
|
65
|
+
COMPOSITE: 'composite',
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* Policy evaluation effect
|
|
69
|
+
*/
|
|
70
|
+
export const PolicyEffects = {
|
|
71
|
+
ALLOW: 'allow',
|
|
72
|
+
DENY: 'deny',
|
|
73
|
+
INDETERMINATE: 'indeterminate',
|
|
74
|
+
NOT_APPLICABLE: 'not_applicable',
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
* Policy combining algorithm
|
|
78
|
+
*/
|
|
79
|
+
export const CombiningAlgorithms = {
|
|
80
|
+
/** First deny wins */
|
|
81
|
+
DENY_OVERRIDES: 'deny_overrides',
|
|
82
|
+
/** First allow wins */
|
|
83
|
+
PERMIT_OVERRIDES: 'permit_overrides',
|
|
84
|
+
/** All must allow */
|
|
85
|
+
UNANIMOUS: 'unanimous',
|
|
86
|
+
/** First applicable wins */
|
|
87
|
+
FIRST_APPLICABLE: 'first_applicable',
|
|
88
|
+
/** Priority-based (highest priority wins) */
|
|
89
|
+
PRIORITY_BASED: 'priority_based',
|
|
90
|
+
};
|
|
91
|
+
// =============================================================================
|
|
92
|
+
// ZOD SCHEMAS
|
|
93
|
+
// =============================================================================
|
|
94
|
+
export const policyTargetSchema = z.object({
|
|
95
|
+
subjectIds: z.array(z.string()).optional(),
|
|
96
|
+
subjectTypes: z.array(z.enum(['user', 'agent', 'service'])).optional(),
|
|
97
|
+
roleIds: z.array(z.string()).optional(),
|
|
98
|
+
tenantIds: z.array(z.string()).optional(),
|
|
99
|
+
excludeSubjectIds: z.array(z.string()).optional(),
|
|
100
|
+
});
|
|
101
|
+
export const policyConditionsSchema = z.object({
|
|
102
|
+
ipAddresses: z.array(z.string()).optional(),
|
|
103
|
+
timeWindow: z.object({
|
|
104
|
+
startTime: z.string(),
|
|
105
|
+
endTime: z.string(),
|
|
106
|
+
daysOfWeek: z.array(z.number()),
|
|
107
|
+
timezone: z.string(),
|
|
108
|
+
}).optional(),
|
|
109
|
+
attributes: z.record(z.unknown()).optional(),
|
|
110
|
+
expression: z.string().optional(),
|
|
111
|
+
});
|
|
112
|
+
export const accessPolicySchema = z.lazy(() => z.object({
|
|
113
|
+
id: z.string(),
|
|
114
|
+
name: z.string(),
|
|
115
|
+
description: z.string().optional(),
|
|
116
|
+
type: z.nativeEnum(PolicyTypes),
|
|
117
|
+
priority: z.number().int().min(0),
|
|
118
|
+
effect: z.nativeEnum(PolicyEffects),
|
|
119
|
+
target: policyTargetSchema.optional(),
|
|
120
|
+
conditions: policyConditionsSchema.optional(),
|
|
121
|
+
requiredPermissions: z.array(z.string()).optional(),
|
|
122
|
+
requiredRoles: z.array(z.string()).optional(),
|
|
123
|
+
requiredTrustTier: z.number().int().min(0).max(7).optional(),
|
|
124
|
+
resourcePatterns: z.array(z.string()).optional(),
|
|
125
|
+
timeRestrictions: z.array(z.object({
|
|
126
|
+
startTime: z.string(),
|
|
127
|
+
endTime: z.string(),
|
|
128
|
+
daysOfWeek: z.array(z.number()),
|
|
129
|
+
timezone: z.string(),
|
|
130
|
+
})).optional(),
|
|
131
|
+
childPolicies: z.array(z.lazy(() => accessPolicySchema)).optional(),
|
|
132
|
+
combiningAlgorithm: z.nativeEnum(CombiningAlgorithms).optional(),
|
|
133
|
+
enabled: z.boolean(),
|
|
134
|
+
tenantId: z.string().optional(),
|
|
135
|
+
metadata: z.record(z.unknown()).optional(),
|
|
136
|
+
createdAt: z.string().datetime(),
|
|
137
|
+
updatedAt: z.string().datetime(),
|
|
138
|
+
}));
|
|
139
|
+
/**
|
|
140
|
+
* RBAC Policy Evaluation Engine
|
|
141
|
+
*
|
|
142
|
+
* Provides comprehensive policy evaluation for access control decisions.
|
|
143
|
+
* Supports multiple policy types and combining algorithms.
|
|
144
|
+
*/
|
|
145
|
+
export class RBACPolicyEngine {
|
|
146
|
+
policies = new Map();
|
|
147
|
+
roleRegistry = new Map();
|
|
148
|
+
permissionRegistry = new Map();
|
|
149
|
+
roleAssignments = new Map();
|
|
150
|
+
options;
|
|
151
|
+
auditLogger;
|
|
152
|
+
evaluationCache = new Map();
|
|
153
|
+
constructor(options = {}) {
|
|
154
|
+
this.options = {
|
|
155
|
+
defaultCombiningAlgorithm: options.defaultCombiningAlgorithm ?? CombiningAlgorithms.DENY_OVERRIDES,
|
|
156
|
+
defaultEffect: options.defaultEffect ?? PolicyEffects.DENY,
|
|
157
|
+
enableAuditLogging: options.enableAuditLogging ?? true,
|
|
158
|
+
enableTracing: options.enableTracing ?? true,
|
|
159
|
+
enableCaching: options.enableCaching ?? true,
|
|
160
|
+
cacheTtlMs: options.cacheTtlMs ?? 60000, // 1 minute
|
|
161
|
+
};
|
|
162
|
+
this.auditLogger = getSecurityAuditLogger();
|
|
163
|
+
// Initialize with built-in roles and permissions
|
|
164
|
+
this.initializeBuiltins();
|
|
165
|
+
logger.info({
|
|
166
|
+
defaultCombiningAlgorithm: this.options.defaultCombiningAlgorithm,
|
|
167
|
+
defaultEffect: this.options.defaultEffect,
|
|
168
|
+
}, 'RBAC policy engine initialized');
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Initialize built-in roles and permissions
|
|
172
|
+
*/
|
|
173
|
+
initializeBuiltins() {
|
|
174
|
+
// Register built-in roles
|
|
175
|
+
for (const role of getBuiltinRoles()) {
|
|
176
|
+
this.roleRegistry.set(role.id, role);
|
|
177
|
+
}
|
|
178
|
+
// Register built-in permissions
|
|
179
|
+
for (const permission of getBuiltinPermissions()) {
|
|
180
|
+
this.permissionRegistry.set(permission.id, permission);
|
|
181
|
+
}
|
|
182
|
+
logger.debug({
|
|
183
|
+
roles: this.roleRegistry.size,
|
|
184
|
+
permissions: this.permissionRegistry.size,
|
|
185
|
+
}, 'Built-in roles and permissions initialized');
|
|
186
|
+
}
|
|
187
|
+
// ===========================================================================
|
|
188
|
+
// POLICY EVALUATION
|
|
189
|
+
// ===========================================================================
|
|
190
|
+
/**
|
|
191
|
+
* Evaluate access request against all applicable policies
|
|
192
|
+
*/
|
|
193
|
+
async evaluate(context) {
|
|
194
|
+
const startTime = performance.now();
|
|
195
|
+
// Check cache
|
|
196
|
+
if (this.options.enableCaching) {
|
|
197
|
+
const cacheKey = this.buildCacheKey(context);
|
|
198
|
+
const cached = this.evaluationCache.get(cacheKey);
|
|
199
|
+
if (cached && cached.expiresAt > Date.now()) {
|
|
200
|
+
policyEvaluations.inc({ result: cached.result.effect, policy_type: 'cached' });
|
|
201
|
+
return cached.result;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
const evaluatedPolicies = [];
|
|
205
|
+
const effects = [];
|
|
206
|
+
// Get applicable policies sorted by priority
|
|
207
|
+
const applicablePolicies = this.getApplicablePolicies(context);
|
|
208
|
+
for (const policy of applicablePolicies) {
|
|
209
|
+
const policyStartTime = performance.now();
|
|
210
|
+
const evaluation = await this.evaluatePolicy(policy, context);
|
|
211
|
+
const policyDuration = performance.now() - policyStartTime;
|
|
212
|
+
const evaluatedPolicy = {
|
|
213
|
+
policyId: policy.id,
|
|
214
|
+
policyName: policy.name,
|
|
215
|
+
policyType: policy.type,
|
|
216
|
+
effect: evaluation.effect,
|
|
217
|
+
matched: evaluation.matched,
|
|
218
|
+
reason: evaluation.reason,
|
|
219
|
+
durationMs: policyDuration,
|
|
220
|
+
};
|
|
221
|
+
evaluatedPolicies.push(evaluatedPolicy);
|
|
222
|
+
if (evaluation.matched && evaluation.effect !== PolicyEffects.NOT_APPLICABLE) {
|
|
223
|
+
effects.push({
|
|
224
|
+
effect: evaluation.effect,
|
|
225
|
+
policy: evaluatedPolicy,
|
|
226
|
+
priority: policy.priority,
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
policyEvaluationDuration.observe({ policy_type: policy.type }, policyDuration / 1000);
|
|
230
|
+
}
|
|
231
|
+
// Combine effects using the configured algorithm
|
|
232
|
+
const { effect, decidingPolicy } = this.combineEffects(effects, this.options.defaultCombiningAlgorithm);
|
|
233
|
+
const finalEffect = effects.length === 0 ? this.options.defaultEffect : effect;
|
|
234
|
+
const permitted = finalEffect === PolicyEffects.ALLOW;
|
|
235
|
+
const durationMs = performance.now() - startTime;
|
|
236
|
+
// Build missing requirements if denied
|
|
237
|
+
const missingRequirements = !permitted
|
|
238
|
+
? this.getMissingRequirements(context, applicablePolicies)
|
|
239
|
+
: undefined;
|
|
240
|
+
const result = {
|
|
241
|
+
effect: finalEffect,
|
|
242
|
+
permitted,
|
|
243
|
+
evaluatedPolicies,
|
|
244
|
+
decidingPolicy,
|
|
245
|
+
reason: this.buildDecisionReason(finalEffect, decidingPolicy, missingRequirements),
|
|
246
|
+
missingRequirements,
|
|
247
|
+
durationMs,
|
|
248
|
+
evaluatedAt: new Date().toISOString(),
|
|
249
|
+
};
|
|
250
|
+
// Cache result
|
|
251
|
+
if (this.options.enableCaching) {
|
|
252
|
+
const cacheKey = this.buildCacheKey(context);
|
|
253
|
+
this.evaluationCache.set(cacheKey, {
|
|
254
|
+
result,
|
|
255
|
+
expiresAt: Date.now() + this.options.cacheTtlMs,
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
// Audit logging
|
|
259
|
+
if (this.options.enableAuditLogging) {
|
|
260
|
+
await this.logAccessDecision(context, result);
|
|
261
|
+
}
|
|
262
|
+
policyEvaluations.inc({ result: finalEffect, policy_type: 'evaluated' });
|
|
263
|
+
logger.debug({
|
|
264
|
+
subjectId: context.subject.id,
|
|
265
|
+
resourceType: context.resource.type,
|
|
266
|
+
action: context.resource.action,
|
|
267
|
+
effect: finalEffect,
|
|
268
|
+
permitted,
|
|
269
|
+
policiesEvaluated: evaluatedPolicies.length,
|
|
270
|
+
durationMs,
|
|
271
|
+
}, 'Policy evaluation completed');
|
|
272
|
+
return result;
|
|
273
|
+
}
|
|
274
|
+
/**
|
|
275
|
+
* Evaluate with OpenTelemetry tracing
|
|
276
|
+
*/
|
|
277
|
+
async evaluateWithTracing(context) {
|
|
278
|
+
if (!this.options.enableTracing) {
|
|
279
|
+
return this.evaluate(context);
|
|
280
|
+
}
|
|
281
|
+
return withSpan('rbac.evaluatePolicy', async (span) => {
|
|
282
|
+
span.attributes['subject.id'] = context.subject.id;
|
|
283
|
+
span.attributes['subject.type'] = context.subject.type;
|
|
284
|
+
span.attributes['resource.type'] = context.resource.type;
|
|
285
|
+
span.attributes['resource.action'] = context.resource.action;
|
|
286
|
+
const result = await this.evaluate(context);
|
|
287
|
+
span.attributes['result.effect'] = result.effect;
|
|
288
|
+
span.attributes['result.permitted'] = result.permitted;
|
|
289
|
+
span.attributes['result.policiesEvaluated'] = result.evaluatedPolicies.length;
|
|
290
|
+
span.attributes['result.durationMs'] = result.durationMs;
|
|
291
|
+
return result;
|
|
292
|
+
}, { 'tenant.id': context.environment.tenantId });
|
|
293
|
+
}
|
|
294
|
+
/**
|
|
295
|
+
* Evaluate a single policy
|
|
296
|
+
*/
|
|
297
|
+
async evaluatePolicy(policy, context) {
|
|
298
|
+
// Check if policy targets this subject
|
|
299
|
+
if (!this.policyTargetsSubject(policy, context)) {
|
|
300
|
+
return { effect: PolicyEffects.NOT_APPLICABLE, matched: false, reason: 'Target mismatch' };
|
|
301
|
+
}
|
|
302
|
+
// Check conditions
|
|
303
|
+
if (policy.conditions && !this.checkConditions(policy.conditions, context)) {
|
|
304
|
+
return { effect: PolicyEffects.NOT_APPLICABLE, matched: false, reason: 'Conditions not met' };
|
|
305
|
+
}
|
|
306
|
+
// Check time restrictions
|
|
307
|
+
if (policy.timeRestrictions && !this.checkTimeRestrictions(policy.timeRestrictions, context.environment.timestamp)) {
|
|
308
|
+
return { effect: PolicyEffects.NOT_APPLICABLE, matched: false, reason: 'Outside time window' };
|
|
309
|
+
}
|
|
310
|
+
// Evaluate based on policy type
|
|
311
|
+
switch (policy.type) {
|
|
312
|
+
case PolicyTypes.ROLE_BASED:
|
|
313
|
+
return this.evaluateRoleBasedPolicy(policy, context);
|
|
314
|
+
case PolicyTypes.RESOURCE_BASED:
|
|
315
|
+
return this.evaluateResourceBasedPolicy(policy, context);
|
|
316
|
+
case PolicyTypes.TRUST_BASED:
|
|
317
|
+
return this.evaluateTrustBasedPolicy(policy, context);
|
|
318
|
+
case PolicyTypes.TIME_BASED:
|
|
319
|
+
return this.evaluateTimeBasedPolicy(policy, context);
|
|
320
|
+
case PolicyTypes.CONDITIONAL:
|
|
321
|
+
return this.evaluateConditionalPolicy(policy, context);
|
|
322
|
+
case PolicyTypes.COMPOSITE:
|
|
323
|
+
return this.evaluateCompositePolicy(policy, context);
|
|
324
|
+
default:
|
|
325
|
+
return { effect: PolicyEffects.INDETERMINATE, matched: false, reason: 'Unknown policy type' };
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
/**
|
|
329
|
+
* Evaluate role-based policy
|
|
330
|
+
*/
|
|
331
|
+
evaluateRoleBasedPolicy(policy, context) {
|
|
332
|
+
// Check required roles
|
|
333
|
+
if (policy.requiredRoles && policy.requiredRoles.length > 0) {
|
|
334
|
+
const hasRequiredRole = policy.requiredRoles.some(role => context.subject.roles.includes(role));
|
|
335
|
+
if (!hasRequiredRole) {
|
|
336
|
+
return {
|
|
337
|
+
effect: PolicyEffects.DENY,
|
|
338
|
+
matched: true,
|
|
339
|
+
reason: `Missing required role: ${policy.requiredRoles.join(' or ')}`,
|
|
340
|
+
};
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
// Check required permissions
|
|
344
|
+
if (policy.requiredPermissions && policy.requiredPermissions.length > 0) {
|
|
345
|
+
const hasAllRequired = hasAllPermissions(context.subject.permissions, policy.requiredPermissions);
|
|
346
|
+
if (!hasAllRequired) {
|
|
347
|
+
return {
|
|
348
|
+
effect: PolicyEffects.DENY,
|
|
349
|
+
matched: true,
|
|
350
|
+
reason: 'Missing required permissions',
|
|
351
|
+
};
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
return { effect: policy.effect, matched: true };
|
|
355
|
+
}
|
|
356
|
+
/**
|
|
357
|
+
* Evaluate resource-based policy
|
|
358
|
+
*/
|
|
359
|
+
evaluateResourceBasedPolicy(policy, context) {
|
|
360
|
+
// Check resource patterns
|
|
361
|
+
if (policy.resourcePatterns && policy.resourcePatterns.length > 0) {
|
|
362
|
+
const resourceKey = `${context.resource.type}:${context.resource.action}`;
|
|
363
|
+
const matches = policy.resourcePatterns.some(pattern => this.matchPattern(resourceKey, pattern));
|
|
364
|
+
if (!matches) {
|
|
365
|
+
return {
|
|
366
|
+
effect: PolicyEffects.NOT_APPLICABLE,
|
|
367
|
+
matched: false,
|
|
368
|
+
reason: 'Resource pattern mismatch',
|
|
369
|
+
};
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
// Check if subject has permission for this resource action
|
|
373
|
+
const requiredPermission = `${context.resource.type}:${context.resource.action}`;
|
|
374
|
+
if (!hasPermission(context.subject.permissions, requiredPermission)) {
|
|
375
|
+
return {
|
|
376
|
+
effect: PolicyEffects.DENY,
|
|
377
|
+
matched: true,
|
|
378
|
+
reason: `Missing permission: ${requiredPermission}`,
|
|
379
|
+
};
|
|
380
|
+
}
|
|
381
|
+
return { effect: policy.effect, matched: true };
|
|
382
|
+
}
|
|
383
|
+
/**
|
|
384
|
+
* Evaluate trust-based policy
|
|
385
|
+
*/
|
|
386
|
+
evaluateTrustBasedPolicy(policy, context) {
|
|
387
|
+
if (policy.requiredTrustTier !== undefined) {
|
|
388
|
+
if (context.subject.trustTier < policy.requiredTrustTier) {
|
|
389
|
+
return {
|
|
390
|
+
effect: PolicyEffects.DENY,
|
|
391
|
+
matched: true,
|
|
392
|
+
reason: `Insufficient trust tier: requires T${policy.requiredTrustTier}, has T${context.subject.trustTier}`,
|
|
393
|
+
};
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
return { effect: policy.effect, matched: true };
|
|
397
|
+
}
|
|
398
|
+
/**
|
|
399
|
+
* Evaluate time-based policy
|
|
400
|
+
*/
|
|
401
|
+
evaluateTimeBasedPolicy(policy, context) {
|
|
402
|
+
if (policy.timeRestrictions && policy.timeRestrictions.length > 0) {
|
|
403
|
+
const withinWindow = this.checkTimeRestrictions(policy.timeRestrictions, context.environment.timestamp);
|
|
404
|
+
if (!withinWindow) {
|
|
405
|
+
return {
|
|
406
|
+
effect: PolicyEffects.DENY,
|
|
407
|
+
matched: true,
|
|
408
|
+
reason: 'Access outside allowed time window',
|
|
409
|
+
};
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
return { effect: policy.effect, matched: true };
|
|
413
|
+
}
|
|
414
|
+
/**
|
|
415
|
+
* Evaluate conditional policy
|
|
416
|
+
*/
|
|
417
|
+
evaluateConditionalPolicy(policy, context) {
|
|
418
|
+
if (!policy.conditions) {
|
|
419
|
+
return { effect: policy.effect, matched: true };
|
|
420
|
+
}
|
|
421
|
+
const conditionsMet = this.checkConditions(policy.conditions, context);
|
|
422
|
+
if (!conditionsMet) {
|
|
423
|
+
return {
|
|
424
|
+
effect: PolicyEffects.DENY,
|
|
425
|
+
matched: true,
|
|
426
|
+
reason: 'Policy conditions not met',
|
|
427
|
+
};
|
|
428
|
+
}
|
|
429
|
+
return { effect: policy.effect, matched: true };
|
|
430
|
+
}
|
|
431
|
+
/**
|
|
432
|
+
* Evaluate composite policy (with child policies)
|
|
433
|
+
*/
|
|
434
|
+
async evaluateCompositePolicy(policy, context) {
|
|
435
|
+
if (!policy.childPolicies || policy.childPolicies.length === 0) {
|
|
436
|
+
return { effect: policy.effect, matched: true };
|
|
437
|
+
}
|
|
438
|
+
const childEffects = [];
|
|
439
|
+
for (const childPolicy of policy.childPolicies) {
|
|
440
|
+
if (!childPolicy.enabled)
|
|
441
|
+
continue;
|
|
442
|
+
const evaluation = await this.evaluatePolicy(childPolicy, context);
|
|
443
|
+
if (evaluation.matched) {
|
|
444
|
+
childEffects.push({
|
|
445
|
+
effect: evaluation.effect,
|
|
446
|
+
policy: childPolicy,
|
|
447
|
+
priority: childPolicy.priority,
|
|
448
|
+
});
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
const algorithm = policy.combiningAlgorithm ?? this.options.defaultCombiningAlgorithm;
|
|
452
|
+
const { effect } = this.combineEffects(childEffects.map(e => ({
|
|
453
|
+
effect: e.effect,
|
|
454
|
+
policy: {
|
|
455
|
+
policyId: e.policy.id,
|
|
456
|
+
policyName: e.policy.name,
|
|
457
|
+
policyType: e.policy.type,
|
|
458
|
+
effect: e.effect,
|
|
459
|
+
matched: true,
|
|
460
|
+
durationMs: 0,
|
|
461
|
+
},
|
|
462
|
+
priority: e.priority,
|
|
463
|
+
})), algorithm);
|
|
464
|
+
return { effect, matched: true };
|
|
465
|
+
}
|
|
466
|
+
// ===========================================================================
|
|
467
|
+
// PERMISSION CHECKING
|
|
468
|
+
// ===========================================================================
|
|
469
|
+
/**
|
|
470
|
+
* Check if a subject has specific permissions
|
|
471
|
+
*/
|
|
472
|
+
async checkPermissions(request) {
|
|
473
|
+
const startTime = performance.now();
|
|
474
|
+
const grantedPermissions = [];
|
|
475
|
+
const deniedPermissions = [];
|
|
476
|
+
// Get subject's effective permissions from roles
|
|
477
|
+
const subjectPermissions = await this.getSubjectPermissions(request.subjectId, request.tenantId);
|
|
478
|
+
for (const required of request.permissions) {
|
|
479
|
+
if (hasPermission(subjectPermissions, required)) {
|
|
480
|
+
grantedPermissions.push(required);
|
|
481
|
+
}
|
|
482
|
+
else {
|
|
483
|
+
deniedPermissions.push(required);
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
const granted = deniedPermissions.length === 0;
|
|
487
|
+
const result = {
|
|
488
|
+
granted,
|
|
489
|
+
grantedPermissions,
|
|
490
|
+
deniedPermissions,
|
|
491
|
+
reason: granted
|
|
492
|
+
? undefined
|
|
493
|
+
: `Missing permissions: ${deniedPermissions.join(', ')}`,
|
|
494
|
+
grantSource: granted ? this.determineGrantSource(subjectPermissions, grantedPermissions) : undefined,
|
|
495
|
+
evaluatedAt: new Date().toISOString(),
|
|
496
|
+
};
|
|
497
|
+
permissionChecks.inc({
|
|
498
|
+
result: granted ? 'granted' : 'denied',
|
|
499
|
+
resource_type: request.resourceType ?? 'unknown',
|
|
500
|
+
});
|
|
501
|
+
logger.debug({
|
|
502
|
+
subjectId: request.subjectId,
|
|
503
|
+
permissions: request.permissions,
|
|
504
|
+
granted,
|
|
505
|
+
durationMs: performance.now() - startTime,
|
|
506
|
+
}, 'Permission check completed');
|
|
507
|
+
return result;
|
|
508
|
+
}
|
|
509
|
+
/**
|
|
510
|
+
* Get all effective permissions for a subject
|
|
511
|
+
*/
|
|
512
|
+
async getSubjectPermissions(subjectId, tenantId) {
|
|
513
|
+
const permissions = new Set();
|
|
514
|
+
// Get role assignments for subject
|
|
515
|
+
const assignments = this.roleAssignments.get(subjectId) ?? [];
|
|
516
|
+
for (const assignment of assignments) {
|
|
517
|
+
if (!assignment.active)
|
|
518
|
+
continue;
|
|
519
|
+
if (assignment.expiresAt && new Date(assignment.expiresAt) < new Date())
|
|
520
|
+
continue;
|
|
521
|
+
if (tenantId && assignment.tenantId && assignment.tenantId !== tenantId)
|
|
522
|
+
continue;
|
|
523
|
+
const role = this.roleRegistry.get(assignment.roleId);
|
|
524
|
+
if (!role || !role.enabled)
|
|
525
|
+
continue;
|
|
526
|
+
// Get effective permissions for role (including inherited)
|
|
527
|
+
const rolePermissions = getEffectivePermissions(role, this.roleRegistry);
|
|
528
|
+
for (const perm of rolePermissions) {
|
|
529
|
+
permissions.add(perm);
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
return permissions;
|
|
533
|
+
}
|
|
534
|
+
/**
|
|
535
|
+
* Get all roles assigned to a subject
|
|
536
|
+
*/
|
|
537
|
+
async getSubjectRoles(subjectId, tenantId) {
|
|
538
|
+
const roles = [];
|
|
539
|
+
const assignments = this.roleAssignments.get(subjectId) ?? [];
|
|
540
|
+
for (const assignment of assignments) {
|
|
541
|
+
if (!assignment.active)
|
|
542
|
+
continue;
|
|
543
|
+
if (assignment.expiresAt && new Date(assignment.expiresAt) < new Date())
|
|
544
|
+
continue;
|
|
545
|
+
if (tenantId && assignment.tenantId && assignment.tenantId !== tenantId)
|
|
546
|
+
continue;
|
|
547
|
+
const role = this.roleRegistry.get(assignment.roleId);
|
|
548
|
+
if (role && role.enabled) {
|
|
549
|
+
roles.push(role);
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
return roles;
|
|
553
|
+
}
|
|
554
|
+
// ===========================================================================
|
|
555
|
+
// POLICY MANAGEMENT
|
|
556
|
+
// ===========================================================================
|
|
557
|
+
/**
|
|
558
|
+
* Add an access policy
|
|
559
|
+
*/
|
|
560
|
+
addPolicy(policy) {
|
|
561
|
+
accessPolicySchema.parse(policy);
|
|
562
|
+
this.policies.set(policy.id, policy);
|
|
563
|
+
this.clearCache();
|
|
564
|
+
logger.info({ policyId: policy.id, policyName: policy.name }, 'Policy added');
|
|
565
|
+
}
|
|
566
|
+
/**
|
|
567
|
+
* Update an access policy
|
|
568
|
+
*/
|
|
569
|
+
updatePolicy(policyId, updates) {
|
|
570
|
+
const existing = this.policies.get(policyId);
|
|
571
|
+
if (!existing) {
|
|
572
|
+
throw new Error(`Policy not found: ${policyId}`);
|
|
573
|
+
}
|
|
574
|
+
const updated = {
|
|
575
|
+
...existing,
|
|
576
|
+
...updates,
|
|
577
|
+
updatedAt: new Date().toISOString(),
|
|
578
|
+
};
|
|
579
|
+
accessPolicySchema.parse(updated);
|
|
580
|
+
this.policies.set(policyId, updated);
|
|
581
|
+
this.clearCache();
|
|
582
|
+
logger.info({ policyId }, 'Policy updated');
|
|
583
|
+
}
|
|
584
|
+
/**
|
|
585
|
+
* Remove an access policy
|
|
586
|
+
*/
|
|
587
|
+
removePolicy(policyId) {
|
|
588
|
+
const removed = this.policies.delete(policyId);
|
|
589
|
+
if (removed) {
|
|
590
|
+
this.clearCache();
|
|
591
|
+
logger.info({ policyId }, 'Policy removed');
|
|
592
|
+
}
|
|
593
|
+
return removed;
|
|
594
|
+
}
|
|
595
|
+
/**
|
|
596
|
+
* Get a policy by ID
|
|
597
|
+
*/
|
|
598
|
+
getPolicy(policyId) {
|
|
599
|
+
return this.policies.get(policyId);
|
|
600
|
+
}
|
|
601
|
+
/**
|
|
602
|
+
* Get all policies
|
|
603
|
+
*/
|
|
604
|
+
getAllPolicies() {
|
|
605
|
+
return Array.from(this.policies.values());
|
|
606
|
+
}
|
|
607
|
+
/**
|
|
608
|
+
* Get enabled policies
|
|
609
|
+
*/
|
|
610
|
+
getEnabledPolicies() {
|
|
611
|
+
return Array.from(this.policies.values()).filter(p => p.enabled);
|
|
612
|
+
}
|
|
613
|
+
// ===========================================================================
|
|
614
|
+
// ROLE MANAGEMENT
|
|
615
|
+
// ===========================================================================
|
|
616
|
+
/**
|
|
617
|
+
* Add a custom role
|
|
618
|
+
*/
|
|
619
|
+
addRole(role) {
|
|
620
|
+
if (role.isSystemRole) {
|
|
621
|
+
throw new Error('Cannot add system role');
|
|
622
|
+
}
|
|
623
|
+
this.roleRegistry.set(role.id, role);
|
|
624
|
+
this.clearCache();
|
|
625
|
+
logger.info({ roleId: role.id, roleName: role.name }, 'Role added');
|
|
626
|
+
}
|
|
627
|
+
/**
|
|
628
|
+
* Update a custom role
|
|
629
|
+
*/
|
|
630
|
+
updateRole(roleId, updates) {
|
|
631
|
+
const existing = this.roleRegistry.get(roleId);
|
|
632
|
+
if (!existing) {
|
|
633
|
+
throw new Error(`Role not found: ${roleId}`);
|
|
634
|
+
}
|
|
635
|
+
if (existing.isSystemRole) {
|
|
636
|
+
throw new Error('Cannot modify system role');
|
|
637
|
+
}
|
|
638
|
+
const updated = {
|
|
639
|
+
...existing,
|
|
640
|
+
...updates,
|
|
641
|
+
updatedAt: new Date().toISOString(),
|
|
642
|
+
};
|
|
643
|
+
this.roleRegistry.set(roleId, updated);
|
|
644
|
+
this.clearCache();
|
|
645
|
+
logger.info({ roleId }, 'Role updated');
|
|
646
|
+
}
|
|
647
|
+
/**
|
|
648
|
+
* Remove a custom role
|
|
649
|
+
*/
|
|
650
|
+
removeRole(roleId) {
|
|
651
|
+
const existing = this.roleRegistry.get(roleId);
|
|
652
|
+
if (existing?.isSystemRole) {
|
|
653
|
+
throw new Error('Cannot remove system role');
|
|
654
|
+
}
|
|
655
|
+
const removed = this.roleRegistry.delete(roleId);
|
|
656
|
+
if (removed) {
|
|
657
|
+
this.clearCache();
|
|
658
|
+
logger.info({ roleId }, 'Role removed');
|
|
659
|
+
}
|
|
660
|
+
return removed;
|
|
661
|
+
}
|
|
662
|
+
/**
|
|
663
|
+
* Get a role by ID
|
|
664
|
+
*/
|
|
665
|
+
getRole(roleId) {
|
|
666
|
+
return this.roleRegistry.get(roleId);
|
|
667
|
+
}
|
|
668
|
+
/**
|
|
669
|
+
* Get all roles
|
|
670
|
+
*/
|
|
671
|
+
getAllRoles() {
|
|
672
|
+
return Array.from(this.roleRegistry.values());
|
|
673
|
+
}
|
|
674
|
+
// ===========================================================================
|
|
675
|
+
// ROLE ASSIGNMENT
|
|
676
|
+
// ===========================================================================
|
|
677
|
+
/**
|
|
678
|
+
* Assign a role to a subject
|
|
679
|
+
*/
|
|
680
|
+
assignRole(assignment) {
|
|
681
|
+
const role = this.roleRegistry.get(assignment.roleId);
|
|
682
|
+
if (!role) {
|
|
683
|
+
throw new Error(`Role not found: ${assignment.roleId}`);
|
|
684
|
+
}
|
|
685
|
+
const assignments = this.roleAssignments.get(assignment.subjectId) ?? [];
|
|
686
|
+
assignments.push(assignment);
|
|
687
|
+
this.roleAssignments.set(assignment.subjectId, assignments);
|
|
688
|
+
this.clearCache();
|
|
689
|
+
logger.info({
|
|
690
|
+
subjectId: assignment.subjectId,
|
|
691
|
+
roleId: assignment.roleId,
|
|
692
|
+
}, 'Role assigned');
|
|
693
|
+
}
|
|
694
|
+
/**
|
|
695
|
+
* Revoke a role from a subject
|
|
696
|
+
*/
|
|
697
|
+
revokeRole(subjectId, roleId, tenantId) {
|
|
698
|
+
const assignments = this.roleAssignments.get(subjectId);
|
|
699
|
+
if (!assignments)
|
|
700
|
+
return false;
|
|
701
|
+
const index = assignments.findIndex(a => a.roleId === roleId &&
|
|
702
|
+
(!tenantId || a.tenantId === tenantId));
|
|
703
|
+
if (index === -1)
|
|
704
|
+
return false;
|
|
705
|
+
assignments[index].active = false;
|
|
706
|
+
this.clearCache();
|
|
707
|
+
logger.info({ subjectId, roleId }, 'Role revoked');
|
|
708
|
+
return true;
|
|
709
|
+
}
|
|
710
|
+
/**
|
|
711
|
+
* Get role assignments for a subject
|
|
712
|
+
*/
|
|
713
|
+
getRoleAssignments(subjectId) {
|
|
714
|
+
return this.roleAssignments.get(subjectId) ?? [];
|
|
715
|
+
}
|
|
716
|
+
// ===========================================================================
|
|
717
|
+
// HELPER METHODS
|
|
718
|
+
// ===========================================================================
|
|
719
|
+
/**
|
|
720
|
+
* Get applicable policies for a context
|
|
721
|
+
*/
|
|
722
|
+
getApplicablePolicies(context) {
|
|
723
|
+
return Array.from(this.policies.values())
|
|
724
|
+
.filter(policy => {
|
|
725
|
+
if (!policy.enabled)
|
|
726
|
+
return false;
|
|
727
|
+
// Check tenant scope
|
|
728
|
+
if (policy.tenantId && policy.tenantId !== context.environment.tenantId) {
|
|
729
|
+
return false;
|
|
730
|
+
}
|
|
731
|
+
return true;
|
|
732
|
+
})
|
|
733
|
+
.sort((a, b) => b.priority - a.priority); // Higher priority first
|
|
734
|
+
}
|
|
735
|
+
/**
|
|
736
|
+
* Check if a policy targets the subject
|
|
737
|
+
*/
|
|
738
|
+
policyTargetsSubject(policy, context) {
|
|
739
|
+
if (!policy.target)
|
|
740
|
+
return true;
|
|
741
|
+
const target = policy.target;
|
|
742
|
+
// Check exclusions first
|
|
743
|
+
if (target.excludeSubjectIds?.includes(context.subject.id)) {
|
|
744
|
+
return false;
|
|
745
|
+
}
|
|
746
|
+
// Check subject ID
|
|
747
|
+
if (target.subjectIds && !target.subjectIds.includes(context.subject.id)) {
|
|
748
|
+
return false;
|
|
749
|
+
}
|
|
750
|
+
// Check subject type
|
|
751
|
+
if (target.subjectTypes && !target.subjectTypes.includes(context.subject.type)) {
|
|
752
|
+
return false;
|
|
753
|
+
}
|
|
754
|
+
// Check role
|
|
755
|
+
if (target.roleIds) {
|
|
756
|
+
const hasRole = target.roleIds.some(roleId => context.subject.roles.includes(roleId));
|
|
757
|
+
if (!hasRole)
|
|
758
|
+
return false;
|
|
759
|
+
}
|
|
760
|
+
// Check tenant
|
|
761
|
+
if (target.tenantIds && context.environment.tenantId) {
|
|
762
|
+
if (!target.tenantIds.includes(context.environment.tenantId)) {
|
|
763
|
+
return false;
|
|
764
|
+
}
|
|
765
|
+
}
|
|
766
|
+
return true;
|
|
767
|
+
}
|
|
768
|
+
/**
|
|
769
|
+
* Check policy conditions
|
|
770
|
+
*/
|
|
771
|
+
checkConditions(conditions, context) {
|
|
772
|
+
// Check IP address
|
|
773
|
+
if (conditions.ipAddresses && context.environment.ipAddress) {
|
|
774
|
+
const matchesIp = conditions.ipAddresses.some(allowed => this.matchIpAddress(context.environment.ipAddress, allowed));
|
|
775
|
+
if (!matchesIp)
|
|
776
|
+
return false;
|
|
777
|
+
}
|
|
778
|
+
// Check time window
|
|
779
|
+
if (conditions.timeWindow) {
|
|
780
|
+
const withinWindow = this.checkTimeRestriction(conditions.timeWindow, context.environment.timestamp);
|
|
781
|
+
if (!withinWindow)
|
|
782
|
+
return false;
|
|
783
|
+
}
|
|
784
|
+
// Check custom attributes
|
|
785
|
+
if (conditions.attributes) {
|
|
786
|
+
for (const [key, value] of Object.entries(conditions.attributes)) {
|
|
787
|
+
const subjectValue = context.subject.attributes?.[key];
|
|
788
|
+
if (subjectValue !== value)
|
|
789
|
+
return false;
|
|
790
|
+
}
|
|
791
|
+
}
|
|
792
|
+
return true;
|
|
793
|
+
}
|
|
794
|
+
/**
|
|
795
|
+
* Check time restrictions
|
|
796
|
+
*/
|
|
797
|
+
checkTimeRestrictions(restrictions, now) {
|
|
798
|
+
return restrictions.some(restriction => this.checkTimeRestriction(restriction, now));
|
|
799
|
+
}
|
|
800
|
+
/**
|
|
801
|
+
* Check a single time restriction
|
|
802
|
+
*/
|
|
803
|
+
checkTimeRestriction(restriction, now) {
|
|
804
|
+
const hour = now.getHours();
|
|
805
|
+
const minute = now.getMinutes();
|
|
806
|
+
const currentTime = hour * 60 + minute;
|
|
807
|
+
const [startHour, startMinute] = restriction.startTime.split(':').map(Number);
|
|
808
|
+
const [endHour, endMinute] = restriction.endTime.split(':').map(Number);
|
|
809
|
+
const startTime = startHour * 60 + startMinute;
|
|
810
|
+
const endTime = endHour * 60 + endMinute;
|
|
811
|
+
// Check time range
|
|
812
|
+
let withinTime;
|
|
813
|
+
if (startTime <= endTime) {
|
|
814
|
+
withinTime = currentTime >= startTime && currentTime <= endTime;
|
|
815
|
+
}
|
|
816
|
+
else {
|
|
817
|
+
// Wrapping (e.g., 22:00 to 06:00)
|
|
818
|
+
withinTime = currentTime >= startTime || currentTime <= endTime;
|
|
819
|
+
}
|
|
820
|
+
if (!withinTime)
|
|
821
|
+
return false;
|
|
822
|
+
// Check day of week
|
|
823
|
+
if (restriction.daysOfWeek.length > 0) {
|
|
824
|
+
const day = now.getDay();
|
|
825
|
+
if (!restriction.daysOfWeek.includes(day))
|
|
826
|
+
return false;
|
|
827
|
+
}
|
|
828
|
+
return true;
|
|
829
|
+
}
|
|
830
|
+
/**
|
|
831
|
+
* Combine policy effects using the specified algorithm
|
|
832
|
+
*/
|
|
833
|
+
combineEffects(effects, algorithm) {
|
|
834
|
+
if (effects.length === 0) {
|
|
835
|
+
return { effect: this.options.defaultEffect };
|
|
836
|
+
}
|
|
837
|
+
switch (algorithm) {
|
|
838
|
+
case CombiningAlgorithms.DENY_OVERRIDES: {
|
|
839
|
+
const deny = effects.find(e => e.effect === PolicyEffects.DENY);
|
|
840
|
+
if (deny)
|
|
841
|
+
return { effect: PolicyEffects.DENY, decidingPolicy: deny.policy };
|
|
842
|
+
const allow = effects.find(e => e.effect === PolicyEffects.ALLOW);
|
|
843
|
+
if (allow)
|
|
844
|
+
return { effect: PolicyEffects.ALLOW, decidingPolicy: allow.policy };
|
|
845
|
+
return { effect: PolicyEffects.INDETERMINATE };
|
|
846
|
+
}
|
|
847
|
+
case CombiningAlgorithms.PERMIT_OVERRIDES: {
|
|
848
|
+
const allow = effects.find(e => e.effect === PolicyEffects.ALLOW);
|
|
849
|
+
if (allow)
|
|
850
|
+
return { effect: PolicyEffects.ALLOW, decidingPolicy: allow.policy };
|
|
851
|
+
const deny = effects.find(e => e.effect === PolicyEffects.DENY);
|
|
852
|
+
if (deny)
|
|
853
|
+
return { effect: PolicyEffects.DENY, decidingPolicy: deny.policy };
|
|
854
|
+
return { effect: PolicyEffects.INDETERMINATE };
|
|
855
|
+
}
|
|
856
|
+
case CombiningAlgorithms.UNANIMOUS: {
|
|
857
|
+
const allAllow = effects.every(e => e.effect === PolicyEffects.ALLOW);
|
|
858
|
+
if (allAllow)
|
|
859
|
+
return { effect: PolicyEffects.ALLOW, decidingPolicy: effects[0]?.policy };
|
|
860
|
+
const anyDeny = effects.find(e => e.effect === PolicyEffects.DENY);
|
|
861
|
+
return { effect: PolicyEffects.DENY, decidingPolicy: anyDeny?.policy };
|
|
862
|
+
}
|
|
863
|
+
case CombiningAlgorithms.FIRST_APPLICABLE: {
|
|
864
|
+
const first = effects[0];
|
|
865
|
+
if (first)
|
|
866
|
+
return { effect: first.effect, decidingPolicy: first.policy };
|
|
867
|
+
return { effect: PolicyEffects.INDETERMINATE };
|
|
868
|
+
}
|
|
869
|
+
case CombiningAlgorithms.PRIORITY_BASED: {
|
|
870
|
+
// Sort by priority (highest first) and take first
|
|
871
|
+
const sorted = [...effects].sort((a, b) => b.priority - a.priority);
|
|
872
|
+
const highest = sorted[0];
|
|
873
|
+
if (highest)
|
|
874
|
+
return { effect: highest.effect, decidingPolicy: highest.policy };
|
|
875
|
+
return { effect: PolicyEffects.INDETERMINATE };
|
|
876
|
+
}
|
|
877
|
+
default:
|
|
878
|
+
return { effect: this.options.defaultEffect };
|
|
879
|
+
}
|
|
880
|
+
}
|
|
881
|
+
/**
|
|
882
|
+
* Match a pattern (supports wildcards)
|
|
883
|
+
*/
|
|
884
|
+
matchPattern(value, pattern) {
|
|
885
|
+
if (pattern === '*')
|
|
886
|
+
return true;
|
|
887
|
+
if (pattern.endsWith('*')) {
|
|
888
|
+
return value.startsWith(pattern.slice(0, -1));
|
|
889
|
+
}
|
|
890
|
+
if (pattern.startsWith('*')) {
|
|
891
|
+
return value.endsWith(pattern.slice(1));
|
|
892
|
+
}
|
|
893
|
+
return value === pattern;
|
|
894
|
+
}
|
|
895
|
+
/**
|
|
896
|
+
* Match IP address against a pattern.
|
|
897
|
+
*
|
|
898
|
+
* Supports:
|
|
899
|
+
* - Wildcard '*' (matches any IP)
|
|
900
|
+
* - CIDR notation for IPv4 (e.g., "192.168.1.0/24")
|
|
901
|
+
* - CIDR notation for IPv6 (e.g., "fe80::/10")
|
|
902
|
+
* - Exact string match as fallback
|
|
903
|
+
*
|
|
904
|
+
* When a CIDR pattern omits the prefix length, it defaults to
|
|
905
|
+
* /32 for IPv4 and /128 for IPv6 (exact host match).
|
|
906
|
+
*/
|
|
907
|
+
matchIpAddress(ip, pattern) {
|
|
908
|
+
if (pattern === '*')
|
|
909
|
+
return true;
|
|
910
|
+
// Attempt CIDR match if the pattern looks like an IP or CIDR
|
|
911
|
+
try {
|
|
912
|
+
return RBACPolicyEngine.ipMatchesCidr(ip, pattern);
|
|
913
|
+
}
|
|
914
|
+
catch {
|
|
915
|
+
// If parsing fails, fall back to exact string comparison
|
|
916
|
+
return ip === pattern;
|
|
917
|
+
}
|
|
918
|
+
}
|
|
919
|
+
// ---------------------------------------------------------------------------
|
|
920
|
+
// Static IP / CIDR helpers (pure TypeScript, no external dependencies)
|
|
921
|
+
// ---------------------------------------------------------------------------
|
|
922
|
+
/**
|
|
923
|
+
* Determine whether `ip` falls within the network described by `cidr`.
|
|
924
|
+
* `cidr` may be a bare IP (treated as /32 or /128) or "ip/prefix".
|
|
925
|
+
*/
|
|
926
|
+
static ipMatchesCidr(ip, cidr) {
|
|
927
|
+
const [networkStr, prefixStr] = cidr.split('/');
|
|
928
|
+
const isIpV6 = RBACPolicyEngine.isIPv6(ip);
|
|
929
|
+
const isPatternV6 = RBACPolicyEngine.isIPv6(networkStr);
|
|
930
|
+
// IP family mismatch → no match
|
|
931
|
+
if (isIpV6 !== isPatternV6)
|
|
932
|
+
return false;
|
|
933
|
+
if (isIpV6) {
|
|
934
|
+
const defaultPrefix = 128;
|
|
935
|
+
const prefixLen = prefixStr !== undefined ? parseInt(prefixStr, 10) : defaultPrefix;
|
|
936
|
+
if (isNaN(prefixLen) || prefixLen < 0 || prefixLen > 128)
|
|
937
|
+
return false;
|
|
938
|
+
const ipBits = RBACPolicyEngine.ipv6ToBits(ip);
|
|
939
|
+
const networkBits = RBACPolicyEngine.ipv6ToBits(networkStr);
|
|
940
|
+
return RBACPolicyEngine.bitsMatchPrefix(ipBits, networkBits, prefixLen);
|
|
941
|
+
}
|
|
942
|
+
else {
|
|
943
|
+
const defaultPrefix = 32;
|
|
944
|
+
const prefixLen = prefixStr !== undefined ? parseInt(prefixStr, 10) : defaultPrefix;
|
|
945
|
+
if (isNaN(prefixLen) || prefixLen < 0 || prefixLen > 32)
|
|
946
|
+
return false;
|
|
947
|
+
const ipNum = RBACPolicyEngine.ipv4ToNumber(ip);
|
|
948
|
+
const networkNum = RBACPolicyEngine.ipv4ToNumber(networkStr);
|
|
949
|
+
// Throw on unparseable addresses so the caller can fall back to
|
|
950
|
+
// exact string comparison for non-IP values (e.g., hostnames).
|
|
951
|
+
if (ipNum === null || networkNum === null) {
|
|
952
|
+
throw new Error(`Invalid IPv4 address: ip=${ip}, network=${networkStr}`);
|
|
953
|
+
}
|
|
954
|
+
if (prefixLen === 0)
|
|
955
|
+
return true; // /0 matches everything
|
|
956
|
+
// Build a 32-bit mask: e.g. prefix 24 → 0xFFFFFF00
|
|
957
|
+
const mask = (~0 << (32 - prefixLen)) >>> 0;
|
|
958
|
+
return ((ipNum & mask) >>> 0) === ((networkNum & mask) >>> 0);
|
|
959
|
+
}
|
|
960
|
+
}
|
|
961
|
+
/** Returns true when the address string contains a colon (→ IPv6). */
|
|
962
|
+
static isIPv6(addr) {
|
|
963
|
+
return addr.includes(':');
|
|
964
|
+
}
|
|
965
|
+
/**
|
|
966
|
+
* Parse a dotted-quad IPv4 string into a 32-bit unsigned integer.
|
|
967
|
+
* Returns null on invalid input.
|
|
968
|
+
*/
|
|
969
|
+
static ipv4ToNumber(ip) {
|
|
970
|
+
const parts = ip.split('.');
|
|
971
|
+
if (parts.length !== 4)
|
|
972
|
+
return null;
|
|
973
|
+
let num = 0;
|
|
974
|
+
for (const part of parts) {
|
|
975
|
+
const octet = parseInt(part, 10);
|
|
976
|
+
if (isNaN(octet) || octet < 0 || octet > 255)
|
|
977
|
+
return null;
|
|
978
|
+
num = ((num << 8) | octet) >>> 0;
|
|
979
|
+
}
|
|
980
|
+
return num;
|
|
981
|
+
}
|
|
982
|
+
/**
|
|
983
|
+
* Expand an IPv6 address (handling :: shorthand) into a 128-element
|
|
984
|
+
* bit array (array of 0 | 1).
|
|
985
|
+
*/
|
|
986
|
+
static ipv6ToBits(addr) {
|
|
987
|
+
// Handle IPv4-mapped IPv6 (e.g., ::ffff:192.168.1.1)
|
|
988
|
+
const v4Suffix = addr.match(/::ffff:(\d+\.\d+\.\d+\.\d+)$/i);
|
|
989
|
+
if (v4Suffix) {
|
|
990
|
+
const ipv4Num = RBACPolicyEngine.ipv4ToNumber(v4Suffix[1]);
|
|
991
|
+
if (ipv4Num === null)
|
|
992
|
+
throw new Error(`Invalid IPv4-mapped IPv6: ${addr}`);
|
|
993
|
+
// Construct the full 128-bit representation
|
|
994
|
+
// First 80 bits are 0, next 16 bits are 0xFFFF, last 32 bits are the IPv4
|
|
995
|
+
const bits = new Array(80).fill(0);
|
|
996
|
+
for (let i = 15; i >= 0; i--) {
|
|
997
|
+
bits.push((0xFFFF >> (15 - i)) & 1);
|
|
998
|
+
}
|
|
999
|
+
for (let i = 31; i >= 0; i--) {
|
|
1000
|
+
bits.push((ipv4Num >> i) & 1);
|
|
1001
|
+
}
|
|
1002
|
+
return bits;
|
|
1003
|
+
}
|
|
1004
|
+
// Expand :: into the correct number of zero groups
|
|
1005
|
+
let fullAddr = addr;
|
|
1006
|
+
if (fullAddr.includes('::')) {
|
|
1007
|
+
const halves = fullAddr.split('::');
|
|
1008
|
+
const left = halves[0] ? halves[0].split(':') : [];
|
|
1009
|
+
const right = halves[1] ? halves[1].split(':') : [];
|
|
1010
|
+
const missing = 8 - left.length - right.length;
|
|
1011
|
+
const middle = new Array(Math.max(missing, 0)).fill('0');
|
|
1012
|
+
fullAddr = [...left, ...middle, ...right].join(':');
|
|
1013
|
+
}
|
|
1014
|
+
const groups = fullAddr.split(':');
|
|
1015
|
+
if (groups.length !== 8)
|
|
1016
|
+
throw new Error(`Invalid IPv6 address: ${addr}`);
|
|
1017
|
+
const bits = [];
|
|
1018
|
+
for (const group of groups) {
|
|
1019
|
+
const val = parseInt(group || '0', 16);
|
|
1020
|
+
if (isNaN(val) || val < 0 || val > 0xFFFF) {
|
|
1021
|
+
throw new Error(`Invalid IPv6 group "${group}" in ${addr}`);
|
|
1022
|
+
}
|
|
1023
|
+
for (let i = 15; i >= 0; i--) {
|
|
1024
|
+
bits.push((val >> i) & 1);
|
|
1025
|
+
}
|
|
1026
|
+
}
|
|
1027
|
+
return bits;
|
|
1028
|
+
}
|
|
1029
|
+
/**
|
|
1030
|
+
* Compare the first `prefixLen` bits of two 128-element bit arrays.
|
|
1031
|
+
*/
|
|
1032
|
+
static bitsMatchPrefix(a, b, prefixLen) {
|
|
1033
|
+
for (let i = 0; i < prefixLen; i++) {
|
|
1034
|
+
if (a[i] !== b[i])
|
|
1035
|
+
return false;
|
|
1036
|
+
}
|
|
1037
|
+
return true;
|
|
1038
|
+
}
|
|
1039
|
+
/**
|
|
1040
|
+
* Get missing requirements for a denied request
|
|
1041
|
+
*/
|
|
1042
|
+
getMissingRequirements(context, policies) {
|
|
1043
|
+
const missingPermissions = [];
|
|
1044
|
+
const missingRoles = [];
|
|
1045
|
+
let requiredTrustTier;
|
|
1046
|
+
for (const policy of policies) {
|
|
1047
|
+
if (policy.requiredPermissions) {
|
|
1048
|
+
for (const perm of policy.requiredPermissions) {
|
|
1049
|
+
if (!hasPermission(context.subject.permissions, perm)) {
|
|
1050
|
+
missingPermissions.push(perm);
|
|
1051
|
+
}
|
|
1052
|
+
}
|
|
1053
|
+
}
|
|
1054
|
+
if (policy.requiredRoles) {
|
|
1055
|
+
for (const role of policy.requiredRoles) {
|
|
1056
|
+
if (!context.subject.roles.includes(role)) {
|
|
1057
|
+
missingRoles.push(role);
|
|
1058
|
+
}
|
|
1059
|
+
}
|
|
1060
|
+
}
|
|
1061
|
+
if (policy.requiredTrustTier !== undefined) {
|
|
1062
|
+
if (context.subject.trustTier < policy.requiredTrustTier) {
|
|
1063
|
+
if (!requiredTrustTier || policy.requiredTrustTier > requiredTrustTier) {
|
|
1064
|
+
requiredTrustTier = policy.requiredTrustTier;
|
|
1065
|
+
}
|
|
1066
|
+
}
|
|
1067
|
+
}
|
|
1068
|
+
}
|
|
1069
|
+
return {
|
|
1070
|
+
permissions: missingPermissions.length > 0 ? [...new Set(missingPermissions)] : undefined,
|
|
1071
|
+
roles: missingRoles.length > 0 ? [...new Set(missingRoles)] : undefined,
|
|
1072
|
+
trustTier: requiredTrustTier,
|
|
1073
|
+
};
|
|
1074
|
+
}
|
|
1075
|
+
/**
|
|
1076
|
+
* Build decision reason string
|
|
1077
|
+
*/
|
|
1078
|
+
buildDecisionReason(effect, decidingPolicy, missingRequirements) {
|
|
1079
|
+
if (effect === PolicyEffects.ALLOW) {
|
|
1080
|
+
return decidingPolicy
|
|
1081
|
+
? `Access granted by policy: ${decidingPolicy.policyName}`
|
|
1082
|
+
: 'Access granted (default)';
|
|
1083
|
+
}
|
|
1084
|
+
if (effect === PolicyEffects.DENY) {
|
|
1085
|
+
const reasons = [];
|
|
1086
|
+
if (decidingPolicy?.reason) {
|
|
1087
|
+
reasons.push(decidingPolicy.reason);
|
|
1088
|
+
}
|
|
1089
|
+
else if (decidingPolicy) {
|
|
1090
|
+
reasons.push(`Denied by policy: ${decidingPolicy.policyName}`);
|
|
1091
|
+
}
|
|
1092
|
+
if (missingRequirements?.permissions?.length) {
|
|
1093
|
+
reasons.push(`Missing permissions: ${missingRequirements.permissions.join(', ')}`);
|
|
1094
|
+
}
|
|
1095
|
+
if (missingRequirements?.roles?.length) {
|
|
1096
|
+
reasons.push(`Missing roles: ${missingRequirements.roles.join(', ')}`);
|
|
1097
|
+
}
|
|
1098
|
+
if (missingRequirements?.trustTier !== undefined) {
|
|
1099
|
+
reasons.push(`Insufficient trust tier: requires T${missingRequirements.trustTier}`);
|
|
1100
|
+
}
|
|
1101
|
+
return reasons.length > 0 ? reasons.join('; ') : 'Access denied';
|
|
1102
|
+
}
|
|
1103
|
+
return 'Unable to determine access';
|
|
1104
|
+
}
|
|
1105
|
+
/**
|
|
1106
|
+
* Determine how permission was granted
|
|
1107
|
+
*/
|
|
1108
|
+
determineGrantSource(permissions, grantedPermissions) {
|
|
1109
|
+
if (permissions.has('*')) {
|
|
1110
|
+
return 'wildcard';
|
|
1111
|
+
}
|
|
1112
|
+
// Check if any are direct matches vs wildcards
|
|
1113
|
+
for (const perm of grantedPermissions) {
|
|
1114
|
+
if (permissions.has(perm)) {
|
|
1115
|
+
return 'direct';
|
|
1116
|
+
}
|
|
1117
|
+
}
|
|
1118
|
+
return 'inherited';
|
|
1119
|
+
}
|
|
1120
|
+
/**
|
|
1121
|
+
* Build cache key for evaluation context
|
|
1122
|
+
*/
|
|
1123
|
+
buildCacheKey(context) {
|
|
1124
|
+
return [
|
|
1125
|
+
context.subject.id,
|
|
1126
|
+
context.subject.type,
|
|
1127
|
+
context.resource.type,
|
|
1128
|
+
context.resource.action,
|
|
1129
|
+
context.resource.id ?? '',
|
|
1130
|
+
context.environment.tenantId ?? '',
|
|
1131
|
+
].join(':');
|
|
1132
|
+
}
|
|
1133
|
+
/**
|
|
1134
|
+
* Clear evaluation cache
|
|
1135
|
+
*/
|
|
1136
|
+
clearCache() {
|
|
1137
|
+
this.evaluationCache.clear();
|
|
1138
|
+
}
|
|
1139
|
+
/**
|
|
1140
|
+
* Log access decision for audit
|
|
1141
|
+
*/
|
|
1142
|
+
async logAccessDecision(context, result) {
|
|
1143
|
+
const actor = {
|
|
1144
|
+
type: context.subject.type === 'user' ? 'user' : 'agent',
|
|
1145
|
+
id: context.subject.id,
|
|
1146
|
+
tenantId: context.environment.tenantId,
|
|
1147
|
+
ip: context.environment.ipAddress,
|
|
1148
|
+
};
|
|
1149
|
+
const resource = {
|
|
1150
|
+
type: context.resource.type,
|
|
1151
|
+
id: context.resource.id ?? context.resource.type,
|
|
1152
|
+
path: `${context.resource.type}:${context.resource.action}`,
|
|
1153
|
+
};
|
|
1154
|
+
if (result.permitted) {
|
|
1155
|
+
await this.auditLogger.logAccessGranted(actor, resource, {
|
|
1156
|
+
effect: result.effect,
|
|
1157
|
+
decidingPolicy: result.decidingPolicy?.policyId,
|
|
1158
|
+
durationMs: result.durationMs,
|
|
1159
|
+
});
|
|
1160
|
+
}
|
|
1161
|
+
else {
|
|
1162
|
+
await this.auditLogger.logAccessDenied(actor, resource, result.reason, {
|
|
1163
|
+
effect: result.effect,
|
|
1164
|
+
decidingPolicy: result.decidingPolicy?.policyId,
|
|
1165
|
+
missingRequirements: result.missingRequirements,
|
|
1166
|
+
durationMs: result.durationMs,
|
|
1167
|
+
});
|
|
1168
|
+
}
|
|
1169
|
+
}
|
|
1170
|
+
/**
|
|
1171
|
+
* Get engine statistics
|
|
1172
|
+
*/
|
|
1173
|
+
getStats() {
|
|
1174
|
+
const roles = Array.from(this.roleRegistry.values());
|
|
1175
|
+
let totalAssignments = 0;
|
|
1176
|
+
for (const assignments of this.roleAssignments.values()) {
|
|
1177
|
+
totalAssignments += assignments.length;
|
|
1178
|
+
}
|
|
1179
|
+
return {
|
|
1180
|
+
totalPolicies: this.policies.size,
|
|
1181
|
+
enabledPolicies: Array.from(this.policies.values()).filter(p => p.enabled).length,
|
|
1182
|
+
totalRoles: roles.length,
|
|
1183
|
+
systemRoles: roles.filter(r => r.isSystemRole).length,
|
|
1184
|
+
customRoles: roles.filter(r => !r.isSystemRole).length,
|
|
1185
|
+
totalAssignments,
|
|
1186
|
+
cacheSize: this.evaluationCache.size,
|
|
1187
|
+
};
|
|
1188
|
+
}
|
|
1189
|
+
/**
|
|
1190
|
+
* Destroy the engine and cleanup resources
|
|
1191
|
+
*/
|
|
1192
|
+
destroy() {
|
|
1193
|
+
this.clearCache();
|
|
1194
|
+
logger.info('RBAC policy engine destroyed');
|
|
1195
|
+
}
|
|
1196
|
+
}
|
|
1197
|
+
/**
|
|
1198
|
+
* Create a new RBAC policy engine
|
|
1199
|
+
*/
|
|
1200
|
+
export function createRBACPolicyEngine(options) {
|
|
1201
|
+
return new RBACPolicyEngine(options);
|
|
1202
|
+
}
|
|
1203
|
+
/**
|
|
1204
|
+
* Create a policy evaluation context
|
|
1205
|
+
*/
|
|
1206
|
+
export function createPolicyEvaluationContext(params) {
|
|
1207
|
+
return {
|
|
1208
|
+
subject: {
|
|
1209
|
+
id: params.subjectId,
|
|
1210
|
+
type: params.subjectType,
|
|
1211
|
+
trustTier: params.trustTier,
|
|
1212
|
+
roles: params.roles,
|
|
1213
|
+
permissions: new Set(params.permissions),
|
|
1214
|
+
attributes: params.subjectAttributes,
|
|
1215
|
+
},
|
|
1216
|
+
resource: {
|
|
1217
|
+
id: params.resourceId,
|
|
1218
|
+
type: params.resourceType,
|
|
1219
|
+
action: params.resourceAction,
|
|
1220
|
+
tenantId: params.tenantId,
|
|
1221
|
+
attributes: params.resourceAttributes,
|
|
1222
|
+
},
|
|
1223
|
+
environment: {
|
|
1224
|
+
timestamp: new Date(),
|
|
1225
|
+
ipAddress: params.ipAddress,
|
|
1226
|
+
userAgent: params.userAgent,
|
|
1227
|
+
tenantId: params.tenantId,
|
|
1228
|
+
requestId: params.requestId,
|
|
1229
|
+
},
|
|
1230
|
+
};
|
|
1231
|
+
}
|
|
1232
|
+
/**
|
|
1233
|
+
* Create an access policy
|
|
1234
|
+
*/
|
|
1235
|
+
export function createAccessPolicy(partial) {
|
|
1236
|
+
const now = new Date().toISOString();
|
|
1237
|
+
return {
|
|
1238
|
+
...partial,
|
|
1239
|
+
enabled: partial.enabled ?? true,
|
|
1240
|
+
createdAt: now,
|
|
1241
|
+
updatedAt: now,
|
|
1242
|
+
};
|
|
1243
|
+
}
|
|
1244
|
+
//# sourceMappingURL=policy-engine.js.map
|