@astram/guard 0.7.0 → 0.9.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.
Files changed (187) hide show
  1. package/dist/auth/account.controller.d.ts +27 -5
  2. package/dist/auth/account.controller.d.ts.map +1 -1
  3. package/dist/auth/account.controller.js +99 -26
  4. package/dist/auth/auth.controller.d.ts +130 -21
  5. package/dist/auth/auth.controller.d.ts.map +1 -1
  6. package/dist/auth/auth.controller.js +537 -143
  7. package/dist/auth/auth.module.d.ts +15 -1
  8. package/dist/auth/auth.module.d.ts.map +1 -1
  9. package/dist/auth/auth.module.js +212 -30
  10. package/dist/auth/connections.d.ts +1 -1
  11. package/dist/auth/connections.d.ts.map +1 -1
  12. package/dist/auth/connections.js +14 -3
  13. package/dist/auth/default-session-facts-projector.d.ts +26 -0
  14. package/dist/auth/default-session-facts-projector.d.ts.map +1 -0
  15. package/dist/auth/default-session-facts-projector.js +21 -0
  16. package/dist/auth/mfa-step-up.d.ts +32 -0
  17. package/dist/auth/mfa-step-up.d.ts.map +1 -0
  18. package/dist/auth/mfa-step-up.js +109 -0
  19. package/dist/auth/pending-mfa-store.d.ts +50 -52
  20. package/dist/auth/pending-mfa-store.d.ts.map +1 -1
  21. package/dist/auth/pending-mfa-store.js +103 -61
  22. package/dist/auth/ports/session-facts-projector.d.ts +5 -0
  23. package/dist/auth/ports/session-facts-projector.d.ts.map +1 -1
  24. package/dist/auth/rate-limit/canonical-hint.d.ts +24 -0
  25. package/dist/auth/rate-limit/canonical-hint.d.ts.map +1 -0
  26. package/dist/auth/rate-limit/canonical-hint.js +63 -0
  27. package/dist/auth/rate-limit/trust-proxy-check.d.ts +46 -0
  28. package/dist/auth/rate-limit/trust-proxy-check.d.ts.map +1 -0
  29. package/dist/auth/rate-limit/trust-proxy-check.js +94 -0
  30. package/dist/auth/tokens.d.ts +70 -11
  31. package/dist/auth/tokens.d.ts.map +1 -1
  32. package/dist/auth/tokens.js +71 -12
  33. package/dist/authentication/log-email-sender.d.ts +9 -4
  34. package/dist/authentication/log-email-sender.d.ts.map +1 -1
  35. package/dist/authentication/mariadb-api-key-store.d.ts +5 -1
  36. package/dist/authentication/mariadb-api-key-store.d.ts.map +1 -1
  37. package/dist/authentication/mariadb-api-key-store.js +43 -7
  38. package/dist/authentication/mariadb-credential-resolver.d.ts +79 -65
  39. package/dist/authentication/mariadb-credential-resolver.d.ts.map +1 -1
  40. package/dist/authentication/mariadb-credential-resolver.js +116 -73
  41. package/dist/authentication/mariadb-credential-writer.d.ts.map +1 -1
  42. package/dist/authentication/mariadb-or-totp-verifier.d.ts +21 -3
  43. package/dist/authentication/mariadb-or-totp-verifier.d.ts.map +1 -1
  44. package/dist/authentication/mariadb-or-totp-verifier.js +37 -6
  45. package/dist/authentication/mariadb-profile-resolver.d.ts.map +1 -1
  46. package/dist/authentication/mariadb-profile-writer.d.ts.map +1 -1
  47. package/dist/authentication/mariadb-session-sweeper.d.ts +14 -1
  48. package/dist/authentication/mariadb-session-sweeper.d.ts.map +1 -1
  49. package/dist/authentication/mariadb-session-sweeper.js +29 -11
  50. package/dist/authentication/noop-email-sender.d.ts +12 -0
  51. package/dist/authentication/noop-email-sender.d.ts.map +1 -0
  52. package/dist/authentication/noop-email-sender.js +9 -0
  53. package/dist/authz/cross-tenant-grant-writer.d.ts.map +1 -1
  54. package/dist/authz/manifest-operation-authority-adapter.d.ts.map +1 -1
  55. package/dist/authz/mariadb-cross-tenant-grant-adapter.d.ts.map +1 -1
  56. package/dist/authz/mariadb-cross-tenant-grant-adapter.js +3 -1
  57. package/dist/authz/mariadb-policy-store.js +1 -1
  58. package/dist/authz/mariadb-record-rule-adapter.d.ts.map +1 -1
  59. package/dist/authz/mariadb-record-rule-adapter.js +1 -4
  60. package/dist/authz/permission-version-cache.d.ts +38 -0
  61. package/dist/authz/permission-version-cache.d.ts.map +1 -0
  62. package/dist/authz/permission-version-cache.js +81 -0
  63. package/dist/authz/wire-record-authorization.d.ts +25 -1
  64. package/dist/authz/wire-record-authorization.d.ts.map +1 -1
  65. package/dist/authz/wire-record-authorization.js +55 -2
  66. package/dist/completeness/catalog-reconciler.d.ts.map +1 -1
  67. package/dist/config/app-config.d.ts +36 -0
  68. package/dist/config/app-config.d.ts.map +1 -1
  69. package/dist/config/app-config.js +44 -4
  70. package/dist/encryption/local-kek-crypto.d.ts.map +1 -1
  71. package/dist/enforcement/enforcement.module.d.ts.map +1 -1
  72. package/dist/enforcement/enforcement.module.js +9 -0
  73. package/dist/enforcement/engine-error.filter.d.ts +57 -0
  74. package/dist/enforcement/engine-error.filter.d.ts.map +1 -0
  75. package/dist/enforcement/engine-error.filter.js +118 -0
  76. package/dist/enforcement/global-enforcement.guard.d.ts +29 -2
  77. package/dist/enforcement/global-enforcement.guard.d.ts.map +1 -1
  78. package/dist/enforcement/global-enforcement.guard.js +143 -5
  79. package/dist/identity/auth-facts.controller.d.ts.map +1 -1
  80. package/dist/identity/permission-facts.adapter.d.ts.map +1 -1
  81. package/dist/identity/permission-facts.adapter.js +2 -3
  82. package/dist/index.d.ts +13 -7
  83. package/dist/index.d.ts.map +1 -1
  84. package/dist/index.js +68 -28
  85. package/dist/internal.d.ts +12 -0
  86. package/dist/internal.d.ts.map +1 -0
  87. package/dist/internal.js +16 -0
  88. package/dist/module/shield.module.d.ts +9 -2
  89. package/dist/module/shield.module.d.ts.map +1 -1
  90. package/dist/module/shield.module.js +47 -38
  91. package/dist/request-auth/session-facts-als.d.ts +16 -1
  92. package/dist/request-auth/session-facts-als.d.ts.map +1 -1
  93. package/dist/request-auth/session-facts-als.js +23 -0
  94. package/dist/request-auth/session-token-binder.d.ts +166 -10
  95. package/dist/request-auth/session-token-binder.d.ts.map +1 -1
  96. package/dist/request-auth/session-token-binder.js +408 -28
  97. package/dist/secrets/encrypted-file-secrets.d.ts.map +1 -1
  98. package/dist/secrets/encrypted-file-secrets.js +9 -3
  99. package/dist/session/hot-revoking-session-record-store.d.ts +46 -0
  100. package/dist/session/hot-revoking-session-record-store.d.ts.map +1 -0
  101. package/dist/session/hot-revoking-session-record-store.js +58 -0
  102. package/dist/session/index.d.ts +3 -1
  103. package/dist/session/index.d.ts.map +1 -1
  104. package/dist/session/index.js +8 -1
  105. package/dist/session/mariadb-session-record-store.d.ts +6 -0
  106. package/dist/session/mariadb-session-record-store.d.ts.map +1 -1
  107. package/dist/session/mariadb-session-record-store.js +16 -1
  108. package/dist/session/session-lifetimes.d.ts +30 -0
  109. package/dist/session/session-lifetimes.d.ts.map +1 -0
  110. package/dist/session/session-lifetimes.js +21 -0
  111. package/dist/session/session-restriction-store.d.ts +43 -0
  112. package/dist/session/session-restriction-store.d.ts.map +1 -0
  113. package/dist/session/session-restriction-store.js +35 -0
  114. package/package.json +14 -3
  115. package/dist/auth/account.controller.js.map +0 -1
  116. package/dist/auth/auth.controller.js.map +0 -1
  117. package/dist/auth/auth.module.js.map +0 -1
  118. package/dist/auth/connections.js.map +0 -1
  119. package/dist/auth/dto.js.map +0 -1
  120. package/dist/auth/pending-mfa-store.js.map +0 -1
  121. package/dist/auth/persistence.module.js.map +0 -1
  122. package/dist/auth/ports/audit-sink.js.map +0 -1
  123. package/dist/auth/ports/credential-writer.js.map +0 -1
  124. package/dist/auth/ports/email-sender.js.map +0 -1
  125. package/dist/auth/ports/membership-checker.js.map +0 -1
  126. package/dist/auth/ports/mfa-device-store.js.map +0 -1
  127. package/dist/auth/ports/profile-writer.js.map +0 -1
  128. package/dist/auth/ports/recovery-code-store.js.map +0 -1
  129. package/dist/auth/ports/reset-token-store.js.map +0 -1
  130. package/dist/auth/ports/scope-subtree-resolver.js.map +0 -1
  131. package/dist/auth/ports/session-facts-projector.js.map +0 -1
  132. package/dist/auth/ports/session-sweeper.js.map +0 -1
  133. package/dist/auth/profile-resolver.js.map +0 -1
  134. package/dist/auth/rate-limit/attempt-limiter.js.map +0 -1
  135. package/dist/auth/tokens.js.map +0 -1
  136. package/dist/auth/totp-enrollment.js.map +0 -1
  137. package/dist/authentication/argon2id-password-hasher.js.map +0 -1
  138. package/dist/authentication/log-email-sender.js.map +0 -1
  139. package/dist/authentication/mariadb-credential-resolver.js.map +0 -1
  140. package/dist/authentication/mariadb-credential-writer.js.map +0 -1
  141. package/dist/authentication/mariadb-mfa-device-store.js.map +0 -1
  142. package/dist/authentication/mariadb-or-totp-verifier.js.map +0 -1
  143. package/dist/authentication/mariadb-profile-resolver.js.map +0 -1
  144. package/dist/authentication/mariadb-profile-writer.js.map +0 -1
  145. package/dist/authentication/mariadb-recovery-code-store.js.map +0 -1
  146. package/dist/authentication/mariadb-reset-token-store.js.map +0 -1
  147. package/dist/authentication/mariadb-session-sweeper.js.map +0 -1
  148. package/dist/authz/cross-tenant-grant-writer.js.map +0 -1
  149. package/dist/authz/list-scope-sql.js.map +0 -1
  150. package/dist/authz/manifest-operation-authority-adapter.js.map +0 -1
  151. package/dist/authz/mariadb-cross-tenant-grant-adapter.js.map +0 -1
  152. package/dist/authz/mariadb-list-scope-adapter.js.map +0 -1
  153. package/dist/authz/mariadb-policy-store.js.map +0 -1
  154. package/dist/authz/mariadb-record-rule-adapter.js.map +0 -1
  155. package/dist/authz/mariadb-record-share-adapter.js.map +0 -1
  156. package/dist/authz/record-share-cascade.js.map +0 -1
  157. package/dist/authz/record-share-writer.js.map +0 -1
  158. package/dist/authz/wire-record-authorization.js.map +0 -1
  159. package/dist/boot/boot-sequence.js.map +0 -1
  160. package/dist/boot/boot.module.js.map +0 -1
  161. package/dist/completeness/catalog-reconciler.js.map +0 -1
  162. package/dist/completeness/operation-inventory-scanner.js.map +0 -1
  163. package/dist/completeness/ports/catalog-store.js.map +0 -1
  164. package/dist/config/app-config.js.map +0 -1
  165. package/dist/config/config.module.js.map +0 -1
  166. package/dist/enforcement/classification.decorator.js.map +0 -1
  167. package/dist/enforcement/core-seam.js.map +0 -1
  168. package/dist/enforcement/enforcement.module.js.map +0 -1
  169. package/dist/enforcement/global-enforcement.guard.js.map +0 -1
  170. package/dist/enforcement/reenroll-allowlist.js.map +0 -1
  171. package/dist/identity/auth-facts.controller.js.map +0 -1
  172. package/dist/identity/identity-actions.js.map +0 -1
  173. package/dist/identity/module-registry.bridge.js.map +0 -1
  174. package/dist/identity/permission-facts.adapter.js.map +0 -1
  175. package/dist/index.js.map +0 -1
  176. package/dist/migrations-dir.js.map +0 -1
  177. package/dist/module/shield-tokens.js.map +0 -1
  178. package/dist/module/shield.module.js.map +0 -1
  179. package/dist/request-auth/request-principal.js.map +0 -1
  180. package/dist/request-auth/session-facts-als.js.map +0 -1
  181. package/dist/request-auth/session-token-binder.js.map +0 -1
  182. package/dist/request-auth/tokens.js.map +0 -1
  183. package/dist/scope/closure-builder.js.map +0 -1
  184. package/dist/session/crypto-adapters.js.map +0 -1
  185. package/dist/session/index.js.map +0 -1
  186. package/dist/session/mariadb-session-record-store.js.map +0 -1
  187. package/dist/session/redis-hot-session-store.js.map +0 -1
package/dist/index.d.ts CHANGED
@@ -25,7 +25,7 @@ export { CatalogReconciler, CatalogGatabilityError } from './completeness/catalo
25
25
  export type { CatalogStore, CatalogPermissionRow, ReconcileReport, } from './completeness/ports/catalog-store.js';
26
26
  export { SHIELD_SESSION_TOKEN_BINDER, SHIELD_SERVICE_AUTHENTICATOR, } from './request-auth/tokens.js';
27
27
  export { SessionTokenBinder } from './request-auth/session-token-binder.js';
28
- export type { BoundPrincipalClaims } from './request-auth/session-token-binder.js';
28
+ export type { BoundPrincipalClaims, SessionTokenBinderOptions, } from './request-auth/session-token-binder.js';
29
29
  export { resolveRequestPrincipal, resolveRequestAuth, principalFromClaims, extractBearerToken, isApiKey, } from './request-auth/request-principal.js';
30
30
  export { MariaDbApiKeyStore } from './authentication/mariadb-api-key-store.js';
31
31
  export { SHIELD_SESSION_FACTS_ALS, NO_SESSION_FACTS, type SessionFactsStore, } from './request-auth/session-facts-als.js';
@@ -34,7 +34,7 @@ export { stubDecisionAuthority, type Effect, type CoreDecisionAuthority, type Co
34
34
  export { Argon2idPasswordHasher, argon2idHasherProvider, SHIELD_PASSWORD_HASHER, type Argon2idParams, } from './authentication/argon2id-password-hasher.js';
35
35
  export { LocalKekCrypto } from './encryption/local-kek-crypto.js';
36
36
  export { EncryptedFileSecretsProvider } from './secrets/encrypted-file-secrets.js';
37
- export { MariaDbSessionRecordStore, SHIELD_SESSION_RECORD_STORE, RedisHotSessionStore, SHIELD_HOT_SESSION_STORE, CryptoTokenGenerator, Sha256RefreshTokenHasher, SystemClock, cryptoTokenGeneratorProvider, refreshHasherProvider, systemClockProvider, SHIELD_TOKEN_GENERATOR, SHIELD_REFRESH_HASHER, SHIELD_CLOCK, } from './session/index.js';
37
+ export { MariaDbSessionRecordStore, SHIELD_SESSION_RECORD_STORE, RedisHotSessionStore, SHIELD_HOT_SESSION_STORE, CryptoTokenGenerator, Sha256RefreshTokenHasher, SystemClock, cryptoTokenGeneratorProvider, refreshHasherProvider, systemClockProvider, SHIELD_TOKEN_GENERATOR, SHIELD_REFRESH_HASHER, SHIELD_CLOCK, HotRevokingSessionRecordStore, type SessionHotRevoker, type LineageSessionLookup, SHIELD_SESSION_LIFETIMES, ROTATE_GRACE_MS, accessBindingTtlMs, } from './session/index.js';
38
38
  export { MariaDbRecordPermissionRuleAdapter, SHIELD_RECORD_RULE_PORT, type RuleQueryable, } from './authz/mariadb-record-rule-adapter.js';
39
39
  export { MariaDbPolicyStore, SHIELD_POLICY_STORE, type RuleQueryable as PolicyStoreQueryable, } from './authz/mariadb-policy-store.js';
40
40
  export { MariaDbListScopeAdapter, SHIELD_LIST_SCOPE_PORT, type ListScopeQueryable, } from './authz/mariadb-list-scope-adapter.js';
@@ -46,17 +46,21 @@ export { MariaDbCrossTenantGrantAdapter, SHIELD_CROSS_TENANT_GRANT_PORT, type Gr
46
46
  export { CrossTenantGrantWriter, SHIELD_CROSS_TENANT_GRANT_WRITER, GrantNotPermittedError, InvalidGrantError, GrantStoreUnavailableError, type GrantAuthorizeFn, type GrantAuditEvent, type GrantAuditSink, type GrantGranteeKind, type GrantScope, type OfferGrantInput, type AcceptGrantInput, type RevokeGrantInput, } from './authz/cross-tenant-grant-writer.js';
47
47
  export { ManifestOperationAuthorityAdapter, SHIELD_OPERATION_AUTHORITY_PORT, type OperationManifestEntry, } from './authz/manifest-operation-authority-adapter.js';
48
48
  export { buildRecordAuthorization } from './authz/wire-record-authorization.js';
49
+ export { withRedisPermissionVersion, type BuildRecordAuthorizationOptions, } from './authz/wire-record-authorization.js';
50
+ export { RedisPermissionVersionCache, PERMISSION_VERSION_KEY_PREFIX, DEFAULT_PERMISSION_VERSION_TTL_MS, type PermissionVersionReader, type PermissionVersionPublisher, type RedisPermissionVersionCacheOptions, } from './authz/permission-version-cache.js';
51
+ export { SHIELD_PERMISSION_VERSION_CACHE } from './auth/tokens.js';
52
+ export { SHIELD_SESSION_RESTRICTIONS } from './auth/tokens.js';
53
+ export { MariaDbSessionRestrictionStore, type SessionRestrictionStore, type SessionRebuildFacts, } from './session/session-restriction-store.js';
49
54
  export { buildListScopeFn, type ListScopeFn } from './authz/wire-record-authorization.js';
50
55
  export { BootSequence, assertPoolBudget } from './boot/boot-sequence.js';
51
56
  export { APP_CONFIG } from './config/config.module.js';
52
- export { loadAppConfig, loadPoolBudget, evaluatePoolBudget, DEFAULT_POOL_BUDGET, SCHEMA_SVC_POOL_HARD_CAP, type AppConfig, type PoolBudgetConfig, type PoolBudgetEvaluation, type RuntimeAccountPools, loadDbConfig, loadRedisConfig, loadSessionLifetimes, loadRefreshHmacKey, assertRefreshHmacKey, DEFAULT_DB_CONFIG, DEFAULT_REDIS_URL, type DbConfig, type RedisConfig, type SessionLifetimeOverrides, } from './config/app-config.js';
53
- export { SHIELD_DB_POOL, SHIELD_REDIS, SHIELD_CREDENTIAL_RESOLVER, SHIELD_PROFILE_RESOLVER, SHIELD_AUTHENTICATOR, SHIELD_SESSION_AUTHORITY, SHIELD_CREDENTIAL_WRITER, SHIELD_RESET_TOKEN_STORE, SHIELD_EMAIL_SENDER, SHIELD_RECOVERY_CODE_STORE, SHIELD_PROFILE_WRITER, SHIELD_SESSION_SWEEPER, SHIELD_AUDIT_SINK, SHIELD_MFA_DEVICE_STORE, SHIELD_TOTP_VERIFIER_OVERRIDE, } from './auth/tokens.js';
57
+ export { loadAppConfig, loadPoolBudget, evaluatePoolBudget, DEFAULT_POOL_BUDGET, SCHEMA_SVC_POOL_HARD_CAP, type AppConfig, type PoolBudgetConfig, type PoolBudgetEvaluation, type RuntimeAccountPools, loadDbConfig, loadRedisConfig, loadSessionLifetimes, loadRefreshHmacKey, assertRefreshHmacKey, DEFAULT_DB_CONFIG, DEFAULT_REDIS_URL, type DbConfig, type RedisConfig, type SessionLifetimeOverrides, loadLoginIpLimit, DEFAULT_LOGIN_IP_LIMIT, isDevOrTestNodeEnv, type LoginIpLimitConfig, } from './config/app-config.js';
58
+ export { SHIELD_REDIS, SHIELD_CREDENTIAL_RESOLVER, SHIELD_PROFILE_RESOLVER, SHIELD_AUTHENTICATOR, SHIELD_SESSION_AUTHORITY, SHIELD_CREDENTIAL_WRITER, SHIELD_RESET_TOKEN_STORE, SHIELD_EMAIL_SENDER, SHIELD_RECOVERY_CODE_STORE, SHIELD_PROFILE_WRITER, SHIELD_SESSION_SWEEPER, SHIELD_AUDIT_SINK, SHIELD_MFA_DEVICE_STORE, SHIELD_TOTP_VERIFIER_OVERRIDE, } from './auth/tokens.js';
54
59
  export { MariaDbCredentialResolver } from './authentication/mariadb-credential-resolver.js';
55
60
  export type { SessionView, SessionTokensView, SessionSuccess, LoginRequest, MfaChallengeResponse, LoginResponse, MfaRequest, MfaResponse, RefreshRequest, RefreshResponse, LogoutRequest, LogoutAck, } from './auth/dto.js';
56
- export { PersistenceModule } from './auth/persistence.module.js';
57
61
  export { AuthModule, type AuthModuleOptions } from './auth/auth.module.js';
58
62
  export { makeDefaultTotpVerifier, resolveTotpVerifier, hmacSha1 } from './auth/auth.module.js';
59
- export type { CredentialResolver, ResolvedCredential, RequiredFactor, } from '@astram/core';
63
+ export type { CredentialResolver, ResolvedCredential, RequiredFactor } from '@astram/core';
60
64
  export type { FactorVerifier, FactorVerdict, Credential } from '@astram/core';
61
65
  export type { ProfileResolver, CurrentUserProfile, ProfileRole, ProfileTenant, } from './auth/profile-resolver.js';
62
66
  export type { CredentialWriter } from './auth/ports/credential-writer.js';
@@ -72,7 +76,9 @@ export { SHIELD_SESSION_FACTS_PROJECTOR } from './auth/tokens.js';
72
76
  export type { ScopeSubtreeResolver } from './auth/ports/scope-subtree-resolver.js';
73
77
  export { SHIELD_SCOPE_SUBTREE_RESOLVER } from './auth/tokens.js';
74
78
  export { AuthController } from './auth/auth.controller.js';
75
- export { PendingMfaStore } from './auth/pending-mfa-store.js';
79
+ export { PendingMfaStore, RedisPendingMfaStore, type PendingMfaChallenge, } from './auth/pending-mfa-store.js';
80
+ export { CredentialMfaStepUp, credentialFingerprint, challengeMatches, type MfaStepUp, type MfaStepUpResult, } from './auth/mfa-step-up.js';
81
+ export { SHIELD_MFA_LIMITER, SHIELD_MFA_STEP_UP, SHIELD_LOGIN_TOTP_VERIFIER, } from './auth/tokens.js';
76
82
  export { generateTotpSecret, buildOtpauthUri, generateRecoveryCodes, } from './auth/totp-enrollment.js';
77
83
  export { AccountController } from './auth/account.controller.js';
78
84
  export { buildClosureRows, ScopeCycleError, ScopeDepthError, ScopeUnknownParentError, type ScopeEdge, type ClosureRow, } from './scope/closure-builder.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAIH,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AASzD,OAAO,EAAE,2BAA2B,EAAE,MAAM,sCAAsC,CAAC;AACnF,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAG1F,OAAO,EACL,YAAY,EACZ,yBAAyB,EACzB,KAAK,mBAAmB,EACxB,KAAK,wBAAwB,EAI7B,KAAK,yBAAyB,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,KAAK,eAAe,GACrB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,0BAA0B,GAC3B,MAAM,kBAAkB,CAAC;AAK1B,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,qBAAqB,GACtB,MAAM,2BAA2B,CAAC;AAKnC,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAQjE,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,eAAe,EACf,uBAAuB,EACvB,KAAK,SAAS,EACd,KAAK,UAAU,GAChB,MAAM,4BAA4B,CAAC"}
package/dist/index.js CHANGED
@@ -16,9 +16,9 @@
16
16
  * `@nestjs/core`, `reflect-metadata`, `rxjs` so the host owns one copy of each.
17
17
  */
18
18
  Object.defineProperty(exports, "__esModule", { value: true });
19
- exports.SHIELD_POLICY_STORE = exports.MariaDbPolicyStore = exports.SHIELD_RECORD_RULE_PORT = exports.MariaDbRecordPermissionRuleAdapter = exports.SHIELD_CLOCK = exports.SHIELD_REFRESH_HASHER = exports.SHIELD_TOKEN_GENERATOR = exports.systemClockProvider = exports.refreshHasherProvider = exports.cryptoTokenGeneratorProvider = exports.SystemClock = exports.Sha256RefreshTokenHasher = exports.CryptoTokenGenerator = exports.SHIELD_HOT_SESSION_STORE = exports.RedisHotSessionStore = exports.SHIELD_SESSION_RECORD_STORE = exports.MariaDbSessionRecordStore = exports.EncryptedFileSecretsProvider = exports.LocalKekCrypto = exports.SHIELD_PASSWORD_HASHER = exports.argon2idHasherProvider = exports.Argon2idPasswordHasher = exports.stubDecisionAuthority = exports.GlobalEnforcementGuard = exports.NO_SESSION_FACTS = exports.SHIELD_SESSION_FACTS_ALS = exports.MariaDbApiKeyStore = exports.isApiKey = exports.extractBearerToken = exports.principalFromClaims = exports.resolveRequestAuth = exports.resolveRequestPrincipal = exports.SessionTokenBinder = exports.SHIELD_SERVICE_AUTHENTICATOR = exports.SHIELD_SESSION_TOKEN_BINDER = exports.CatalogGatabilityError = exports.CatalogReconciler = exports.OperationInventoryScanner = exports.normalizeClassification = exports.DEFAULT_CLASSIFIED_ACTION = exports.CLASSIFICATION_METADATA = exports.Classified = exports.Public = exports.SHIELD_DECISION_AUTHORITY = exports.ShieldModule = exports.actionsFor = exports.IDENTITY_ACTIONS = exports.MODULE_KEY = exports.buildIdentityModuleRegistry = exports.guardMigrationsDir = void 0;
20
- exports.SHIELD_AUDIT_SINK = exports.SHIELD_SESSION_SWEEPER = exports.SHIELD_PROFILE_WRITER = exports.SHIELD_RECOVERY_CODE_STORE = exports.SHIELD_EMAIL_SENDER = exports.SHIELD_RESET_TOKEN_STORE = exports.SHIELD_CREDENTIAL_WRITER = exports.SHIELD_SESSION_AUTHORITY = exports.SHIELD_AUTHENTICATOR = exports.SHIELD_PROFILE_RESOLVER = exports.SHIELD_CREDENTIAL_RESOLVER = exports.SHIELD_REDIS = exports.SHIELD_DB_POOL = exports.DEFAULT_REDIS_URL = exports.DEFAULT_DB_CONFIG = exports.assertRefreshHmacKey = exports.loadRefreshHmacKey = exports.loadSessionLifetimes = exports.loadRedisConfig = exports.loadDbConfig = exports.SCHEMA_SVC_POOL_HARD_CAP = exports.DEFAULT_POOL_BUDGET = exports.evaluatePoolBudget = exports.loadPoolBudget = exports.loadAppConfig = exports.APP_CONFIG = exports.assertPoolBudget = exports.BootSequence = exports.buildListScopeFn = exports.buildRecordAuthorization = exports.SHIELD_OPERATION_AUTHORITY_PORT = exports.ManifestOperationAuthorityAdapter = exports.GrantStoreUnavailableError = exports.InvalidGrantError = exports.GrantNotPermittedError = exports.SHIELD_CROSS_TENANT_GRANT_WRITER = exports.CrossTenantGrantWriter = exports.SHIELD_CROSS_TENANT_GRANT_PORT = exports.MariaDbCrossTenantGrantAdapter = exports.makeShareDeleteCascade = exports.ShareStoreUnavailableError = exports.ShareNotPermittedError = exports.SHIELD_RECORD_SHARE_WRITER = exports.RecordShareWriter = exports.SHIELD_RECORD_SHARE_PORT = exports.MariaDbRecordShareAdapter = exports.UnknownScopeFieldError = exports.translateListScope = exports.SHIELD_LIST_SCOPE_PORT = exports.MariaDbListScopeAdapter = void 0;
21
- exports.ScopeUnknownParentError = exports.ScopeDepthError = exports.ScopeCycleError = exports.buildClosureRows = exports.AccountController = exports.generateRecoveryCodes = exports.buildOtpauthUri = exports.generateTotpSecret = exports.PendingMfaStore = exports.AuthController = exports.SHIELD_SCOPE_SUBTREE_RESOLVER = exports.SHIELD_SESSION_FACTS_PROJECTOR = exports.hmacSha1 = exports.resolveTotpVerifier = exports.makeDefaultTotpVerifier = exports.AuthModule = exports.PersistenceModule = exports.MariaDbCredentialResolver = exports.SHIELD_TOTP_VERIFIER_OVERRIDE = exports.SHIELD_MFA_DEVICE_STORE = void 0;
19
+ exports.accessBindingTtlMs = exports.ROTATE_GRACE_MS = exports.SHIELD_SESSION_LIFETIMES = exports.HotRevokingSessionRecordStore = exports.SHIELD_CLOCK = exports.SHIELD_REFRESH_HASHER = exports.SHIELD_TOKEN_GENERATOR = exports.systemClockProvider = exports.refreshHasherProvider = exports.cryptoTokenGeneratorProvider = exports.SystemClock = exports.Sha256RefreshTokenHasher = exports.CryptoTokenGenerator = exports.SHIELD_HOT_SESSION_STORE = exports.RedisHotSessionStore = exports.SHIELD_SESSION_RECORD_STORE = exports.MariaDbSessionRecordStore = exports.EncryptedFileSecretsProvider = exports.LocalKekCrypto = exports.SHIELD_PASSWORD_HASHER = exports.argon2idHasherProvider = exports.Argon2idPasswordHasher = exports.stubDecisionAuthority = exports.GlobalEnforcementGuard = exports.NO_SESSION_FACTS = exports.SHIELD_SESSION_FACTS_ALS = exports.MariaDbApiKeyStore = exports.isApiKey = exports.extractBearerToken = exports.principalFromClaims = exports.resolveRequestAuth = exports.resolveRequestPrincipal = exports.SessionTokenBinder = exports.SHIELD_SERVICE_AUTHENTICATOR = exports.SHIELD_SESSION_TOKEN_BINDER = exports.CatalogGatabilityError = exports.CatalogReconciler = exports.OperationInventoryScanner = exports.normalizeClassification = exports.DEFAULT_CLASSIFIED_ACTION = exports.CLASSIFICATION_METADATA = exports.Classified = exports.Public = exports.SHIELD_DECISION_AUTHORITY = exports.ShieldModule = exports.actionsFor = exports.IDENTITY_ACTIONS = exports.MODULE_KEY = exports.buildIdentityModuleRegistry = exports.guardMigrationsDir = void 0;
20
+ exports.DEFAULT_LOGIN_IP_LIMIT = exports.loadLoginIpLimit = exports.DEFAULT_REDIS_URL = exports.DEFAULT_DB_CONFIG = exports.assertRefreshHmacKey = exports.loadRefreshHmacKey = exports.loadSessionLifetimes = exports.loadRedisConfig = exports.loadDbConfig = exports.SCHEMA_SVC_POOL_HARD_CAP = exports.DEFAULT_POOL_BUDGET = exports.evaluatePoolBudget = exports.loadPoolBudget = exports.loadAppConfig = exports.APP_CONFIG = exports.assertPoolBudget = exports.BootSequence = exports.buildListScopeFn = exports.MariaDbSessionRestrictionStore = exports.SHIELD_SESSION_RESTRICTIONS = exports.SHIELD_PERMISSION_VERSION_CACHE = exports.DEFAULT_PERMISSION_VERSION_TTL_MS = exports.PERMISSION_VERSION_KEY_PREFIX = exports.RedisPermissionVersionCache = exports.withRedisPermissionVersion = exports.buildRecordAuthorization = exports.SHIELD_OPERATION_AUTHORITY_PORT = exports.ManifestOperationAuthorityAdapter = exports.GrantStoreUnavailableError = exports.InvalidGrantError = exports.GrantNotPermittedError = exports.SHIELD_CROSS_TENANT_GRANT_WRITER = exports.CrossTenantGrantWriter = exports.SHIELD_CROSS_TENANT_GRANT_PORT = exports.MariaDbCrossTenantGrantAdapter = exports.makeShareDeleteCascade = exports.ShareStoreUnavailableError = exports.ShareNotPermittedError = exports.SHIELD_RECORD_SHARE_WRITER = exports.RecordShareWriter = exports.SHIELD_RECORD_SHARE_PORT = exports.MariaDbRecordShareAdapter = exports.UnknownScopeFieldError = exports.translateListScope = exports.SHIELD_LIST_SCOPE_PORT = exports.MariaDbListScopeAdapter = exports.SHIELD_POLICY_STORE = exports.MariaDbPolicyStore = exports.SHIELD_RECORD_RULE_PORT = exports.MariaDbRecordPermissionRuleAdapter = void 0;
21
+ exports.ScopeUnknownParentError = exports.ScopeDepthError = exports.ScopeCycleError = exports.buildClosureRows = exports.AccountController = exports.generateRecoveryCodes = exports.buildOtpauthUri = exports.generateTotpSecret = exports.SHIELD_LOGIN_TOTP_VERIFIER = exports.SHIELD_MFA_STEP_UP = exports.SHIELD_MFA_LIMITER = exports.challengeMatches = exports.credentialFingerprint = exports.CredentialMfaStepUp = exports.RedisPendingMfaStore = exports.PendingMfaStore = exports.AuthController = exports.SHIELD_SCOPE_SUBTREE_RESOLVER = exports.SHIELD_SESSION_FACTS_PROJECTOR = exports.hmacSha1 = exports.resolveTotpVerifier = exports.makeDefaultTotpVerifier = exports.AuthModule = exports.MariaDbCredentialResolver = exports.SHIELD_TOTP_VERIFIER_OVERRIDE = exports.SHIELD_MFA_DEVICE_STORE = exports.SHIELD_AUDIT_SINK = exports.SHIELD_SESSION_SWEEPER = exports.SHIELD_PROFILE_WRITER = exports.SHIELD_RECOVERY_CODE_STORE = exports.SHIELD_EMAIL_SENDER = exports.SHIELD_RESET_TOKEN_STORE = exports.SHIELD_CREDENTIAL_WRITER = exports.SHIELD_SESSION_AUTHORITY = exports.SHIELD_AUTHENTICATOR = exports.SHIELD_PROFILE_RESOLVER = exports.SHIELD_CREDENTIAL_RESOLVER = exports.SHIELD_REDIS = exports.isDevOrTestNodeEnv = void 0;
22
22
  // Framework authz migrations (shield_authz DDL — permission / role_permission /
23
23
  // authz_permission_version). Absolute path a consumer's `@astram/migrate` setup merges in.
24
24
  var migrations_dir_js_1 = require("./migrations-dir.js");
@@ -136,6 +136,12 @@ Object.defineProperty(exports, "systemClockProvider", { enumerable: true, get: f
136
136
  Object.defineProperty(exports, "SHIELD_TOKEN_GENERATOR", { enumerable: true, get: function () { return index_js_1.SHIELD_TOKEN_GENERATOR; } });
137
137
  Object.defineProperty(exports, "SHIELD_REFRESH_HASHER", { enumerable: true, get: function () { return index_js_1.SHIELD_REFRESH_HASHER; } });
138
138
  Object.defineProperty(exports, "SHIELD_CLOCK", { enumerable: true, get: function () { return index_js_1.SHIELD_CLOCK; } });
139
+ // Security hardening M-A: durable revoke → Redis unbind decorator.
140
+ Object.defineProperty(exports, "HotRevokingSessionRecordStore", { enumerable: true, get: function () { return index_js_1.HotRevokingSessionRecordStore; } });
141
+ // Security hardening #8: the resolved lifetimes token + the access-binding TTL rule.
142
+ Object.defineProperty(exports, "SHIELD_SESSION_LIFETIMES", { enumerable: true, get: function () { return index_js_1.SHIELD_SESSION_LIFETIMES; } });
143
+ Object.defineProperty(exports, "ROTATE_GRACE_MS", { enumerable: true, get: function () { return index_js_1.ROTATE_GRACE_MS; } });
144
+ Object.defineProperty(exports, "accessBindingTtlMs", { enumerable: true, get: function () { return index_js_1.accessBindingTtlMs; } });
139
145
  // The record-permit ADMIN-rule adapter (ADR-0003 / design §5.1): the concrete
140
146
  // `RecordPermissionRulePort` over the `record_permission_rule` table. Reads ADMIN
141
147
  // rules only; the framework-owned OWNER baseline is core's job (not a row here). An
@@ -237,13 +243,31 @@ Object.defineProperty(exports, "SHIELD_OPERATION_AUTHORITY_PORT", { enumerable:
237
243
  // enforcement-only path core-free.
238
244
  var wire_record_authorization_js_1 = require("./authz/wire-record-authorization.js");
239
245
  Object.defineProperty(exports, "buildRecordAuthorization", { enumerable: true, get: function () { return wire_record_authorization_js_1.buildRecordAuthorization; } });
246
+ var wire_record_authorization_js_2 = require("./authz/wire-record-authorization.js");
247
+ Object.defineProperty(exports, "withRedisPermissionVersion", { enumerable: true, get: function () { return wire_record_authorization_js_2.withRedisPermissionVersion; } });
248
+ // The Redis-held permission version (ADR-0035, GAPS #6): gate 5 reads `shield:permver:<tenant>`
249
+ // instead of MariaDB; `@astram/identity`'s bumper publishes to it after commit (injecting
250
+ // `SHIELD_PERMISSION_VERSION_CACHE`, provided by the auth surface under `auth: true`). Monotonic
251
+ // writes, TTL-bounded; a Redis error on the read fails closed.
252
+ var permission_version_cache_js_1 = require("./authz/permission-version-cache.js");
253
+ Object.defineProperty(exports, "RedisPermissionVersionCache", { enumerable: true, get: function () { return permission_version_cache_js_1.RedisPermissionVersionCache; } });
254
+ Object.defineProperty(exports, "PERMISSION_VERSION_KEY_PREFIX", { enumerable: true, get: function () { return permission_version_cache_js_1.PERMISSION_VERSION_KEY_PREFIX; } });
255
+ Object.defineProperty(exports, "DEFAULT_PERMISSION_VERSION_TTL_MS", { enumerable: true, get: function () { return permission_version_cache_js_1.DEFAULT_PERMISSION_VERSION_TTL_MS; } });
256
+ var tokens_js_2 = require("./auth/tokens.js");
257
+ Object.defineProperty(exports, "SHIELD_PERMISSION_VERSION_CACHE", { enumerable: true, get: function () { return tokens_js_2.SHIELD_PERMISSION_VERSION_CACHE; } });
258
+ // Durable session restrictions (Phase 3B review P1): the recovery-login re-enroll marker on the
259
+ // durable session + the account status the refresh-time rebuild checks.
260
+ var tokens_js_3 = require("./auth/tokens.js");
261
+ Object.defineProperty(exports, "SHIELD_SESSION_RESTRICTIONS", { enumerable: true, get: function () { return tokens_js_3.SHIELD_SESSION_RESTRICTIONS; } });
262
+ var session_restriction_store_js_1 = require("./session/session-restriction-store.js");
263
+ Object.defineProperty(exports, "MariaDbSessionRestrictionStore", { enumerable: true, get: function () { return session_restriction_store_js_1.MariaDbSessionRestrictionStore; } });
240
264
  // The LIST-FORM sibling (Task 2.2): the engine-facing `ListScopeFn` the module wiring hands
241
265
  // to the engine's `list()` (Task 3.1). `buildListScopeFn` is a SEPARATE factory (Option A)
242
266
  // that takes the SAME `RecordAuthorizationInputs` and constructs its `MariaDbListScopeAdapter`
243
267
  // over the SAME un-overridable `inputs.pool` — the adapter is NOT a field of the inputs, so a
244
268
  // consumer cannot inject a fail-open scope port. Fail-closed: a transient throw PROPAGATES.
245
- var wire_record_authorization_js_2 = require("./authz/wire-record-authorization.js");
246
- Object.defineProperty(exports, "buildListScopeFn", { enumerable: true, get: function () { return wire_record_authorization_js_2.buildListScopeFn; } });
269
+ var wire_record_authorization_js_3 = require("./authz/wire-record-authorization.js");
270
+ Object.defineProperty(exports, "buildListScopeFn", { enumerable: true, get: function () { return wire_record_authorization_js_3.buildListScopeFn; } });
247
271
  // Boot infrastructure (ADR-0018 connection-pool budget assertion). `BootModule`
248
272
  // itself is NOT exported — it is composed internally by `ShieldModule.forRoot()`.
249
273
  var boot_sequence_js_1 = require("./boot/boot-sequence.js");
@@ -271,6 +295,11 @@ Object.defineProperty(exports, "loadRefreshHmacKey", { enumerable: true, get: fu
271
295
  Object.defineProperty(exports, "assertRefreshHmacKey", { enumerable: true, get: function () { return app_config_js_1.assertRefreshHmacKey; } });
272
296
  Object.defineProperty(exports, "DEFAULT_DB_CONFIG", { enumerable: true, get: function () { return app_config_js_1.DEFAULT_DB_CONFIG; } });
273
297
  Object.defineProperty(exports, "DEFAULT_REDIS_URL", { enumerable: true, get: function () { return app_config_js_1.DEFAULT_REDIS_URL; } });
298
+ // Security hardening #5/#6 (additive): the per-IP login failure limit (D3) and the
299
+ // raw-NODE_ENV dev/test predicate that gates the dev email logger.
300
+ Object.defineProperty(exports, "loadLoginIpLimit", { enumerable: true, get: function () { return app_config_js_1.loadLoginIpLimit; } });
301
+ Object.defineProperty(exports, "DEFAULT_LOGIN_IP_LIMIT", { enumerable: true, get: function () { return app_config_js_1.DEFAULT_LOGIN_IP_LIMIT; } });
302
+ Object.defineProperty(exports, "isDevOrTestNodeEnv", { enumerable: true, get: function () { return app_config_js_1.isDevOrTestNodeEnv; } });
274
303
  // ---------------------------------------------------------------------------
275
304
  // Phase 0b Auth surface (framework-owned login → session, spec §2/§3/§4).
276
305
  //
@@ -281,37 +310,37 @@ Object.defineProperty(exports, "DEFAULT_REDIS_URL", { enumerable: true, get: fun
281
310
  // path is untouched; ShieldModule wiring is deferred to the integration owner.
282
311
  // ---------------------------------------------------------------------------
283
312
  // Shared DI provider tokens (the seams the teams bind/consume — see tokens.ts for
284
- // who provides/consumes each).
285
- var tokens_js_2 = require("./auth/tokens.js");
286
- Object.defineProperty(exports, "SHIELD_DB_POOL", { enumerable: true, get: function () { return tokens_js_2.SHIELD_DB_POOL; } });
287
- Object.defineProperty(exports, "SHIELD_REDIS", { enumerable: true, get: function () { return tokens_js_2.SHIELD_REDIS; } });
288
- Object.defineProperty(exports, "SHIELD_CREDENTIAL_RESOLVER", { enumerable: true, get: function () { return tokens_js_2.SHIELD_CREDENTIAL_RESOLVER; } });
289
- Object.defineProperty(exports, "SHIELD_PROFILE_RESOLVER", { enumerable: true, get: function () { return tokens_js_2.SHIELD_PROFILE_RESOLVER; } });
290
- Object.defineProperty(exports, "SHIELD_AUTHENTICATOR", { enumerable: true, get: function () { return tokens_js_2.SHIELD_AUTHENTICATOR; } });
291
- Object.defineProperty(exports, "SHIELD_SESSION_AUTHORITY", { enumerable: true, get: function () { return tokens_js_2.SHIELD_SESSION_AUTHORITY; } });
313
+ // who provides/consumes each). The raw pool token `SHIELD_DB_POOL` is NOT here (Phase 8 #5):
314
+ // it is on `@astram/guard/internal`, with the `PersistenceModule` that provides it.
315
+ var tokens_js_4 = require("./auth/tokens.js");
316
+ Object.defineProperty(exports, "SHIELD_REDIS", { enumerable: true, get: function () { return tokens_js_4.SHIELD_REDIS; } });
317
+ Object.defineProperty(exports, "SHIELD_CREDENTIAL_RESOLVER", { enumerable: true, get: function () { return tokens_js_4.SHIELD_CREDENTIAL_RESOLVER; } });
318
+ Object.defineProperty(exports, "SHIELD_PROFILE_RESOLVER", { enumerable: true, get: function () { return tokens_js_4.SHIELD_PROFILE_RESOLVER; } });
319
+ Object.defineProperty(exports, "SHIELD_AUTHENTICATOR", { enumerable: true, get: function () { return tokens_js_4.SHIELD_AUTHENTICATOR; } });
320
+ Object.defineProperty(exports, "SHIELD_SESSION_AUTHORITY", { enumerable: true, get: function () { return tokens_js_4.SHIELD_SESSION_AUTHORITY; } });
292
321
  // Account & credential-surface seams (forgot/reset, change-password, MFA
293
322
  // enrollment, profile edit) — all OPTIONAL, consumer-plugged through
294
323
  // ShieldModule.forRoot. See tokens.ts for who provides/consumes each.
295
- Object.defineProperty(exports, "SHIELD_CREDENTIAL_WRITER", { enumerable: true, get: function () { return tokens_js_2.SHIELD_CREDENTIAL_WRITER; } });
296
- Object.defineProperty(exports, "SHIELD_RESET_TOKEN_STORE", { enumerable: true, get: function () { return tokens_js_2.SHIELD_RESET_TOKEN_STORE; } });
297
- Object.defineProperty(exports, "SHIELD_EMAIL_SENDER", { enumerable: true, get: function () { return tokens_js_2.SHIELD_EMAIL_SENDER; } });
298
- Object.defineProperty(exports, "SHIELD_RECOVERY_CODE_STORE", { enumerable: true, get: function () { return tokens_js_2.SHIELD_RECOVERY_CODE_STORE; } });
299
- Object.defineProperty(exports, "SHIELD_PROFILE_WRITER", { enumerable: true, get: function () { return tokens_js_2.SHIELD_PROFILE_WRITER; } });
300
- Object.defineProperty(exports, "SHIELD_SESSION_SWEEPER", { enumerable: true, get: function () { return tokens_js_2.SHIELD_SESSION_SWEEPER; } });
324
+ Object.defineProperty(exports, "SHIELD_CREDENTIAL_WRITER", { enumerable: true, get: function () { return tokens_js_4.SHIELD_CREDENTIAL_WRITER; } });
325
+ Object.defineProperty(exports, "SHIELD_RESET_TOKEN_STORE", { enumerable: true, get: function () { return tokens_js_4.SHIELD_RESET_TOKEN_STORE; } });
326
+ Object.defineProperty(exports, "SHIELD_EMAIL_SENDER", { enumerable: true, get: function () { return tokens_js_4.SHIELD_EMAIL_SENDER; } });
327
+ Object.defineProperty(exports, "SHIELD_RECOVERY_CODE_STORE", { enumerable: true, get: function () { return tokens_js_4.SHIELD_RECOVERY_CODE_STORE; } });
328
+ Object.defineProperty(exports, "SHIELD_PROFILE_WRITER", { enumerable: true, get: function () { return tokens_js_4.SHIELD_PROFILE_WRITER; } });
329
+ Object.defineProperty(exports, "SHIELD_SESSION_SWEEPER", { enumerable: true, get: function () { return tokens_js_4.SHIELD_SESSION_SWEEPER; } });
301
330
  // The auth-surface audit sink seam (the first auth audit event — recovery login).
302
- Object.defineProperty(exports, "SHIELD_AUDIT_SINK", { enumerable: true, get: function () { return tokens_js_2.SHIELD_AUDIT_SINK; } });
331
+ Object.defineProperty(exports, "SHIELD_AUDIT_SINK", { enumerable: true, get: function () { return tokens_js_4.SHIELD_AUDIT_SINK; } });
303
332
  // The multi-device MFA store seam (multiple independent authenticator devices).
304
- Object.defineProperty(exports, "SHIELD_MFA_DEVICE_STORE", { enumerable: true, get: function () { return tokens_js_2.SHIELD_MFA_DEVICE_STORE; } });
333
+ Object.defineProperty(exports, "SHIELD_MFA_DEVICE_STORE", { enumerable: true, get: function () { return tokens_js_4.SHIELD_MFA_DEVICE_STORE; } });
305
334
  // The login totp-verifier OVERRIDE seam (Phase 2 — plug an OR-matching verifier).
306
- Object.defineProperty(exports, "SHIELD_TOTP_VERIFIER_OVERRIDE", { enumerable: true, get: function () { return tokens_js_2.SHIELD_TOTP_VERIFIER_OVERRIDE; } });
335
+ Object.defineProperty(exports, "SHIELD_TOTP_VERIFIER_OVERRIDE", { enumerable: true, get: function () { return tokens_js_4.SHIELD_TOTP_VERIFIER_OVERRIDE; } });
307
336
  // The credential-store contract (skeleton — Team A implements the SELECT).
308
337
  var mariadb_credential_resolver_js_1 = require("./authentication/mariadb-credential-resolver.js");
309
338
  Object.defineProperty(exports, "MariaDbCredentialResolver", { enumerable: true, get: function () { return mariadb_credential_resolver_js_1.MariaDbCredentialResolver; } });
310
339
  // The composition module skeletons (Team B fills the factory bodies; the
311
340
  // integration owner imports AuthModule into ShieldModule — see auth.module.ts /
312
341
  // DONE.md).
313
- var persistence_module_js_1 = require("./auth/persistence.module.js");
314
- Object.defineProperty(exports, "PersistenceModule", { enumerable: true, get: function () { return persistence_module_js_1.PersistenceModule; } });
342
+ // `PersistenceModule` (it provides the raw `SHIELD_DB_POOL` pool) is NOT exported here (Phase 8
343
+ // #5): a feature module importing it could inject the pool. It is on `@astram/guard/internal`.
315
344
  var auth_module_js_1 = require("./auth/auth.module.js");
316
345
  Object.defineProperty(exports, "AuthModule", { enumerable: true, get: function () { return auth_module_js_1.AuthModule; } });
317
346
  // Phase-2 verifier-seam helpers. `makeDefaultTotpVerifier()` builds the framework's
@@ -325,10 +354,10 @@ var auth_module_js_2 = require("./auth/auth.module.js");
325
354
  Object.defineProperty(exports, "makeDefaultTotpVerifier", { enumerable: true, get: function () { return auth_module_js_2.makeDefaultTotpVerifier; } });
326
355
  Object.defineProperty(exports, "resolveTotpVerifier", { enumerable: true, get: function () { return auth_module_js_2.resolveTotpVerifier; } });
327
356
  Object.defineProperty(exports, "hmacSha1", { enumerable: true, get: function () { return auth_module_js_2.hmacSha1; } });
328
- var tokens_js_3 = require("./auth/tokens.js");
329
- Object.defineProperty(exports, "SHIELD_SESSION_FACTS_PROJECTOR", { enumerable: true, get: function () { return tokens_js_3.SHIELD_SESSION_FACTS_PROJECTOR; } });
330
- var tokens_js_4 = require("./auth/tokens.js");
331
- Object.defineProperty(exports, "SHIELD_SCOPE_SUBTREE_RESOLVER", { enumerable: true, get: function () { return tokens_js_4.SHIELD_SCOPE_SUBTREE_RESOLVER; } });
357
+ var tokens_js_5 = require("./auth/tokens.js");
358
+ Object.defineProperty(exports, "SHIELD_SESSION_FACTS_PROJECTOR", { enumerable: true, get: function () { return tokens_js_5.SHIELD_SESSION_FACTS_PROJECTOR; } });
359
+ var tokens_js_6 = require("./auth/tokens.js");
360
+ Object.defineProperty(exports, "SHIELD_SCOPE_SUBTREE_RESOLVER", { enumerable: true, get: function () { return tokens_js_6.SHIELD_SCOPE_SUBTREE_RESOLVER; } });
332
361
  // The framework-owned `/auth/*` HTTP controller (Team C) + its pending-MFA store.
333
362
  // The controller CONSUMES SHIELD_AUTHENTICATOR / SHIELD_SESSION_AUTHORITY and the
334
363
  // PendingMfaStore. It is EXPORTED so AuthModule (Team B) / the integration owner
@@ -338,6 +367,17 @@ var auth_controller_js_1 = require("./auth/auth.controller.js");
338
367
  Object.defineProperty(exports, "AuthController", { enumerable: true, get: function () { return auth_controller_js_1.AuthController; } });
339
368
  var pending_mfa_store_js_1 = require("./auth/pending-mfa-store.js");
340
369
  Object.defineProperty(exports, "PendingMfaStore", { enumerable: true, get: function () { return pending_mfa_store_js_1.PendingMfaStore; } });
370
+ Object.defineProperty(exports, "RedisPendingMfaStore", { enumerable: true, get: function () { return pending_mfa_store_js_1.RedisPendingMfaStore; } });
371
+ // The MFA step-up (security hardening M6): `/auth/mfa` verifies only the second factor for
372
+ // the principal the password step recorded (no password held between the two requests).
373
+ var mfa_step_up_js_1 = require("./auth/mfa-step-up.js");
374
+ Object.defineProperty(exports, "CredentialMfaStepUp", { enumerable: true, get: function () { return mfa_step_up_js_1.CredentialMfaStepUp; } });
375
+ Object.defineProperty(exports, "credentialFingerprint", { enumerable: true, get: function () { return mfa_step_up_js_1.credentialFingerprint; } });
376
+ Object.defineProperty(exports, "challengeMatches", { enumerable: true, get: function () { return mfa_step_up_js_1.challengeMatches; } });
377
+ var tokens_js_7 = require("./auth/tokens.js");
378
+ Object.defineProperty(exports, "SHIELD_MFA_LIMITER", { enumerable: true, get: function () { return tokens_js_7.SHIELD_MFA_LIMITER; } });
379
+ Object.defineProperty(exports, "SHIELD_MFA_STEP_UP", { enumerable: true, get: function () { return tokens_js_7.SHIELD_MFA_STEP_UP; } });
380
+ Object.defineProperty(exports, "SHIELD_LOGIN_TOTP_VERIFIER", { enumerable: true, get: function () { return tokens_js_7.SHIELD_LOGIN_TOTP_VERIFIER; } });
341
381
  // The pure TOTP-enrollment helpers (Phase 4 MFA). Re-exported for consumers/tests
342
382
  // that need them; the multi-device MFA routes (Phase 3) reuse them to mint a device
343
383
  // secret + provisioning URI + recovery codes. (The old in-memory
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @astram/guard/internal — framework-composition and test surface (Phase 8 #5).
3
+ *
4
+ * `PersistenceModule` provides the raw `shield_core` pool under `SHIELD_DB_POOL`; a module that
5
+ * imported it could inject that pool. Neither is on the package entry point (`@astram/guard`):
6
+ * `ShieldModule.forRoot({ auth: true })` composes them internally, and the pool provider is not
7
+ * exported app-wide. The scaffolded app's lint wall rejects this subpath outside the composition
8
+ * root.
9
+ */
10
+ export { PersistenceModule } from './auth/persistence.module.js';
11
+ export { SHIELD_DB_POOL } from './auth/tokens.js';
12
+ //# sourceMappingURL=internal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC"}
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SHIELD_DB_POOL = exports.PersistenceModule = void 0;
4
+ /**
5
+ * @astram/guard/internal — framework-composition and test surface (Phase 8 #5).
6
+ *
7
+ * `PersistenceModule` provides the raw `shield_core` pool under `SHIELD_DB_POOL`; a module that
8
+ * imported it could inject that pool. Neither is on the package entry point (`@astram/guard`):
9
+ * `ShieldModule.forRoot({ auth: true })` composes them internally, and the pool provider is not
10
+ * exported app-wide. The scaffolded app's lint wall rejects this subpath outside the composition
11
+ * root.
12
+ */
13
+ var persistence_module_js_1 = require("./auth/persistence.module.js");
14
+ Object.defineProperty(exports, "PersistenceModule", { enumerable: true, get: function () { return persistence_module_js_1.PersistenceModule; } });
15
+ var tokens_js_1 = require("./auth/tokens.js");
16
+ Object.defineProperty(exports, "SHIELD_DB_POOL", { enumerable: true, get: function () { return tokens_js_1.SHIELD_DB_POOL; } });
@@ -105,7 +105,13 @@ export interface ShieldModuleOptions {
105
105
  */
106
106
  readonly credentialWriter?: CredentialWriter;
107
107
  readonly resetTokenStore?: ResetTokenStore;
108
- readonly emailSender?: EmailSender;
108
+ /**
109
+ * Password-reset email delivery — see {@link AuthModuleOptions.emailSender}. A real
110
+ * sender, or `'disabled'` (no-op, forgot-password still 204). REQUIRED under
111
+ * `auth: true` unless the raw `NODE_ENV` is `development`/`test` (where the dev
112
+ * `LogEmailSender` is the default); otherwise boot fails (security hardening #6).
113
+ */
114
+ readonly emailSender?: EmailSender | 'disabled';
109
115
  readonly recoveryCodeStore?: RecoveryCodeStore;
110
116
  readonly profileWriter?: ProfileWriter;
111
117
  readonly sessionSweeper?: SessionSweeper;
@@ -221,7 +227,8 @@ export interface ShieldModuleAsyncOptions {
221
227
  */
222
228
  readonly credentialWriter?: CredentialWriter;
223
229
  readonly resetTokenStore?: ResetTokenStore;
224
- readonly emailSender?: EmailSender;
230
+ /** See {@link ShieldModuleOptions.emailSender} (a sender, or `'disabled'`). */
231
+ readonly emailSender?: EmailSender | 'disabled';
225
232
  readonly recoveryCodeStore?: RecoveryCodeStore;
226
233
  readonly profileWriter?: ProfileWriter;
227
234
  readonly sessionSweeper?: SessionSweeper;
@@ -1 +1 @@
1
- {"version":3,"file":"shield.module.d.ts","sourceRoot":"","sources":["../../src/module/shield.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,aAAa,EAAiB,MAAM,gBAAgB,CAAC;AAOnF,OAAO,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAQvE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,uCAAuC,CAAC;AACvF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAC9E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACxE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C;IAC/B;;;;OAIG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,cAAc,CAAC;IACzC;;;;OAIG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,cAAc,CAAC;IACvC;;;;;;;;OAQG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC;;;;;OAKG;IACH,QAAQ,CAAC,kBAAkB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAChD,2FAA2F;IAC3F,QAAQ,CAAC,wBAAwB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACtD;;;;;OAKG;IACH,QAAQ,CAAC,qBAAqB,CAAC,EAAE,qBAAqB,CAAC;IACvD;;;;OAIG;IACH,QAAQ,CAAC,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;IACrD;;;;OAIG;IACH,QAAQ,CAAC,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;CAChD;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,qBAEa,YAAY;IACvB,6DAA6D;IAC7D,MAAM,CAAC,OAAO,CAAC,OAAO,GAAE,mBAAwB,GAAG,aAAa;IA8FhE;;;;;;;;;OASG;IACH,MAAM,CAAC,YAAY,CAAC,OAAO,EAAE,wBAAwB,GAAG,aAAa;CAkGtE"}
@@ -55,6 +55,9 @@ const app_config_js_1 = require("../config/app-config.js");
55
55
  // the enforcement-only path never INSTANTIATES it (no live pool/Redis, no HMAC
56
56
  // gate, no core load).
57
57
  const auth_module_js_1 = require("../auth/auth.module.js");
58
+ // Core-free (type-only core imports): the deferred default projector + the version-cache token.
59
+ const default_session_facts_projector_js_1 = require("../auth/default-session-facts-projector.js");
60
+ const tokens_js_1 = require("../auth/tokens.js");
58
61
  // The `SHIELD_DECISION_AUTHORITY` token now lives in `./shield-tokens.js` so the
59
62
  // enforcement guard can import it without a cycle (guard → token → ShieldModule →
60
63
  // EnforcementModule → guard). Re-exported here to keep the public import path stable.
@@ -87,7 +90,8 @@ let cachedRecordAuthApi;
87
90
  async function loadBuildRecordAuthorization() {
88
91
  if (cachedRecordAuthApi === undefined) {
89
92
  try {
90
- cachedRecordAuthApi = (await Promise.resolve().then(() => __importStar(require('../authz/wire-record-authorization.js'))));
93
+ cachedRecordAuthApi =
94
+ (await Promise.resolve().then(() => __importStar(require('../authz/wire-record-authorization.js'))));
91
95
  }
92
96
  catch {
93
97
  // Built-dist fallback (the CJS dist path — see evalImport). `__dirname` is defined
@@ -97,7 +101,7 @@ async function loadBuildRecordAuthorization() {
97
101
  cachedRecordAuthApi = (await evalImport(base));
98
102
  }
99
103
  }
100
- return cachedRecordAuthApi.buildRecordAuthorization;
104
+ return cachedRecordAuthApi;
101
105
  }
102
106
  /**
103
107
  * Resolve the `SHIELD_DECISION_AUTHORITY` VALUE from the caller's options (the ONE seam,
@@ -113,18 +117,33 @@ async function loadBuildRecordAuthorization() {
113
117
  *
114
118
  * Async because the `recordAuthorization` path lazy-loads the (core-touching) builder.
115
119
  */
116
- async function resolveDecisionAuthority(options) {
120
+ async function resolveDecisionAuthority(options, extras = {}) {
117
121
  if (options.recordAuthorization && options.decisionAuthority) {
118
122
  throw new Error('ShieldModule: `recordAuthorization` and `decisionAuthority` are mutually exclusive — ' +
119
123
  'supply the record-authorization inputs (pool + app ports + registry) so the framework ' +
120
124
  'builds the decision authority, OR a pre-built `decisionAuthority`, but not both.');
121
125
  }
122
126
  if (options.recordAuthorization) {
123
- const build = await loadBuildRecordAuthorization();
124
- return build(options.recordAuthorization);
127
+ const api = await loadBuildRecordAuthorization();
128
+ const versionCache = extras.versionCache ?? undefined;
129
+ // ADR-0035 default projector: cache the SAME facts the authority decides on (version-cache
130
+ // wrapped, so a login projection also warms the Redis version).
131
+ extras.defaultProjector?.attach(versionCache !== undefined
132
+ ? api.withRedisPermissionVersion(options.recordAuthorization.permissionFacts, versionCache)
133
+ : options.recordAuthorization.permissionFacts);
134
+ return api.buildRecordAuthorization(options.recordAuthorization, versionCache !== undefined ? { versionCache } : {});
125
135
  }
126
136
  return options.decisionAuthority ?? core_seam_js_1.stubDecisionAuthority;
127
137
  }
138
+ /**
139
+ * The deferred default projector for a registration (ADR-0035): only when auth is on and the
140
+ * consumer did not supply its own projector. `undefined` otherwise.
141
+ */
142
+ function defaultProjectorFor(auth, explicit) {
143
+ return auth && explicit === undefined ? new default_session_facts_projector_js_1.DeferredSessionFactsProjector() : undefined;
144
+ }
145
+ /** Inject the Redis version cache when AuthModule provides it (`auth: true`); absent otherwise. */
146
+ const OPTIONAL_VERSION_CACHE = { token: tokens_js_1.SHIELD_PERMISSION_VERSION_CACHE, optional: true };
128
147
  /**
129
148
  * `ShieldModule` — the SINGLE registration seam (ADR-0023 §4).
130
149
  *
@@ -153,6 +172,10 @@ let ShieldModule = ShieldModule_1 = class ShieldModule {
153
172
  /** Register Shield with static options (the common path). */
154
173
  static forRoot(options = {}) {
155
174
  const config = options.config ?? (0, app_config_js_1.loadAppConfig)();
175
+ // ADR-0035: with auth on and no explicit projector, sessions cache the facts the framework-built
176
+ // authority decides on (attached when the authority is built; inactive until then).
177
+ const defaultProjector = defaultProjectorFor(options.auth, options.sessionFactsProjector);
178
+ const sessionFactsProjector = options.sessionFactsProjector ?? defaultProjector;
156
179
  // Build the opt-in AuthModule ONCE so the SAME DynamicModule instance is both
157
180
  // imported (composes) and re-exported (propagates its exported engine tokens
158
181
  // app-wide through the @Global ShieldModule). Re-exporting the two Symbols
@@ -172,9 +195,7 @@ let ShieldModule = ShieldModule_1 = class ShieldModule {
172
195
  ...(options.credentialResolver
173
196
  ? { credentialResolver: options.credentialResolver }
174
197
  : {}),
175
- ...(options.profileResolver
176
- ? { profileResolver: options.profileResolver }
177
- : {}),
198
+ ...(options.profileResolver ? { profileResolver: options.profileResolver } : {}),
178
199
  // The account/credential-surface seams — same spread-when-present rule
179
200
  // (an explicit `undefined` is not assignable under
180
201
  // exactOptionalPropertyTypes; absent → AuthModule binds `null` → 501).
@@ -194,15 +215,11 @@ let ShieldModule = ShieldModule_1 = class ShieldModule {
194
215
  ...(options.identityControlPlaneKeys
195
216
  ? { identityControlPlaneKeys: options.identityControlPlaneKeys }
196
217
  : {}),
197
- ...(options.sessionFactsProjector
198
- ? { sessionFactsProjector: options.sessionFactsProjector }
199
- : {}),
218
+ ...(sessionFactsProjector ? { sessionFactsProjector } : {}),
200
219
  ...(options.scopeSubtreeResolver
201
220
  ? { scopeSubtreeResolver: options.scopeSubtreeResolver }
202
221
  : {}),
203
- ...(options.membershipChecker
204
- ? { membershipChecker: options.membershipChecker }
205
- : {}),
222
+ ...(options.membershipChecker ? { membershipChecker: options.membershipChecker } : {}),
206
223
  })
207
224
  : undefined;
208
225
  return {
@@ -221,24 +238,22 @@ let ShieldModule = ShieldModule_1 = class ShieldModule {
221
238
  // stub paths resolve synchronously but flow through the same one seam. Both
222
239
  // supplied → throws (mutual exclusion).
223
240
  provide: shield_tokens_js_1.SHIELD_DECISION_AUTHORITY,
224
- useFactory: () => resolveDecisionAuthority({
241
+ useFactory: (versionCache) => resolveDecisionAuthority({
225
242
  ...(options.recordAuthorization
226
243
  ? { recordAuthorization: options.recordAuthorization }
227
244
  : {}),
228
245
  ...(options.decisionAuthority
229
246
  ? { decisionAuthority: options.decisionAuthority }
230
247
  : {}),
231
- }),
248
+ }, { versionCache, defaultProjector }),
249
+ // ADR-0035: the Redis version cache AuthModule provides under `auth: true`.
250
+ inject: [OPTIONAL_VERSION_CACHE],
232
251
  },
233
252
  ],
234
253
  // Re-export the composed AuthModule app-wide ONLY when auth is opted in — its
235
254
  // own `exports` (SHIELD_AUTHENTICATOR / SHIELD_SESSION_AUTHORITY) then become
236
255
  // visible to a consumer's controllers/services via the @Global seam.
237
- exports: [
238
- config_module_js_1.APP_CONFIG,
239
- shield_tokens_js_1.SHIELD_DECISION_AUTHORITY,
240
- ...(authModule ? [authModule] : []),
241
- ],
256
+ exports: [config_module_js_1.APP_CONFIG, shield_tokens_js_1.SHIELD_DECISION_AUTHORITY, ...(authModule ? [authModule] : [])],
242
257
  };
243
258
  }
244
259
  /**
@@ -263,6 +278,10 @@ let ShieldModule = ShieldModule_1 = class ShieldModule {
263
278
  useFactory: (opts) => opts.config ?? (0, app_config_js_1.loadAppConfig)(),
264
279
  inject: [optionsToken],
265
280
  };
281
+ // ADR-0035: the deferred default projector (auth on, no explicit projector), attached when the
282
+ // async-resolved options yield `recordAuthorization`.
283
+ const defaultProjector = defaultProjectorFor(options.auth, options.sessionFactsProjector);
284
+ const sessionFactsProjector = options.sessionFactsProjector ?? defaultProjector;
266
285
  const authorityProvider = {
267
286
  provide: shield_tokens_js_1.SHIELD_DECISION_AUTHORITY,
268
287
  // Same one-seam resolution as forRoot, over the async-resolved options: the
@@ -270,11 +289,11 @@ let ShieldModule = ShieldModule_1 = class ShieldModule {
270
289
  // in its useFactory from the injected registrations) has the framework build the
271
290
  // real wired authority; `decisionAuthority` is the legacy passthrough; both →
272
291
  // throws; neither → stub. Async because the record path lazy-loads the builder.
273
- useFactory: (opts) => resolveDecisionAuthority({
292
+ useFactory: (opts, versionCache) => resolveDecisionAuthority({
274
293
  ...(opts.recordAuthorization ? { recordAuthorization: opts.recordAuthorization } : {}),
275
294
  ...(opts.decisionAuthority ? { decisionAuthority: opts.decisionAuthority } : {}),
276
- }),
277
- inject: [optionsToken],
295
+ }, { versionCache, defaultProjector }),
296
+ inject: [optionsToken, OPTIONAL_VERSION_CACHE],
278
297
  };
279
298
  // Same one-instance opt-in AuthModule as forRoot (imported + re-exported).
280
299
  // `credentialResolver` is STATIC on the async options (like `auth`) — a
@@ -289,9 +308,7 @@ let ShieldModule = ShieldModule_1 = class ShieldModule {
289
308
  ...(options.credentialResolver
290
309
  ? { credentialResolver: options.credentialResolver }
291
310
  : {}),
292
- ...(options.profileResolver
293
- ? { profileResolver: options.profileResolver }
294
- : {}),
311
+ ...(options.profileResolver ? { profileResolver: options.profileResolver } : {}),
295
312
  // The account/credential-surface seams — same spread-when-present rule
296
313
  // (an explicit `undefined` is not assignable under
297
314
  // exactOptionalPropertyTypes; absent → AuthModule binds `null` → 501).
@@ -311,15 +328,11 @@ let ShieldModule = ShieldModule_1 = class ShieldModule {
311
328
  ...(options.identityControlPlaneKeys
312
329
  ? { identityControlPlaneKeys: options.identityControlPlaneKeys }
313
330
  : {}),
314
- ...(options.sessionFactsProjector
315
- ? { sessionFactsProjector: options.sessionFactsProjector }
316
- : {}),
331
+ ...(sessionFactsProjector ? { sessionFactsProjector } : {}),
317
332
  ...(options.scopeSubtreeResolver
318
333
  ? { scopeSubtreeResolver: options.scopeSubtreeResolver }
319
334
  : {}),
320
- ...(options.membershipChecker
321
- ? { membershipChecker: options.membershipChecker }
322
- : {}),
335
+ ...(options.membershipChecker ? { membershipChecker: options.membershipChecker } : {}),
323
336
  })
324
337
  : undefined;
325
338
  return {
@@ -335,11 +348,7 @@ let ShieldModule = ShieldModule_1 = class ShieldModule {
335
348
  ...(options.imports ?? []),
336
349
  ],
337
350
  providers: [asyncOptionsProvider, configProvider, authorityProvider],
338
- exports: [
339
- config_module_js_1.APP_CONFIG,
340
- shield_tokens_js_1.SHIELD_DECISION_AUTHORITY,
341
- ...(authModule ? [authModule] : []),
342
- ],
351
+ exports: [config_module_js_1.APP_CONFIG, shield_tokens_js_1.SHIELD_DECISION_AUTHORITY, ...(authModule ? [authModule] : [])],
343
352
  };
344
353
  }
345
354
  };
@@ -35,7 +35,7 @@
35
35
  * (`PermissionFactsPort.loadCoarseGrants`). A cache miss NEVER fabricates a permit.
36
36
  */
37
37
  import { AsyncLocalStorage } from 'node:async_hooks';
38
- import type { CoarseGrants } from '@astram/core';
38
+ import type { CoarseGrants, PermissionFactsPort } from '@astram/core';
39
39
  /**
40
40
  * The per-request session-facts store carried through the ALS. `cachedFacts` is the
41
41
  * principal's coarse grants for THIS request (or `null` when none were projected →
@@ -47,7 +47,22 @@ export interface SessionFactsStore {
47
47
  readonly cachedFacts: CoarseGrants | null;
48
48
  /** The version `cachedFacts` was projected at (0 when absent). */
49
49
  readonly permissionsVersion: number;
50
+ /**
51
+ * OPTIONAL reload signal (security hardening Phase 1C). The framework-built decision authority
52
+ * calls it when gate 5 RELOADS the coarse grants for a principal inside this request's scope
53
+ * (cache miss or stale version), passing the authoritative reloaded grants. The enforcement guard
54
+ * uses it to notice a permission-version move and re-derive the session's scope subtree. A pure
55
+ * notification: it never changes the decision, and readers ignore it.
56
+ */
57
+ readonly onReload?: (principalId: string, tenantId: string, grants: CoarseGrants) => void;
50
58
  }
59
+ /**
60
+ * Wrap an app-owned `PermissionFactsPort`-shaped object so a gate-5 reload inside an enforcement
61
+ * request notifies that request's {@link SessionFactsStore.onReload}. Behaviour-identical
62
+ * otherwise: same results, same errors (a throwing reload propagates and notifies nothing).
63
+ * Outside a guard request (no ALS store, e.g. the engine's in-handler decide calls) it is a no-op.
64
+ */
65
+ export declare function signalGateFiveReloads(port: PermissionFactsPort): PermissionFactsPort;
51
66
  /**
52
67
  * The ONE shared session-facts `AsyncLocalStorage` (see the file header). The
53
68
  * enforcement guard imports this to `run()` the `decide()` call inside the request's
@@ -1 +1 @@
1
- {"version":3,"file":"session-facts-als.d.ts","sourceRoot":"","sources":["../../src/request-auth/session-facts-als.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAIrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IAChC,wFAAwF;IACxF,QAAQ,CAAC,WAAW,EAAE,YAAY,GAAG,IAAI,CAAC;IAC1C,kEAAkE;IAClE,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAC;CACrC;AAED;;;;;;GAMG;AACH,eAAO,MAAM,wBAAwB,sCAA6C,CAAC;AAEnF;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,EAAE,iBAG7B,CAAC"}
1
+ {"version":3,"file":"session-facts-als.d.ts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