@colveor/core 1.0.1 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -0
- package/README.md +6 -0
- package/dist/bootstrap/bootstrap-colveor-app.d.ts.map +1 -1
- package/dist/bootstrap/bootstrap-colveor-app.js +22 -3
- package/dist/bootstrap/bootstrap-colveor-app.js.map +1 -1
- package/dist/common/decorators/index.d.ts +6 -0
- package/dist/common/decorators/index.d.ts.map +1 -1
- package/dist/common/decorators/index.js +8 -1
- package/dist/common/decorators/index.js.map +1 -1
- package/dist/common/decorators/ip-rate-limit-bucket.decorator.d.ts +9 -0
- package/dist/common/decorators/ip-rate-limit-bucket.decorator.d.ts.map +1 -0
- package/dist/common/decorators/ip-rate-limit-bucket.decorator.js +12 -0
- package/dist/common/decorators/ip-rate-limit-bucket.decorator.js.map +1 -0
- package/dist/common/guards/login-ip-rate-limit.guard.d.ts +12 -6
- package/dist/common/guards/login-ip-rate-limit.guard.d.ts.map +1 -1
- package/dist/common/guards/login-ip-rate-limit.guard.js +65 -21
- package/dist/common/guards/login-ip-rate-limit.guard.js.map +1 -1
- package/dist/common/guards/otp-ip-rate-limit.guard.d.ts +3 -2
- package/dist/common/guards/otp-ip-rate-limit.guard.d.ts.map +1 -1
- package/dist/common/guards/otp-ip-rate-limit.guard.js +17 -15
- package/dist/common/guards/otp-ip-rate-limit.guard.js.map +1 -1
- package/dist/common/guards/permissions.guard.d.ts.map +1 -1
- package/dist/common/guards/permissions.guard.js +12 -2
- package/dist/common/guards/permissions.guard.js.map +1 -1
- package/dist/common/interceptors/timeout.interceptor.d.ts +1 -1
- package/dist/common/interceptors/timeout.interceptor.d.ts.map +1 -1
- package/dist/common/interceptors/timeout.interceptor.js +5 -1
- package/dist/common/interceptors/timeout.interceptor.js.map +1 -1
- package/dist/common/interfaces/request-user.d.ts +4 -3
- package/dist/common/interfaces/request-user.d.ts.map +1 -1
- package/dist/common/utils/cache-version.util.d.ts +12 -0
- package/dist/common/utils/cache-version.util.d.ts.map +1 -0
- package/dist/common/utils/cache-version.util.js +34 -0
- package/dist/common/utils/cache-version.util.js.map +1 -0
- package/dist/common/utils/postgres-error.util.d.ts +5 -0
- package/dist/common/utils/postgres-error.util.d.ts.map +1 -0
- package/dist/common/utils/postgres-error.util.js +13 -0
- package/dist/common/utils/postgres-error.util.js.map +1 -0
- package/dist/common/utils/singleflight.util.d.ts +6 -0
- package/dist/common/utils/singleflight.util.d.ts.map +1 -0
- package/dist/common/utils/singleflight.util.js +21 -0
- package/dist/common/utils/singleflight.util.js.map +1 -0
- package/dist/common/validators/is-exclusive-auth-params.validator.js +1 -1
- package/dist/common/validators/is-exclusive-auth-params.validator.js.map +1 -1
- package/dist/common/validators/is-exclusive-delete-confirm-params.validator.js +1 -1
- package/dist/common/validators/is-exclusive-delete-confirm-params.validator.js.map +1 -1
- package/dist/config/app.config.d.ts +38 -0
- package/dist/config/app.config.d.ts.map +1 -1
- package/dist/config/app.config.js +24 -0
- package/dist/config/app.config.js.map +1 -1
- package/dist/config/database.config.d.ts +6 -0
- package/dist/config/database.config.d.ts.map +1 -1
- package/dist/config/database.config.js +3 -0
- package/dist/config/database.config.js.map +1 -1
- package/dist/config/env-flags.util.d.ts +4 -0
- package/dist/config/env-flags.util.d.ts.map +1 -1
- package/dist/config/env-flags.util.js +7 -0
- package/dist/config/env-flags.util.js.map +1 -1
- package/dist/config/env.validation.d.ts +24 -1
- package/dist/config/env.validation.d.ts.map +1 -1
- package/dist/config/env.validation.js +92 -2
- package/dist/config/env.validation.js.map +1 -1
- package/dist/config/in-memory-redis.client.d.ts +23 -4
- package/dist/config/in-memory-redis.client.d.ts.map +1 -1
- package/dist/config/in-memory-redis.client.js +148 -4
- package/dist/config/in-memory-redis.client.js.map +1 -1
- package/dist/config/redis.module.d.ts.map +1 -1
- package/dist/config/redis.module.js +5 -0
- package/dist/config/redis.module.js.map +1 -1
- package/dist/core.module.d.ts +5 -0
- package/dist/core.module.d.ts.map +1 -1
- package/dist/core.module.js +5 -0
- package/dist/core.module.js.map +1 -1
- package/dist/database/migrations/1785006199371-auth-mfa-oauth.d.ts +7 -0
- package/dist/database/migrations/1785006199371-auth-mfa-oauth.d.ts.map +1 -0
- package/dist/database/migrations/1785006199371-auth-mfa-oauth.js +24 -0
- package/dist/database/migrations/1785006199371-auth-mfa-oauth.js.map +1 -0
- package/dist/database/migrations/1785006199372-auth-mfa-backup-codes.d.ts +7 -0
- package/dist/database/migrations/1785006199372-auth-mfa-backup-codes.d.ts.map +1 -0
- package/dist/database/migrations/1785006199372-auth-mfa-backup-codes.js +16 -0
- package/dist/database/migrations/1785006199372-auth-mfa-backup-codes.js.map +1 -0
- package/dist/database/migrations/1785006199373-auth-gap-fixes.d.ts +7 -0
- package/dist/database/migrations/1785006199373-auth-gap-fixes.d.ts.map +1 -0
- package/dist/database/migrations/1785006199373-auth-gap-fixes.js +14 -0
- package/dist/database/migrations/1785006199373-auth-gap-fixes.js.map +1 -0
- package/dist/database/migrations/1785006199374-auth-sessions-indexes.d.ts +13 -0
- package/dist/database/migrations/1785006199374-auth-sessions-indexes.d.ts.map +1 -0
- package/dist/database/migrations/1785006199374-auth-sessions-indexes.js +35 -0
- package/dist/database/migrations/1785006199374-auth-sessions-indexes.js.map +1 -0
- package/dist/database/migrations/1785006199375-auth-identity-and-audit.d.ts +11 -0
- package/dist/database/migrations/1785006199375-auth-identity-and-audit.d.ts.map +1 -0
- package/dist/database/migrations/1785006199375-auth-identity-and-audit.js +60 -0
- package/dist/database/migrations/1785006199375-auth-identity-and-audit.js.map +1 -0
- package/dist/database/migrations/1785006199376-auth-settings-security-defaults.d.ts +14 -0
- package/dist/database/migrations/1785006199376-auth-settings-security-defaults.d.ts.map +1 -0
- package/dist/database/migrations/1785006199376-auth-settings-security-defaults.js +39 -0
- package/dist/database/migrations/1785006199376-auth-settings-security-defaults.js.map +1 -0
- package/dist/database/migrations/1785006199377-auth-security-hardening.d.ts +13 -0
- package/dist/database/migrations/1785006199377-auth-security-hardening.d.ts.map +1 -0
- package/dist/database/migrations/1785006199377-auth-security-hardening.js +69 -0
- package/dist/database/migrations/1785006199377-auth-security-hardening.js.map +1 -0
- package/dist/database/migrations/1785006199378-auth-family-denylist-and-hardening.d.ts +11 -0
- package/dist/database/migrations/1785006199378-auth-family-denylist-and-hardening.d.ts.map +1 -0
- package/dist/database/migrations/1785006199378-auth-family-denylist-and-hardening.js +51 -0
- package/dist/database/migrations/1785006199378-auth-family-denylist-and-hardening.js.map +1 -0
- package/dist/database/migrations/1785006199379-authz-lifecycle-hardening.d.ts +12 -0
- package/dist/database/migrations/1785006199379-authz-lifecycle-hardening.d.ts.map +1 -0
- package/dist/database/migrations/1785006199379-authz-lifecycle-hardening.js +37 -0
- package/dist/database/migrations/1785006199379-authz-lifecycle-hardening.js.map +1 -0
- package/dist/database/migrations/1785006199380-auth-remaining-gaps.d.ts +12 -0
- package/dist/database/migrations/1785006199380-auth-remaining-gaps.d.ts.map +1 -0
- package/dist/database/migrations/1785006199380-auth-remaining-gaps.js +74 -0
- package/dist/database/migrations/1785006199380-auth-remaining-gaps.js.map +1 -0
- package/dist/database/migrations/1785006199381-settings-blast-radius.d.ts +12 -0
- package/dist/database/migrations/1785006199381-settings-blast-radius.d.ts.map +1 -0
- package/dist/database/migrations/1785006199381-settings-blast-radius.js +52 -0
- package/dist/database/migrations/1785006199381-settings-blast-radius.js.map +1 -0
- package/dist/database/migrations/1785006199382-oauth-client-ids-lock.d.ts +11 -0
- package/dist/database/migrations/1785006199382-oauth-client-ids-lock.d.ts.map +1 -0
- package/dist/database/migrations/1785006199382-oauth-client-ids-lock.js +36 -0
- package/dist/database/migrations/1785006199382-oauth-client-ids-lock.js.map +1 -0
- package/dist/database/migrations/1785006199383-settings-role-and-verified-lock.d.ts +12 -0
- package/dist/database/migrations/1785006199383-settings-role-and-verified-lock.d.ts.map +1 -0
- package/dist/database/migrations/1785006199383-settings-role-and-verified-lock.js +39 -0
- package/dist/database/migrations/1785006199383-settings-role-and-verified-lock.js.map +1 -0
- package/dist/database/migrations/1785006199384-settings-providers-and-test-otp-lock.d.ts +12 -0
- package/dist/database/migrations/1785006199384-settings-providers-and-test-otp-lock.d.ts.map +1 -0
- package/dist/database/migrations/1785006199384-settings-providers-and-test-otp-lock.js +39 -0
- package/dist/database/migrations/1785006199384-settings-providers-and-test-otp-lock.js.map +1 -0
- package/dist/database/migrations/1785006199385-settings-auth-surface-lock.d.ts +13 -0
- package/dist/database/migrations/1785006199385-settings-auth-surface-lock.d.ts.map +1 -0
- package/dist/database/migrations/1785006199385-settings-auth-surface-lock.js +72 -0
- package/dist/database/migrations/1785006199385-settings-auth-surface-lock.js.map +1 -0
- package/dist/database/migrations/1785006199386-audit-events.d.ts +10 -0
- package/dist/database/migrations/1785006199386-audit-events.d.ts.map +1 -0
- package/dist/database/migrations/1785006199386-audit-events.js +60 -0
- package/dist/database/migrations/1785006199386-audit-events.js.map +1 -0
- package/dist/database/migrations/1785006199387-audit-resource-id-varchar.d.ts +10 -0
- package/dist/database/migrations/1785006199387-audit-resource-id-varchar.d.ts.map +1 -0
- package/dist/database/migrations/1785006199387-audit-resource-id-varchar.js +25 -0
- package/dist/database/migrations/1785006199387-audit-resource-id-varchar.js.map +1 -0
- package/dist/database/migrations/1785006199388-audit-enterprise.d.ts +11 -0
- package/dist/database/migrations/1785006199388-audit-enterprise.d.ts.map +1 -0
- package/dist/database/migrations/1785006199388-audit-enterprise.js +157 -0
- package/dist/database/migrations/1785006199388-audit-enterprise.js.map +1 -0
- package/dist/database/migrations/1785006199389-drop-admin-logs.d.ts +10 -0
- package/dist/database/migrations/1785006199389-drop-admin-logs.d.ts.map +1 -0
- package/dist/database/migrations/1785006199389-drop-admin-logs.js +38 -0
- package/dist/database/migrations/1785006199389-drop-admin-logs.js.map +1 -0
- package/dist/database/migrations/1785006199390-audit-hardening.d.ts +14 -0
- package/dist/database/migrations/1785006199390-audit-hardening.d.ts.map +1 -0
- package/dist/database/migrations/1785006199390-audit-hardening.js +345 -0
- package/dist/database/migrations/1785006199390-audit-hardening.js.map +1 -0
- package/dist/database/migrations/1785006199391-audit-owner-schema-create.d.ts +10 -0
- package/dist/database/migrations/1785006199391-audit-owner-schema-create.d.ts.map +1 -0
- package/dist/database/migrations/1785006199391-audit-owner-schema-create.js +39 -0
- package/dist/database/migrations/1785006199391-audit-owner-schema-create.js.map +1 -0
- package/dist/database/migrations/1785006199392-profile-photo-url.d.ts +11 -0
- package/dist/database/migrations/1785006199392-profile-photo-url.d.ts.map +1 -0
- package/dist/database/migrations/1785006199392-profile-photo-url.js +33 -0
- package/dist/database/migrations/1785006199392-profile-photo-url.js.map +1 -0
- package/dist/database/migrations/1785006199393-profile-cover-url.d.ts +11 -0
- package/dist/database/migrations/1785006199393-profile-cover-url.d.ts.map +1 -0
- package/dist/database/migrations/1785006199393-profile-cover-url.js +33 -0
- package/dist/database/migrations/1785006199393-profile-cover-url.js.map +1 -0
- package/dist/database/migrations/1785006199394-profile-is-public-default-false.d.ts +11 -0
- package/dist/database/migrations/1785006199394-profile-is-public-default-false.d.ts.map +1 -0
- package/dist/database/migrations/1785006199394-profile-is-public-default-false.js +24 -0
- package/dist/database/migrations/1785006199394-profile-is-public-default-false.js.map +1 -0
- package/dist/database/migrations/1785006199395-delivery-scale-indexes.d.ts +10 -0
- package/dist/database/migrations/1785006199395-delivery-scale-indexes.d.ts.map +1 -0
- package/dist/database/migrations/1785006199395-delivery-scale-indexes.js +35 -0
- package/dist/database/migrations/1785006199395-delivery-scale-indexes.js.map +1 -0
- package/dist/database/migrations/1785006199396-delivery-recipient-index.d.ts +11 -0
- package/dist/database/migrations/1785006199396-delivery-recipient-index.d.ts.map +1 -0
- package/dist/database/migrations/1785006199396-delivery-recipient-index.js +23 -0
- package/dist/database/migrations/1785006199396-delivery-recipient-index.js.map +1 -0
- package/dist/database/seeds/roles.seed.d.ts +6 -0
- package/dist/database/seeds/roles.seed.d.ts.map +1 -1
- package/dist/database/seeds/roles.seed.js +22 -5
- package/dist/database/seeds/roles.seed.js.map +1 -1
- package/dist/database/seeds/settings.seed.d.ts +5 -0
- package/dist/database/seeds/settings.seed.d.ts.map +1 -1
- package/dist/database/seeds/settings.seed.js +500 -25
- package/dist/database/seeds/settings.seed.js.map +1 -1
- package/dist/database/seeds/templates/html-template.reader.d.ts +1 -0
- package/dist/database/seeds/templates/html-template.reader.d.ts.map +1 -1
- package/dist/database/seeds/templates/html-template.reader.js +3 -1
- package/dist/database/seeds/templates/html-template.reader.js.map +1 -1
- package/dist/database/seeds/templates/html-template.reader.ts +5 -1
- package/dist/database/typeorm.util.d.ts.map +1 -1
- package/dist/database/typeorm.util.js +6 -0
- package/dist/database/typeorm.util.js.map +1 -1
- package/dist/index.d.ts +8 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +39 -4
- package/dist/index.js.map +1 -1
- package/dist/modules/admin/controllers/admin.controller.d.ts +15 -7
- package/dist/modules/admin/controllers/admin.controller.d.ts.map +1 -1
- package/dist/modules/admin/controllers/admin.controller.js +74 -17
- package/dist/modules/admin/controllers/admin.controller.js.map +1 -1
- package/dist/modules/admin/services/admin-log.service.d.ts +14 -7
- package/dist/modules/admin/services/admin-log.service.d.ts.map +1 -1
- package/dist/modules/admin/services/admin-log.service.js +41 -38
- package/dist/modules/admin/services/admin-log.service.js.map +1 -1
- package/dist/modules/audit/audit.manifest.d.ts +8 -0
- package/dist/modules/audit/audit.manifest.d.ts.map +1 -0
- package/dist/modules/audit/audit.manifest.js +31 -0
- package/dist/modules/audit/audit.manifest.js.map +1 -0
- package/dist/modules/audit/audit.module.d.ts +8 -0
- package/dist/modules/audit/audit.module.d.ts.map +1 -0
- package/dist/modules/audit/audit.module.js +57 -0
- package/dist/modules/audit/audit.module.js.map +1 -0
- package/dist/modules/audit/constants/audit-actions.d.ts +79 -0
- package/dist/modules/audit/constants/audit-actions.d.ts.map +1 -0
- package/dist/modules/audit/constants/audit-actions.js +89 -0
- package/dist/modules/audit/constants/audit-actions.js.map +1 -0
- package/dist/modules/audit/constants/audit-mutation.d.ts +10 -0
- package/dist/modules/audit/constants/audit-mutation.d.ts.map +1 -0
- package/dist/modules/audit/constants/audit-mutation.js +13 -0
- package/dist/modules/audit/constants/audit-mutation.js.map +1 -0
- package/dist/modules/audit/controllers/audit.controller.d.ts +13 -0
- package/dist/modules/audit/controllers/audit.controller.d.ts.map +1 -0
- package/dist/modules/audit/controllers/audit.controller.js +149 -0
- package/dist/modules/audit/controllers/audit.controller.js.map +1 -0
- package/dist/modules/audit/decorators/audit.decorator.d.ts +27 -0
- package/dist/modules/audit/decorators/audit.decorator.d.ts.map +1 -0
- package/dist/modules/audit/decorators/audit.decorator.js +18 -0
- package/dist/modules/audit/decorators/audit.decorator.js.map +1 -0
- package/dist/modules/audit/dto/audit.dto.d.ts +54 -0
- package/dist/modules/audit/dto/audit.dto.d.ts.map +1 -0
- package/dist/modules/audit/dto/audit.dto.js +129 -0
- package/dist/modules/audit/dto/audit.dto.js.map +1 -0
- package/dist/modules/audit/entities/audit-event.entity.d.ts +33 -0
- package/dist/modules/audit/entities/audit-event.entity.d.ts.map +1 -0
- package/dist/modules/audit/entities/audit-event.entity.js +125 -0
- package/dist/modules/audit/entities/audit-event.entity.js.map +1 -0
- package/dist/modules/audit/entities/audit-outbox.entity.d.ts +16 -0
- package/dist/modules/audit/entities/audit-outbox.entity.d.ts.map +1 -0
- package/dist/modules/audit/entities/audit-outbox.entity.js +65 -0
- package/dist/modules/audit/entities/audit-outbox.entity.js.map +1 -0
- package/dist/modules/audit/index.d.ts +13 -0
- package/dist/modules/audit/index.d.ts.map +1 -0
- package/dist/modules/audit/index.js +23 -0
- package/dist/modules/audit/index.js.map +1 -0
- package/dist/modules/audit/interceptors/audit.interceptor.d.ts +11 -0
- package/dist/modules/audit/interceptors/audit.interceptor.d.ts.map +1 -0
- package/dist/modules/audit/interceptors/audit.interceptor.js +75 -0
- package/dist/modules/audit/interceptors/audit.interceptor.js.map +1 -0
- package/dist/modules/audit/listeners/auth-audit.listener.d.ts +31 -0
- package/dist/modules/audit/listeners/auth-audit.listener.d.ts.map +1 -0
- package/dist/modules/audit/listeners/auth-audit.listener.js +338 -0
- package/dist/modules/audit/listeners/auth-audit.listener.js.map +1 -0
- package/dist/modules/audit/services/audit-archive.service.d.ts +28 -0
- package/dist/modules/audit/services/audit-archive.service.d.ts.map +1 -0
- package/dist/modules/audit/services/audit-archive.service.js +132 -0
- package/dist/modules/audit/services/audit-archive.service.js.map +1 -0
- package/dist/modules/audit/services/audit-hash-backfill.service.d.ts +22 -0
- package/dist/modules/audit/services/audit-hash-backfill.service.d.ts.map +1 -0
- package/dist/modules/audit/services/audit-hash-backfill.service.js +79 -0
- package/dist/modules/audit/services/audit-hash-backfill.service.js.map +1 -0
- package/dist/modules/audit/services/audit-leader.service.d.ts +28 -0
- package/dist/modules/audit/services/audit-leader.service.d.ts.map +1 -0
- package/dist/modules/audit/services/audit-leader.service.js +99 -0
- package/dist/modules/audit/services/audit-leader.service.js.map +1 -0
- package/dist/modules/audit/services/audit-outbox.worker.d.ts +29 -0
- package/dist/modules/audit/services/audit-outbox.worker.d.ts.map +1 -0
- package/dist/modules/audit/services/audit-outbox.worker.js +144 -0
- package/dist/modules/audit/services/audit-outbox.worker.js.map +1 -0
- package/dist/modules/audit/services/audit-partition.service.d.ts +18 -0
- package/dist/modules/audit/services/audit-partition.service.d.ts.map +1 -0
- package/dist/modules/audit/services/audit-partition.service.js +70 -0
- package/dist/modules/audit/services/audit-partition.service.js.map +1 -0
- package/dist/modules/audit/services/audit-write.service.d.ts +60 -0
- package/dist/modules/audit/services/audit-write.service.d.ts.map +1 -0
- package/dist/modules/audit/services/audit-write.service.js +463 -0
- package/dist/modules/audit/services/audit-write.service.js.map +1 -0
- package/dist/modules/audit/services/audit.service.d.ts +60 -0
- package/dist/modules/audit/services/audit.service.d.ts.map +1 -0
- package/dist/modules/audit/services/audit.service.js +373 -0
- package/dist/modules/audit/services/audit.service.js.map +1 -0
- package/dist/modules/audit/utils/audit-hash.util.d.ts +20 -0
- package/dist/modules/audit/utils/audit-hash.util.d.ts.map +1 -0
- package/dist/modules/audit/utils/audit-hash.util.js +44 -0
- package/dist/modules/audit/utils/audit-hash.util.js.map +1 -0
- package/dist/modules/auth/auth-core/auth-core.module.d.ts.map +1 -1
- package/dist/modules/auth/auth-core/auth-core.module.js +16 -4
- package/dist/modules/auth/auth-core/auth-core.module.js.map +1 -1
- package/dist/modules/auth/auth-core/constants/jwt-redis.keys.d.ts +22 -0
- package/dist/modules/auth/auth-core/constants/jwt-redis.keys.d.ts.map +1 -0
- package/dist/modules/auth/auth-core/constants/jwt-redis.keys.js +25 -0
- package/dist/modules/auth/auth-core/constants/jwt-redis.keys.js.map +1 -0
- package/dist/modules/auth/auth-core/services/access-token.validator.d.ts +19 -0
- package/dist/modules/auth/auth-core/services/access-token.validator.d.ts.map +1 -0
- package/dist/modules/auth/auth-core/services/access-token.validator.js +110 -0
- package/dist/modules/auth/auth-core/services/access-token.validator.js.map +1 -0
- package/dist/modules/auth/auth-core/services/family-denylist.reader.d.ts +10 -0
- package/dist/modules/auth/auth-core/services/family-denylist.reader.d.ts.map +1 -0
- package/dist/modules/auth/auth-core/services/family-denylist.reader.js +44 -0
- package/dist/modules/auth/auth-core/services/family-denylist.reader.js.map +1 -0
- package/dist/modules/auth/auth-core/services/session-epoch.reader.d.ts +10 -0
- package/dist/modules/auth/auth-core/services/session-epoch.reader.d.ts.map +1 -0
- package/dist/modules/auth/auth-core/services/session-epoch.reader.js +44 -0
- package/dist/modules/auth/auth-core/services/session-epoch.reader.js.map +1 -0
- package/dist/modules/auth/auth-core/strategies/jwt.strategy.d.ts +7 -8
- package/dist/modules/auth/auth-core/strategies/jwt.strategy.d.ts.map +1 -1
- package/dist/modules/auth/auth-core/strategies/jwt.strategy.js +34 -34
- package/dist/modules/auth/auth-core/strategies/jwt.strategy.js.map +1 -1
- package/dist/modules/auth/auth.manifest.d.ts +6 -0
- package/dist/modules/auth/auth.manifest.d.ts.map +1 -1
- package/dist/modules/auth/auth.manifest.js +38 -2
- package/dist/modules/auth/auth.manifest.js.map +1 -1
- package/dist/modules/auth/auth.module.d.ts.map +1 -1
- package/dist/modules/auth/auth.module.js +39 -4
- package/dist/modules/auth/auth.module.js.map +1 -1
- package/dist/modules/auth/controllers/account.controller.d.ts +15 -1
- package/dist/modules/auth/controllers/account.controller.d.ts.map +1 -1
- package/dist/modules/auth/controllers/account.controller.js +65 -7
- package/dist/modules/auth/controllers/account.controller.js.map +1 -1
- package/dist/modules/auth/controllers/auth.controller.d.ts +7 -3
- package/dist/modules/auth/controllers/auth.controller.d.ts.map +1 -1
- package/dist/modules/auth/controllers/auth.controller.js +76 -16
- package/dist/modules/auth/controllers/auth.controller.js.map +1 -1
- package/dist/modules/auth/controllers/forgot-password.controller.d.ts +4 -2
- package/dist/modules/auth/controllers/forgot-password.controller.d.ts.map +1 -1
- package/dist/modules/auth/controllers/forgot-password.controller.js +32 -11
- package/dist/modules/auth/controllers/forgot-password.controller.js.map +1 -1
- package/dist/modules/auth/controllers/mfa.controller.d.ts +18 -0
- package/dist/modules/auth/controllers/mfa.controller.d.ts.map +1 -0
- package/dist/modules/auth/controllers/mfa.controller.js +192 -0
- package/dist/modules/auth/controllers/mfa.controller.js.map +1 -0
- package/dist/modules/auth/controllers/oauth.controller.d.ts +22 -0
- package/dist/modules/auth/controllers/oauth.controller.d.ts.map +1 -0
- package/dist/modules/auth/controllers/oauth.controller.js +192 -0
- package/dist/modules/auth/controllers/oauth.controller.js.map +1 -0
- package/dist/modules/auth/controllers/otp.controller.d.ts +6 -3
- package/dist/modules/auth/controllers/otp.controller.d.ts.map +1 -1
- package/dist/modules/auth/controllers/otp.controller.js +32 -33
- package/dist/modules/auth/controllers/otp.controller.js.map +1 -1
- package/dist/modules/auth/controllers/pin.controller.d.ts.map +1 -1
- package/dist/modules/auth/controllers/pin.controller.js +10 -2
- package/dist/modules/auth/controllers/pin.controller.js.map +1 -1
- package/dist/modules/auth/controllers/session.controller.d.ts +12 -4
- package/dist/modules/auth/controllers/session.controller.d.ts.map +1 -1
- package/dist/modules/auth/controllers/session.controller.js +130 -31
- package/dist/modules/auth/controllers/session.controller.js.map +1 -1
- package/dist/modules/auth/dto/auth-config.dto.d.ts +11 -2
- package/dist/modules/auth/dto/auth-config.dto.d.ts.map +1 -1
- package/dist/modules/auth/dto/auth-config.dto.js +78 -3
- package/dist/modules/auth/dto/auth-config.dto.js.map +1 -1
- package/dist/modules/auth/dto/index.d.ts +2 -0
- package/dist/modules/auth/dto/index.d.ts.map +1 -1
- package/dist/modules/auth/dto/index.js +2 -0
- package/dist/modules/auth/dto/index.js.map +1 -1
- package/dist/modules/auth/dto/login.dto.d.ts +8 -1
- package/dist/modules/auth/dto/login.dto.d.ts.map +1 -1
- package/dist/modules/auth/dto/login.dto.js +48 -3
- package/dist/modules/auth/dto/login.dto.js.map +1 -1
- package/dist/modules/auth/dto/mfa.dto.d.ts +61 -0
- package/dist/modules/auth/dto/mfa.dto.d.ts.map +1 -0
- package/dist/modules/auth/dto/mfa.dto.js +326 -0
- package/dist/modules/auth/dto/mfa.dto.js.map +1 -0
- package/dist/modules/auth/dto/oauth.dto.d.ts +45 -0
- package/dist/modules/auth/dto/oauth.dto.d.ts.map +1 -0
- package/dist/modules/auth/dto/oauth.dto.js +249 -0
- package/dist/modules/auth/dto/oauth.dto.js.map +1 -0
- package/dist/modules/auth/dto/otp.dto.d.ts +3 -1
- package/dist/modules/auth/dto/otp.dto.d.ts.map +1 -1
- package/dist/modules/auth/dto/otp.dto.js +19 -0
- package/dist/modules/auth/dto/otp.dto.js.map +1 -1
- package/dist/modules/auth/dto/password.dto.d.ts +28 -0
- package/dist/modules/auth/dto/password.dto.d.ts.map +1 -1
- package/dist/modules/auth/dto/password.dto.js +191 -5
- package/dist/modules/auth/dto/password.dto.js.map +1 -1
- package/dist/modules/auth/dto/register.dto.d.ts +1 -0
- package/dist/modules/auth/dto/register.dto.d.ts.map +1 -1
- package/dist/modules/auth/dto/register.dto.js +1 -0
- package/dist/modules/auth/dto/register.dto.js.map +1 -1
- package/dist/modules/auth/dto/session.dto.d.ts +20 -0
- package/dist/modules/auth/dto/session.dto.d.ts.map +1 -0
- package/dist/modules/auth/dto/session.dto.js +98 -0
- package/dist/modules/auth/dto/session.dto.js.map +1 -0
- package/dist/modules/auth/dto/token.dto.d.ts +38 -1
- package/dist/modules/auth/dto/token.dto.d.ts.map +1 -1
- package/dist/modules/auth/dto/token.dto.js +21 -1
- package/dist/modules/auth/dto/token.dto.js.map +1 -1
- package/dist/modules/auth/entities/index.d.ts +2 -0
- package/dist/modules/auth/entities/index.d.ts.map +1 -1
- package/dist/modules/auth/entities/index.js +2 -0
- package/dist/modules/auth/entities/index.js.map +1 -1
- package/dist/modules/auth/entities/password-reset-token.entity.d.ts +2 -0
- package/dist/modules/auth/entities/password-reset-token.entity.d.ts.map +1 -1
- package/dist/modules/auth/entities/password-reset-token.entity.js +6 -0
- package/dist/modules/auth/entities/password-reset-token.entity.js.map +1 -1
- package/dist/modules/auth/entities/user-mfa.entity.d.ts +19 -0
- package/dist/modules/auth/entities/user-mfa.entity.d.ts.map +1 -0
- package/dist/modules/auth/entities/user-mfa.entity.js +73 -0
- package/dist/modules/auth/entities/user-mfa.entity.js.map +1 -0
- package/dist/modules/auth/entities/user-oauth-identity.entity.d.ts +24 -0
- package/dist/modules/auth/entities/user-oauth-identity.entity.d.ts.map +1 -0
- package/dist/modules/auth/entities/user-oauth-identity.entity.js +84 -0
- package/dist/modules/auth/entities/user-oauth-identity.entity.js.map +1 -0
- package/dist/modules/auth/events/auth.events.d.ts +84 -19
- package/dist/modules/auth/events/auth.events.d.ts.map +1 -1
- package/dist/modules/auth/events/auth.events.js +17 -9
- package/dist/modules/auth/events/auth.events.js.map +1 -1
- package/dist/modules/auth/services/account.service.d.ts +74 -14
- package/dist/modules/auth/services/account.service.d.ts.map +1 -1
- package/dist/modules/auth/services/account.service.js +247 -31
- package/dist/modules/auth/services/account.service.js.map +1 -1
- package/dist/modules/auth/services/dpop.service.d.ts +41 -0
- package/dist/modules/auth/services/dpop.service.d.ts.map +1 -0
- package/dist/modules/auth/services/dpop.service.js +159 -0
- package/dist/modules/auth/services/dpop.service.js.map +1 -0
- package/dist/modules/auth/services/index.d.ts +2 -0
- package/dist/modules/auth/services/index.d.ts.map +1 -1
- package/dist/modules/auth/services/index.js +2 -0
- package/dist/modules/auth/services/index.js.map +1 -1
- package/dist/modules/auth/services/legacy-hash-cleanup.service.d.ts +28 -0
- package/dist/modules/auth/services/legacy-hash-cleanup.service.d.ts.map +1 -0
- package/dist/modules/auth/services/legacy-hash-cleanup.service.js +163 -0
- package/dist/modules/auth/services/legacy-hash-cleanup.service.js.map +1 -0
- package/dist/modules/auth/services/login.service.d.ts +29 -34
- package/dist/modules/auth/services/login.service.d.ts.map +1 -1
- package/dist/modules/auth/services/login.service.js +173 -61
- package/dist/modules/auth/services/login.service.js.map +1 -1
- package/dist/modules/auth/services/mfa.service.d.ts +111 -0
- package/dist/modules/auth/services/mfa.service.d.ts.map +1 -0
- package/dist/modules/auth/services/mfa.service.js +662 -0
- package/dist/modules/auth/services/mfa.service.js.map +1 -0
- package/dist/modules/auth/services/oauth/apple-id-token.verifier.d.ts +11 -0
- package/dist/modules/auth/services/oauth/apple-id-token.verifier.d.ts.map +1 -0
- package/dist/modules/auth/services/oauth/apple-id-token.verifier.js +56 -0
- package/dist/modules/auth/services/oauth/apple-id-token.verifier.js.map +1 -0
- package/dist/modules/auth/services/oauth/google-id-token.verifier.d.ts +12 -0
- package/dist/modules/auth/services/oauth/google-id-token.verifier.d.ts.map +1 -0
- package/dist/modules/auth/services/oauth/google-id-token.verifier.js +64 -0
- package/dist/modules/auth/services/oauth/google-id-token.verifier.js.map +1 -0
- package/dist/modules/auth/services/oauth/microsoft-id-token.verifier.d.ts +11 -0
- package/dist/modules/auth/services/oauth/microsoft-id-token.verifier.d.ts.map +1 -0
- package/dist/modules/auth/services/oauth/microsoft-id-token.verifier.js +76 -0
- package/dist/modules/auth/services/oauth/microsoft-id-token.verifier.js.map +1 -0
- package/dist/modules/auth/services/oauth/oidc-id-token.verifier.d.ts +16 -0
- package/dist/modules/auth/services/oauth/oidc-id-token.verifier.d.ts.map +1 -0
- package/dist/modules/auth/services/oauth/oidc-id-token.verifier.js +92 -0
- package/dist/modules/auth/services/oauth/oidc-id-token.verifier.js.map +1 -0
- package/dist/modules/auth/services/oauth/verified-oauth-identity.d.ts +9 -0
- package/dist/modules/auth/services/oauth/verified-oauth-identity.d.ts.map +1 -0
- package/dist/modules/auth/services/oauth/verified-oauth-identity.js +3 -0
- package/dist/modules/auth/services/oauth/verified-oauth-identity.js.map +1 -0
- package/dist/modules/auth/services/oauth.service.d.ts +83 -0
- package/dist/modules/auth/services/oauth.service.d.ts.map +1 -0
- package/dist/modules/auth/services/oauth.service.js +471 -0
- package/dist/modules/auth/services/oauth.service.js.map +1 -0
- package/dist/modules/auth/services/otp-auth.service.d.ts +13 -3
- package/dist/modules/auth/services/otp-auth.service.d.ts.map +1 -1
- package/dist/modules/auth/services/otp-auth.service.js +41 -7
- package/dist/modules/auth/services/otp-auth.service.js.map +1 -1
- package/dist/modules/auth/services/password-reset-audit-retention.service.d.ts +22 -0
- package/dist/modules/auth/services/password-reset-audit-retention.service.d.ts.map +1 -0
- package/dist/modules/auth/services/password-reset-audit-retention.service.js +117 -0
- package/dist/modules/auth/services/password-reset-audit-retention.service.js.map +1 -0
- package/dist/modules/auth/services/password.service.d.ts +25 -5
- package/dist/modules/auth/services/password.service.d.ts.map +1 -1
- package/dist/modules/auth/services/password.service.js +154 -20
- package/dist/modules/auth/services/password.service.js.map +1 -1
- package/dist/modules/auth/services/pin-auth.service.d.ts +10 -3
- package/dist/modules/auth/services/pin-auth.service.d.ts.map +1 -1
- package/dist/modules/auth/services/pin-auth.service.js +110 -13
- package/dist/modules/auth/services/pin-auth.service.js.map +1 -1
- package/dist/modules/auth/services/registration.service.d.ts +10 -2
- package/dist/modules/auth/services/registration.service.d.ts.map +1 -1
- package/dist/modules/auth/services/registration.service.js +113 -25
- package/dist/modules/auth/services/registration.service.js.map +1 -1
- package/dist/modules/auth/services/turnstile.service.d.ts +17 -0
- package/dist/modules/auth/services/turnstile.service.d.ts.map +1 -0
- package/dist/modules/auth/services/turnstile.service.js +94 -0
- package/dist/modules/auth/services/turnstile.service.js.map +1 -0
- package/dist/modules/auth/utils/auth-params.util.d.ts +13 -6
- package/dist/modules/auth/utils/auth-params.util.d.ts.map +1 -1
- package/dist/modules/auth/utils/auth-params.util.js +27 -4
- package/dist/modules/auth/utils/auth-params.util.js.map +1 -1
- package/dist/modules/auth/utils/auth-supported.util.d.ts +12 -1
- package/dist/modules/auth/utils/auth-supported.util.d.ts.map +1 -1
- package/dist/modules/auth/utils/auth-supported.util.js +36 -4
- package/dist/modules/auth/utils/auth-supported.util.js.map +1 -1
- package/dist/modules/auth/utils/backup-code-hash.util.d.ts +10 -0
- package/dist/modules/auth/utils/backup-code-hash.util.d.ts.map +1 -0
- package/dist/modules/auth/utils/backup-code-hash.util.js +31 -0
- package/dist/modules/auth/utils/backup-code-hash.util.js.map +1 -0
- package/dist/modules/auth/utils/backup-codes.util.d.ts +5 -0
- package/dist/modules/auth/utils/backup-codes.util.d.ts.map +1 -0
- package/dist/modules/auth/utils/backup-codes.util.js +22 -0
- package/dist/modules/auth/utils/backup-codes.util.js.map +1 -0
- package/dist/modules/auth/utils/dpop.util.d.ts +22 -0
- package/dist/modules/auth/utils/dpop.util.d.ts.map +1 -0
- package/dist/modules/auth/utils/dpop.util.js +73 -0
- package/dist/modules/auth/utils/dpop.util.js.map +1 -0
- package/dist/modules/auth/utils/mfa-secret.util.d.ts +22 -0
- package/dist/modules/auth/utils/mfa-secret.util.d.ts.map +1 -0
- package/dist/modules/auth/utils/mfa-secret.util.js +59 -0
- package/dist/modules/auth/utils/mfa-secret.util.js.map +1 -0
- package/dist/modules/auth/utils/mfa-verify-params.util.d.ts +26 -0
- package/dist/modules/auth/utils/mfa-verify-params.util.d.ts.map +1 -0
- package/dist/modules/auth/utils/mfa-verify-params.util.js +49 -0
- package/dist/modules/auth/utils/mfa-verify-params.util.js.map +1 -0
- package/dist/modules/auth/utils/step-up-purpose.util.d.ts +5 -0
- package/dist/modules/auth/utils/step-up-purpose.util.d.ts.map +1 -0
- package/dist/modules/auth/utils/step-up-purpose.util.js +18 -0
- package/dist/modules/auth/utils/step-up-purpose.util.js.map +1 -0
- package/dist/modules/auth/utils/totp.util.d.ts +16 -0
- package/dist/modules/auth/utils/totp.util.d.ts.map +1 -0
- package/dist/modules/auth/utils/totp.util.js +88 -0
- package/dist/modules/auth/utils/totp.util.js.map +1 -0
- package/dist/modules/delivery/composers/otp-delivery.composer.d.ts +28 -1
- package/dist/modules/delivery/composers/otp-delivery.composer.d.ts.map +1 -1
- package/dist/modules/delivery/composers/otp-delivery.composer.js +48 -2
- package/dist/modules/delivery/composers/otp-delivery.composer.js.map +1 -1
- package/dist/modules/delivery/constants/delivery-worker.constants.d.ts +29 -0
- package/dist/modules/delivery/constants/delivery-worker.constants.d.ts.map +1 -0
- package/dist/modules/delivery/constants/delivery-worker.constants.js +51 -0
- package/dist/modules/delivery/constants/delivery-worker.constants.js.map +1 -0
- package/dist/modules/delivery/delivery.module.d.ts.map +1 -1
- package/dist/modules/delivery/delivery.module.js +1 -15
- package/dist/modules/delivery/delivery.module.js.map +1 -1
- package/dist/modules/delivery/entities/notification-delivery-log.entity.d.ts.map +1 -1
- package/dist/modules/delivery/entities/notification-delivery-log.entity.js +3 -1
- package/dist/modules/delivery/entities/notification-delivery-log.entity.js.map +1 -1
- package/dist/modules/delivery/notification-delivery.service.d.ts +12 -1
- package/dist/modules/delivery/notification-delivery.service.d.ts.map +1 -1
- package/dist/modules/delivery/notification-delivery.service.js +121 -40
- package/dist/modules/delivery/notification-delivery.service.js.map +1 -1
- package/dist/modules/delivery/processors/delivery-job.runner.d.ts +22 -1
- package/dist/modules/delivery/processors/delivery-job.runner.d.ts.map +1 -1
- package/dist/modules/delivery/processors/delivery-job.runner.js +144 -42
- package/dist/modules/delivery/processors/delivery-job.runner.js.map +1 -1
- package/dist/modules/delivery/processors/delivery.processor.d.ts.map +1 -1
- package/dist/modules/delivery/processors/delivery.processor.js +6 -1
- package/dist/modules/delivery/processors/delivery.processor.js.map +1 -1
- package/dist/modules/delivery/processors/otp-delivery-job.runner.d.ts +11 -0
- package/dist/modules/delivery/processors/otp-delivery-job.runner.d.ts.map +1 -1
- package/dist/modules/delivery/processors/otp-delivery-job.runner.js +90 -16
- package/dist/modules/delivery/processors/otp-delivery-job.runner.js.map +1 -1
- package/dist/modules/delivery/processors/otp-delivery.processor.d.ts.map +1 -1
- package/dist/modules/delivery/processors/otp-delivery.processor.js +6 -1
- package/dist/modules/delivery/processors/otp-delivery.processor.js.map +1 -1
- package/dist/modules/delivery/queues/sync-jobs.queue.d.ts +7 -1
- package/dist/modules/delivery/queues/sync-jobs.queue.d.ts.map +1 -1
- package/dist/modules/delivery/queues/sync-jobs.queue.js +11 -2
- package/dist/modules/delivery/queues/sync-jobs.queue.js.map +1 -1
- package/dist/modules/delivery/services/delivery-audit-retention.service.d.ts +7 -3
- package/dist/modules/delivery/services/delivery-audit-retention.service.d.ts.map +1 -1
- package/dist/modules/delivery/services/delivery-audit-retention.service.js +33 -10
- package/dist/modules/delivery/services/delivery-audit-retention.service.js.map +1 -1
- package/dist/modules/delivery/services/notification-audit.service.d.ts +7 -4
- package/dist/modules/delivery/services/notification-audit.service.d.ts.map +1 -1
- package/dist/modules/delivery/services/notification-audit.service.js +83 -26
- package/dist/modules/delivery/services/notification-audit.service.js.map +1 -1
- package/dist/modules/delivery/utils/payload-snapshot.util.d.ts +2 -0
- package/dist/modules/delivery/utils/payload-snapshot.util.d.ts.map +1 -1
- package/dist/modules/delivery/utils/payload-snapshot.util.js +22 -3
- package/dist/modules/delivery/utils/payload-snapshot.util.js.map +1 -1
- package/dist/modules/file-upload/controllers/file-upload.controller.d.ts +7 -1
- package/dist/modules/file-upload/controllers/file-upload.controller.d.ts.map +1 -1
- package/dist/modules/file-upload/controllers/file-upload.controller.js +5 -7
- package/dist/modules/file-upload/controllers/file-upload.controller.js.map +1 -1
- package/dist/modules/file-upload/dto/file-upload.dto.d.ts +2 -0
- package/dist/modules/file-upload/dto/file-upload.dto.d.ts.map +1 -1
- package/dist/modules/file-upload/dto/file-upload.dto.js +20 -0
- package/dist/modules/file-upload/dto/file-upload.dto.js.map +1 -1
- package/dist/modules/file-upload/file-upload.module.d.ts.map +1 -1
- package/dist/modules/file-upload/file-upload.module.js +12 -2
- package/dist/modules/file-upload/file-upload.module.js.map +1 -1
- package/dist/modules/file-upload/services/file-upload.service.d.ts +24 -6
- package/dist/modules/file-upload/services/file-upload.service.d.ts.map +1 -1
- package/dist/modules/file-upload/services/file-upload.service.js +164 -36
- package/dist/modules/file-upload/services/file-upload.service.js.map +1 -1
- package/dist/modules/file-upload/services/upload-orphan-cleanup.service.d.ts +4 -2
- package/dist/modules/file-upload/services/upload-orphan-cleanup.service.d.ts.map +1 -1
- package/dist/modules/file-upload/services/upload-orphan-cleanup.service.js +30 -5
- package/dist/modules/file-upload/services/upload-orphan-cleanup.service.js.map +1 -1
- package/dist/modules/file-upload/utils/image-optimize.util.d.ts.map +1 -1
- package/dist/modules/file-upload/utils/image-optimize.util.js +7 -1
- package/dist/modules/file-upload/utils/image-optimize.util.js.map +1 -1
- package/dist/modules/health/health.controller.d.ts +5 -1
- package/dist/modules/health/health.controller.d.ts.map +1 -1
- package/dist/modules/health/health.controller.js +57 -3
- package/dist/modules/health/health.controller.js.map +1 -1
- package/dist/modules/invitations/controllers/invitations.controller.d.ts +19 -4
- package/dist/modules/invitations/controllers/invitations.controller.d.ts.map +1 -1
- package/dist/modules/invitations/controllers/invitations.controller.js +19 -10
- package/dist/modules/invitations/controllers/invitations.controller.js.map +1 -1
- package/dist/modules/invitations/dto/invitation.dto.d.ts +13 -0
- package/dist/modules/invitations/dto/invitation.dto.d.ts.map +1 -1
- package/dist/modules/invitations/dto/invitation.dto.js +69 -2
- package/dist/modules/invitations/dto/invitation.dto.js.map +1 -1
- package/dist/modules/invitations/services/invitations.service.d.ts +24 -6
- package/dist/modules/invitations/services/invitations.service.d.ts.map +1 -1
- package/dist/modules/invitations/services/invitations.service.js +96 -20
- package/dist/modules/invitations/services/invitations.service.js.map +1 -1
- package/dist/modules/jobs/queues/jobs.queue.d.ts +7 -2
- package/dist/modules/jobs/queues/jobs.queue.d.ts.map +1 -1
- package/dist/modules/jobs/queues/jobs.queue.js +25 -10
- package/dist/modules/jobs/queues/jobs.queue.js.map +1 -1
- package/dist/modules/notifications/controllers/notifications.controller.d.ts +3 -1
- package/dist/modules/notifications/controllers/notifications.controller.d.ts.map +1 -1
- package/dist/modules/notifications/controllers/notifications.controller.js +25 -2
- package/dist/modules/notifications/controllers/notifications.controller.js.map +1 -1
- package/dist/modules/notifications/dto/notification-query.dto.d.ts.map +1 -1
- package/dist/modules/notifications/dto/notification-query.dto.js +1 -0
- package/dist/modules/notifications/dto/notification-query.dto.js.map +1 -1
- package/dist/modules/notifications/entities/device-token.entity.d.ts.map +1 -1
- package/dist/modules/notifications/entities/device-token.entity.js +3 -1
- package/dist/modules/notifications/entities/device-token.entity.js.map +1 -1
- package/dist/modules/notifications/services/fcm.service.d.ts +2 -0
- package/dist/modules/notifications/services/fcm.service.d.ts.map +1 -1
- package/dist/modules/notifications/services/fcm.service.js +28 -7
- package/dist/modules/notifications/services/fcm.service.js.map +1 -1
- package/dist/modules/notifications/services/notifications.service.d.ts +16 -3
- package/dist/modules/notifications/services/notifications.service.d.ts.map +1 -1
- package/dist/modules/notifications/services/notifications.service.js +95 -24
- package/dist/modules/notifications/services/notifications.service.js.map +1 -1
- package/dist/modules/observability/metrics/metrics.service.d.ts +2 -0
- package/dist/modules/observability/metrics/metrics.service.d.ts.map +1 -1
- package/dist/modules/observability/metrics/metrics.service.js +11 -0
- package/dist/modules/observability/metrics/metrics.service.js.map +1 -1
- package/dist/modules/otp/constants/otp.constants.d.ts +7 -5
- package/dist/modules/otp/constants/otp.constants.d.ts.map +1 -1
- package/dist/modules/otp/constants/otp.constants.js +11 -8
- package/dist/modules/otp/constants/otp.constants.js.map +1 -1
- package/dist/modules/otp/interfaces/otp.service.interface.d.ts +1 -1
- package/dist/modules/otp/interfaces/otp.service.interface.d.ts.map +1 -1
- package/dist/modules/otp/otp.service.d.ts +10 -2
- package/dist/modules/otp/otp.service.d.ts.map +1 -1
- package/dist/modules/otp/otp.service.js +48 -4
- package/dist/modules/otp/otp.service.js.map +1 -1
- package/dist/modules/otp/services/otp.rate-limiter.d.ts +2 -0
- package/dist/modules/otp/services/otp.rate-limiter.d.ts.map +1 -1
- package/dist/modules/otp/services/otp.rate-limiter.js +19 -0
- package/dist/modules/otp/services/otp.rate-limiter.js.map +1 -1
- package/dist/modules/otp/services/otp.session.store.d.ts +9 -3
- package/dist/modules/otp/services/otp.session.store.d.ts.map +1 -1
- package/dist/modules/otp/services/otp.session.store.js +34 -42
- package/dist/modules/otp/services/otp.session.store.js.map +1 -1
- package/dist/modules/otp/utils/otp-code-hash.util.d.ts +11 -0
- package/dist/modules/otp/utils/otp-code-hash.util.d.ts.map +1 -0
- package/dist/modules/otp/utils/otp-code-hash.util.js +68 -0
- package/dist/modules/otp/utils/otp-code-hash.util.js.map +1 -0
- package/dist/modules/profile/controllers/profile.controller.d.ts +9 -3
- package/dist/modules/profile/controllers/profile.controller.d.ts.map +1 -1
- package/dist/modules/profile/controllers/profile.controller.js +140 -8
- package/dist/modules/profile/controllers/profile.controller.js.map +1 -1
- package/dist/modules/profile/dto/create-user-profile.dto.d.ts +10 -0
- package/dist/modules/profile/dto/create-user-profile.dto.d.ts.map +1 -1
- package/dist/modules/profile/dto/create-user-profile.dto.js +43 -1
- package/dist/modules/profile/dto/create-user-profile.dto.js.map +1 -1
- package/dist/modules/profile/dto/public-user-profile.dto.d.ts +24 -0
- package/dist/modules/profile/dto/public-user-profile.dto.d.ts.map +1 -0
- package/dist/modules/profile/dto/public-user-profile.dto.js +115 -0
- package/dist/modules/profile/dto/public-user-profile.dto.js.map +1 -0
- package/dist/modules/profile/dto/user-profile-response.dto.d.ts +4 -0
- package/dist/modules/profile/dto/user-profile-response.dto.d.ts.map +1 -1
- package/dist/modules/profile/dto/user-profile-response.dto.js +4 -0
- package/dist/modules/profile/dto/user-profile-response.dto.js.map +1 -1
- package/dist/modules/profile/dto/username-available.dto.d.ts +6 -0
- package/dist/modules/profile/dto/username-available.dto.d.ts.map +1 -0
- package/dist/modules/profile/dto/username-available.dto.js +31 -0
- package/dist/modules/profile/dto/username-available.dto.js.map +1 -0
- package/dist/modules/profile/entities/user-profiles.entity.d.ts +10 -0
- package/dist/modules/profile/entities/user-profiles.entity.d.ts.map +1 -1
- package/dist/modules/profile/entities/user-profiles.entity.js +29 -1
- package/dist/modules/profile/entities/user-profiles.entity.js.map +1 -1
- package/dist/modules/profile/index.d.ts +1 -0
- package/dist/modules/profile/index.d.ts.map +1 -1
- package/dist/modules/profile/index.js +1 -0
- package/dist/modules/profile/index.js.map +1 -1
- package/dist/modules/profile/profile.manifest.d.ts +2 -2
- package/dist/modules/profile/profile.manifest.js +2 -2
- package/dist/modules/profile/profile.manifest.js.map +1 -1
- package/dist/modules/profile/profile.module.d.ts.map +1 -1
- package/dist/modules/profile/profile.module.js +7 -2
- package/dist/modules/profile/profile.module.js.map +1 -1
- package/dist/modules/profile/services/profile.service.d.ts +56 -4
- package/dist/modules/profile/services/profile.service.d.ts.map +1 -1
- package/dist/modules/profile/services/profile.service.js +247 -20
- package/dist/modules/profile/services/profile.service.js.map +1 -1
- package/dist/modules/realtime/adapters/redis-io.adapter.d.ts +26 -0
- package/dist/modules/realtime/adapters/redis-io.adapter.d.ts.map +1 -0
- package/dist/modules/realtime/adapters/redis-io.adapter.js +124 -0
- package/dist/modules/realtime/adapters/redis-io.adapter.js.map +1 -0
- package/dist/modules/realtime/constants/realtime.constants.d.ts +36 -0
- package/dist/modules/realtime/constants/realtime.constants.d.ts.map +1 -0
- package/dist/modules/realtime/constants/realtime.constants.js +42 -0
- package/dist/modules/realtime/constants/realtime.constants.js.map +1 -0
- package/dist/modules/realtime/controllers/realtime.controller.d.ts +21 -0
- package/dist/modules/realtime/controllers/realtime.controller.d.ts.map +1 -0
- package/dist/modules/realtime/controllers/realtime.controller.js +113 -0
- package/dist/modules/realtime/controllers/realtime.controller.js.map +1 -0
- package/dist/modules/realtime/gateway/realtime.gateway.d.ts +42 -0
- package/dist/modules/realtime/gateway/realtime.gateway.d.ts.map +1 -0
- package/dist/modules/realtime/gateway/realtime.gateway.js +289 -0
- package/dist/modules/realtime/gateway/realtime.gateway.js.map +1 -0
- package/dist/modules/realtime/index.d.ts +12 -0
- package/dist/modules/realtime/index.d.ts.map +1 -0
- package/dist/modules/realtime/index.js +35 -0
- package/dist/modules/realtime/index.js.map +1 -0
- package/dist/modules/realtime/realtime.manifest.d.ts +8 -0
- package/dist/modules/realtime/realtime.manifest.d.ts.map +1 -0
- package/dist/modules/realtime/realtime.manifest.js +31 -0
- package/dist/modules/realtime/realtime.manifest.js.map +1 -0
- package/dist/modules/realtime/realtime.module.d.ts +14 -0
- package/dist/modules/realtime/realtime.module.d.ts.map +1 -0
- package/dist/modules/realtime/realtime.module.js +126 -0
- package/dist/modules/realtime/realtime.module.js.map +1 -0
- package/dist/modules/realtime/services/realtime-handler.registry.d.ts +16 -0
- package/dist/modules/realtime/services/realtime-handler.registry.d.ts.map +1 -0
- package/dist/modules/realtime/services/realtime-handler.registry.js +55 -0
- package/dist/modules/realtime/services/realtime-handler.registry.js.map +1 -0
- package/dist/modules/realtime/services/realtime-presence.service.d.ts +15 -0
- package/dist/modules/realtime/services/realtime-presence.service.d.ts.map +1 -0
- package/dist/modules/realtime/services/realtime-presence.service.js +86 -0
- package/dist/modules/realtime/services/realtime-presence.service.js.map +1 -0
- package/dist/modules/realtime/services/realtime-rate-limiter.service.d.ts +12 -0
- package/dist/modules/realtime/services/realtime-rate-limiter.service.d.ts.map +1 -0
- package/dist/modules/realtime/services/realtime-rate-limiter.service.js +63 -0
- package/dist/modules/realtime/services/realtime-rate-limiter.service.js.map +1 -0
- package/dist/modules/realtime/services/realtime.service.d.ts +88 -0
- package/dist/modules/realtime/services/realtime.service.d.ts.map +1 -0
- package/dist/modules/realtime/services/realtime.service.js +343 -0
- package/dist/modules/realtime/services/realtime.service.js.map +1 -0
- package/dist/modules/realtime/types/realtime.types.d.ts +50 -0
- package/dist/modules/realtime/types/realtime.types.d.ts.map +1 -0
- package/dist/modules/realtime/types/realtime.types.js +14 -0
- package/dist/modules/realtime/types/realtime.types.js.map +1 -0
- package/dist/modules/realtime/utils/handshake-error.util.d.ts +5 -0
- package/dist/modules/realtime/utils/handshake-error.util.d.ts.map +1 -0
- package/dist/modules/realtime/utils/handshake-error.util.js +45 -0
- package/dist/modules/realtime/utils/handshake-error.util.js.map +1 -0
- package/dist/modules/roles/controllers/modules.controller.d.ts +4 -3
- package/dist/modules/roles/controllers/modules.controller.d.ts.map +1 -1
- package/dist/modules/roles/controllers/modules.controller.js +21 -10
- package/dist/modules/roles/controllers/modules.controller.js.map +1 -1
- package/dist/modules/roles/controllers/permissions.controller.d.ts +4 -3
- package/dist/modules/roles/controllers/permissions.controller.d.ts.map +1 -1
- package/dist/modules/roles/controllers/permissions.controller.js +21 -10
- package/dist/modules/roles/controllers/permissions.controller.js.map +1 -1
- package/dist/modules/roles/controllers/roles.controller.d.ts +5 -4
- package/dist/modules/roles/controllers/roles.controller.d.ts.map +1 -1
- package/dist/modules/roles/controllers/roles.controller.js +26 -13
- package/dist/modules/roles/controllers/roles.controller.js.map +1 -1
- package/dist/modules/roles/controllers/user-roles.controller.d.ts +3 -2
- package/dist/modules/roles/controllers/user-roles.controller.d.ts.map +1 -1
- package/dist/modules/roles/controllers/user-roles.controller.js +14 -6
- package/dist/modules/roles/controllers/user-roles.controller.js.map +1 -1
- package/dist/modules/roles/services/modules.service.d.ts +8 -5
- package/dist/modules/roles/services/modules.service.d.ts.map +1 -1
- package/dist/modules/roles/services/modules.service.js +58 -12
- package/dist/modules/roles/services/modules.service.js.map +1 -1
- package/dist/modules/roles/services/permissions.service.d.ts +8 -5
- package/dist/modules/roles/services/permissions.service.d.ts.map +1 -1
- package/dist/modules/roles/services/permissions.service.js +61 -12
- package/dist/modules/roles/services/permissions.service.js.map +1 -1
- package/dist/modules/roles/services/roles.service.d.ts +19 -9
- package/dist/modules/roles/services/roles.service.d.ts.map +1 -1
- package/dist/modules/roles/services/roles.service.js +137 -47
- package/dist/modules/roles/services/roles.service.js.map +1 -1
- package/dist/modules/roles/services/user-roles.service.d.ts +12 -4
- package/dist/modules/roles/services/user-roles.service.d.ts.map +1 -1
- package/dist/modules/roles/services/user-roles.service.js +58 -26
- package/dist/modules/roles/services/user-roles.service.js.map +1 -1
- package/dist/modules/sessions/entities/refresh-token.entity.d.ts +7 -1
- package/dist/modules/sessions/entities/refresh-token.entity.d.ts.map +1 -1
- package/dist/modules/sessions/entities/refresh-token.entity.js +10 -0
- package/dist/modules/sessions/entities/refresh-token.entity.js.map +1 -1
- package/dist/modules/sessions/entities/revoked-refresh-family.entity.d.ts +12 -0
- package/dist/modules/sessions/entities/revoked-refresh-family.entity.d.ts.map +1 -0
- package/dist/modules/sessions/entities/revoked-refresh-family.entity.js +46 -0
- package/dist/modules/sessions/entities/revoked-refresh-family.entity.js.map +1 -0
- package/dist/modules/sessions/services/refresh-token-retention.service.d.ts +20 -0
- package/dist/modules/sessions/services/refresh-token-retention.service.d.ts.map +1 -0
- package/dist/modules/sessions/services/refresh-token-retention.service.js +97 -0
- package/dist/modules/sessions/services/refresh-token-retention.service.js.map +1 -0
- package/dist/modules/sessions/services/token.service.d.ts +150 -16
- package/dist/modules/sessions/services/token.service.d.ts.map +1 -1
- package/dist/modules/sessions/services/token.service.js +505 -74
- package/dist/modules/sessions/services/token.service.js.map +1 -1
- package/dist/modules/sessions/sessions.module.d.ts.map +1 -1
- package/dist/modules/sessions/sessions.module.js +4 -2
- package/dist/modules/sessions/sessions.module.js.map +1 -1
- package/dist/modules/sessions/utils/refresh-token-hash.util.d.ts +13 -0
- package/dist/modules/sessions/utils/refresh-token-hash.util.d.ts.map +1 -0
- package/dist/modules/sessions/utils/refresh-token-hash.util.js +37 -0
- package/dist/modules/sessions/utils/refresh-token-hash.util.js.map +1 -0
- package/dist/modules/settings/constants/settings.defaults.d.ts +57 -3
- package/dist/modules/settings/constants/settings.defaults.d.ts.map +1 -1
- package/dist/modules/settings/constants/settings.defaults.js +58 -3
- package/dist/modules/settings/constants/settings.defaults.js.map +1 -1
- package/dist/modules/settings/constants/settings.keys.d.ts +138 -2
- package/dist/modules/settings/constants/settings.keys.d.ts.map +1 -1
- package/dist/modules/settings/constants/settings.keys.js +140 -2
- package/dist/modules/settings/constants/settings.keys.js.map +1 -1
- package/dist/modules/settings/controllers/settings.controller.d.ts +5 -1
- package/dist/modules/settings/controllers/settings.controller.d.ts.map +1 -1
- package/dist/modules/settings/controllers/settings.controller.js +134 -5
- package/dist/modules/settings/controllers/settings.controller.js.map +1 -1
- package/dist/modules/settings/services/settings.service.d.ts +17 -7
- package/dist/modules/settings/services/settings.service.d.ts.map +1 -1
- package/dist/modules/settings/services/settings.service.js +80 -14
- package/dist/modules/settings/services/settings.service.js.map +1 -1
- package/dist/modules/settings/utils/settings-secret.util.d.ts +13 -0
- package/dist/modules/settings/utils/settings-secret.util.d.ts.map +1 -0
- package/dist/modules/settings/utils/settings-secret.util.js +80 -0
- package/dist/modules/settings/utils/settings-secret.util.js.map +1 -0
- package/dist/modules/users/controllers/users.controller.d.ts +4 -2
- package/dist/modules/users/controllers/users.controller.d.ts.map +1 -1
- package/dist/modules/users/controllers/users.controller.js +89 -10
- package/dist/modules/users/controllers/users.controller.js.map +1 -1
- package/dist/modules/users/dto/user.dto.d.ts +5 -0
- package/dist/modules/users/dto/user.dto.d.ts.map +1 -1
- package/dist/modules/users/dto/user.dto.js +46 -5
- package/dist/modules/users/dto/user.dto.js.map +1 -1
- package/dist/modules/users/entities/user.entity.d.ts +7 -1
- package/dist/modules/users/entities/user.entity.d.ts.map +1 -1
- package/dist/modules/users/entities/user.entity.js +10 -0
- package/dist/modules/users/entities/user.entity.js.map +1 -1
- package/dist/modules/users/services/users.service.d.ts +15 -2
- package/dist/modules/users/services/users.service.d.ts.map +1 -1
- package/dist/modules/users/services/users.service.js +152 -37
- package/dist/modules/users/services/users.service.js.map +1 -1
- package/dist/modules/users/users.module.d.ts.map +1 -1
- package/dist/modules/users/users.module.js +1 -2
- package/dist/modules/users/users.module.js.map +1 -1
- package/package.json +19 -7
- package/dist/modules/admin/entities/admin-log.entity.d.ts +0 -20
- package/dist/modules/admin/entities/admin-log.entity.d.ts.map +0 -1
- package/dist/modules/admin/entities/admin-log.entity.js +0 -65
- package/dist/modules/admin/entities/admin-log.entity.js.map +0 -1
|
@@ -53,21 +53,132 @@ exports.SETTING_KEYS = {
|
|
|
53
53
|
// ─── Auth ─────────────────────────────────────────────────────────────────
|
|
54
54
|
/** Primary identity method: "phone" | "email". */
|
|
55
55
|
AUTH_METHOD: 'auth.method',
|
|
56
|
-
/** Enabled login credential shapes: JSON string[] of "phone" | "email". */
|
|
56
|
+
/** Enabled login credential shapes: JSON string[] of "phone" | "email" | "oauth". */
|
|
57
57
|
AUTH_SUPPORTED_LOGIN_METHODS: 'auth.supported_login_methods',
|
|
58
|
-
/** Enabled registration credential shapes: JSON string[] of "phone" | "email". */
|
|
58
|
+
/** Enabled registration credential shapes: JSON string[] of "phone" | "email" | "oauth". */
|
|
59
59
|
AUTH_SUPPORTED_REGISTRATION_METHODS: 'auth.supported_registration_methods',
|
|
60
60
|
/** Role slug automatically assigned to every self-registered user. Empty string = no role. */
|
|
61
61
|
AUTH_DEFAULT_ROLE_SLUG: 'auth.default_role_slug',
|
|
62
|
+
/**
|
|
63
|
+
* When true, email/password login is rejected until `user.isEmailVerified` is true.
|
|
64
|
+
* OAuth / phone OTP paths are unaffected.
|
|
65
|
+
*/
|
|
66
|
+
AUTH_EMAIL_REQUIRE_VERIFIED_TO_LOGIN: 'auth.email.require_verified_to_login',
|
|
67
|
+
/** Global MFA kill-switch. When false, MFA challenges are never issued. */
|
|
68
|
+
AUTH_MFA_ENABLED: 'auth.mfa.enabled',
|
|
69
|
+
/**
|
|
70
|
+
* First-factor methods that trigger MFA when the user has MFA enrolled.
|
|
71
|
+
* JSON string[] of "phone" | "email" | "oauth". Default: phone + email + oauth.
|
|
72
|
+
*/
|
|
73
|
+
AUTH_MFA_REQUIRED_FOR_METHODS: 'auth.mfa.required_for_methods',
|
|
74
|
+
/** MFA challenge token TTL in seconds. */
|
|
75
|
+
AUTH_MFA_CHALLENGE_TTL_SECONDS: 'auth.mfa.challenge_ttl_seconds',
|
|
76
|
+
/** Max failed MFA attempts before temporary lockout. */
|
|
77
|
+
AUTH_MFA_MAX_ATTEMPTS: 'auth.mfa.max_attempts',
|
|
78
|
+
/** MFA lockout duration in seconds. */
|
|
79
|
+
AUTH_MFA_LOCKOUT_DURATION_SECONDS: 'auth.mfa.lockout_duration_seconds',
|
|
80
|
+
/** Issuer label shown in authenticator apps. */
|
|
81
|
+
AUTH_MFA_TOTP_ISSUER: 'auth.mfa.totp_issuer',
|
|
82
|
+
/** Number of one-time backup codes issued when enabling/regenerating MFA recovery codes. */
|
|
83
|
+
AUTH_MFA_BACKUP_CODES_COUNT: 'auth.mfa.backup_codes_count',
|
|
84
|
+
/** Step-up MFA token TTL in seconds (elevated session for sensitive actions). */
|
|
85
|
+
AUTH_MFA_STEP_UP_TTL_SECONDS: 'auth.mfa.step_up_ttl_seconds',
|
|
86
|
+
/** Enabled OAuth providers: JSON string[] of "google" | "apple" | "microsoft". */
|
|
87
|
+
AUTH_OAUTH_PROVIDERS: 'auth.oauth.providers',
|
|
88
|
+
/**
|
|
89
|
+
* Google OAuth client IDs allowed to mint ID tokens (iOS / Android / Web).
|
|
90
|
+
* JSON string[].
|
|
91
|
+
*/
|
|
92
|
+
AUTH_OAUTH_GOOGLE_CLIENT_IDS: 'auth.oauth.google.client_ids',
|
|
93
|
+
/** Google OAuth client secret for authorization-code + PKCE web exchange. */
|
|
94
|
+
AUTH_OAUTH_GOOGLE_CLIENT_SECRET: 'auth.oauth.google.client_secret',
|
|
95
|
+
/**
|
|
96
|
+
* Optional Google Workspace hosted domain restriction (`hd` claim).
|
|
97
|
+
* Empty string = no restriction.
|
|
98
|
+
*/
|
|
99
|
+
AUTH_OAUTH_GOOGLE_HOSTED_DOMAIN: 'auth.oauth.google.hosted_domain',
|
|
100
|
+
/** Apple Services ID / bundle IDs allowed as ID token audience. JSON string[]. */
|
|
101
|
+
AUTH_OAUTH_APPLE_CLIENT_IDS: 'auth.oauth.apple.client_ids',
|
|
102
|
+
/** Microsoft app (client) IDs allowed as ID token audience. JSON string[]. */
|
|
103
|
+
AUTH_OAUTH_MICROSOFT_CLIENT_IDS: 'auth.oauth.microsoft.client_ids',
|
|
104
|
+
/** Microsoft OAuth client secret for authorization-code + PKCE web exchange. */
|
|
105
|
+
AUTH_OAUTH_MICROSOFT_CLIENT_SECRET: 'auth.oauth.microsoft.client_secret',
|
|
106
|
+
/** Microsoft Entra tenant: "common", "organizations", "consumers", or a tenant GUID. */
|
|
107
|
+
AUTH_OAUTH_MICROSOFT_TENANT: 'auth.oauth.microsoft.tenant',
|
|
108
|
+
/**
|
|
109
|
+
* Allowed OAuth redirect URIs for web start/callback. JSON string[].
|
|
110
|
+
* Empty = web code flow disabled.
|
|
111
|
+
*/
|
|
112
|
+
AUTH_OAUTH_REDIRECT_URIS: 'auth.oauth.redirect_uris',
|
|
113
|
+
/**
|
|
114
|
+
* When true, a verified OAuth email matching an existing account auto-links on first OAuth login.
|
|
115
|
+
* When false (default), returns 409 and requires an authenticated link call.
|
|
116
|
+
*/
|
|
117
|
+
AUTH_OAUTH_AUTO_LINK_VERIFIED_EMAIL: 'auth.oauth.auto_link_verified_email',
|
|
118
|
+
/**
|
|
119
|
+
* When true, OAuth ID-token login/register/link require a matching `nonce`
|
|
120
|
+
* (same value used at the IdP). Disable only for legacy clients.
|
|
121
|
+
*/
|
|
122
|
+
AUTH_OAUTH_REQUIRE_ID_TOKEN_NONCE: 'auth.oauth.require_id_token_nonce',
|
|
123
|
+
/** Phone password-reset cool-off window in seconds (SIM-swap friction). */
|
|
124
|
+
AUTH_PASSWORD_RESET_PHONE_COOLDOWN_SECONDS: 'auth.password_reset.phone_cooldown_seconds',
|
|
125
|
+
/** Soft global OTP send budget per rolling day (0 = disabled). */
|
|
126
|
+
OTP_GLOBAL_DAILY_SEND_LIMIT: 'otp.global_daily_send_limit',
|
|
127
|
+
/** Require Cloudflare Turnstile on send-otp / resend-otp. */
|
|
128
|
+
AUTH_TURNSTILE_ENABLED: 'auth.turnstile.enabled',
|
|
129
|
+
/** Public Turnstile site key (also returned from GET /auth/config when enabled). */
|
|
130
|
+
AUTH_TURNSTILE_SITE_KEY: 'auth.turnstile.site_key',
|
|
131
|
+
/** Turnstile secret (encrypted at rest when ENCRYPTION_KEY is set). */
|
|
132
|
+
AUTH_TURNSTILE_SECRET_KEY: 'auth.turnstile.secret_key',
|
|
133
|
+
/**
|
|
134
|
+
* DPoP mode for access tokens: "off" | "optional" | "required".
|
|
135
|
+
* optional = bind when client sends DPoP; required = reject token issue without DPoP.
|
|
136
|
+
*/
|
|
137
|
+
AUTH_DPOP_MODE: 'auth.dpop.mode',
|
|
62
138
|
// ─── Login rate limiting & lockout ───────────────────────────────────────
|
|
63
139
|
/** Max login attempts per IP within the rate-limit window. */
|
|
64
140
|
LOGIN_IP_RATE_LIMIT_MAX: 'login.ip_rate_limit_max',
|
|
65
141
|
/** Rolling window (seconds) for the per-IP login rate limit. */
|
|
66
142
|
LOGIN_IP_RATE_LIMIT_WINDOW_SECONDS: 'login.ip_rate_limit_window_seconds',
|
|
143
|
+
/** Max refresh attempts per IP within the refresh rate-limit window. */
|
|
144
|
+
REFRESH_IP_RATE_LIMIT_MAX: 'refresh.ip_rate_limit_max',
|
|
145
|
+
/** Rolling window (seconds) for the per-IP refresh rate limit. */
|
|
146
|
+
REFRESH_IP_RATE_LIMIT_WINDOW_SECONDS: 'refresh.ip_rate_limit_window_seconds',
|
|
147
|
+
/**
|
|
148
|
+
* Max attempts per IP for public auth endpoints that are not login/refresh
|
|
149
|
+
* (register, forgot-password, OAuth start).
|
|
150
|
+
*/
|
|
151
|
+
AUTH_PUBLIC_IP_RATE_LIMIT_MAX: 'auth.public_ip_rate_limit_max',
|
|
152
|
+
/** Rolling window (seconds) for the public-auth IP rate limit. */
|
|
153
|
+
AUTH_PUBLIC_IP_RATE_LIMIT_WINDOW_SECONDS: 'auth.public_ip_rate_limit_window_seconds',
|
|
154
|
+
/** Max GET /profile/u/:username attempts per IP within the window. */
|
|
155
|
+
PROFILE_PUBLIC_IP_RATE_LIMIT_MAX: 'profile.public_ip_rate_limit_max',
|
|
156
|
+
/** Rolling window (seconds) for public profile IP rate limit. */
|
|
157
|
+
PROFILE_PUBLIC_IP_RATE_LIMIT_WINDOW_SECONDS: 'profile.public_ip_rate_limit_window_seconds',
|
|
67
158
|
/** Failed login attempts (per identifier) before the account is temporarily locked. */
|
|
68
159
|
LOGIN_LOCKOUT_MAX_ATTEMPTS: 'login.lockout_max_attempts',
|
|
69
160
|
/** Duration (seconds) an identifier remains locked after exceeding max attempts. */
|
|
70
161
|
LOGIN_LOCKOUT_DURATION_SECONDS: 'login.lockout_duration_seconds',
|
|
162
|
+
/**
|
|
163
|
+
* Minimum seconds between last-login DB writes for the same user.
|
|
164
|
+
* Reduces hot-row churn under high login QPS (0 = write every login).
|
|
165
|
+
*/
|
|
166
|
+
LOGIN_LAST_LOGIN_MIN_INTERVAL_SECONDS: 'login.last_login_min_interval_seconds',
|
|
167
|
+
/** Days to retain revoked/expired refresh_tokens before hard-delete purge. */
|
|
168
|
+
SESSIONS_REFRESH_TOKEN_RETENTION_DAYS: 'sessions.refresh_token_retention_days',
|
|
169
|
+
/** Default page size for GET /auth/sessions. */
|
|
170
|
+
SESSIONS_LIST_PAGE_SIZE: 'sessions.list_page_size',
|
|
171
|
+
/** Max page size for GET /auth/sessions. */
|
|
172
|
+
SESSIONS_LIST_MAX_PAGE_SIZE: 'sessions.list_max_page_size',
|
|
173
|
+
/** Days to retain password_reset_tokens audit rows before hard-delete. */
|
|
174
|
+
AUTH_PASSWORD_RESET_AUDIT_RETENTION_DAYS: 'auth.password_reset_audit_retention_days',
|
|
175
|
+
// ─── Audit (compliance trail) ─────────────────────────────────────────────
|
|
176
|
+
/** Days to keep audit_events in hot Postgres before R2 archive + purge. */
|
|
177
|
+
AUDIT_HOT_RETENTION_DAYS: 'audit.hot_retention_days',
|
|
178
|
+
/** When true, daily job archives aged non-legal-hold events to R2 then purges. */
|
|
179
|
+
AUDIT_ARCHIVE_ENABLED: 'audit.archive_enabled',
|
|
180
|
+
/** Max rows returned by GET /audit/events/export. */
|
|
181
|
+
AUDIT_EXPORT_MAX_ROWS: 'audit.export_max_rows',
|
|
71
182
|
// ─── Health ───────────────────────────────────────────────────────────────
|
|
72
183
|
/** Node.js heap threshold in MB — triggers health warning when exceeded. */
|
|
73
184
|
HEALTH_MAX_HEAP_MB: 'health.max_heap_mb',
|
|
@@ -157,6 +268,15 @@ exports.SETTING_KEYS = {
|
|
|
157
268
|
PIN_MAX_ATTEMPTS: 'pin.max_attempts',
|
|
158
269
|
/** Duration (seconds) a PIN remains locked after exceeding max attempts. */
|
|
159
270
|
PIN_LOCKOUT_DURATION_SECONDS: 'pin.lockout_duration_seconds',
|
|
271
|
+
/** Max PIN verify attempts per user within the rate-limit window. */
|
|
272
|
+
PIN_VERIFY_RATE_LIMIT_MAX: 'pin.verify_rate_limit_max',
|
|
273
|
+
/** Rolling window (seconds) for per-user PIN verify rate limit. */
|
|
274
|
+
PIN_VERIFY_RATE_LIMIT_WINDOW_SECONDS: 'pin.verify_rate_limit_window_seconds',
|
|
275
|
+
/**
|
|
276
|
+
* Minimum seconds between lastVerifiedAt writes for the same PIN.
|
|
277
|
+
* Reduces hot-row churn under frequent unlock (0 = write every verify).
|
|
278
|
+
*/
|
|
279
|
+
PIN_LAST_VERIFIED_MIN_INTERVAL_SECONDS: 'pin.last_verified_min_interval_seconds',
|
|
160
280
|
// ─── Delivery audit ───────────────────────────────────────────────────────
|
|
161
281
|
/** Days to retain full payload snapshots on failed deliveries before redaction. */
|
|
162
282
|
DELIVERY_AUDIT_SNAPSHOT_RETENTION_DAYS: 'delivery.audit_snapshot_retention_days',
|
|
@@ -192,5 +312,23 @@ exports.SETTING_KEYS = {
|
|
|
192
312
|
FILES_UPLOAD_USER_RATE_LIMIT_MAX: 'files.upload.user_rate_limit_max',
|
|
193
313
|
/** Rolling window (seconds) for per-user upload rate limit. */
|
|
194
314
|
FILES_UPLOAD_USER_RATE_LIMIT_WINDOW_SECONDS: 'files.upload.user_rate_limit_window_seconds',
|
|
315
|
+
// ─── Realtime (WebSocket) ─────────────────────────────────────────────────
|
|
316
|
+
/** Max JSON payload bytes for realtime emit/inbound. */
|
|
317
|
+
REALTIME_MAX_PAYLOAD_BYTES: 'realtime.max_payload_bytes',
|
|
318
|
+
/** Presence key TTL / heartbeat window (seconds). */
|
|
319
|
+
REALTIME_PRESENCE_TTL_SECONDS: 'realtime.presence_ttl_seconds',
|
|
320
|
+
/** Max handshake attempts per IP in the window. */
|
|
321
|
+
REALTIME_HANDSHAKE_IP_RATE_LIMIT_MAX: 'realtime.handshake.ip_rate_limit_max',
|
|
322
|
+
REALTIME_HANDSHAKE_IP_RATE_LIMIT_WINDOW_SECONDS: 'realtime.handshake.ip_rate_limit_window_seconds',
|
|
323
|
+
/** Max server emits attributed per user in the window. */
|
|
324
|
+
REALTIME_EMIT_USER_RATE_LIMIT_MAX: 'realtime.emit.user_rate_limit_max',
|
|
325
|
+
REALTIME_EMIT_USER_RATE_LIMIT_WINDOW_SECONDS: 'realtime.emit.user_rate_limit_window_seconds',
|
|
326
|
+
/** Max client→server inbound events per user in the window. */
|
|
327
|
+
REALTIME_INBOUND_USER_RATE_LIMIT_MAX: 'realtime.inbound.user_rate_limit_max',
|
|
328
|
+
REALTIME_INBOUND_USER_RATE_LIMIT_WINDOW_SECONDS: 'realtime.inbound.user_rate_limit_window_seconds',
|
|
329
|
+
/** Emit notification.created to the user socket when channel includes websocket. */
|
|
330
|
+
REALTIME_EMIT_NOTIFICATION_CREATED: 'realtime.emit.notification_created',
|
|
331
|
+
/** Emit session.revoked before force-disconnect. */
|
|
332
|
+
REALTIME_EMIT_SESSION_REVOKED: 'realtime.emit.session_revoked',
|
|
195
333
|
};
|
|
196
334
|
//# sourceMappingURL=settings.keys.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings.keys.js","sourceRoot":"","sources":["../../../../src/modules/settings/constants/settings.keys.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACU,QAAA,YAAY,GAAG;IAC3B,4EAA4E;IAC5E,yDAAyD;IACzD,eAAe,EAAE,iBAAiB;IAClC,oEAAoE;IACpE,gBAAgB,EAAE,kBAAkB;IACpC,gEAAgE;IAChE,2BAA2B,EAAE,6BAA6B;IAC1D,iEAAiE;IACjE,kBAAkB,EAAE,oBAAoB;IACxC,kEAAkE;IAClE,6BAA6B,EAAE,+BAA+B;IAC9D,4DAA4D;IAC5D,qBAAqB,EAAE,uBAAuB;IAC9C,8DAA8D;IAC9D,gCAAgC,EAAE,kCAAkC;IACpE,qDAAqD;IACrD,gBAAgB,EAAE,kBAAkB;IACpC,2CAA2C;IAC3C,iBAAiB,EAAE,mBAAmB;IACtC,4DAA4D;IAC5D,uBAAuB,EAAE,yBAAyB;IAClD,sEAAsE;IACtE,uBAAuB,EAAE,yBAAyB;IAClD,+CAA+C;IAC/C,eAAe,EAAE,iBAAiB;IAElC,6EAA6E;IAC7E,sCAAsC;IACtC,uBAAuB,EAAE,yBAAyB;IAClD,iDAAiD;IACjD,4BAA4B,EAAE,8BAA8B;IAC5D,yDAAyD;IACzD,wBAAwB,EAAE,0BAA0B;IACpD,oCAAoC;IACpC,sBAAsB,EAAE,wBAAwB;IAChD,gDAAgD;IAChD,iCAAiC,EAAE,mCAAmC;IAEtE,6EAA6E;IAC7E;;;;OAIG;IACH,oBAAoB,EAAE,sBAAsB;IAE5C,6EAA6E;IAC7E,kDAAkD;IAClD,WAAW,EAAE,aAAa;IAC1B,2EAA2E;IAC3E,4BAA4B,EAAE,8BAA8B;IAC5D,kFAAkF;IAClF,mCAAmC,EAAE,qCAAqC;IAC1E,
|
|
1
|
+
{"version":3,"file":"settings.keys.js","sourceRoot":"","sources":["../../../../src/modules/settings/constants/settings.keys.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACU,QAAA,YAAY,GAAG;IAC3B,4EAA4E;IAC5E,yDAAyD;IACzD,eAAe,EAAE,iBAAiB;IAClC,oEAAoE;IACpE,gBAAgB,EAAE,kBAAkB;IACpC,gEAAgE;IAChE,2BAA2B,EAAE,6BAA6B;IAC1D,iEAAiE;IACjE,kBAAkB,EAAE,oBAAoB;IACxC,kEAAkE;IAClE,6BAA6B,EAAE,+BAA+B;IAC9D,4DAA4D;IAC5D,qBAAqB,EAAE,uBAAuB;IAC9C,8DAA8D;IAC9D,gCAAgC,EAAE,kCAAkC;IACpE,qDAAqD;IACrD,gBAAgB,EAAE,kBAAkB;IACpC,2CAA2C;IAC3C,iBAAiB,EAAE,mBAAmB;IACtC,4DAA4D;IAC5D,uBAAuB,EAAE,yBAAyB;IAClD,sEAAsE;IACtE,uBAAuB,EAAE,yBAAyB;IAClD,+CAA+C;IAC/C,eAAe,EAAE,iBAAiB;IAElC,6EAA6E;IAC7E,sCAAsC;IACtC,uBAAuB,EAAE,yBAAyB;IAClD,iDAAiD;IACjD,4BAA4B,EAAE,8BAA8B;IAC5D,yDAAyD;IACzD,wBAAwB,EAAE,0BAA0B;IACpD,oCAAoC;IACpC,sBAAsB,EAAE,wBAAwB;IAChD,gDAAgD;IAChD,iCAAiC,EAAE,mCAAmC;IAEtE,6EAA6E;IAC7E;;;;OAIG;IACH,oBA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C9D,mDAAmD;IACnD,oCAAoC,EAAE,sCAAsC;IAC5E,+CAA+C,EAC9C,iDAAiD;IAClD,0DAA0D;IAC1D,iCAAiC,EAAE,mCAAmC;IACtE,4CAA4C,EAAE,8CAA8C;IAC5F,+DAA+D;IAC/D,oCAAoC,EAAE,sCAAsC;IAC5E,+CAA+C,EAC9C,iDAAiD;IAClD,oFAAoF;IACpF,kCAAkC,EAAE,oCAAoC;IACxE,oDAAoD;IACpD,6BAA6B,EAAE,+BAA+B;CACrD,CAAC"}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
+
import { DataSource } from 'typeorm';
|
|
2
|
+
import { AuditService } from '../../audit/services/audit.service';
|
|
1
3
|
import { UpdateSettingDto } from '../dto/settings.dto';
|
|
2
4
|
import { SettingsService } from '../services/settings.service';
|
|
3
5
|
export declare class SettingsController {
|
|
4
6
|
private readonly settingsService;
|
|
5
|
-
|
|
7
|
+
private readonly audit;
|
|
8
|
+
private readonly dataSource;
|
|
9
|
+
constructor(settingsService: SettingsService, audit: AuditService, dataSource: DataSource);
|
|
6
10
|
/**
|
|
7
11
|
* Returns all settings rows ordered by group then key.
|
|
8
12
|
* Requires: settings:read
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings.controller.d.ts","sourceRoot":"","sources":["../../../../src/modules/settings/controllers/settings.controller.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"settings.controller.d.ts","sourceRoot":"","sources":["../../../../src/modules/settings/controllers/settings.controller.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAMrC,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAQlE,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAQ/D,qBAIa,kBAAkB;IAE7B,OAAO,CAAC,QAAQ,CAAC,eAAe;IAChC,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,UAAU;gBAFV,eAAe,EAAE,eAAe,EAChC,KAAK,EAAE,YAAY,EACnB,UAAU,EAAE,UAAU;IAGxC;;;OAGG;IAUH,OAAO;IAIP;;;;OAIG;IAqBG,MAAM,CACG,GAAG,EAAE,MAAM,EACjB,GAAG,EAAE,gBAAgB,EACV,MAAM,EAAE,MAAM;;;;;CAyLlC"}
|
|
@@ -15,18 +15,26 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
15
15
|
exports.SettingsController = void 0;
|
|
16
16
|
const common_1 = require("@nestjs/common");
|
|
17
17
|
const swagger_1 = require("@nestjs/swagger");
|
|
18
|
+
const typeorm_1 = require("typeorm");
|
|
18
19
|
const decorators_1 = require("../../../common/decorators");
|
|
19
20
|
const auth_guard_1 = require("../../../common/guards/auth.guard");
|
|
20
21
|
const permissions_guard_1 = require("../../../common/guards/permissions.guard");
|
|
22
|
+
const audit_actions_1 = require("../../audit/constants/audit-actions");
|
|
23
|
+
const audit_service_1 = require("../../audit/services/audit.service");
|
|
21
24
|
const otp_constants_1 = require("../../otp/constants/otp.constants");
|
|
22
25
|
const settings_keys_1 = require("../constants/settings.keys");
|
|
23
26
|
const settings_dto_1 = require("../dto/settings.dto");
|
|
24
27
|
const settings_service_1 = require("../services/settings.service");
|
|
25
28
|
const settings_manifest_1 = require("../settings.manifest");
|
|
29
|
+
const settings_secret_util_1 = require("../utils/settings-secret.util");
|
|
26
30
|
let SettingsController = class SettingsController {
|
|
27
31
|
settingsService;
|
|
28
|
-
|
|
32
|
+
audit;
|
|
33
|
+
dataSource;
|
|
34
|
+
constructor(settingsService, audit, dataSource) {
|
|
29
35
|
this.settingsService = settingsService;
|
|
36
|
+
this.audit = audit;
|
|
37
|
+
this.dataSource = dataSource;
|
|
30
38
|
}
|
|
31
39
|
/**
|
|
32
40
|
* Returns all settings rows ordered by group then key.
|
|
@@ -50,11 +58,130 @@ let SettingsController = class SettingsController {
|
|
|
50
58
|
}
|
|
51
59
|
if (key === settings_keys_1.SETTING_KEYS.OTP_CODE_LENGTH) {
|
|
52
60
|
const parsed = parseInt(String(dto.value), 10);
|
|
53
|
-
|
|
54
|
-
|
|
61
|
+
const min = process.env.NODE_ENV === 'production' ? otp_constants_1.OTP_PROD_MIN_LENGTH : otp_constants_1.OTP_MIN_LENGTH;
|
|
62
|
+
if (!Number.isInteger(parsed) || (0, otp_constants_1.clampOtpCodeLength)(parsed, min) !== parsed) {
|
|
63
|
+
throw new common_1.BadRequestException(`otp.code_length must be an integer between ${min} and ${otp_constants_1.OTP_MAX_LENGTH}.`);
|
|
55
64
|
}
|
|
56
65
|
}
|
|
57
|
-
|
|
66
|
+
if (key === settings_keys_1.SETTING_KEYS.AUTH_OAUTH_AUTO_LINK_VERIFIED_EMAIL &&
|
|
67
|
+
(dto.value === 'true' || dto.value === '1')) {
|
|
68
|
+
throw new common_1.BadRequestException('Enabling OAuth auto-link is blocked via API (account-takeover risk). ' +
|
|
69
|
+
'Set it only via controlled ops/seed after threat-model review.');
|
|
70
|
+
}
|
|
71
|
+
if (key === settings_keys_1.SETTING_KEYS.AUTH_MFA_ENABLED && (dto.value === 'false' || dto.value === '0')) {
|
|
72
|
+
throw new common_1.BadRequestException('Disabling global MFA via API is blocked (factor-bypass risk). ' +
|
|
73
|
+
'Change only via controlled ops/seed after threat-model review.');
|
|
74
|
+
}
|
|
75
|
+
if (key === settings_keys_1.SETTING_KEYS.AUTH_OAUTH_REQUIRE_ID_TOKEN_NONCE &&
|
|
76
|
+
(dto.value === 'false' || dto.value === '0')) {
|
|
77
|
+
throw new common_1.BadRequestException('Disabling OAuth ID-token nonce via API is blocked (replay risk). Ops/seed only.');
|
|
78
|
+
}
|
|
79
|
+
if (key === settings_keys_1.SETTING_KEYS.AUTH_DPOP_MODE &&
|
|
80
|
+
String(dto.value).trim().toLowerCase() !== 'required') {
|
|
81
|
+
throw new common_1.BadRequestException('Weakening DPoP mode via API is blocked. Use AUTH_DPOP_MODE env / ops only.');
|
|
82
|
+
}
|
|
83
|
+
if (key === settings_keys_1.SETTING_KEYS.AUTH_TURNSTILE_ENABLED &&
|
|
84
|
+
(dto.value === 'false' || dto.value === '0')) {
|
|
85
|
+
throw new common_1.BadRequestException('Disabling Turnstile via API is blocked. Use TURNSTILE_ENABLED env / ops only.');
|
|
86
|
+
}
|
|
87
|
+
if ((0, settings_secret_util_1.isSecretSettingKey)(key) ||
|
|
88
|
+
(0, settings_secret_util_1.isOAuthAllowlistSettingKey)(key) ||
|
|
89
|
+
(0, settings_secret_util_1.isOpsOnlySettingKey)(key)) {
|
|
90
|
+
throw new common_1.BadRequestException(`Setting "${key}" cannot be changed via API (credential / OAuth allowlist / ops-only). Ops/seed only.`);
|
|
91
|
+
}
|
|
92
|
+
if (key === settings_keys_1.SETTING_KEYS.AUTH_DEFAULT_ROLE_SLUG) {
|
|
93
|
+
throw new common_1.BadRequestException('auth.default_role_slug cannot be changed via API (privilege-escalation risk). Ops/seed only.');
|
|
94
|
+
}
|
|
95
|
+
if (key === settings_keys_1.SETTING_KEYS.AUTH_EMAIL_REQUIRE_VERIFIED_TO_LOGIN &&
|
|
96
|
+
(dto.value === 'false' || dto.value === '0')) {
|
|
97
|
+
throw new common_1.BadRequestException('Disabling email verified-to-login via API is blocked. Ops/seed only.');
|
|
98
|
+
}
|
|
99
|
+
if (key === settings_keys_1.SETTING_KEYS.TOKENS_ACCESS_EXPIRES_IN) {
|
|
100
|
+
const raw = String(dto.value).trim().toLowerCase();
|
|
101
|
+
const match = /^(\d+)([smhd])$/.exec(raw);
|
|
102
|
+
if (!match) {
|
|
103
|
+
throw new common_1.BadRequestException('tokens.access_expires_in must be a duration like 5m, 300s, or 1h.');
|
|
104
|
+
}
|
|
105
|
+
const n = Number(match[1]);
|
|
106
|
+
const unit = match[2];
|
|
107
|
+
const ms = unit === 's'
|
|
108
|
+
? n * 1000
|
|
109
|
+
: unit === 'm'
|
|
110
|
+
? n * 60_000
|
|
111
|
+
: unit === 'h'
|
|
112
|
+
? n * 3_600_000
|
|
113
|
+
: n * 86_400_000;
|
|
114
|
+
if (ms > 5 * 60_000) {
|
|
115
|
+
throw new common_1.BadRequestException('tokens.access_expires_in cannot exceed 5m (stolen access-token window).');
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
if (key === settings_keys_1.SETTING_KEYS.TOKENS_REFRESH_TTL_DAYS) {
|
|
119
|
+
const days = parseInt(String(dto.value), 10);
|
|
120
|
+
if (!Number.isInteger(days) || days < 1 || days > 90) {
|
|
121
|
+
throw new common_1.BadRequestException('tokens.refresh_ttl_days must be an integer between 1 and 90.');
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
const integerBounds = {
|
|
125
|
+
[settings_keys_1.SETTING_KEYS.LOGIN_IP_RATE_LIMIT_MAX]: { min: 5, max: 1_000 },
|
|
126
|
+
[settings_keys_1.SETTING_KEYS.REFRESH_IP_RATE_LIMIT_MAX]: { min: 10, max: 5_000 },
|
|
127
|
+
[settings_keys_1.SETTING_KEYS.OTP_IP_RATE_LIMIT_MAX]: { min: 5, max: 500 },
|
|
128
|
+
[settings_keys_1.SETTING_KEYS.AUTH_PUBLIC_IP_RATE_LIMIT_MAX]: { min: 5, max: 1_000 },
|
|
129
|
+
[settings_keys_1.SETTING_KEYS.PROFILE_PUBLIC_IP_RATE_LIMIT_MAX]: { min: 5, max: 1_000 },
|
|
130
|
+
[settings_keys_1.SETTING_KEYS.OTP_RATE_LIMIT_MAX]: { min: 3, max: 100 },
|
|
131
|
+
[settings_keys_1.SETTING_KEYS.OTP_MAX_ATTEMPTS]: { min: 3, max: 20 },
|
|
132
|
+
[settings_keys_1.SETTING_KEYS.AUTH_MFA_MAX_ATTEMPTS]: { min: 3, max: 20 },
|
|
133
|
+
[settings_keys_1.SETTING_KEYS.AUTH_MFA_LOCKOUT_DURATION_SECONDS]: { min: 300, max: 86_400 },
|
|
134
|
+
[settings_keys_1.SETTING_KEYS.LOGIN_LOCKOUT_MAX_ATTEMPTS]: { min: 5, max: 50 },
|
|
135
|
+
[settings_keys_1.SETTING_KEYS.LOGIN_LOCKOUT_DURATION_SECONDS]: { min: 300, max: 86_400 },
|
|
136
|
+
[settings_keys_1.SETTING_KEYS.AUTH_PASSWORD_RESET_PHONE_COOLDOWN_SECONDS]: { min: 3600, max: 604_800 },
|
|
137
|
+
[settings_keys_1.SETTING_KEYS.PIN_MAX_ATTEMPTS]: { min: 3, max: 20 },
|
|
138
|
+
[settings_keys_1.SETTING_KEYS.PIN_LOCKOUT_DURATION_SECONDS]: { min: 60, max: 3_600 },
|
|
139
|
+
[settings_keys_1.SETTING_KEYS.PIN_VERIFY_RATE_LIMIT_MAX]: { min: 5, max: 1_000 },
|
|
140
|
+
[settings_keys_1.SETTING_KEYS.PIN_VERIFY_RATE_LIMIT_WINDOW_SECONDS]: { min: 60, max: 86_400 },
|
|
141
|
+
[settings_keys_1.SETTING_KEYS.PIN_LAST_VERIFIED_MIN_INTERVAL_SECONDS]: { min: 0, max: 3_600 },
|
|
142
|
+
[settings_keys_1.SETTING_KEYS.OTP_RESEND_COOLDOWN_SECONDS]: { min: 30, max: 3_600 },
|
|
143
|
+
[settings_keys_1.SETTING_KEYS.OTP_RATE_LIMIT_WINDOW_SECONDS]: { min: 60, max: 86_400 },
|
|
144
|
+
[settings_keys_1.SETTING_KEYS.OTP_IP_RATE_LIMIT_WINDOW_SECONDS]: { min: 60, max: 86_400 },
|
|
145
|
+
[settings_keys_1.SETTING_KEYS.LOGIN_IP_RATE_LIMIT_WINDOW_SECONDS]: { min: 60, max: 86_400 },
|
|
146
|
+
[settings_keys_1.SETTING_KEYS.REFRESH_IP_RATE_LIMIT_WINDOW_SECONDS]: { min: 60, max: 86_400 },
|
|
147
|
+
[settings_keys_1.SETTING_KEYS.AUTH_PUBLIC_IP_RATE_LIMIT_WINDOW_SECONDS]: { min: 60, max: 86_400 },
|
|
148
|
+
[settings_keys_1.SETTING_KEYS.PROFILE_PUBLIC_IP_RATE_LIMIT_WINDOW_SECONDS]: {
|
|
149
|
+
min: 60,
|
|
150
|
+
max: 86_400,
|
|
151
|
+
},
|
|
152
|
+
[settings_keys_1.SETTING_KEYS.FILES_UPLOAD_IP_RATE_LIMIT_MAX]: { min: 5, max: 1_000 },
|
|
153
|
+
[settings_keys_1.SETTING_KEYS.FILES_UPLOAD_USER_RATE_LIMIT_MAX]: { min: 5, max: 1_000 },
|
|
154
|
+
[settings_keys_1.SETTING_KEYS.FILES_UPLOAD_IP_RATE_LIMIT_WINDOW_SECONDS]: { min: 60, max: 86_400 },
|
|
155
|
+
[settings_keys_1.SETTING_KEYS.FILES_UPLOAD_USER_RATE_LIMIT_WINDOW_SECONDS]: { min: 60, max: 86_400 },
|
|
156
|
+
[settings_keys_1.SETTING_KEYS.AUTH_MFA_CHALLENGE_TTL_SECONDS]: { min: 60, max: 900 },
|
|
157
|
+
[settings_keys_1.SETTING_KEYS.AUTH_MFA_STEP_UP_TTL_SECONDS]: { min: 60, max: 900 },
|
|
158
|
+
[settings_keys_1.SETTING_KEYS.OTP_TTL_SECONDS]: { min: 60, max: 900 },
|
|
159
|
+
[settings_keys_1.SETTING_KEYS.TOKENS_TEMPORARY_TTL_SECONDS]: { min: 60, max: 900 },
|
|
160
|
+
[settings_keys_1.SETTING_KEYS.TOKENS_PASSWORD_RESET_TTL_SECONDS]: { min: 300, max: 7_200 },
|
|
161
|
+
[settings_keys_1.SETTING_KEYS.TOKENS_INVITE_TTL_DAYS]: { min: 1, max: 30 },
|
|
162
|
+
/** Soft SMS-drain budget; API cannot set 0 (disables). Ops/seed only for disable. */
|
|
163
|
+
[settings_keys_1.SETTING_KEYS.OTP_GLOBAL_DAILY_SEND_LIMIT]: { min: 1_000, max: 1_000_000 },
|
|
164
|
+
};
|
|
165
|
+
const bounds = integerBounds[key];
|
|
166
|
+
if (bounds) {
|
|
167
|
+
const parsed = parseInt(String(dto.value), 10);
|
|
168
|
+
if (!Number.isInteger(parsed) || parsed < bounds.min || parsed > bounds.max) {
|
|
169
|
+
throw new common_1.BadRequestException(`${key} must be an integer between ${bounds.min} and ${bounds.max} via API.`);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
const previous = (0, settings_secret_util_1.isSecretSettingKey)(key) ? '[REDACTED]' : setting.value;
|
|
173
|
+
const next = (0, settings_secret_util_1.isSecretSettingKey)(key) ? '[REDACTED]' : dto.value;
|
|
174
|
+
await this.dataSource.transaction(async (manager) => {
|
|
175
|
+
await this.settingsService.set(key, dto.value, userId, manager);
|
|
176
|
+
await this.audit.recordInTransaction(manager, {
|
|
177
|
+
action: audit_actions_1.AUDIT_ACTIONS.SETTING_UPDATED,
|
|
178
|
+
actorType: 'ADMIN',
|
|
179
|
+
actorId: userId,
|
|
180
|
+
resourceType: 'setting',
|
|
181
|
+
resourceId: key,
|
|
182
|
+
metadata: { before: previous, after: next },
|
|
183
|
+
});
|
|
184
|
+
});
|
|
58
185
|
return { key, value: dto.value, message: 'Setting updated successfully.' };
|
|
59
186
|
}
|
|
60
187
|
};
|
|
@@ -104,6 +231,8 @@ exports.SettingsController = SettingsController = __decorate([
|
|
|
104
231
|
(0, swagger_1.ApiBearerAuth)(),
|
|
105
232
|
(0, common_1.Controller)('settings'),
|
|
106
233
|
(0, common_1.UseGuards)(auth_guard_1.JwtAuthGuard, permissions_guard_1.PermissionsGuard),
|
|
107
|
-
__metadata("design:paramtypes", [settings_service_1.SettingsService
|
|
234
|
+
__metadata("design:paramtypes", [settings_service_1.SettingsService,
|
|
235
|
+
audit_service_1.AuditService,
|
|
236
|
+
typeorm_1.DataSource])
|
|
108
237
|
], SettingsController);
|
|
109
238
|
//# sourceMappingURL=settings.controller.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings.controller.js","sourceRoot":"","sources":["../../../../src/modules/settings/controllers/settings.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAYwB;AACxB,6CAQyB;
|
|
1
|
+
{"version":3,"file":"settings.controller.js","sourceRoot":"","sources":["../../../../src/modules/settings/controllers/settings.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAYwB;AACxB,6CAQyB;AACzB,qCAAqC;AAErC,2DAA4E;AAC5E,kEAAiE;AACjE,gFAA4E;AAC5E,uEAAoE;AACpE,sEAAkE;AAClE,qEAK2C;AAC3C,8DAA0D;AAC1D,sDAAuD;AACvD,mEAA+D;AAC/D,4DAA4D;AAC5D,wEAIuC;AAMhC,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IAEZ;IACA;IACA;IAHlB,YACkB,eAAgC,EAChC,KAAmB,EACnB,UAAsB;QAFtB,oBAAe,GAAf,eAAe,CAAiB;QAChC,UAAK,GAAL,KAAK,CAAc;QACnB,eAAU,GAAV,UAAU,CAAY;IACrC,CAAC;IAEJ;;;OAGG;IAUH,OAAO;QACN,OAAO,IAAI,CAAC,eAAe,CAAC,OAAO,EAAE,CAAC;IACvC,CAAC;IAED;;;;OAIG;IAqBG,AAAN,KAAK,CAAC,MAAM,CACG,GAAW,EACjB,GAAqB,EACV,MAAc;QAEjC,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QAExD,IAAI,CAAC,OAAO,EAAE,CAAC;YACd,MAAM,IAAI,0BAAiB,CAAC,YAAY,GAAG,mBAAmB,CAAC,CAAC;QACjE,CAAC;QAED,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC;YACzB,MAAM,IAAI,2BAAkB,CAC3B,YAAY,GAAG,mDAAmD,CAClE,CAAC;QACH,CAAC;QAED,IAAI,GAAG,KAAK,4BAAY,CAAC,eAAe,EAAE,CAAC;YAC1C,MAAM,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC;YAC/C,MAAM,GAAG,GACR,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,CAAC,CAA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I,EAAE,KAAK;QACX,OAAO,EAAE,qBAAqB;QAC9B,WAAW,EAAE,4BAA4B;KACzC,CAAC;IACD,IAAA,uBAAa,EAAC,EAAE,WAAW,EAAE,+BAA+B,EAAE,CAAC;IAC/D,IAAA,6BAAmB,EAAC,EAAE,WAAW,EAAE,6BAA6B,EAAE,CAAC;IAElE,WAAA,IAAA,cAAK,EAAC,KAAK,CAAC,CAAA;IACZ,WAAA,IAAA,aAAI,GAAE,CAAA;IACN,WAAA,IAAA,wBAAW,EAAC,IAAI,CAAC,CAAA;;6CADL,+BAAgB;;gDAyL7B;6BA5OW,kBAAkB;IAJ9B,IAAA,iBAAO,EAAC,UAAU,CAAC;IACnB,IAAA,uBAAa,GAAE;IACf,IAAA,mBAAU,EAAC,UAAU,CAAC;IACtB,IAAA,kBAAS,EAAC,yBAAY,EAAE,oCAAgB,CAAC;qCAGN,kCAAe;QACzB,4BAAY;QACP,oBAAU;GAJ5B,kBAAkB,CA6O9B"}
|
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
import { OnModuleInit } from '@nestjs/common';
|
|
2
|
-
import {
|
|
1
|
+
import { OnModuleDestroy, OnModuleInit } from '@nestjs/common';
|
|
2
|
+
import { ConfigService } from '@nestjs/config';
|
|
3
|
+
import type IORedis from 'ioredis';
|
|
4
|
+
import { EntityManager, Repository } from 'typeorm';
|
|
3
5
|
import { StructuredLoggerService } from '../../observability/logging/structured-logger.service';
|
|
4
6
|
import { AppSetting } from '../entities/app-setting.entity';
|
|
5
7
|
type ChangeHook = (key: string, value: unknown) => void;
|
|
6
|
-
export declare class SettingsService implements OnModuleInit {
|
|
8
|
+
export declare class SettingsService implements OnModuleInit, OnModuleDestroy {
|
|
7
9
|
private readonly repo;
|
|
8
10
|
private readonly logger;
|
|
11
|
+
private readonly configService;
|
|
12
|
+
private readonly redis;
|
|
9
13
|
/** Raw string values keyed by setting key (populated from DB at boot). */
|
|
10
14
|
private readonly valueCache;
|
|
11
15
|
/** Stored parse type per key (integer | boolean | json | string). */
|
|
@@ -16,8 +20,12 @@ export declare class SettingsService implements OnModuleInit {
|
|
|
16
20
|
* Registered via registerChangeHook() from any OnModuleInit.
|
|
17
21
|
*/
|
|
18
22
|
private readonly changeHooks;
|
|
19
|
-
|
|
23
|
+
private localCacheVersion;
|
|
24
|
+
private pollTimer;
|
|
25
|
+
constructor(repo: Repository<AppSetting>, logger: StructuredLoggerService, configService: ConfigService, redis: IORedis);
|
|
26
|
+
private get encryptionKey();
|
|
20
27
|
onModuleInit(): Promise<void>;
|
|
28
|
+
onModuleDestroy(): void;
|
|
21
29
|
/**
|
|
22
30
|
* Returns the setting value typed as T using a three-tier lookup:
|
|
23
31
|
*
|
|
@@ -39,7 +47,7 @@ export declare class SettingsService implements OnModuleInit {
|
|
|
39
47
|
* registered change hooks whose prefix matches the key.
|
|
40
48
|
* Throws if the key does not exist (settings are not created ad hoc).
|
|
41
49
|
*/
|
|
42
|
-
set(key: string, value: unknown, updatedById?: string): Promise<void>;
|
|
50
|
+
set(key: string, value: unknown, updatedById?: string, manager?: EntityManager): Promise<void>;
|
|
43
51
|
/**
|
|
44
52
|
* Registers a callback that is called synchronously after any setting whose
|
|
45
53
|
* key starts with `prefix` is updated via set().
|
|
@@ -53,10 +61,12 @@ export declare class SettingsService implements OnModuleInit {
|
|
|
53
61
|
* Call this after bulk changes (e.g. via a migration or seed).
|
|
54
62
|
*/
|
|
55
63
|
reload(): Promise<void>;
|
|
56
|
-
|
|
64
|
+
private pollRemoteCacheVersion;
|
|
65
|
+
/** Returns all settings rows (for admin read endpoints). Secrets are redacted. */
|
|
57
66
|
findAll(): Promise<AppSetting[]>;
|
|
58
|
-
/** Returns a single setting row by key, or null if it doesn't exist. */
|
|
67
|
+
/** Returns a single setting row by key, or null if it doesn't exist. Secrets are redacted. */
|
|
59
68
|
findOne(key: string): Promise<AppSetting | null>;
|
|
69
|
+
private redactSecretRow;
|
|
60
70
|
private loadAll;
|
|
61
71
|
private fireHooks;
|
|
62
72
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings.service.d.ts","sourceRoot":"","sources":["../../../../src/modules/settings/services/settings.service.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"settings.service.d.ts","sourceRoot":"","sources":["../../../../src/modules/settings/services/settings.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,eAAe,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnF,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/C,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAIpD,OAAO,EAAE,uBAAuB,EAAE,MAAM,uDAAuD,CAAC;AAEhG,OAAO,EAAE,UAAU,EAAe,MAAM,gCAAgC,CAAC;AAQzE,KAAK,UAAU,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;AAIxD,qBACa,eAAgB,YAAW,YAAY,EAAE,eAAe;IAgBnE,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,aAAa;IAE9B,OAAO,CAAC,QAAQ,CAAC,KAAK;IAnBvB,0EAA0E;IAC1E,OAAO,CAAC,QAAQ,CAAC,UAAU,CAA6B;IACxD,qEAAqE;IACrE,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAkC;IAC5D;;;;OAIG;IACH,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAmD;IAC/E,OAAO,CAAC,iBAAiB,CAAO;IAChC,OAAO,CAAC,SAAS,CAA+C;gBAI9C,IAAI,EAAE,UAAU,CAAC,UAAU,CAAC,EAC5B,MAAM,EAAE,uBAAuB,EAC/B,aAAa,EAAE,aAAa,EAE5B,KAAK,EAAE,OAAO;IAGhC,OAAO,KAAK,aAAa,GAExB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