@colveor/core 1.1.0 → 1.2.1
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 +24 -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/1784284557959-full-schema.d.ts.map +1 -1
- package/dist/database/migrations/1784284557959-full-schema.js +48 -14
- package/dist/database/migrations/1784284557959-full-schema.js.map +1 -1
- package/dist/database/migrations/1784284557960-audit-partitioning.d.ts +17 -0
- package/dist/database/migrations/1784284557960-audit-partitioning.d.ts.map +1 -0
- package/dist/database/migrations/1784284557960-audit-partitioning.js +384 -0
- package/dist/database/migrations/1784284557960-audit-partitioning.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 +3 -0
- package/dist/modules/users/dto/user.dto.d.ts.map +1 -1
- package/dist/modules/users/dto/user.dto.js +27 -4
- 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
|
@@ -0,0 +1,662 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
19
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
20
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
21
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
22
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
23
|
+
};
|
|
24
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
25
|
+
var ownKeys = function(o) {
|
|
26
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
27
|
+
var ar = [];
|
|
28
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
29
|
+
return ar;
|
|
30
|
+
};
|
|
31
|
+
return ownKeys(o);
|
|
32
|
+
};
|
|
33
|
+
return function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
})();
|
|
41
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
42
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
43
|
+
};
|
|
44
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
45
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
46
|
+
};
|
|
47
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
48
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
49
|
+
};
|
|
50
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
51
|
+
exports.MfaService = void 0;
|
|
52
|
+
const common_1 = require("@nestjs/common");
|
|
53
|
+
const config_1 = require("@nestjs/config");
|
|
54
|
+
const typeorm_1 = require("@nestjs/typeorm");
|
|
55
|
+
const argon2 = __importStar(require("argon2"));
|
|
56
|
+
const ioredis_1 = __importDefault(require("ioredis"));
|
|
57
|
+
const typeorm_2 = require("typeorm");
|
|
58
|
+
const redis_module_1 = require("../../../config/redis.module");
|
|
59
|
+
const audit_actions_1 = require("../../audit/constants/audit-actions");
|
|
60
|
+
const audit_service_1 = require("../../audit/services/audit.service");
|
|
61
|
+
const structured_logger_service_1 = require("../../observability/logging/structured-logger.service");
|
|
62
|
+
const metrics_service_1 = require("../../observability/metrics/metrics.service");
|
|
63
|
+
const refresh_token_entity_1 = require("../../sessions/entities/refresh-token.entity");
|
|
64
|
+
const token_service_1 = require("../../sessions/services/token.service");
|
|
65
|
+
const settings_keys_1 = require("../../settings/constants/settings.keys");
|
|
66
|
+
const settings_service_1 = require("../../settings/services/settings.service");
|
|
67
|
+
const users_service_1 = require("../../users/services/users.service");
|
|
68
|
+
const user_mfa_entity_1 = require("../entities/user-mfa.entity");
|
|
69
|
+
const auth_events_1 = require("../events/auth.events");
|
|
70
|
+
const backup_code_hash_util_1 = require("../utils/backup-code-hash.util");
|
|
71
|
+
const backup_codes_util_1 = require("../utils/backup-codes.util");
|
|
72
|
+
const mfa_secret_util_1 = require("../utils/mfa-secret.util");
|
|
73
|
+
const mfa_verify_params_util_1 = require("../utils/mfa-verify-params.util");
|
|
74
|
+
const totp_util_1 = require("../utils/totp.util");
|
|
75
|
+
const login_service_1 = require("./login.service");
|
|
76
|
+
const oauth_service_1 = require("./oauth.service");
|
|
77
|
+
const otp_auth_service_1 = require("./otp-auth.service");
|
|
78
|
+
const KEY_MFA_SETUP = 'tmp:mfa_setup:';
|
|
79
|
+
const KEY_TOTP_USED = 'mfa:totp_used:';
|
|
80
|
+
let MfaService = class MfaService {
|
|
81
|
+
mfaRepo;
|
|
82
|
+
usersService;
|
|
83
|
+
tokenService;
|
|
84
|
+
loginService;
|
|
85
|
+
settingsService;
|
|
86
|
+
configService;
|
|
87
|
+
redis;
|
|
88
|
+
logger;
|
|
89
|
+
metrics;
|
|
90
|
+
dataSource;
|
|
91
|
+
otpAuthService;
|
|
92
|
+
oauthService;
|
|
93
|
+
audit;
|
|
94
|
+
eventEmitter;
|
|
95
|
+
constructor(mfaRepo, usersService, tokenService, loginService, settingsService, configService, redis, logger, metrics, dataSource, otpAuthService, oauthService, audit, eventEmitter = null) {
|
|
96
|
+
this.mfaRepo = mfaRepo;
|
|
97
|
+
this.usersService = usersService;
|
|
98
|
+
this.tokenService = tokenService;
|
|
99
|
+
this.loginService = loginService;
|
|
100
|
+
this.settingsService = settingsService;
|
|
101
|
+
this.configService = configService;
|
|
102
|
+
this.redis = redis;
|
|
103
|
+
this.logger = logger;
|
|
104
|
+
this.metrics = metrics;
|
|
105
|
+
this.dataSource = dataSource;
|
|
106
|
+
this.otpAuthService = otpAuthService;
|
|
107
|
+
this.oauthService = oauthService;
|
|
108
|
+
this.audit = audit;
|
|
109
|
+
this.eventEmitter = eventEmitter;
|
|
110
|
+
}
|
|
111
|
+
async getStatus(userId) {
|
|
112
|
+
const { entities, raw } = await this.mfaRepo
|
|
113
|
+
.createQueryBuilder('mfa')
|
|
114
|
+
.addSelect('COALESCE(jsonb_array_length(mfa.backup_codes_hash), 0)', 'backupCount')
|
|
115
|
+
.where('mfa.userId = :userId', { userId })
|
|
116
|
+
.getRawAndEntities();
|
|
117
|
+
const row = entities[0] ?? null;
|
|
118
|
+
const backupCodesRemaining = Number(raw[0]?.backupCount ?? 0);
|
|
119
|
+
return this.toStatus(row, backupCodesRemaining);
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Whether this user must complete MFA before session tokens are issued.
|
|
123
|
+
* Prefer {@link issueChallengeIfRequired} on the login hot path (one query + token).
|
|
124
|
+
*/
|
|
125
|
+
async requiresMfa(user, _firstFactor) {
|
|
126
|
+
const globallyEnabled = this.settingsService.get(settings_keys_1.SETTING_KEYS.AUTH_MFA_ENABLED);
|
|
127
|
+
if (!globallyEnabled)
|
|
128
|
+
return false;
|
|
129
|
+
// When MFA is enrolled, always challenge — do not allow allowlist misconfig to skip it.
|
|
130
|
+
const row = await this.mfaRepo.findOne({ where: { userId: user.id } });
|
|
131
|
+
return row?.mfaEnabled === true;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Single-query MFA gate for login: returns a challenge response or null.
|
|
135
|
+
* Loads backup-code availability in the same round-trip.
|
|
136
|
+
* Enrolled MFA always challenges (ignore required_for_methods allowlist).
|
|
137
|
+
*/
|
|
138
|
+
async issueChallengeIfRequired(user, amr, provider) {
|
|
139
|
+
const globallyEnabled = this.settingsService.get(settings_keys_1.SETTING_KEYS.AUTH_MFA_ENABLED);
|
|
140
|
+
if (!globallyEnabled)
|
|
141
|
+
return null;
|
|
142
|
+
const { entities, raw } = await this.mfaRepo
|
|
143
|
+
.createQueryBuilder('mfa')
|
|
144
|
+
.addSelect('COALESCE(jsonb_array_length(mfa.backup_codes_hash), 0)', 'backupCount')
|
|
145
|
+
.where('mfa.userId = :userId', { userId: user.id })
|
|
146
|
+
.getRawAndEntities();
|
|
147
|
+
const row = entities[0];
|
|
148
|
+
if (row?.mfaEnabled !== true)
|
|
149
|
+
return null;
|
|
150
|
+
const { mfaToken, expiresIn } = await this.tokenService.createMfaChallengeToken({
|
|
151
|
+
userId: user.id,
|
|
152
|
+
amr,
|
|
153
|
+
provider,
|
|
154
|
+
});
|
|
155
|
+
const methods = ['totp'];
|
|
156
|
+
if (Number(raw[0]?.backupCount ?? 0) > 0) {
|
|
157
|
+
methods.push('backup_code');
|
|
158
|
+
}
|
|
159
|
+
return {
|
|
160
|
+
mfaRequired: true,
|
|
161
|
+
mfaToken,
|
|
162
|
+
methods,
|
|
163
|
+
expiresIn,
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
async beginChallenge(user, amr, provider) {
|
|
167
|
+
const challenge = await this.issueChallengeIfRequired(user, amr, provider);
|
|
168
|
+
if (!challenge) {
|
|
169
|
+
throw new common_1.BadRequestException('MFA is not required for this account / method.');
|
|
170
|
+
}
|
|
171
|
+
return challenge;
|
|
172
|
+
}
|
|
173
|
+
async setupTotp(userId) {
|
|
174
|
+
const user = await this.usersService.findByIdOrFail(userId);
|
|
175
|
+
const existing = await this.mfaRepo.findOne({ where: { userId } });
|
|
176
|
+
if (existing?.mfaEnabled) {
|
|
177
|
+
throw new common_1.ConflictException('MFA is already enabled. Disable it before re-enrolling.');
|
|
178
|
+
}
|
|
179
|
+
const secret = (0, totp_util_1.generateTotpSecret)();
|
|
180
|
+
const encrypted = (0, mfa_secret_util_1.sealMfaSecret)(secret, this.requireMfaEncryptionKey());
|
|
181
|
+
const ttl = this.settingsService.get(settings_keys_1.SETTING_KEYS.AUTH_MFA_CHALLENGE_TTL_SECONDS);
|
|
182
|
+
await this.redis.set(`${KEY_MFA_SETUP}${userId}`, encrypted, 'EX', ttl);
|
|
183
|
+
this.audit.record({
|
|
184
|
+
action: audit_actions_1.AUDIT_ACTIONS.MFA_SETUP_STARTED,
|
|
185
|
+
actorType: 'USER',
|
|
186
|
+
actorId: userId,
|
|
187
|
+
resourceType: 'user',
|
|
188
|
+
resourceId: userId,
|
|
189
|
+
});
|
|
190
|
+
const issuer = this.settingsService.get(settings_keys_1.SETTING_KEYS.AUTH_MFA_TOTP_ISSUER);
|
|
191
|
+
const accountName = user.email ?? user.phoneNumber ?? userId;
|
|
192
|
+
return {
|
|
193
|
+
secret,
|
|
194
|
+
otpauthUrl: (0, totp_util_1.buildOtpAuthUri)({ secret, accountName, issuer }),
|
|
195
|
+
issuer,
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
async confirmTotp(userId, dto) {
|
|
199
|
+
await this.assertEnrollmentReauth(userId, dto);
|
|
200
|
+
const encrypted = await this.redis.get(`${KEY_MFA_SETUP}${userId}`);
|
|
201
|
+
if (!encrypted) {
|
|
202
|
+
throw new common_1.BadRequestException('MFA setup expired or not started. Call POST /auth/mfa/totp/setup first.');
|
|
203
|
+
}
|
|
204
|
+
const secret = this.decryptTotpSecret(encrypted);
|
|
205
|
+
if (!secret || !(0, totp_util_1.verifyTotp)(secret, dto.code)) {
|
|
206
|
+
throw new common_1.UnauthorizedException('Invalid TOTP code');
|
|
207
|
+
}
|
|
208
|
+
let row = await this.loadMfaWithSecrets(userId);
|
|
209
|
+
if (!row) {
|
|
210
|
+
row = this.mfaRepo.create({ userId });
|
|
211
|
+
}
|
|
212
|
+
const plaintextCodes = await this.issueBackupCodes(row);
|
|
213
|
+
// Persist under current key + version prefix (reseal if setup used previous key).
|
|
214
|
+
row.totpSecretEncrypted = (0, mfa_secret_util_1.sealMfaSecret)(secret, this.requireMfaEncryptionKey());
|
|
215
|
+
row.mfaEnabled = true;
|
|
216
|
+
row.totpConfirmedAt = new Date();
|
|
217
|
+
row.failedAttempts = 0;
|
|
218
|
+
row.lockedUntil = undefined;
|
|
219
|
+
await this.mfaRepo.save(row);
|
|
220
|
+
await this.redis.del(`${KEY_MFA_SETUP}${userId}`);
|
|
221
|
+
this.metrics.recordBusinessEvent('auth', 'mfa', 'enabled');
|
|
222
|
+
this.logger.info('MFA enabled', {
|
|
223
|
+
event: 'auth.mfa.enabled',
|
|
224
|
+
metadata: { userId },
|
|
225
|
+
});
|
|
226
|
+
await this.emitMfaEvent(auth_events_1.AUTH_EVENTS.MFA_ENABLED, userId);
|
|
227
|
+
return {
|
|
228
|
+
...this.toStatus(row),
|
|
229
|
+
backupCodes: plaintextCodes,
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
async regenerateBackupCodes(userId, dto) {
|
|
233
|
+
const row = await this.loadMfaWithSecrets(userId);
|
|
234
|
+
if (!row?.mfaEnabled || !row.totpSecretEncrypted) {
|
|
235
|
+
throw new common_1.BadRequestException('MFA is not enabled');
|
|
236
|
+
}
|
|
237
|
+
// Regenerating codes requires a live authenticator (TOTP only).
|
|
238
|
+
const mode = (0, mfa_verify_params_util_1.resolveMfaDisableMode)(dto);
|
|
239
|
+
if (mode !== 'totp') {
|
|
240
|
+
throw new common_1.BadRequestException('Regenerating backup codes requires a valid TOTP { code }. Use backup codes only to disable MFA or complete login.');
|
|
241
|
+
}
|
|
242
|
+
await this.assertNotLocked(row);
|
|
243
|
+
const secret = this.decryptTotpSecret(row.totpSecretEncrypted);
|
|
244
|
+
if (!secret || !(0, totp_util_1.verifyTotp)(secret, dto.code)) {
|
|
245
|
+
await this.recordFailedAttempt(row);
|
|
246
|
+
throw new common_1.UnauthorizedException('Invalid TOTP code');
|
|
247
|
+
}
|
|
248
|
+
const backupCodes = await this.issueBackupCodes(row);
|
|
249
|
+
row.failedAttempts = 0;
|
|
250
|
+
row.lockedUntil = undefined;
|
|
251
|
+
await this.mfaRepo.save(row);
|
|
252
|
+
this.metrics.recordBusinessEvent('auth', 'mfa', 'backup_codes_regenerated');
|
|
253
|
+
await this.emitMfaEvent(auth_events_1.AUTH_EVENTS.MFA_BACKUP_CODES_REGENERATED, userId);
|
|
254
|
+
return {
|
|
255
|
+
backupCodes,
|
|
256
|
+
status: this.toStatus(row),
|
|
257
|
+
};
|
|
258
|
+
}
|
|
259
|
+
async disable(userId, dto) {
|
|
260
|
+
const mode = (0, mfa_verify_params_util_1.resolveMfaDisableMode)(dto);
|
|
261
|
+
if (mode === 'ambiguous' || mode === 'missing') {
|
|
262
|
+
throw new common_1.BadRequestException(mfa_verify_params_util_1.MFA_DISABLE_PARAMS_ERROR);
|
|
263
|
+
}
|
|
264
|
+
const row = await this.loadMfaWithSecrets(userId);
|
|
265
|
+
if (!row?.mfaEnabled || !row.totpSecretEncrypted) {
|
|
266
|
+
throw new common_1.BadRequestException('MFA is not enabled');
|
|
267
|
+
}
|
|
268
|
+
await this.assertNotLocked(row);
|
|
269
|
+
if (mode === 'totp') {
|
|
270
|
+
const secret = this.decryptTotpSecret(row.totpSecretEncrypted);
|
|
271
|
+
if (!secret || !(0, totp_util_1.verifyTotp)(secret, dto.code)) {
|
|
272
|
+
await this.recordFailedAttempt(row);
|
|
273
|
+
throw new common_1.UnauthorizedException('Invalid TOTP code');
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
else {
|
|
277
|
+
const consumed = await this.consumeBackupCode(row, dto.backupCode);
|
|
278
|
+
if (!consumed) {
|
|
279
|
+
await this.recordFailedAttempt(row);
|
|
280
|
+
throw new common_1.UnauthorizedException('Invalid backup code');
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
row.mfaEnabled = false;
|
|
284
|
+
row.totpSecretEncrypted = undefined;
|
|
285
|
+
row.totpConfirmedAt = undefined;
|
|
286
|
+
row.backupCodesHash = undefined;
|
|
287
|
+
row.backupCodesGeneratedAt = undefined;
|
|
288
|
+
row.failedAttempts = 0;
|
|
289
|
+
row.lockedUntil = undefined;
|
|
290
|
+
await this.mfaRepo.save(row);
|
|
291
|
+
// Dropping MFA is a factor change — kill all sessions so stolen refresh cannot continue.
|
|
292
|
+
await this.tokenService.revokeAllUserTokens(userId, refresh_token_entity_1.RevokeReason.LOGOUT);
|
|
293
|
+
this.metrics.recordBusinessEvent('auth', 'mfa', 'disabled');
|
|
294
|
+
this.logger.info('MFA disabled', {
|
|
295
|
+
event: 'auth.mfa.disabled',
|
|
296
|
+
metadata: { userId, recovery: mode === 'backup_code' },
|
|
297
|
+
});
|
|
298
|
+
await this.emitMfaEvent(auth_events_1.AUTH_EVENTS.MFA_DISABLED, userId);
|
|
299
|
+
return this.toStatus(row);
|
|
300
|
+
}
|
|
301
|
+
/**
|
|
302
|
+
* Re-auth before enabling MFA (stolen-session cannot enroll attacker TOTP).
|
|
303
|
+
* Password → phone OTP → linked OAuth ID token.
|
|
304
|
+
*/
|
|
305
|
+
async assertEnrollmentReauth(userId, dto) {
|
|
306
|
+
await this.assertFirstFactorReauth(userId, dto, 'enable MFA');
|
|
307
|
+
}
|
|
308
|
+
/**
|
|
309
|
+
* Sensitive actions: never silent-pass.
|
|
310
|
+
* MFA enrolled → purpose-scoped step-up; otherwise first-factor proof (password / phone OTP / OAuth).
|
|
311
|
+
*/
|
|
312
|
+
async assertSensitiveReauth(userId, opts) {
|
|
313
|
+
const row = await this.mfaRepo.findOne({ where: { userId } });
|
|
314
|
+
if (row?.mfaEnabled) {
|
|
315
|
+
await this.consumeStepUpIfRequired(userId, opts.stepUpToken, opts.purpose);
|
|
316
|
+
return;
|
|
317
|
+
}
|
|
318
|
+
await this.assertFirstFactorReauth(userId, opts, 'this action');
|
|
319
|
+
}
|
|
320
|
+
/**
|
|
321
|
+
* When the user has MFA enrolled, require and consume a purpose-scoped step-up token.
|
|
322
|
+
* No-op when MFA is disabled — callers that need always-on re-auth should use
|
|
323
|
+
* {@link assertSensitiveReauth} instead.
|
|
324
|
+
*/
|
|
325
|
+
async consumeStepUpIfRequired(userId, stepUpToken, purpose) {
|
|
326
|
+
const row = await this.mfaRepo.findOne({ where: { userId } });
|
|
327
|
+
if (!row?.mfaEnabled)
|
|
328
|
+
return;
|
|
329
|
+
if (!stepUpToken?.trim()) {
|
|
330
|
+
throw new common_1.ForbiddenException(`MFA step-up required for ${purpose}. Call POST /auth/mfa/step-up with purpose="${purpose}" and pass stepUpToken.`);
|
|
331
|
+
}
|
|
332
|
+
const tokenUserId = await this.tokenService.consumeStepUpToken(stepUpToken, purpose);
|
|
333
|
+
if (tokenUserId !== userId) {
|
|
334
|
+
throw new common_1.UnauthorizedException('Invalid or expired step-up token');
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
/** First-factor proof when MFA is off (never silent-pass). */
|
|
338
|
+
async assertFirstFactorReauth(userId, opts, actionLabel) {
|
|
339
|
+
const user = await this.usersService.findByIdWithPassword(userId);
|
|
340
|
+
if (!user)
|
|
341
|
+
throw new common_1.BadRequestException('User not found');
|
|
342
|
+
if (user.passwordHash) {
|
|
343
|
+
if (!opts.password) {
|
|
344
|
+
throw new common_1.BadRequestException(`Password is required for ${actionLabel} when MFA is not enrolled.`);
|
|
345
|
+
}
|
|
346
|
+
const ok = await argon2.verify(user.passwordHash, opts.password);
|
|
347
|
+
if (!ok)
|
|
348
|
+
throw new common_1.UnauthorizedException('Invalid password');
|
|
349
|
+
return;
|
|
350
|
+
}
|
|
351
|
+
if (user.phoneNumber) {
|
|
352
|
+
if (!opts.verificationId || !opts.otp) {
|
|
353
|
+
throw new common_1.BadRequestException(`Phone re-auth required for ${actionLabel}. Send OTP to your account phone, then pass { verificationId, otp }.`);
|
|
354
|
+
}
|
|
355
|
+
const { subject, channel } = await this.otpAuthService
|
|
356
|
+
.verifyOtpChallengeWithSubject(opts.verificationId, opts.otp)
|
|
357
|
+
.catch(() => {
|
|
358
|
+
throw new common_1.UnauthorizedException('Invalid or expired OTP code.');
|
|
359
|
+
});
|
|
360
|
+
if (channel !== 'sms') {
|
|
361
|
+
throw new common_1.BadRequestException(`${actionLabel} requires an SMS OTP to your account phone.`);
|
|
362
|
+
}
|
|
363
|
+
if (subject !== user.phoneNumber) {
|
|
364
|
+
throw new common_1.UnauthorizedException('OTP was not issued for this account phone number.');
|
|
365
|
+
}
|
|
366
|
+
return;
|
|
367
|
+
}
|
|
368
|
+
if (opts.provider && opts.idToken) {
|
|
369
|
+
await this.oauthService.assertLinkedIdentity(userId, opts.provider, opts.idToken);
|
|
370
|
+
return;
|
|
371
|
+
}
|
|
372
|
+
throw new common_1.BadRequestException(`Re-auth required for ${actionLabel}. Pass a linked OAuth { provider, idToken }, ` +
|
|
373
|
+
'or set a password / verify a phone first.');
|
|
374
|
+
}
|
|
375
|
+
async verifyChallenge(dto, deviceInfo, ipAddress, dpopJkt) {
|
|
376
|
+
const mode = (0, mfa_verify_params_util_1.resolveMfaVerifyMode)(dto);
|
|
377
|
+
if (mode === 'ambiguous' || mode === 'missing') {
|
|
378
|
+
throw new common_1.BadRequestException(mfa_verify_params_util_1.MFA_VERIFY_PARAMS_ERROR);
|
|
379
|
+
}
|
|
380
|
+
// Peek first so a wrong code does not burn the challenge token.
|
|
381
|
+
const challenge = await this.tokenService.peekMfaChallengeToken(dto.mfaToken);
|
|
382
|
+
const user = await this.usersService.findById(challenge.userId);
|
|
383
|
+
if (!user) {
|
|
384
|
+
throw new common_1.UnauthorizedException('User not found');
|
|
385
|
+
}
|
|
386
|
+
const row = await this.loadMfaWithSecrets(user.id);
|
|
387
|
+
if (!row?.mfaEnabled || !row.totpSecretEncrypted) {
|
|
388
|
+
throw new common_1.UnauthorizedException('MFA is not enabled for this account');
|
|
389
|
+
}
|
|
390
|
+
await this.assertNotLocked(row);
|
|
391
|
+
if (mode === 'totp') {
|
|
392
|
+
const secret = this.decryptTotpSecret(row.totpSecretEncrypted);
|
|
393
|
+
if (!secret || !(0, totp_util_1.verifyTotp)(secret, dto.totp)) {
|
|
394
|
+
await this.recordFailedAttempt(row);
|
|
395
|
+
this.metrics.recordBusinessEvent('auth', 'mfa', 'challenge_failed');
|
|
396
|
+
throw new common_1.UnauthorizedException('Invalid TOTP code');
|
|
397
|
+
}
|
|
398
|
+
// Replay key first, then burn challenge. If consume fails, clear replay so
|
|
399
|
+
// the same TOTP window remains usable with a fresh challenge.
|
|
400
|
+
await this.assertTotpNotReplayed(user.id, dto.totp);
|
|
401
|
+
try {
|
|
402
|
+
await this.tokenService.consumeMfaChallengeToken(dto.mfaToken);
|
|
403
|
+
}
|
|
404
|
+
catch (err) {
|
|
405
|
+
await this.clearTotpReplay(user.id, dto.totp);
|
|
406
|
+
throw err;
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
else {
|
|
410
|
+
const consumed = await this.consumeBackupCode(row, dto.backupCode);
|
|
411
|
+
if (!consumed) {
|
|
412
|
+
await this.recordFailedAttempt(row);
|
|
413
|
+
this.metrics.recordBusinessEvent('auth', 'mfa', 'challenge_failed');
|
|
414
|
+
throw new common_1.UnauthorizedException('Invalid backup code');
|
|
415
|
+
}
|
|
416
|
+
await this.tokenService.consumeMfaChallengeToken(dto.mfaToken);
|
|
417
|
+
}
|
|
418
|
+
await this.clearMfaLockoutIfNeeded(row);
|
|
419
|
+
const method = challenge.amr;
|
|
420
|
+
return this.loginService.completeLoginForUser(user, method, deviceInfo, ipAddress, {
|
|
421
|
+
skipAuthMethodCheck: challenge.amr === 'oauth',
|
|
422
|
+
mfaUsed: true,
|
|
423
|
+
amr: [challenge.amr, 'mfa'],
|
|
424
|
+
oauthProvider: challenge.provider,
|
|
425
|
+
dpopJkt,
|
|
426
|
+
});
|
|
427
|
+
}
|
|
428
|
+
/**
|
|
429
|
+
* Authenticated step-up: confirm MFA again and receive a short-lived elevated token.
|
|
430
|
+
*/
|
|
431
|
+
async stepUp(userId, dto) {
|
|
432
|
+
const mode = (0, mfa_verify_params_util_1.resolveMfaStepUpMode)(dto);
|
|
433
|
+
if (mode === 'ambiguous' || mode === 'missing') {
|
|
434
|
+
throw new common_1.BadRequestException(mfa_verify_params_util_1.MFA_STEP_UP_PARAMS_ERROR);
|
|
435
|
+
}
|
|
436
|
+
const row = await this.loadMfaWithSecrets(userId);
|
|
437
|
+
if (!row?.mfaEnabled || !row.totpSecretEncrypted) {
|
|
438
|
+
throw new common_1.BadRequestException('MFA is not enabled');
|
|
439
|
+
}
|
|
440
|
+
await this.assertNotLocked(row);
|
|
441
|
+
if (mode === 'totp') {
|
|
442
|
+
const secret = this.decryptTotpSecret(row.totpSecretEncrypted);
|
|
443
|
+
if (!secret || !(0, totp_util_1.verifyTotp)(secret, dto.totp)) {
|
|
444
|
+
await this.recordFailedAttempt(row);
|
|
445
|
+
throw new common_1.UnauthorizedException('Invalid TOTP code');
|
|
446
|
+
}
|
|
447
|
+
await this.assertTotpNotReplayed(userId, dto.totp);
|
|
448
|
+
}
|
|
449
|
+
else {
|
|
450
|
+
const consumed = await this.consumeBackupCode(row, dto.backupCode);
|
|
451
|
+
if (!consumed) {
|
|
452
|
+
await this.recordFailedAttempt(row);
|
|
453
|
+
throw new common_1.UnauthorizedException('Invalid backup code');
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
await this.clearMfaLockoutIfNeeded(row);
|
|
457
|
+
const result = await this.tokenService.createStepUpToken({
|
|
458
|
+
userId,
|
|
459
|
+
purpose: dto.purpose,
|
|
460
|
+
});
|
|
461
|
+
this.metrics.recordBusinessEvent('auth', 'mfa', 'step_up');
|
|
462
|
+
await this.emitMfaEvent(auth_events_1.AUTH_EVENTS.MFA_STEP_UP, userId);
|
|
463
|
+
return result;
|
|
464
|
+
}
|
|
465
|
+
async issueBackupCodes(row) {
|
|
466
|
+
const count = this.settingsService.get(settings_keys_1.SETTING_KEYS.AUTH_MFA_BACKUP_CODES_COUNT) || 10;
|
|
467
|
+
const pepper = this.requireMfaEncryptionKey();
|
|
468
|
+
const codes = (0, backup_codes_util_1.generateBackupCodes)(count);
|
|
469
|
+
row.backupCodesHash = codes.map((code) => (0, backup_code_hash_util_1.hashBackupCode)((0, backup_codes_util_1.normalizeBackupCode)(code), pepper));
|
|
470
|
+
row.backupCodesGeneratedAt = new Date();
|
|
471
|
+
return codes;
|
|
472
|
+
}
|
|
473
|
+
/**
|
|
474
|
+
* Verify backup codes outside the DB lock, then claim under a short
|
|
475
|
+
* pessimistic lock by matching the stored hash string.
|
|
476
|
+
*/
|
|
477
|
+
async consumeBackupCode(row, code) {
|
|
478
|
+
const normalized = (0, backup_codes_util_1.normalizeBackupCode)(code);
|
|
479
|
+
const peppers = this.mfaPeppers();
|
|
480
|
+
const hashes = row.backupCodesHash ?? [];
|
|
481
|
+
let matchedHash = null;
|
|
482
|
+
for (const stored of hashes) {
|
|
483
|
+
for (const pepper of peppers) {
|
|
484
|
+
if ((0, backup_code_hash_util_1.verifyBackupCodeHash)(stored, normalized, pepper)) {
|
|
485
|
+
matchedHash = stored;
|
|
486
|
+
break;
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
if (matchedHash)
|
|
490
|
+
break;
|
|
491
|
+
}
|
|
492
|
+
if (!matchedHash)
|
|
493
|
+
return false;
|
|
494
|
+
return this.dataSource.transaction(async (manager) => {
|
|
495
|
+
const locked = await manager
|
|
496
|
+
.createQueryBuilder(user_mfa_entity_1.UserMfa, 'mfa')
|
|
497
|
+
.addSelect('mfa.backupCodesHash')
|
|
498
|
+
.setLock('pessimistic_write')
|
|
499
|
+
.where('mfa.userId = :userId', { userId: row.userId })
|
|
500
|
+
.getOne();
|
|
501
|
+
if (!locked)
|
|
502
|
+
return false;
|
|
503
|
+
const lockedHashes = [...(locked.backupCodesHash ?? [])];
|
|
504
|
+
const idx = lockedHashes.indexOf(matchedHash);
|
|
505
|
+
if (idx < 0)
|
|
506
|
+
return false; // concurrent consume won
|
|
507
|
+
lockedHashes.splice(idx, 1);
|
|
508
|
+
locked.backupCodesHash = lockedHashes;
|
|
509
|
+
await manager.save(locked);
|
|
510
|
+
row.backupCodesHash = lockedHashes;
|
|
511
|
+
return true;
|
|
512
|
+
});
|
|
513
|
+
}
|
|
514
|
+
/** Avoid a no-op MFA row write when lockout fields are already clear. */
|
|
515
|
+
async clearMfaLockoutIfNeeded(row) {
|
|
516
|
+
if ((row.failedAttempts ?? 0) === 0 && !row.lockedUntil)
|
|
517
|
+
return;
|
|
518
|
+
row.failedAttempts = 0;
|
|
519
|
+
row.lockedUntil = undefined;
|
|
520
|
+
await this.mfaRepo.save(row);
|
|
521
|
+
}
|
|
522
|
+
toStatus(row, backupCodesRemaining) {
|
|
523
|
+
return {
|
|
524
|
+
mfaEnabled: row?.mfaEnabled === true,
|
|
525
|
+
totpConfigured: Boolean(row?.totpConfirmedAt),
|
|
526
|
+
totpConfirmedAt: row?.totpConfirmedAt,
|
|
527
|
+
backupCodesRemaining: backupCodesRemaining ?? row?.backupCodesHash?.length ?? 0,
|
|
528
|
+
};
|
|
529
|
+
}
|
|
530
|
+
async loadMfaWithSecrets(userId) {
|
|
531
|
+
return this.mfaRepo
|
|
532
|
+
.createQueryBuilder('mfa')
|
|
533
|
+
.addSelect('mfa.totpSecretEncrypted')
|
|
534
|
+
.addSelect('mfa.backupCodesHash')
|
|
535
|
+
.where('mfa.userId = :userId', { userId })
|
|
536
|
+
.getOne();
|
|
537
|
+
}
|
|
538
|
+
async assertNotLocked(row) {
|
|
539
|
+
if (row.lockedUntil && row.lockedUntil.getTime() > Date.now()) {
|
|
540
|
+
const retryAfter = Math.ceil((row.lockedUntil.getTime() - Date.now()) / 1000);
|
|
541
|
+
throw new common_1.HttpException({
|
|
542
|
+
message: `Too many failed MFA attempts. Please try again in ${retryAfter}s.`,
|
|
543
|
+
retryAfter,
|
|
544
|
+
}, common_1.HttpStatus.TOO_MANY_REQUESTS);
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
/** Increment failed attempts under a row lock so concurrent wrong codes cannot under-count. */
|
|
548
|
+
async recordFailedAttempt(row) {
|
|
549
|
+
const max = this.settingsService.get(settings_keys_1.SETTING_KEYS.AUTH_MFA_MAX_ATTEMPTS);
|
|
550
|
+
const duration = this.settingsService.get(settings_keys_1.SETTING_KEYS.AUTH_MFA_LOCKOUT_DURATION_SECONDS);
|
|
551
|
+
await this.dataSource.transaction(async (manager) => {
|
|
552
|
+
const locked = await manager
|
|
553
|
+
.createQueryBuilder(user_mfa_entity_1.UserMfa, 'mfa')
|
|
554
|
+
.setLock('pessimistic_write')
|
|
555
|
+
.where('mfa.userId = :userId', { userId: row.userId })
|
|
556
|
+
.getOne();
|
|
557
|
+
if (!locked)
|
|
558
|
+
return;
|
|
559
|
+
locked.failedAttempts = (locked.failedAttempts ?? 0) + 1;
|
|
560
|
+
if (locked.failedAttempts >= max) {
|
|
561
|
+
locked.lockedUntil = new Date(Date.now() + duration * 1000);
|
|
562
|
+
locked.failedAttempts = 0;
|
|
563
|
+
}
|
|
564
|
+
await manager.save(locked);
|
|
565
|
+
row.failedAttempts = locked.failedAttempts;
|
|
566
|
+
row.lockedUntil = locked.lockedUntil;
|
|
567
|
+
});
|
|
568
|
+
if (row.lockedUntil && row.lockedUntil.getTime() > Date.now()) {
|
|
569
|
+
this.audit.record({
|
|
570
|
+
action: audit_actions_1.AUDIT_ACTIONS.MFA_LOCKED,
|
|
571
|
+
actorType: 'USER',
|
|
572
|
+
actorId: row.userId,
|
|
573
|
+
resourceType: 'user',
|
|
574
|
+
resourceId: row.userId,
|
|
575
|
+
status: 'FAILURE',
|
|
576
|
+
metadata: { lockedUntil: row.lockedUntil.toISOString() },
|
|
577
|
+
});
|
|
578
|
+
}
|
|
579
|
+
else {
|
|
580
|
+
this.audit.record({
|
|
581
|
+
action: audit_actions_1.AUDIT_ACTIONS.MFA_VERIFY_FAILED,
|
|
582
|
+
actorType: 'USER',
|
|
583
|
+
actorId: row.userId,
|
|
584
|
+
resourceType: 'user',
|
|
585
|
+
resourceId: row.userId,
|
|
586
|
+
status: 'FAILURE',
|
|
587
|
+
metadata: { failedAttempts: row.failedAttempts },
|
|
588
|
+
});
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
async assertTotpNotReplayed(userId, code) {
|
|
592
|
+
const key = `${KEY_TOTP_USED}${userId}:${code}`;
|
|
593
|
+
const result = await this.redis.set(key, '1', 'EX', 90, 'NX');
|
|
594
|
+
if (result !== 'OK') {
|
|
595
|
+
throw new common_1.UnauthorizedException('TOTP code already used');
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
async clearTotpReplay(userId, code) {
|
|
599
|
+
await this.redis.del(`${KEY_TOTP_USED}${userId}:${code}`).catch(() => undefined);
|
|
600
|
+
}
|
|
601
|
+
/**
|
|
602
|
+
* Prefer dedicated MFA_ENCRYPTION_KEY; fall back to ENCRYPTION_KEY.
|
|
603
|
+
* Backup-code HMAC pepper uses the same material.
|
|
604
|
+
*/
|
|
605
|
+
requireMfaEncryptionKey() {
|
|
606
|
+
const key = this.configService.get('app.mfaEncryptionKey') ||
|
|
607
|
+
this.configService.get('app.encryptionKey');
|
|
608
|
+
if (!key) {
|
|
609
|
+
throw new common_1.BadRequestException('MFA requires MFA_ENCRYPTION_KEY or ENCRYPTION_KEY (64 hex characters).');
|
|
610
|
+
}
|
|
611
|
+
return key;
|
|
612
|
+
}
|
|
613
|
+
previousMfaEncryptionKey() {
|
|
614
|
+
return this.configService.get('app.mfaEncryptionKeyPrevious') || undefined;
|
|
615
|
+
}
|
|
616
|
+
mfaPeppers() {
|
|
617
|
+
const current = this.requireMfaEncryptionKey();
|
|
618
|
+
const previous = this.previousMfaEncryptionKey();
|
|
619
|
+
return previous && previous !== current ? [current, previous] : [current];
|
|
620
|
+
}
|
|
621
|
+
decryptTotpSecret(stored) {
|
|
622
|
+
if (!stored)
|
|
623
|
+
return null;
|
|
624
|
+
return (0, mfa_secret_util_1.openMfaSecret)(stored, this.requireMfaEncryptionKey(), this.previousMfaEncryptionKey());
|
|
625
|
+
}
|
|
626
|
+
async emitMfaEvent(event, userId) {
|
|
627
|
+
if (!this.eventEmitter)
|
|
628
|
+
return;
|
|
629
|
+
const payload = { userId, at: new Date() };
|
|
630
|
+
void this.eventEmitter.emitAsync(event, payload).catch((err) => {
|
|
631
|
+
this.logger.error('Auth MFA event listener failed', {
|
|
632
|
+
event: 'auth.mfa.event_failed',
|
|
633
|
+
metadata: { listener: event },
|
|
634
|
+
err: err instanceof Error ? err : undefined,
|
|
635
|
+
});
|
|
636
|
+
});
|
|
637
|
+
}
|
|
638
|
+
};
|
|
639
|
+
exports.MfaService = MfaService;
|
|
640
|
+
exports.MfaService = MfaService = __decorate([
|
|
641
|
+
(0, common_1.Injectable)(),
|
|
642
|
+
__param(0, (0, typeorm_1.InjectRepository)(user_mfa_entity_1.UserMfa)),
|
|
643
|
+
__param(3, (0, common_1.Inject)((0, common_1.forwardRef)(() => login_service_1.LoginService))),
|
|
644
|
+
__param(6, (0, common_1.Inject)(redis_module_1.REDIS_CLIENT)),
|
|
645
|
+
__param(10, (0, common_1.Inject)((0, common_1.forwardRef)(() => otp_auth_service_1.OtpAuthService))),
|
|
646
|
+
__param(11, (0, common_1.Inject)((0, common_1.forwardRef)(() => oauth_service_1.OAuthService))),
|
|
647
|
+
__param(13, (0, common_1.Optional)()),
|
|
648
|
+
__metadata("design:paramtypes", [typeorm_2.Repository,
|
|
649
|
+
users_service_1.UsersService,
|
|
650
|
+
token_service_1.TokenService,
|
|
651
|
+
login_service_1.LoginService,
|
|
652
|
+
settings_service_1.SettingsService,
|
|
653
|
+
config_1.ConfigService,
|
|
654
|
+
ioredis_1.default,
|
|
655
|
+
structured_logger_service_1.StructuredLoggerService,
|
|
656
|
+
metrics_service_1.MetricsService,
|
|
657
|
+
typeorm_2.DataSource,
|
|
658
|
+
otp_auth_service_1.OtpAuthService,
|
|
659
|
+
oauth_service_1.OAuthService,
|
|
660
|
+
audit_service_1.AuditService, Object])
|
|
661
|
+
], MfaService);
|
|
662
|
+
//# sourceMappingURL=mfa.service.js.map
|