@futdevpro/nts-dynamo 1.15.140 → 1.15.141
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/README.md +27 -0
- package/__documentations/2026-08-18-standalone-account-security-and-privacy-bedrock.md +131 -0
- package/build/_modules/account-security/_enums/account-challenge-purpose.type-enum.d.ts +6 -0
- package/build/_modules/account-security/_enums/account-challenge-purpose.type-enum.d.ts.map +1 -0
- package/build/_modules/account-security/_enums/account-challenge-purpose.type-enum.js +10 -0
- package/build/_modules/account-security/_enums/account-challenge-purpose.type-enum.js.map +1 -0
- package/build/_modules/account-security/_enums/account-refresh-token-state.type-enum.d.ts +7 -0
- package/build/_modules/account-security/_enums/account-refresh-token-state.type-enum.d.ts.map +1 -0
- package/build/_modules/account-security/_enums/account-refresh-token-state.type-enum.js +11 -0
- package/build/_modules/account-security/_enums/account-refresh-token-state.type-enum.js.map +1 -0
- package/build/_modules/account-security/_enums/account-session-state.type-enum.d.ts +7 -0
- package/build/_modules/account-security/_enums/account-session-state.type-enum.d.ts.map +1 -0
- package/build/_modules/account-security/_enums/account-session-state.type-enum.js +11 -0
- package/build/_modules/account-security/_enums/account-session-state.type-enum.js.map +1 -0
- package/build/_modules/account-security/_models/account-challenge-adapter.interface.d.ts +9 -0
- package/build/_modules/account-security/_models/account-challenge-adapter.interface.d.ts.map +1 -0
- package/build/_modules/account-security/_models/account-challenge-adapter.interface.js +3 -0
- package/build/_modules/account-security/_models/account-challenge-adapter.interface.js.map +1 -0
- package/build/_modules/account-security/_models/account-challenge-issued.interface.d.ts +7 -0
- package/build/_modules/account-security/_models/account-challenge-issued.interface.d.ts.map +1 -0
- package/build/_modules/account-security/_models/account-challenge-issued.interface.js +3 -0
- package/build/_modules/account-security/_models/account-challenge-issued.interface.js.map +1 -0
- package/build/_modules/account-security/_models/account-challenge-record.interface.d.ts +13 -0
- package/build/_modules/account-security/_models/account-challenge-record.interface.d.ts.map +1 -0
- package/build/_modules/account-security/_models/account-challenge-record.interface.js +3 -0
- package/build/_modules/account-security/_models/account-challenge-record.interface.js.map +1 -0
- package/build/_modules/account-security/_models/account-challenge-result.interface.d.ts +8 -0
- package/build/_modules/account-security/_models/account-challenge-result.interface.d.ts.map +1 -0
- package/build/_modules/account-security/_models/account-challenge-result.interface.js +3 -0
- package/build/_modules/account-security/_models/account-challenge-result.interface.js.map +1 -0
- package/build/_modules/account-security/_models/account-challenge-settings.interface.d.ts +9 -0
- package/build/_modules/account-security/_models/account-challenge-settings.interface.d.ts.map +1 -0
- package/build/_modules/account-security/_models/account-challenge-settings.interface.js +3 -0
- package/build/_modules/account-security/_models/account-challenge-settings.interface.js.map +1 -0
- package/build/_modules/account-security/_models/account-password-policy.interface.d.ts +12 -0
- package/build/_modules/account-security/_models/account-password-policy.interface.d.ts.map +1 -0
- package/build/_modules/account-security/_models/account-password-policy.interface.js +3 -0
- package/build/_modules/account-security/_models/account-password-policy.interface.js.map +1 -0
- package/build/_modules/account-security/_models/account-password-verification.interface.d.ts +6 -0
- package/build/_modules/account-security/_models/account-password-verification.interface.d.ts.map +1 -0
- package/build/_modules/account-security/_models/account-password-verification.interface.js +3 -0
- package/build/_modules/account-security/_models/account-password-verification.interface.js.map +1 -0
- package/build/_modules/account-security/_models/account-refresh-token-record.interface.d.ts +13 -0
- package/build/_modules/account-security/_models/account-refresh-token-record.interface.d.ts.map +1 -0
- package/build/_modules/account-security/_models/account-refresh-token-record.interface.js +3 -0
- package/build/_modules/account-security/_models/account-refresh-token-record.interface.js.map +1 -0
- package/build/_modules/account-security/_models/account-session-adapter.interface.d.ts +19 -0
- package/build/_modules/account-security/_models/account-session-adapter.interface.d.ts.map +1 -0
- package/build/_modules/account-security/_models/account-session-adapter.interface.js +3 -0
- package/build/_modules/account-security/_models/account-session-adapter.interface.js.map +1 -0
- package/build/_modules/account-security/_models/account-session-claims.interface.d.ts +8 -0
- package/build/_modules/account-security/_models/account-session-claims.interface.d.ts.map +1 -0
- package/build/_modules/account-security/_models/account-session-claims.interface.js +3 -0
- package/build/_modules/account-security/_models/account-session-claims.interface.js.map +1 -0
- package/build/_modules/account-security/_models/account-session-context.interface.d.ts +7 -0
- package/build/_modules/account-security/_models/account-session-context.interface.d.ts.map +1 -0
- package/build/_modules/account-security/_models/account-session-context.interface.js +3 -0
- package/build/_modules/account-security/_models/account-session-context.interface.js.map +1 -0
- package/build/_modules/account-security/_models/account-session-create.interface.d.ts +8 -0
- package/build/_modules/account-security/_models/account-session-create.interface.d.ts.map +1 -0
- package/build/_modules/account-security/_models/account-session-create.interface.js +3 -0
- package/build/_modules/account-security/_models/account-session-create.interface.js.map +1 -0
- package/build/_modules/account-security/_models/account-session-record.interface.d.ts +21 -0
- package/build/_modules/account-security/_models/account-session-record.interface.d.ts.map +1 -0
- package/build/_modules/account-security/_models/account-session-record.interface.js +3 -0
- package/build/_modules/account-security/_models/account-session-record.interface.js.map +1 -0
- package/build/_modules/account-security/_models/account-session-rotate.interface.d.ts +11 -0
- package/build/_modules/account-security/_models/account-session-rotate.interface.d.ts.map +1 -0
- package/build/_modules/account-security/_models/account-session-rotate.interface.js +3 -0
- package/build/_modules/account-security/_models/account-session-rotate.interface.js.map +1 -0
- package/build/_modules/account-security/_models/account-session-settings.interface.d.ts +11 -0
- package/build/_modules/account-security/_models/account-session-settings.interface.d.ts.map +1 -0
- package/build/_modules/account-security/_models/account-session-settings.interface.js +3 -0
- package/build/_modules/account-security/_models/account-session-settings.interface.js.map +1 -0
- package/build/_modules/account-security/_models/account-session-token-pair.interface.d.ts +9 -0
- package/build/_modules/account-security/_models/account-session-token-pair.interface.d.ts.map +1 -0
- package/build/_modules/account-security/_models/account-session-token-pair.interface.js +3 -0
- package/build/_modules/account-security/_models/account-session-token-pair.interface.js.map +1 -0
- package/build/_modules/account-security/_models/account-session-view.interface.d.ts +13 -0
- package/build/_modules/account-security/_models/account-session-view.interface.d.ts.map +1 -0
- package/build/_modules/account-security/_models/account-session-view.interface.js +3 -0
- package/build/_modules/account-security/_models/account-session-view.interface.js.map +1 -0
- package/build/_modules/account-security/account-challenge.control-service.d.ts +24 -0
- package/build/_modules/account-security/account-challenge.control-service.d.ts.map +1 -0
- package/build/_modules/account-security/account-challenge.control-service.js +117 -0
- package/build/_modules/account-security/account-challenge.control-service.js.map +1 -0
- package/build/_modules/account-security/account-password.control-service.d.ts +24 -0
- package/build/_modules/account-security/account-password.control-service.d.ts.map +1 -0
- package/build/_modules/account-security/account-password.control-service.js +214 -0
- package/build/_modules/account-security/account-password.control-service.js.map +1 -0
- package/build/_modules/account-security/account-session.control-service.d.ts +39 -0
- package/build/_modules/account-security/account-session.control-service.d.ts.map +1 -0
- package/build/_modules/account-security/account-session.control-service.js +277 -0
- package/build/_modules/account-security/account-session.control-service.js.map +1 -0
- package/build/_modules/account-security/index.d.ts +24 -0
- package/build/_modules/account-security/index.d.ts.map +1 -0
- package/build/_modules/account-security/index.js +16 -0
- package/build/_modules/account-security/index.js.map +1 -0
- package/build/_modules/privacy-lifecycle/_enums/privacy-consent-decision.type-enum.d.ts +6 -0
- package/build/_modules/privacy-lifecycle/_enums/privacy-consent-decision.type-enum.d.ts.map +1 -0
- package/build/_modules/privacy-lifecycle/_enums/privacy-consent-decision.type-enum.js +10 -0
- package/build/_modules/privacy-lifecycle/_enums/privacy-consent-decision.type-enum.js.map +1 -0
- package/build/_modules/privacy-lifecycle/_enums/privacy-contributor-action.type-enum.d.ts +11 -0
- package/build/_modules/privacy-lifecycle/_enums/privacy-contributor-action.type-enum.d.ts.map +1 -0
- package/build/_modules/privacy-lifecycle/_enums/privacy-contributor-action.type-enum.js +15 -0
- package/build/_modules/privacy-lifecycle/_enums/privacy-contributor-action.type-enum.js.map +1 -0
- package/build/_modules/privacy-lifecycle/_enums/privacy-contributor-outcome.type-enum.d.ts +8 -0
- package/build/_modules/privacy-lifecycle/_enums/privacy-contributor-outcome.type-enum.d.ts.map +1 -0
- package/build/_modules/privacy-lifecycle/_enums/privacy-contributor-outcome.type-enum.js +12 -0
- package/build/_modules/privacy-lifecycle/_enums/privacy-contributor-outcome.type-enum.js.map +1 -0
- package/build/_modules/privacy-lifecycle/_enums/privacy-request-state.type-enum.d.ts +16 -0
- package/build/_modules/privacy-lifecycle/_enums/privacy-request-state.type-enum.d.ts.map +1 -0
- package/build/_modules/privacy-lifecycle/_enums/privacy-request-state.type-enum.js +20 -0
- package/build/_modules/privacy-lifecycle/_enums/privacy-request-state.type-enum.js.map +1 -0
- package/build/_modules/privacy-lifecycle/_enums/privacy-request.type-enum.d.ts +10 -0
- package/build/_modules/privacy-lifecycle/_enums/privacy-request.type-enum.d.ts.map +1 -0
- package/build/_modules/privacy-lifecycle/_enums/privacy-request.type-enum.js +14 -0
- package/build/_modules/privacy-lifecycle/_enums/privacy-request.type-enum.js.map +1 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-consent-input.interface.d.ts +12 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-consent-input.interface.d.ts.map +1 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-consent-input.interface.js +3 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-consent-input.interface.js.map +1 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-consent-persistence-result.interface.d.ts +7 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-consent-persistence-result.interface.d.ts.map +1 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-consent-persistence-result.interface.js +3 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-consent-persistence-result.interface.js.map +1 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-consent-record.interface.d.ts +15 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-consent-record.interface.d.ts.map +1 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-consent-record.interface.js +3 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-consent-record.interface.js.map +1 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-consent-result.interface.d.ts +7 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-consent-result.interface.d.ts.map +1 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-consent-result.interface.js +3 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-consent-result.interface.js.map +1 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-consent-view.interface.d.ts +13 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-consent-view.interface.d.ts.map +1 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-consent-view.interface.js +3 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-consent-view.interface.js.map +1 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-contributor-context.interface.d.ts +9 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-contributor-context.interface.d.ts.map +1 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-contributor-context.interface.js +3 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-contributor-context.interface.js.map +1 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-contributor-outcome.interface.d.ts +14 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-contributor-outcome.interface.d.ts.map +1 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-contributor-outcome.interface.js +3 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-contributor-outcome.interface.js.map +1 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-contributor-plan.interface.d.ts +8 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-contributor-plan.interface.d.ts.map +1 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-contributor-plan.interface.js +3 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-contributor-plan.interface.js.map +1 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-contributor.interface.d.ts +11 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-contributor.interface.d.ts.map +1 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-contributor.interface.js +3 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-contributor.interface.js.map +1 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-ledger-adapter.interface.d.ts +13 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-ledger-adapter.interface.d.ts.map +1 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-ledger-adapter.interface.js +3 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-ledger-adapter.interface.js.map +1 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-ledger-result.interface.d.ts +9 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-ledger-result.interface.d.ts.map +1 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-ledger-result.interface.js +3 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-ledger-result.interface.js.map +1 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-ledger-settings.interface.d.ts +7 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-ledger-settings.interface.d.ts.map +1 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-ledger-settings.interface.js +3 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-ledger-settings.interface.js.map +1 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-legal-acceptance-input.interface.d.ts +11 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-legal-acceptance-input.interface.d.ts.map +1 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-legal-acceptance-input.interface.js +3 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-legal-acceptance-input.interface.js.map +1 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-legal-acceptance-persistence-result.interface.d.ts +7 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-legal-acceptance-persistence-result.interface.d.ts.map +1 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-legal-acceptance-persistence-result.interface.js +3 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-legal-acceptance-persistence-result.interface.js.map +1 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-legal-acceptance-result.interface.d.ts +7 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-legal-acceptance-result.interface.d.ts.map +1 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-legal-acceptance-result.interface.js +3 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-legal-acceptance-result.interface.js.map +1 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-legal-acceptance-view.interface.d.ts +12 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-legal-acceptance-view.interface.d.ts.map +1 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-legal-acceptance-view.interface.js +3 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-legal-acceptance-view.interface.js.map +1 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-legal-acceptance.interface.d.ts +14 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-legal-acceptance.interface.d.ts.map +1 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-legal-acceptance.interface.js +3 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-legal-acceptance.interface.js.map +1 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-lifecycle-adapter.interface.d.ts +15 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-lifecycle-adapter.interface.d.ts.map +1 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-lifecycle-adapter.interface.js +3 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-lifecycle-adapter.interface.js.map +1 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-lifecycle-settings.interface.d.ts +9 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-lifecycle-settings.interface.d.ts.map +1 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-lifecycle-settings.interface.js +3 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-lifecycle-settings.interface.js.map +1 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-request-create-result.interface.d.ts +7 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-request-create-result.interface.d.ts.map +1 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-request-create-result.interface.js +3 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-request-create-result.interface.js.map +1 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-request-open.interface.d.ts +10 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-request-open.interface.d.ts.map +1 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-request-open.interface.js +3 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-request-open.interface.js.map +1 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-request-persistence-create-result.interface.d.ts +7 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-request-persistence-create-result.interface.d.ts.map +1 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-request-persistence-create-result.interface.js +3 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-request-persistence-create-result.interface.js.map +1 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-request-record.interface.d.ts +21 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-request-record.interface.d.ts.map +1 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-request-record.interface.js +3 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-request-record.interface.js.map +1 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-request-result.interface.d.ts +8 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-request-result.interface.d.ts.map +1 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-request-result.interface.js +3 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-request-result.interface.js.map +1 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-request-view.interface.d.ts +20 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-request-view.interface.d.ts.map +1 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-request-view.interface.js +3 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-request-view.interface.js.map +1 -0
- package/build/_modules/privacy-lifecycle/index.d.ts +33 -0
- package/build/_modules/privacy-lifecycle/index.d.ts.map +1 -0
- package/build/_modules/privacy-lifecycle/index.js +18 -0
- package/build/_modules/privacy-lifecycle/index.js.map +1 -0
- package/build/_modules/privacy-lifecycle/privacy-ledger.control-service.d.ts +28 -0
- package/build/_modules/privacy-lifecycle/privacy-ledger.control-service.d.ts.map +1 -0
- package/build/_modules/privacy-lifecycle/privacy-ledger.control-service.js +168 -0
- package/build/_modules/privacy-lifecycle/privacy-ledger.control-service.js.map +1 -0
- package/build/_modules/privacy-lifecycle/privacy-lifecycle.control-service.d.ts +42 -0
- package/build/_modules/privacy-lifecycle/privacy-lifecycle.control-service.d.ts.map +1 -0
- package/build/_modules/privacy-lifecycle/privacy-lifecycle.control-service.js +364 -0
- package/build/_modules/privacy-lifecycle/privacy-lifecycle.control-service.js.map +1 -0
- package/package.json +19 -1
- package/src/_modules/account-security/_enums/account-challenge-purpose.type-enum.ts +5 -0
- package/src/_modules/account-security/_enums/account-refresh-token-state.type-enum.ts +6 -0
- package/src/_modules/account-security/_enums/account-session-state.type-enum.ts +6 -0
- package/src/_modules/account-security/_models/account-challenge-adapter.interface.ts +17 -0
- package/src/_modules/account-security/_models/account-challenge-issued.interface.ts +6 -0
- package/src/_modules/account-security/_models/account-challenge-record.interface.ts +13 -0
- package/src/_modules/account-security/_models/account-challenge-result.interface.ts +8 -0
- package/src/_modules/account-security/_models/account-challenge-settings.interface.ts +9 -0
- package/src/_modules/account-security/_models/account-password-policy.interface.ts +11 -0
- package/src/_modules/account-security/_models/account-password-verification.interface.ts +5 -0
- package/src/_modules/account-security/_models/account-refresh-token-record.interface.ts +13 -0
- package/src/_modules/account-security/_models/account-session-adapter.interface.ts +19 -0
- package/src/_modules/account-security/_models/account-session-claims.interface.ts +7 -0
- package/src/_modules/account-security/_models/account-session-context.interface.ts +6 -0
- package/src/_modules/account-security/_models/account-session-create.interface.ts +8 -0
- package/src/_modules/account-security/_models/account-session-record.interface.ts +21 -0
- package/src/_modules/account-security/_models/account-session-rotate.interface.ts +11 -0
- package/src/_modules/account-security/_models/account-session-settings.interface.ts +11 -0
- package/src/_modules/account-security/_models/account-session-token-pair.interface.ts +8 -0
- package/src/_modules/account-security/_models/account-session-view.interface.ts +13 -0
- package/src/_modules/account-security/account-challenge.control-service.spec.ts +195 -0
- package/src/_modules/account-security/account-challenge.control-service.ts +164 -0
- package/src/_modules/account-security/account-password.control-service.spec.ts +96 -0
- package/src/_modules/account-security/account-password.control-service.ts +288 -0
- package/src/_modules/account-security/account-session.control-service.spec.ts +294 -0
- package/src/_modules/account-security/account-session.control-service.ts +376 -0
- package/src/_modules/account-security/index.ts +31 -0
- package/src/_modules/privacy-lifecycle/_enums/privacy-consent-decision.type-enum.ts +5 -0
- package/src/_modules/privacy-lifecycle/_enums/privacy-contributor-action.type-enum.ts +10 -0
- package/src/_modules/privacy-lifecycle/_enums/privacy-contributor-outcome.type-enum.ts +7 -0
- package/src/_modules/privacy-lifecycle/_enums/privacy-request-state.type-enum.ts +15 -0
- package/src/_modules/privacy-lifecycle/_enums/privacy-request.type-enum.ts +9 -0
- package/src/_modules/privacy-lifecycle/_models/privacy-consent-input.interface.ts +12 -0
- package/src/_modules/privacy-lifecycle/_models/privacy-consent-persistence-result.interface.ts +7 -0
- package/src/_modules/privacy-lifecycle/_models/privacy-consent-record.interface.ts +15 -0
- package/src/_modules/privacy-lifecycle/_models/privacy-consent-result.interface.ts +7 -0
- package/src/_modules/privacy-lifecycle/_models/privacy-consent-view.interface.ts +13 -0
- package/src/_modules/privacy-lifecycle/_models/privacy-contributor-context.interface.ts +9 -0
- package/src/_modules/privacy-lifecycle/_models/privacy-contributor-outcome.interface.ts +14 -0
- package/src/_modules/privacy-lifecycle/_models/privacy-contributor-plan.interface.ts +8 -0
- package/src/_modules/privacy-lifecycle/_models/privacy-contributor.interface.ts +17 -0
- package/src/_modules/privacy-lifecycle/_models/privacy-ledger-adapter.interface.ts +21 -0
- package/src/_modules/privacy-lifecycle/_models/privacy-ledger-result.interface.ts +9 -0
- package/src/_modules/privacy-lifecycle/_models/privacy-ledger-settings.interface.ts +7 -0
- package/src/_modules/privacy-lifecycle/_models/privacy-legal-acceptance-input.interface.ts +10 -0
- package/src/_modules/privacy-lifecycle/_models/privacy-legal-acceptance-persistence-result.interface.ts +7 -0
- package/src/_modules/privacy-lifecycle/_models/privacy-legal-acceptance-result.interface.ts +7 -0
- package/src/_modules/privacy-lifecycle/_models/privacy-legal-acceptance-view.interface.ts +11 -0
- package/src/_modules/privacy-lifecycle/_models/privacy-legal-acceptance.interface.ts +13 -0
- package/src/_modules/privacy-lifecycle/_models/privacy-lifecycle-adapter.interface.ts +19 -0
- package/src/_modules/privacy-lifecycle/_models/privacy-lifecycle-settings.interface.ts +9 -0
- package/src/_modules/privacy-lifecycle/_models/privacy-request-create-result.interface.ts +7 -0
- package/src/_modules/privacy-lifecycle/_models/privacy-request-open.interface.ts +10 -0
- package/src/_modules/privacy-lifecycle/_models/privacy-request-persistence-create-result.interface.ts +7 -0
- package/src/_modules/privacy-lifecycle/_models/privacy-request-record.interface.ts +21 -0
- package/src/_modules/privacy-lifecycle/_models/privacy-request-result.interface.ts +8 -0
- package/src/_modules/privacy-lifecycle/_models/privacy-request-view.interface.ts +20 -0
- package/src/_modules/privacy-lifecycle/index.ts +40 -0
- package/src/_modules/privacy-lifecycle/privacy-ledger.control-service.spec.ts +206 -0
- package/src/_modules/privacy-lifecycle/privacy-ledger.control-service.ts +253 -0
- package/src/_modules/privacy-lifecycle/privacy-lifecycle.control-service.spec.ts +353 -0
- package/src/_modules/privacy-lifecycle/privacy-lifecycle.control-service.ts +586 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { DyNTS_AccountRefreshTokenRecord_Interface } from './account-refresh-token-record.interface';
|
|
2
|
+
import { DyNTS_AccountSessionRecord_Interface } from './account-session-record.interface';
|
|
3
|
+
/** Atomic one-time refresh rotation payload for a concrete Dynamo DataService adapter. */
|
|
4
|
+
export interface DyNTS_AccountSessionRotate_Interface {
|
|
5
|
+
expectedSessionRevision: number;
|
|
6
|
+
currentRefreshTokenHash: string;
|
|
7
|
+
usedAt: string;
|
|
8
|
+
replacementSession: DyNTS_AccountSessionRecord_Interface;
|
|
9
|
+
replacementRefreshToken: DyNTS_AccountRefreshTokenRecord_Interface;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=account-session-rotate.interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"account-session-rotate.interface.d.ts","sourceRoot":"","sources":["../../../../src/_modules/account-security/_models/account-session-rotate.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yCAAyC,EAAE,MAAM,0CAA0C,CAAC;AACrG,OAAO,EAAE,oCAAoC,EAAE,MAAM,oCAAoC,CAAC;AAE1F,0FAA0F;AAC1F,MAAM,WAAW,oCAAoC;IACnD,uBAAuB,EAAE,MAAM,CAAC;IAChC,uBAAuB,EAAE,MAAM,CAAC;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,kBAAkB,EAAE,oCAAoC,CAAC;IACzD,uBAAuB,EAAE,yCAAyC,CAAC;CACpE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"account-session-rotate.interface.js","sourceRoot":"","sources":["../../../../src/_modules/account-security/_models/account-session-rotate.interface.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { DyNTS_AccountSessionAdapter_Interface } from './account-session-adapter.interface';
|
|
2
|
+
/** Runtime settings for opaque access credentials and rotating one-time refresh families. */
|
|
3
|
+
export interface DyNTS_AccountSessionSettings_Interface {
|
|
4
|
+
adapter: DyNTS_AccountSessionAdapter_Interface;
|
|
5
|
+
accessTtlMs?: number;
|
|
6
|
+
refreshTtlMs?: number;
|
|
7
|
+
tokenBytes?: number;
|
|
8
|
+
maxRefreshRotations?: number;
|
|
9
|
+
clock?: () => Date;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=account-session-settings.interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"account-session-settings.interface.d.ts","sourceRoot":"","sources":["../../../../src/_modules/account-security/_models/account-session-settings.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qCAAqC,EAAE,MAAM,qCAAqC,CAAC;AAE5F,6FAA6F;AAC7F,MAAM,WAAW,sCAAsC;IACrD,OAAO,EAAE,qCAAqC,CAAC;IAC/C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,KAAK,CAAC,EAAE,MAAM,IAAI,CAAC;CACpB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"account-session-settings.interface.js","sourceRoot":"","sources":["../../../../src/_modules/account-security/_models/account-session-settings.interface.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Raw credentials returned exactly once to the transport layer after an atomic persistence commit. */
|
|
2
|
+
export interface DyNTS_AccountSessionTokenPair_Interface {
|
|
3
|
+
sessionId: string;
|
|
4
|
+
accessToken: string;
|
|
5
|
+
refreshToken: string;
|
|
6
|
+
accessExpiresAt: string;
|
|
7
|
+
refreshExpiresAt: string;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=account-session-token-pair.interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"account-session-token-pair.interface.d.ts","sourceRoot":"","sources":["../../../../src/_modules/account-security/_models/account-session-token-pair.interface.ts"],"names":[],"mappings":"AAAA,uGAAuG;AACvG,MAAM,WAAW,uCAAuC;IACtD,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,gBAAgB,EAAE,MAAM,CAAC;CAC1B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"account-session-token-pair.interface.js","sourceRoot":"","sources":["../../../../src/_modules/account-security/_models/account-session-token-pair.interface.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { DyNTS_AccountSessionState_Type } from '../_enums/account-session-state.type-enum';
|
|
2
|
+
import { DyNTS_AccountSessionContext_Interface } from './account-session-context.interface';
|
|
3
|
+
/** User-safe session list item without access or refresh token hashes. */
|
|
4
|
+
export interface DyNTS_AccountSessionView_Interface {
|
|
5
|
+
sessionId: string;
|
|
6
|
+
state: DyNTS_AccountSessionState_Type;
|
|
7
|
+
createdAt: string;
|
|
8
|
+
lastRotatedAt: string;
|
|
9
|
+
accessExpiresAt: string;
|
|
10
|
+
refreshExpiresAt: string;
|
|
11
|
+
context: DyNTS_AccountSessionContext_Interface;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=account-session-view.interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"account-session-view.interface.d.ts","sourceRoot":"","sources":["../../../../src/_modules/account-security/_models/account-session-view.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,8BAA8B,EAAE,MAAM,2CAA2C,CAAC;AAC3F,OAAO,EAAE,qCAAqC,EAAE,MAAM,qCAAqC,CAAC;AAE5F,0EAA0E;AAC1E,MAAM,WAAW,kCAAkC;IACjD,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,8BAA8B,CAAC;IACtC,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;IACxB,gBAAgB,EAAE,MAAM,CAAC;IACzB,OAAO,EAAE,qCAAqC,CAAC;CAChD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"account-session-view.interface.js","sourceRoot":"","sources":["../../../../src/_modules/account-security/_models/account-session-view.interface.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { DyNTS_AccountChallengePurpose_Type } from './_enums/account-challenge-purpose.type-enum';
|
|
2
|
+
import { DyNTS_AccountChallengeIssued_Interface } from './_models/account-challenge-issued.interface';
|
|
3
|
+
import { DyNTS_AccountChallengeResult_Interface } from './_models/account-challenge-result.interface';
|
|
4
|
+
import { DyNTS_AccountChallengeSettings_Interface } from './_models/account-challenge-settings.interface';
|
|
5
|
+
/** Issues and atomically consumes opaque email-verification and password-reset credentials. */
|
|
6
|
+
export declare class DyNTS_AccountChallenge_ControlService {
|
|
7
|
+
private readonly adapter;
|
|
8
|
+
private readonly ttlMs;
|
|
9
|
+
private readonly tokenBytes;
|
|
10
|
+
private readonly clock;
|
|
11
|
+
/** Creates a challenge service over an atomic persistence adapter. */
|
|
12
|
+
constructor(set: DyNTS_AccountChallengeSettings_Interface);
|
|
13
|
+
/** Replaces any active subject-purpose challenge before returning the new raw credential once. */
|
|
14
|
+
issueChallenge(subjectId: string, purpose: DyNTS_AccountChallengePurpose_Type): Promise<DyNTS_AccountChallengeIssued_Interface>;
|
|
15
|
+
/** Atomically consumes one unexpired challenge and returns its trusted subject binding. */
|
|
16
|
+
consumeChallenge(token: string, purpose: DyNTS_AccountChallengePurpose_Type): Promise<DyNTS_AccountChallengeResult_Interface>;
|
|
17
|
+
/** Revokes every active challenge for a subject-purpose pair. */
|
|
18
|
+
revokeSubjectChallenges(subjectId: string, purpose: DyNTS_AccountChallengePurpose_Type): Promise<void>;
|
|
19
|
+
private hashToken;
|
|
20
|
+
private validateSettings;
|
|
21
|
+
private isFutureDate;
|
|
22
|
+
private buildInvalid;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=account-challenge.control-service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"account-challenge.control-service.d.ts","sourceRoot":"","sources":["../../../src/_modules/account-security/account-challenge.control-service.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,kCAAkC,EAAE,MAAM,8CAA8C,CAAC;AAElG,OAAO,EAAE,sCAAsC,EAAE,MAAM,8CAA8C,CAAC;AAEtG,OAAO,EAAE,sCAAsC,EAAE,MAAM,8CAA8C,CAAC;AACtG,OAAO,EAAE,wCAAwC,EAAE,MAAM,gDAAgD,CAAC;AAK1G,+FAA+F;AAC/F,qBAAa,qCAAqC;IAChD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA0C;IAClE,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAS;IAC/B,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAS;IACpC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAa;IAEnC,sEAAsE;gBAC1D,GAAG,EAAE,wCAAwC;IAQzD,kGAAkG;IACrF,cAAc,CACzB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,kCAAkC,GAC1C,OAAO,CAAC,sCAAsC,CAAC;IA+BlD,2FAA2F;IAC9E,gBAAgB,CAC3B,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,kCAAkC,GAC1C,OAAO,CAAC,sCAAsC,CAAC;IAkClD,iEAAiE;IACpD,uBAAuB,CAClC,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,kCAAkC,GAC1C,OAAO,CAAC,IAAI,CAAC;IAYhB,OAAO,CAAC,SAAS;IAIjB,OAAO,CAAC,gBAAgB;IAoBxB,OAAO,CAAC,YAAY;IAMpB,OAAO,CAAC,YAAY;CASrB"}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DyNTS_AccountChallenge_ControlService = void 0;
|
|
4
|
+
const crypto_1 = require("crypto");
|
|
5
|
+
const fsm_dynamo_1 = require("@futdevpro/fsm-dynamo");
|
|
6
|
+
const global_settings_const_1 = require("../../_collections/global-settings.const");
|
|
7
|
+
const account_challenge_purpose_type_enum_1 = require("./_enums/account-challenge-purpose.type-enum");
|
|
8
|
+
const DEFAULT_CHALLENGE_TTL_MS = 15 * 60 * 1000;
|
|
9
|
+
const DEFAULT_TOKEN_BYTES = 32;
|
|
10
|
+
/** Issues and atomically consumes opaque email-verification and password-reset credentials. */
|
|
11
|
+
class DyNTS_AccountChallenge_ControlService {
|
|
12
|
+
adapter;
|
|
13
|
+
ttlMs;
|
|
14
|
+
tokenBytes;
|
|
15
|
+
clock;
|
|
16
|
+
/** Creates a challenge service over an atomic persistence adapter. */
|
|
17
|
+
constructor(set) {
|
|
18
|
+
this.adapter = set.adapter;
|
|
19
|
+
this.ttlMs = set.ttlMs ?? DEFAULT_CHALLENGE_TTL_MS;
|
|
20
|
+
this.tokenBytes = set.tokenBytes ?? DEFAULT_TOKEN_BYTES;
|
|
21
|
+
this.clock = set.clock ?? (() => new Date());
|
|
22
|
+
this.validateSettings();
|
|
23
|
+
}
|
|
24
|
+
/** Replaces any active subject-purpose challenge before returning the new raw credential once. */
|
|
25
|
+
async issueChallenge(subjectId, purpose) {
|
|
26
|
+
if (!subjectId
|
|
27
|
+
|| subjectId.length > 256
|
|
28
|
+
|| !Object.values(account_challenge_purpose_type_enum_1.DyNTS_AccountChallengePurpose_Type).includes(purpose)) {
|
|
29
|
+
throw this.buildInvalid('CHALLENGE_REQUEST_INVALID');
|
|
30
|
+
}
|
|
31
|
+
const now = this.clock();
|
|
32
|
+
const token = (0, crypto_1.randomBytes)(this.tokenBytes).toString('base64url');
|
|
33
|
+
const record = {
|
|
34
|
+
challengeId: (0, crypto_1.randomUUID)(),
|
|
35
|
+
subjectId: subjectId,
|
|
36
|
+
purpose: purpose,
|
|
37
|
+
tokenHash: this.hashToken(token),
|
|
38
|
+
createdAt: now.toISOString(),
|
|
39
|
+
expiresAt: new Date(now.getTime() + this.ttlMs).toISOString(),
|
|
40
|
+
consumedAt: '',
|
|
41
|
+
revokedAt: '',
|
|
42
|
+
};
|
|
43
|
+
await this.adapter.replaceActiveChallenge(record);
|
|
44
|
+
return {
|
|
45
|
+
challengeId: record.challengeId,
|
|
46
|
+
token: token,
|
|
47
|
+
expiresAt: record.expiresAt,
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
/** Atomically consumes one unexpired challenge and returns its trusted subject binding. */
|
|
51
|
+
async consumeChallenge(token, purpose) {
|
|
52
|
+
if (!token
|
|
53
|
+
|| token.length > 512
|
|
54
|
+
|| !Object.values(account_challenge_purpose_type_enum_1.DyNTS_AccountChallengePurpose_Type).includes(purpose)) {
|
|
55
|
+
throw this.buildInvalid('CHALLENGE_INVALID');
|
|
56
|
+
}
|
|
57
|
+
const now = this.clock();
|
|
58
|
+
const tokenHash = this.hashToken(token);
|
|
59
|
+
const record = await this.adapter.consumeActiveChallenge(tokenHash, purpose, now.toISOString());
|
|
60
|
+
if (record?.purpose !== purpose
|
|
61
|
+
|| record.tokenHash !== tokenHash
|
|
62
|
+
|| !record.consumedAt
|
|
63
|
+
|| !!record.revokedAt
|
|
64
|
+
|| !this.isFutureDate(record.expiresAt, now)) {
|
|
65
|
+
throw this.buildInvalid('CHALLENGE_INVALID');
|
|
66
|
+
}
|
|
67
|
+
return {
|
|
68
|
+
challengeId: record.challengeId,
|
|
69
|
+
subjectId: record.subjectId,
|
|
70
|
+
purpose: record.purpose,
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
/** Revokes every active challenge for a subject-purpose pair. */
|
|
74
|
+
async revokeSubjectChallenges(subjectId, purpose) {
|
|
75
|
+
if (!subjectId
|
|
76
|
+
|| subjectId.length > 256
|
|
77
|
+
|| !Object.values(account_challenge_purpose_type_enum_1.DyNTS_AccountChallengePurpose_Type).includes(purpose)) {
|
|
78
|
+
throw this.buildInvalid('CHALLENGE_REQUEST_INVALID');
|
|
79
|
+
}
|
|
80
|
+
await this.adapter.revokeSubjectChallenges(subjectId, purpose, this.clock().toISOString());
|
|
81
|
+
}
|
|
82
|
+
hashToken(token) {
|
|
83
|
+
return (0, crypto_1.createHash)('sha256').update(token).digest('hex');
|
|
84
|
+
}
|
|
85
|
+
validateSettings() {
|
|
86
|
+
if (!this.adapter
|
|
87
|
+
|| !Number.isSafeInteger(this.ttlMs)
|
|
88
|
+
|| this.ttlMs < 60_000
|
|
89
|
+
|| this.ttlMs > 24 * 60 * 60 * 1000
|
|
90
|
+
|| !Number.isSafeInteger(this.tokenBytes)
|
|
91
|
+
|| this.tokenBytes < 32
|
|
92
|
+
|| this.tokenBytes > 128) {
|
|
93
|
+
throw new fsm_dynamo_1.DyFM_Error({
|
|
94
|
+
status: 500,
|
|
95
|
+
errorCode: `${global_settings_const_1.DyNTS_global_settings.systemShortCodeName}|ACCOUNT_SECURITY|CHALLENGE_SETTINGS_INVALID`,
|
|
96
|
+
message: 'The account challenge settings are outside supported safe bounds.',
|
|
97
|
+
userMessage: 'The account security service is unavailable.',
|
|
98
|
+
issuerService: this.constructor.name,
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
isFutureDate(value, now) {
|
|
103
|
+
const timestamp = new Date(value).getTime();
|
|
104
|
+
return Number.isFinite(timestamp) && timestamp > now.getTime();
|
|
105
|
+
}
|
|
106
|
+
buildInvalid(errorCode) {
|
|
107
|
+
return new fsm_dynamo_1.DyFM_Error({
|
|
108
|
+
status: 401,
|
|
109
|
+
errorCode: `${global_settings_const_1.DyNTS_global_settings.systemShortCodeName}|ACCOUNT_SECURITY|${errorCode}`,
|
|
110
|
+
message: 'Opaque one-time account challenge validation failed.',
|
|
111
|
+
userMessage: 'The verification request is invalid or has expired. Please request a new one.',
|
|
112
|
+
issuerService: this.constructor.name,
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
exports.DyNTS_AccountChallenge_ControlService = DyNTS_AccountChallenge_ControlService;
|
|
117
|
+
//# sourceMappingURL=account-challenge.control-service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"account-challenge.control-service.js","sourceRoot":"","sources":["../../../src/_modules/account-security/account-challenge.control-service.ts"],"names":[],"mappings":";;;AAAA,mCAIgB;AAEhB,sDAAmD;AAEnD,oFAAiF;AACjF,sGAAkG;AAOlG,MAAM,wBAAwB,GAAW,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAC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AAC,CAAC;QACL,CAAC;IACH,CAAC;IAEO,YAAY,CAAC,KAAa,EAAE,GAAS;QAC3C,MAAM,SAAS,GAAW,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC;QAEpD,OAAO,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,SAAS,GAAG,GAAG,CAAC,OAAO,EAAE,CAAC;IACjE,CAAC;IAEO,YAAY,CAAC,SAAiB;QACpC,OAAO,IAAI,uBAAU,CAAC;YACpB,MAAM,EAAE,GAAG;YACX,SAAS,EAAE,GAAG,6CAAqB,CAAC,mBAAmB,qBAAqB,SAAS,EAAE;YACvF,OAAO,EAAE,sDAAsD;YAC/D,WAAW,EAAE,+EAA+E;YAC5F,aAAa,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI;SACrC,CAAC,CAAC;IACL,CAAC;CACF;AA/ID,sFA+IC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { DyNTS_AccountPasswordPolicy_Interface } from './_models/account-password-policy.interface';
|
|
2
|
+
import { DyNTS_AccountPasswordVerification_Interface } from './_models/account-password-verification.interface';
|
|
3
|
+
/**
|
|
4
|
+
* Standalone password capability using versioned Node scrypt hashes.
|
|
5
|
+
* Passwords and derived bytes never enter errors, logs or result objects.
|
|
6
|
+
*/
|
|
7
|
+
export declare class DyNTS_AccountPassword_ControlService {
|
|
8
|
+
private readonly policy;
|
|
9
|
+
/** Creates a validated immutable policy snapshot. */
|
|
10
|
+
constructor(policy?: Partial<DyNTS_AccountPasswordPolicy_Interface>);
|
|
11
|
+
/** Validates and hashes one password to a self-describing scrypt record. */
|
|
12
|
+
hashPassword(password: string): Promise<string>;
|
|
13
|
+
/** Performs constant-time verification and reports whether the stored cost should be upgraded. */
|
|
14
|
+
verifyPassword(password: string, storedHash: string): Promise<DyNTS_AccountPasswordVerification_Interface>;
|
|
15
|
+
/** Rejects weak, oversized and configured common passwords without exposing their content. */
|
|
16
|
+
validatePassword(password: string): void;
|
|
17
|
+
private parseHash;
|
|
18
|
+
private runDummyDerivation;
|
|
19
|
+
private deriveKey;
|
|
20
|
+
private validatePolicy;
|
|
21
|
+
private isPowerOfTwo;
|
|
22
|
+
private buildError;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=account-password.control-service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"account-password.control-service.d.ts","sourceRoot":"","sources":["../../../src/_modules/account-security/account-password.control-service.ts"],"names":[],"mappings":"AAUA,OAAO,EACL,qCAAqC,EACtC,MAAM,6CAA6C,CAAC;AACrD,OAAO,EACL,2CAA2C,EAC5C,MAAM,mDAAmD,CAAC;AAqC3D;;;GAGG;AACH,qBAAa,oCAAoC;IAC/C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAwC;IAE/D,qDAAqD;gBACzC,MAAM,CAAC,EAAE,OAAO,CAAC,qCAAqC,CAAC;IAWnE,4EAA4E;IAC/D,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAuB5D,kGAAkG;IACrF,cAAc,CACzB,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,2CAA2C,CAAC;IA+CvD,8FAA8F;IACvF,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IA0B/C,OAAO,CAAC,SAAS;YA2CH,kBAAkB;IAWhC,OAAO,CAAC,SAAS;IAqBjB,OAAO,CAAC,cAAc;IA0BtB,OAAO,CAAC,YAAY;IAIpB,OAAO,CAAC,UAAU;CASnB"}
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DyNTS_AccountPassword_ControlService = void 0;
|
|
4
|
+
const crypto_1 = require("crypto");
|
|
5
|
+
const fsm_dynamo_1 = require("@futdevpro/fsm-dynamo");
|
|
6
|
+
const global_settings_const_1 = require("../../_collections/global-settings.const");
|
|
7
|
+
const PASSWORD_HASH_VERSION = 'dyn-scrypt-v1';
|
|
8
|
+
const DEFAULT_POLICY = {
|
|
9
|
+
minLength: 12,
|
|
10
|
+
maxLength: 128,
|
|
11
|
+
scryptCost: 16_384,
|
|
12
|
+
scryptBlockSize: 8,
|
|
13
|
+
scryptParallelization: 1,
|
|
14
|
+
derivedKeyLength: 32,
|
|
15
|
+
saltLength: 16,
|
|
16
|
+
commonPasswordSha256: [],
|
|
17
|
+
};
|
|
18
|
+
const MAX_VERIFY_COST = 131_072;
|
|
19
|
+
const MAX_VERIFY_BLOCK_SIZE = 8;
|
|
20
|
+
const MAX_VERIFY_PARALLELIZATION = 2;
|
|
21
|
+
const MAX_VERIFY_KEY_LENGTH = 64;
|
|
22
|
+
const MAX_PASSWORD_LENGTH = 1_024;
|
|
23
|
+
const MAX_STORED_HASH_LENGTH = 1_024;
|
|
24
|
+
/**
|
|
25
|
+
* Standalone password capability using versioned Node scrypt hashes.
|
|
26
|
+
* Passwords and derived bytes never enter errors, logs or result objects.
|
|
27
|
+
*/
|
|
28
|
+
class DyNTS_AccountPassword_ControlService {
|
|
29
|
+
policy;
|
|
30
|
+
/** Creates a validated immutable policy snapshot. */
|
|
31
|
+
constructor(policy) {
|
|
32
|
+
this.policy = {
|
|
33
|
+
...DEFAULT_POLICY,
|
|
34
|
+
...policy,
|
|
35
|
+
commonPasswordSha256: [
|
|
36
|
+
...(policy?.commonPasswordSha256 ?? DEFAULT_POLICY.commonPasswordSha256),
|
|
37
|
+
],
|
|
38
|
+
};
|
|
39
|
+
this.validatePolicy();
|
|
40
|
+
}
|
|
41
|
+
/** Validates and hashes one password to a self-describing scrypt record. */
|
|
42
|
+
async hashPassword(password) {
|
|
43
|
+
this.validatePassword(password);
|
|
44
|
+
const salt = (0, crypto_1.randomBytes)(this.policy.saltLength);
|
|
45
|
+
const derivedKey = await this.deriveKey({
|
|
46
|
+
password: password,
|
|
47
|
+
salt: salt,
|
|
48
|
+
cost: this.policy.scryptCost,
|
|
49
|
+
blockSize: this.policy.scryptBlockSize,
|
|
50
|
+
parallelization: this.policy.scryptParallelization,
|
|
51
|
+
keyLength: this.policy.derivedKeyLength,
|
|
52
|
+
});
|
|
53
|
+
return [
|
|
54
|
+
PASSWORD_HASH_VERSION,
|
|
55
|
+
this.policy.scryptCost,
|
|
56
|
+
this.policy.scryptBlockSize,
|
|
57
|
+
this.policy.scryptParallelization,
|
|
58
|
+
salt.toString('base64url'),
|
|
59
|
+
derivedKey.toString('base64url'),
|
|
60
|
+
].join('$');
|
|
61
|
+
}
|
|
62
|
+
/** Performs constant-time verification and reports whether the stored cost should be upgraded. */
|
|
63
|
+
async verifyPassword(password, storedHash) {
|
|
64
|
+
if (typeof password !== 'string' || Array.from(password).length > this.policy.maxLength) {
|
|
65
|
+
await this.runDummyDerivation('invalid-password-candidate');
|
|
66
|
+
return { isValid: false, needsRehash: false };
|
|
67
|
+
}
|
|
68
|
+
const parsed = this.parseHash(storedHash);
|
|
69
|
+
if (!parsed) {
|
|
70
|
+
await this.runDummyDerivation(password);
|
|
71
|
+
return { isValid: false, needsRehash: false };
|
|
72
|
+
}
|
|
73
|
+
let candidate;
|
|
74
|
+
try {
|
|
75
|
+
candidate = await this.deriveKey({
|
|
76
|
+
password: password,
|
|
77
|
+
salt: parsed.salt,
|
|
78
|
+
cost: parsed.cost,
|
|
79
|
+
blockSize: parsed.blockSize,
|
|
80
|
+
parallelization: parsed.parallelization,
|
|
81
|
+
keyLength: parsed.derivedKey.length,
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
catch {
|
|
85
|
+
await this.runDummyDerivation(password);
|
|
86
|
+
return { isValid: false, needsRehash: false };
|
|
87
|
+
}
|
|
88
|
+
const isValid = candidate.length === parsed.derivedKey.length
|
|
89
|
+
&& (0, crypto_1.timingSafeEqual)(candidate, parsed.derivedKey);
|
|
90
|
+
return {
|
|
91
|
+
isValid: isValid,
|
|
92
|
+
needsRehash: isValid && (parsed.cost !== this.policy.scryptCost
|
|
93
|
+
|| parsed.blockSize !== this.policy.scryptBlockSize
|
|
94
|
+
|| parsed.parallelization !== this.policy.scryptParallelization
|
|
95
|
+
|| parsed.derivedKey.length !== this.policy.derivedKeyLength
|
|
96
|
+
|| parsed.salt.length !== this.policy.saltLength),
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
/** Rejects weak, oversized and configured common passwords without exposing their content. */
|
|
100
|
+
validatePassword(password) {
|
|
101
|
+
if (typeof password !== 'string') {
|
|
102
|
+
throw this.buildError('PASSWORD_POLICY_LENGTH', 'Password input must be a string.');
|
|
103
|
+
}
|
|
104
|
+
const passwordLength = Array.from(password).length;
|
|
105
|
+
if (passwordLength < this.policy.minLength || passwordLength > this.policy.maxLength) {
|
|
106
|
+
throw this.buildError('PASSWORD_POLICY_LENGTH', `Password length must be between ${this.policy.minLength} and ${this.policy.maxLength} characters.`);
|
|
107
|
+
}
|
|
108
|
+
const commonDigest = (0, crypto_1.createHash)('sha256')
|
|
109
|
+
.update(password.normalize('NFKC').toLocaleLowerCase('en-US'))
|
|
110
|
+
.digest('hex');
|
|
111
|
+
if (this.policy.commonPasswordSha256.includes(commonDigest)) {
|
|
112
|
+
throw this.buildError('PASSWORD_POLICY_COMMON', 'The password matches a configured common-password denylist entry.');
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
parseHash(storedHash) {
|
|
116
|
+
if (typeof storedHash !== 'string' || storedHash.length > MAX_STORED_HASH_LENGTH) {
|
|
117
|
+
return null;
|
|
118
|
+
}
|
|
119
|
+
const parts = storedHash.split('$');
|
|
120
|
+
if (parts.length !== 6 || parts[0] !== PASSWORD_HASH_VERSION) {
|
|
121
|
+
return null;
|
|
122
|
+
}
|
|
123
|
+
const cost = Number(parts[1]);
|
|
124
|
+
const blockSize = Number(parts[2]);
|
|
125
|
+
const parallelization = Number(parts[3]);
|
|
126
|
+
const salt = Buffer.from(parts[4], 'base64url');
|
|
127
|
+
const derivedKey = Buffer.from(parts[5], 'base64url');
|
|
128
|
+
if (!this.isPowerOfTwo(cost)
|
|
129
|
+
|| cost < 2
|
|
130
|
+
|| cost > MAX_VERIFY_COST
|
|
131
|
+
|| !Number.isInteger(blockSize)
|
|
132
|
+
|| blockSize < 1
|
|
133
|
+
|| blockSize > MAX_VERIFY_BLOCK_SIZE
|
|
134
|
+
|| !Number.isInteger(parallelization)
|
|
135
|
+
|| parallelization < 1
|
|
136
|
+
|| parallelization > MAX_VERIFY_PARALLELIZATION
|
|
137
|
+
|| !salt.length
|
|
138
|
+
|| !derivedKey.length
|
|
139
|
+
|| derivedKey.length > MAX_VERIFY_KEY_LENGTH) {
|
|
140
|
+
return null;
|
|
141
|
+
}
|
|
142
|
+
return {
|
|
143
|
+
cost: cost,
|
|
144
|
+
blockSize: blockSize,
|
|
145
|
+
parallelization: parallelization,
|
|
146
|
+
salt: salt,
|
|
147
|
+
derivedKey: derivedKey,
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
async runDummyDerivation(password) {
|
|
151
|
+
await this.deriveKey({
|
|
152
|
+
password: password,
|
|
153
|
+
salt: Buffer.alloc(this.policy.saltLength),
|
|
154
|
+
cost: this.policy.scryptCost,
|
|
155
|
+
blockSize: this.policy.scryptBlockSize,
|
|
156
|
+
parallelization: this.policy.scryptParallelization,
|
|
157
|
+
keyLength: this.policy.derivedKeyLength,
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
deriveKey(set) {
|
|
161
|
+
return new Promise((resolve, reject) => {
|
|
162
|
+
const maxmem = Math.max(32 * 1024 * 1024, 256 * set.cost * set.blockSize);
|
|
163
|
+
(0, crypto_1.scrypt)(set.password, set.salt, set.keyLength, {
|
|
164
|
+
N: set.cost,
|
|
165
|
+
r: set.blockSize,
|
|
166
|
+
p: set.parallelization,
|
|
167
|
+
maxmem: maxmem,
|
|
168
|
+
}, (error, derivedKey) => {
|
|
169
|
+
if (error) {
|
|
170
|
+
reject(error);
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
resolve(derivedKey);
|
|
174
|
+
});
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
validatePolicy() {
|
|
178
|
+
if (!Number.isInteger(this.policy.minLength)
|
|
179
|
+
|| !Number.isInteger(this.policy.maxLength)
|
|
180
|
+
|| this.policy.minLength < 8
|
|
181
|
+
|| this.policy.maxLength < this.policy.minLength
|
|
182
|
+
|| this.policy.maxLength > MAX_PASSWORD_LENGTH
|
|
183
|
+
|| !this.isPowerOfTwo(this.policy.scryptCost)
|
|
184
|
+
|| this.policy.scryptCost > MAX_VERIFY_COST
|
|
185
|
+
|| !Number.isInteger(this.policy.scryptBlockSize)
|
|
186
|
+
|| this.policy.scryptBlockSize < 1
|
|
187
|
+
|| this.policy.scryptBlockSize > MAX_VERIFY_BLOCK_SIZE
|
|
188
|
+
|| !Number.isInteger(this.policy.scryptParallelization)
|
|
189
|
+
|| this.policy.scryptParallelization < 1
|
|
190
|
+
|| this.policy.scryptParallelization > MAX_VERIFY_PARALLELIZATION
|
|
191
|
+
|| !Number.isInteger(this.policy.derivedKeyLength)
|
|
192
|
+
|| this.policy.derivedKeyLength < 16
|
|
193
|
+
|| this.policy.derivedKeyLength > MAX_VERIFY_KEY_LENGTH
|
|
194
|
+
|| !Number.isInteger(this.policy.saltLength)
|
|
195
|
+
|| this.policy.saltLength < 16
|
|
196
|
+
|| this.policy.saltLength > 64) {
|
|
197
|
+
throw this.buildError('PASSWORD_POLICY_INVALID', 'The password policy is outside supported safe bounds.');
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
isPowerOfTwo(value) {
|
|
201
|
+
return Number.isSafeInteger(value) && value > 0 && (value & (value - 1)) === 0;
|
|
202
|
+
}
|
|
203
|
+
buildError(errorCode, message) {
|
|
204
|
+
return new fsm_dynamo_1.DyFM_Error({
|
|
205
|
+
status: 400,
|
|
206
|
+
errorCode: `${global_settings_const_1.DyNTS_global_settings.systemShortCodeName}|ACCOUNT_SECURITY|${errorCode}`,
|
|
207
|
+
message: message,
|
|
208
|
+
userMessage: 'The credential does not satisfy the account security policy.',
|
|
209
|
+
issuerService: this.constructor.name,
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
exports.DyNTS_AccountPassword_ControlService = DyNTS_AccountPassword_ControlService;
|
|
214
|
+
//# sourceMappingURL=account-password.control-service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"account-password.control-service.js","sourceRoot":"","sources":["../../../src/_modules/account-security/account-password.control-service.ts"],"names":[],"mappings":";;;AAAA,mCAKgB;AAEhB,sDAAmD;AAEnD,oFAAiF;AAQjF,MAAM,qBAAqB,GAAW,eAAe,CAAC;AACtD,MAAM,cAAc,GAA0C;IAC5D,SAAS,EAAE,EAAE;IACb,SAAS,EAAE,GAAG;IACd,UAAU,EAAE,MAAM;IAClB,eAAe,EAAE,CAAC;IAClB,qBAAqB,EAAE,CAAC;IACxB,gBAAgB,EAAE,EAAE;IACpB,UAAU,EAAE,EAAE;IACd,oBAAoB,EAAE,EAAE;CACzB,CAAC;AACF,MAAM,eAAe,GAAW,OAAO,CAAC;AACxC,MAAM,qBAAqB,GAAW,CAAC,CAAC;AACxC,MAAM,0BAA0B,GAAW,CAAC,CAAC;AAC7C,MAAM,qBAAqB,GAAW,EAAE,CAAC;AACzC,MAAM,mBAAmB,GAAW,KAAK,CAAC;AAC1C,MAAM,sBAAsB,GAAW,KAAK,CAAC;AAmB7C;;;GAGG;AACH,MAAa,oCAAoC;IAC9B,MAAM,CAAwC;IAE/D,qDAAqD;IACrD,YAAY,MAAuD;QACjE,IAAI,CAAC,MAAM,GAAG;YACZ,GAAG,cAAc;YACjB,GAAG,MAAM;YACT,oBAAoB,EAAE;gBACpB,GAAG,CAAC,MAAM,EAAE,oBAAoB,IAAI,cAAc,CAAC,oBAAoB,CAAC;aACzE;SACF,CAAC;QACF,IAAI,CAAC,cAAc,EAAE,CAAC;IACxB,CAAC;IAED,4EAA4E;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GAAG,6CAAqB,CAAC,mBAAmB,qBAAqB,SAAS,EAAE;YACvF,OAAO,EAAE,OAAO;YAChB,WAAW,EAAE,8DAA8D;YAC3E,aAAa,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI;SACrC,CAAC,CAAC;IACL,CAAC;CACF;AAvOD,oFAuOC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { DyNTS_AccountSessionClaims_Interface } from './_models/account-session-claims.interface';
|
|
2
|
+
import { DyNTS_AccountSessionContext_Interface } from './_models/account-session-context.interface';
|
|
3
|
+
import { DyNTS_AccountSessionSettings_Interface } from './_models/account-session-settings.interface';
|
|
4
|
+
import { DyNTS_AccountSessionTokenPair_Interface } from './_models/account-session-token-pair.interface';
|
|
5
|
+
import { DyNTS_AccountSessionView_Interface } from './_models/account-session-view.interface';
|
|
6
|
+
/**
|
|
7
|
+
* Opaque, server-revocable account session families with one-time refresh rotation and replay detection.
|
|
8
|
+
*/
|
|
9
|
+
export declare class DyNTS_AccountSession_ControlService {
|
|
10
|
+
private readonly adapter;
|
|
11
|
+
private readonly accessTtlMs;
|
|
12
|
+
private readonly refreshTtlMs;
|
|
13
|
+
private readonly tokenBytes;
|
|
14
|
+
private readonly maxRefreshRotations;
|
|
15
|
+
private readonly clock;
|
|
16
|
+
/** Creates a validated session service over an atomic persistence adapter. */
|
|
17
|
+
constructor(set: DyNTS_AccountSessionSettings_Interface);
|
|
18
|
+
/** Atomically persists a new session family before returning its raw credentials. */
|
|
19
|
+
issueSession(subjectId: string, authorizationVersion: number, context: DyNTS_AccountSessionContext_Interface): Promise<DyNTS_AccountSessionTokenPair_Interface>;
|
|
20
|
+
/** Resolves an opaque access token through the server-side active-session record. */
|
|
21
|
+
authenticateAccessToken(accessToken: string): Promise<DyNTS_AccountSessionClaims_Interface>;
|
|
22
|
+
/** Rotates a one-time refresh token; replay revokes the complete token family. */
|
|
23
|
+
rotateRefreshToken(refreshToken: string, context: DyNTS_AccountSessionContext_Interface): Promise<DyNTS_AccountSessionTokenPair_Interface>;
|
|
24
|
+
/** Revokes one server-side session. */
|
|
25
|
+
revokeSession(sessionId: string, reasonCode: string): Promise<void>;
|
|
26
|
+
/** Revokes every session belonging to one subject. */
|
|
27
|
+
revokeAllSubjectSessions(subjectId: string, reasonCode: string): Promise<void>;
|
|
28
|
+
/** Returns a user-safe session projection without token hashes. */
|
|
29
|
+
listSubjectSessions(subjectId: string): Promise<DyNTS_AccountSessionView_Interface[]>;
|
|
30
|
+
private createMaterial;
|
|
31
|
+
private toTokenPair;
|
|
32
|
+
private hashToken;
|
|
33
|
+
private validateSettings;
|
|
34
|
+
private validateContext;
|
|
35
|
+
private validateRevocation;
|
|
36
|
+
private isFutureDate;
|
|
37
|
+
private buildUnauthorized;
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=account-session.control-service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"account-session.control-service.d.ts","sourceRoot":"","sources":["../../../src/_modules/account-security/account-session.control-service.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,oCAAoC,EAAE,MAAM,4CAA4C,CAAC;AAClG,OAAO,EAAE,qCAAqC,EAAE,MAAM,6CAA6C,CAAC;AAEpG,OAAO,EAAE,sCAAsC,EAAE,MAAM,8CAA8C,CAAC;AACtG,OAAO,EAAE,uCAAuC,EAAE,MAAM,gDAAgD,CAAC;AACzG,OAAO,EAAE,kCAAkC,EAAE,MAAM,0CAA0C,CAAC;AAc9F;;GAEG;AACH,qBAAa,mCAAmC;IAC9C,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAwC;IAChE,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAS;IACrC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAS;IACtC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAS;IACpC,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAS;IAC7C,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAa;IAEnC,8EAA8E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