@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
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,27 @@
|
|
|
1
|
+
## [1.2.1](https://github.com/colveor/core/compare/v1.2.0...v1.2.1) (2026-07-30)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
* correct formatting in audit partitioning migration and test ([5cafb19](https://github.com/colveor/core/commit/5cafb19b790868a412a7d19bc637fcf0c4497532))
|
|
6
|
+
* restore audit_events partitioning after full-schema ([57fd535](https://github.com/colveor/core/commit/57fd5354e26f0137d1ebe1b543e29c34e280ac45))
|
|
7
|
+
|
|
8
|
+
## [1.2.0](https://github.com/colveor/core/compare/v1.1.0...v1.2.0) (2026-07-30)
|
|
9
|
+
|
|
10
|
+
### Features
|
|
11
|
+
|
|
12
|
+
* add documentation submodule ([d976042](https://github.com/colveor/core/commit/d9760421b5fb831cc23b53b105a3ae3c6a430ca4))
|
|
13
|
+
* add realtime WebSocket support and related configurations ([78546a7](https://github.com/colveor/core/commit/78546a730fddfd015d6deff70f78636105b6c5fb))
|
|
14
|
+
* enhance database configuration and admin controller with caching and audit logging ([a3e2795](https://github.com/colveor/core/commit/a3e27950b6020cf2e34f228953ff7baa210b369e))
|
|
15
|
+
* enhance file upload and profile modules with photo URL management ([0238bdb](https://github.com/colveor/core/commit/0238bdb76fe7bc5ef50b7ccd569e70f38559a54f))
|
|
16
|
+
* enhance PIN management with rate limiting and verification improvements ([64a941a](https://github.com/colveor/core/commit/64a941a6fc47a3781b581dd00201ac5e9144d6bf))
|
|
17
|
+
* enhance profile module with public username lookup and cover photo management ([b24a4b1](https://github.com/colveor/core/commit/b24a4b150d5ab890c62984c7abe2ef6e21f611ef))
|
|
18
|
+
* harden auth with MFA, OAuth, DPoP, and settings locks ([fce2692](https://github.com/colveor/core/commit/fce26923e0fcbf81b1e58d985d81c8f4cf37f12c))
|
|
19
|
+
* implement audit logging across various modules ([3a32fef](https://github.com/colveor/core/commit/3a32fef2fba6c08ecd9b4e7dce1d3206262632e0))
|
|
20
|
+
|
|
21
|
+
### Bug Fixes
|
|
22
|
+
|
|
23
|
+
* clean up import statements and formatting across multiple files ([2efdbe4](https://github.com/colveor/core/commit/2efdbe4595a768a1ac61ea0641c3eda2092b089d))
|
|
24
|
+
|
|
1
25
|
## [1.1.0](https://github.com/colveor/core/compare/v1.0.1...v1.1.0) (2026-07-24)
|
|
2
26
|
|
|
3
27
|
### Features
|
package/README.md
CHANGED
|
@@ -78,6 +78,12 @@ npm run build
|
|
|
78
78
|
|
|
79
79
|
Shared tooling comes from [`@colveor/devkit`](https://github.com/colveor/devkit).
|
|
80
80
|
|
|
81
|
+
## Documentation
|
|
82
|
+
|
|
83
|
+
Ecosystem docs live under [`documentation/`](documentation/readme.md) (products, guides, tutorials, architecture).
|
|
84
|
+
|
|
85
|
+
Start with [Core introduction](documentation/products/core/introduction.md) or [Creating your first app](documentation/guides/creating-your-first-app.md).
|
|
86
|
+
|
|
81
87
|
## Related packages
|
|
82
88
|
|
|
83
89
|
| Package | Purpose |
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bootstrap-colveor-app.d.ts","sourceRoot":"","sources":["../../src/bootstrap/bootstrap-colveor-app.ts"],"names":[],"mappings":"AAAA,OAAO,EAA+B,KAAK,IAAI,EAAkB,MAAM,gBAAgB,CAAC;AAGxF,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"bootstrap-colveor-app.d.ts","sourceRoot":"","sources":["../../src/bootstrap/bootstrap-colveor-app.ts"],"names":[],"mappings":"AAAA,OAAO,EAA+B,KAAK,IAAI,EAAkB,MAAM,gBAAgB,CAAC;AAGxF,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAWvE,OAAO,KAAK,EAAE,uBAAuB,EAA4B,MAAM,mBAAmB,CAAC;AAiC3F;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,mBAAmB,CACxC,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,EACxB,OAAO,GAAE,uBAA4B,GACnC,OAAO,CAAC,sBAAsB,CAAC,CAyDjC;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAC5B,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,EACxB,OAAO,GAAE,uBAA4B,GACnC,IAAI,CAQN"}
|
|
@@ -15,9 +15,22 @@ const middlewares_1 = require("../common/middlewares");
|
|
|
15
15
|
const validation_1 = require("../common/utils/validation");
|
|
16
16
|
const env_flags_util_1 = require("../config/env-flags.util");
|
|
17
17
|
const observability_1 = require("../modules/observability");
|
|
18
|
+
const realtime_1 = require("../modules/realtime");
|
|
18
19
|
const logger_utils_1 = require("./logger.utils");
|
|
19
20
|
const metrics_prefix_alias_middleware_1 = require("./metrics-prefix-alias.middleware");
|
|
20
21
|
const observability_bootstrap_1 = require("./observability.bootstrap");
|
|
22
|
+
async function installRealtimeAdapterIfEnabled(app) {
|
|
23
|
+
try {
|
|
24
|
+
const enabled = app.get(realtime_1.REALTIME_ENABLED_TOKEN, { strict: false });
|
|
25
|
+
if (enabled === true) {
|
|
26
|
+
await (0, realtime_1.installRealtimeIoAdapter)(app);
|
|
27
|
+
new common_1.Logger('Bootstrap').log('Realtime Socket.IO adapter installed');
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
catch {
|
|
31
|
+
// Realtime module not registered
|
|
32
|
+
}
|
|
33
|
+
}
|
|
21
34
|
// ─── Defaults ─────────────────────────────────────────────────────────────────
|
|
22
35
|
const DEFAULT_PREFIX_EXCLUDE = [
|
|
23
36
|
'/',
|
|
@@ -54,6 +67,7 @@ async function bootstrapColveorApp(appModule, options = {}) {
|
|
|
54
67
|
const app = await core_1.NestFactory.create(appModule, {
|
|
55
68
|
logger: loggerLevels,
|
|
56
69
|
});
|
|
70
|
+
await installRealtimeAdapterIfEnabled(app);
|
|
57
71
|
await options.beforeConfigure?.(app);
|
|
58
72
|
const configService = app.get(config_1.ConfigService);
|
|
59
73
|
const configNamespace = options.configNamespace ?? 'app';
|
|
@@ -61,7 +75,7 @@ async function bootstrapColveorApp(appModule, options = {}) {
|
|
|
61
75
|
const port = configService.get(getKey('port'), options.defaultPort ?? 3001);
|
|
62
76
|
const apiPrefix = configService.get(getKey('apiPrefix'), options.defaultApiPrefix ?? 'api/v1');
|
|
63
77
|
const nodeEnv = configService.get(getKey('nodeEnv'), 'development');
|
|
64
|
-
configureTrustProxy(app, options);
|
|
78
|
+
configureTrustProxy(app, options, nodeEnv);
|
|
65
79
|
configureMiddleware(app, options, nodeEnv);
|
|
66
80
|
configureRequestId(app, options);
|
|
67
81
|
configureGlobalPrefix(app, apiPrefix, options);
|
|
@@ -98,8 +112,13 @@ function runColveorApp(appModule, options = {}) {
|
|
|
98
112
|
});
|
|
99
113
|
}
|
|
100
114
|
// ─── Configuration Helpers ────────────────────────────────────────────────────
|
|
101
|
-
function configureTrustProxy(app, options) {
|
|
102
|
-
|
|
115
|
+
function configureTrustProxy(app, options, nodeEnv) {
|
|
116
|
+
const value = options.trustProxy ?? 1;
|
|
117
|
+
if (nodeEnv === 'production' && (value === false || value === 0)) {
|
|
118
|
+
throw new Error('trust proxy must be enabled in production (IP rate limits and audit depend on req.ip). ' +
|
|
119
|
+
'Pass trustProxy: 1 (or hop count) to runColveorApp / bootstrapColveorApp.');
|
|
120
|
+
}
|
|
121
|
+
app.set('trust proxy', value);
|
|
103
122
|
}
|
|
104
123
|
function configureMiddleware(app, options, nodeEnv) {
|
|
105
124
|
if (options.helmet !== false) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bootstrap-colveor-app.js","sourceRoot":"","sources":["../../src/bootstrap/bootstrap-colveor-app.ts"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"bootstrap-colveor-app.js","sourceRoot":"","sources":["../../src/bootstrap/bootstrap-colveor-app.ts"],"names":[],"mappings":";;;;;AAgEA,kDA4DC;AAOD,sCAWC;AA9ID,2CAAwF;AACxF,2CAA+C;AAC/C,uCAA2C;AAE3C,6CAAiE;AAEjE,8DAAsC;AACtC,oDAA4B;AAE5B,uDAA4D;AAC5D,2DAA0E;AAC1E,6DAAkE;AAClE,4DAA0E;AAC1E,kDAAuF;AAEvF,iDAAiD;AACjD,uFAAuF;AACvF,uEAAiE;AAEjE,KAAK,UAAU,+BAA+B,CAAC,GAA2B;IACzE,IAAI,CAAC;QACJ,MAAM,OAA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MAAM,EACN,aAAa,EACb,IAAI,EACJ,SAAS,EACT,OAAO,EACP,cAAc,EACd,WAAW,EACX,eAAe,GACc;IAC7B,MAAM,OAAO,GACZ,aAAa,CAAC,GAAG,CAAS,GAAG,eAAe,MAAM,CAAC,IAAI,oBAAoB,IAAI,EAAE,CAAC;IAEnF,MAAM,gBAAgB,GAAG,aAAa,CAAC,GAAG,CACzC,GAAG,eAAe,mBAAmB,EACrC,MAAM,CACN,CAAC;IAEF,MAAM,CAAC,GAAG,CAAC,8BAA8B,OAAO,IAAI,SAAS,EAAE,CAAC,CAAC;IACjE,MAAM,CAAC,GAAG,CAAC,gBAAgB,OAAO,EAAE,CAAC,CAAC;IACtC,MAAM,CAAC,GAAG,CAAC,oBAAoB,gBAAgB,IAAI,CAAC,CAAC;IACrD,MAAM,CAAC,GAAG,CAAC,YAAY,OAAO,UAAU,CAAC,CAAC;IAC1C,MAAM,CAAC,GAAG,CAAC,iBAAiB,cAAc,CAAC,CAAC,CAAC,GAAG,OAAO,IAAI,WAAW,EAAE,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC,CAAC;AAC1F,CAAC"}
|
|
@@ -3,6 +3,12 @@ export declare const IS_PUBLIC_KEY = "isPublic";
|
|
|
3
3
|
export declare const Public: () => import("@nestjs/common").CustomDecorator<string>;
|
|
4
4
|
export declare const PERMISSIONS_KEY = "permissions";
|
|
5
5
|
export declare const RequirePermission: (...permissions: string[]) => import("@nestjs/common").CustomDecorator<string>;
|
|
6
|
+
/**
|
|
7
|
+
* Intentional JWT-only route (no permission slug).
|
|
8
|
+
* Required when PermissionsGuard is fail-closed and the handler has no @RequirePermission.
|
|
9
|
+
*/
|
|
10
|
+
export declare const ALLOW_AUTHENTICATED_KEY = "allowAuthenticated";
|
|
11
|
+
export declare const AllowAuthenticated: () => import("@nestjs/common").CustomDecorator<string>;
|
|
6
12
|
export declare const IpAddress: (...dataOrPipes: unknown[]) => ParameterDecorator;
|
|
7
13
|
export declare const UserAgent: (...dataOrPipes: unknown[]) => ParameterDecorator;
|
|
8
14
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/common/decorators/index.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,WAAW,qMAMvB,CAAC;AAGF,eAAO,MAAM,aAAa,aAAa,CAAC;AACxC,eAAO,MAAM,MAAM,wDAAyC,CAAC;AAG7D,eAAO,MAAM,eAAe,gBAAgB,CAAC;AAC7C,eAAO,MAAM,iBAAiB,GAAI,GAAG,aAAa,MAAM,EAAE,qDAChB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/common/decorators/index.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,WAAW,qMAMvB,CAAC;AAGF,eAAO,MAAM,aAAa,aAAa,CAAC;AACxC,eAAO,MAAM,MAAM,wDAAyC,CAAC;AAG7D,eAAO,MAAM,eAAe,gBAAgB,CAAC;AAC7C,eAAO,MAAM,iBAAiB,GAAI,GAAG,aAAa,MAAM,EAAE,qDAChB,CAAC;AAE3C;;;GAGG;AACH,eAAO,MAAM,uBAAuB,uBAAuB,CAAC;AAC5D,eAAO,MAAM,kBAAkB,wDAAmD,CAAC;AAGnF,eAAO,MAAM,SAAS,mDAQpB,CAAC;AAGH,eAAO,MAAM,SAAS,mDAGpB,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UserAgent = exports.IpAddress = exports.RequirePermission = exports.PERMISSIONS_KEY = exports.Public = exports.IS_PUBLIC_KEY = exports.CurrentUser = void 0;
|
|
3
|
+
exports.UserAgent = exports.IpAddress = exports.AllowAuthenticated = exports.ALLOW_AUTHENTICATED_KEY = exports.RequirePermission = exports.PERMISSIONS_KEY = exports.Public = exports.IS_PUBLIC_KEY = exports.CurrentUser = void 0;
|
|
4
4
|
const common_1 = require("@nestjs/common");
|
|
5
5
|
// Current user decorator - extracts user from request
|
|
6
6
|
exports.CurrentUser = (0, common_1.createParamDecorator)((data, ctx) => {
|
|
@@ -16,6 +16,13 @@ exports.Public = Public;
|
|
|
16
16
|
exports.PERMISSIONS_KEY = 'permissions';
|
|
17
17
|
const RequirePermission = (...permissions) => (0, common_1.SetMetadata)(exports.PERMISSIONS_KEY, permissions);
|
|
18
18
|
exports.RequirePermission = RequirePermission;
|
|
19
|
+
/**
|
|
20
|
+
* Intentional JWT-only route (no permission slug).
|
|
21
|
+
* Required when PermissionsGuard is fail-closed and the handler has no @RequirePermission.
|
|
22
|
+
*/
|
|
23
|
+
exports.ALLOW_AUTHENTICATED_KEY = 'allowAuthenticated';
|
|
24
|
+
const AllowAuthenticated = () => (0, common_1.SetMetadata)(exports.ALLOW_AUTHENTICATED_KEY, true);
|
|
25
|
+
exports.AllowAuthenticated = AllowAuthenticated;
|
|
19
26
|
// IP address decorator
|
|
20
27
|
exports.IpAddress = (0, common_1.createParamDecorator)((_data, ctx) => {
|
|
21
28
|
const request = ctx.switchToHttp().getRequest();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/common/decorators/index.ts"],"names":[],"mappings":";;;AAAA,2CAA0F;AAO1F,sDAAsD;AACzC,QAAA,WAAW,GAAG,IAAA,6BAAoB,EAC9C,CAAC,IAAwB,EAAE,GAAqB,EAAE,EAAE;IACnD,MAAM,OAAO,GAAG,GAAG,CAAC,YAAY,EAAE,CAAC,UAAU,EAAwB,CAAC;IACtE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAC1B,OAAO,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AACnC,CAAC,CACD,CAAC;AAEF,uDAAuD;AAC1C,QAAA,aAAa,GAAG,UAAU,CAAC;AACjC,MAAM,MAAM,GAAG,GA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MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QAClE,OAAO,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC;IACpC,CAAC;IACD,OAAO,OAAO,CAAC,EAAE,IAAI,OAAO,CAAC,MAAM,EAAE,aAAa,CAAC;AACpD,CAAC,CAAC,CAAC;AAEH,uBAAuB;AACV,QAAA,SAAS,GAAG,IAAA,6BAAoB,EAAC,CAAC,KAAc,EAAE,GAAqB,EAAE,EAAE;IACvF,MAAM,OAAO,GAAG,GAAG,CAAC,YAAY,EAAE,CAAC,UAAU,EAAW,CAAC;IACzD,OAAO,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;AACtC,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Rate-limit bucket for {@link LoginIpRateLimitGuard}. */
|
|
2
|
+
export type IpRateLimitBucket = 'login' | 'refresh' | 'auth_public' | 'profile_public';
|
|
3
|
+
export declare const IP_RATE_LIMIT_BUCKET_KEY = "ip_rate_limit_bucket";
|
|
4
|
+
/**
|
|
5
|
+
* Selects which IP rate-limit settings / Redis key prefix the guard uses.
|
|
6
|
+
* Default (no decorator) = `login`.
|
|
7
|
+
*/
|
|
8
|
+
export declare const IpRateLimitBucket: (bucket: IpRateLimitBucket) => import("@nestjs/common").CustomDecorator<string>;
|
|
9
|
+
//# sourceMappingURL=ip-rate-limit-bucket.decorator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ip-rate-limit-bucket.decorator.d.ts","sourceRoot":"","sources":["../../../src/common/decorators/ip-rate-limit-bucket.decorator.ts"],"names":[],"mappings":"AAEA,2DAA2D;AAC3D,MAAM,MAAM,iBAAiB,GAAG,OAAO,GAAG,SAAS,GAAG,aAAa,GAAG,gBAAgB,CAAC;AAEvF,eAAO,MAAM,wBAAwB,yBAAyB,CAAC;AAE/D;;;GAGG;AACH,eAAO,MAAM,iBAAiB,GAAI,QAAQ,iBAAiB,qDACb,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IpRateLimitBucket = exports.IP_RATE_LIMIT_BUCKET_KEY = void 0;
|
|
4
|
+
const common_1 = require("@nestjs/common");
|
|
5
|
+
exports.IP_RATE_LIMIT_BUCKET_KEY = 'ip_rate_limit_bucket';
|
|
6
|
+
/**
|
|
7
|
+
* Selects which IP rate-limit settings / Redis key prefix the guard uses.
|
|
8
|
+
* Default (no decorator) = `login`.
|
|
9
|
+
*/
|
|
10
|
+
const IpRateLimitBucket = (bucket) => (0, common_1.SetMetadata)(exports.IP_RATE_LIMIT_BUCKET_KEY, bucket);
|
|
11
|
+
exports.IpRateLimitBucket = IpRateLimitBucket;
|
|
12
|
+
//# sourceMappingURL=ip-rate-limit-bucket.decorator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ip-rate-limit-bucket.decorator.js","sourceRoot":"","sources":["../../../src/common/decorators/ip-rate-limit-bucket.decorator.ts"],"names":[],"mappings":";;;AAAA,2CAA6C;AAKhC,QAAA,wBAAwB,GAAG,sBAAsB,CAAC;AAE/D;;;GAGG;AACI,MAAM,iBAAiB,GAAG,CAAC,MAAyB,EAAE,EAAE,CAC9D,IAAA,oBAAW,EAAC,gCAAwB,EAAE,MAAM,CAAC,CAAC;AADlC,QAAA,iBAAiB,qBACiB"}
|
|
@@ -1,18 +1,24 @@
|
|
|
1
1
|
import { CanActivate, ExecutionContext } from '@nestjs/common';
|
|
2
|
+
import { ConfigService } from '@nestjs/config';
|
|
3
|
+
import { Reflector } from '@nestjs/core';
|
|
2
4
|
import IORedis from 'ioredis';
|
|
3
5
|
import { SettingsService } from '../../modules/settings/services/settings.service';
|
|
4
6
|
/**
|
|
5
|
-
* Per-IP rate limit guard for
|
|
7
|
+
* Per-IP rate limit guard for public auth endpoints.
|
|
6
8
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
9
|
+
* Bucket selected via {@link IpRateLimitBucket} metadata (default: `login`):
|
|
10
|
+
* - `login` — credential stuffing protection (login / MFA verify / OAuth callback)
|
|
11
|
+
* - `refresh` — higher budget for mobile token rotation
|
|
12
|
+
* - `auth_public` — register / forgot-password / OAuth start
|
|
13
|
+
* - `profile_public` — public username profile lookup
|
|
10
14
|
*/
|
|
11
15
|
export declare class LoginIpRateLimitGuard implements CanActivate {
|
|
12
16
|
private readonly redis;
|
|
13
17
|
private readonly settingsService;
|
|
14
|
-
|
|
18
|
+
private readonly reflector;
|
|
19
|
+
private readonly configService;
|
|
20
|
+
constructor(redis: IORedis, settingsService: SettingsService, reflector: Reflector, configService: ConfigService);
|
|
15
21
|
canActivate(context: ExecutionContext): Promise<boolean>;
|
|
16
|
-
private
|
|
22
|
+
private resolveBucket;
|
|
17
23
|
}
|
|
18
24
|
//# sourceMappingURL=login-ip-rate-limit.guard.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"login-ip-rate-limit.guard.d.ts","sourceRoot":"","sources":["../../../src/common/guards/login-ip-rate-limit.guard.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,WAAW,EACX,gBAAgB,EAKhB,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"login-ip-rate-limit.guard.d.ts","sourceRoot":"","sources":["../../../src/common/guards/login-ip-rate-limit.guard.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,WAAW,EACX,gBAAgB,EAKhB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,OAAO,MAAM,SAAS,CAAC;AAK9B,OAAO,EAAE,eAAe,EAAE,MAAM,kDAAkD,CAAC;AAOnF;;;;;;;;GAQG;AACH,qBACa,qBAAsB,YAAW,WAAW;IAGvD,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,eAAe;IAChC,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,aAAa;gBAHb,KAAK,EAAE,OAAO,EACd,eAAe,EAAE,eAAe,EAChC,SAAS,EAAE,SAAS,EACpB,aAAa,EAAE,aAAa;IAGxC,WAAW,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,OAAO,CAAC;IAkD9D,OAAO,CAAC,aAAa;CA+CrB"}
|
|
@@ -17,54 +17,96 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports.LoginIpRateLimitGuard = void 0;
|
|
19
19
|
const common_1 = require("@nestjs/common");
|
|
20
|
+
const config_1 = require("@nestjs/config");
|
|
21
|
+
const core_1 = require("@nestjs/core");
|
|
20
22
|
const ioredis_1 = __importDefault(require("ioredis"));
|
|
23
|
+
const node_env_util_1 = require("../../config/node-env.util");
|
|
21
24
|
const redis_module_1 = require("../../config/redis.module");
|
|
22
25
|
const settings_keys_1 = require("../../modules/settings/constants/settings.keys");
|
|
23
26
|
const settings_service_1 = require("../../modules/settings/services/settings.service");
|
|
27
|
+
const ip_rate_limit_bucket_decorator_1 = require("../decorators/ip-rate-limit-bucket.decorator");
|
|
28
|
+
const request_utils_1 = require("../utils/request.utils");
|
|
24
29
|
/**
|
|
25
|
-
* Per-IP rate limit guard for
|
|
30
|
+
* Per-IP rate limit guard for public auth endpoints.
|
|
26
31
|
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
32
|
+
* Bucket selected via {@link IpRateLimitBucket} metadata (default: `login`):
|
|
33
|
+
* - `login` — credential stuffing protection (login / MFA verify / OAuth callback)
|
|
34
|
+
* - `refresh` — higher budget for mobile token rotation
|
|
35
|
+
* - `auth_public` — register / forgot-password / OAuth start
|
|
36
|
+
* - `profile_public` — public username profile lookup
|
|
30
37
|
*/
|
|
31
38
|
let LoginIpRateLimitGuard = class LoginIpRateLimitGuard {
|
|
32
39
|
redis;
|
|
33
40
|
settingsService;
|
|
34
|
-
|
|
41
|
+
reflector;
|
|
42
|
+
configService;
|
|
43
|
+
constructor(redis, settingsService, reflector, configService) {
|
|
35
44
|
this.redis = redis;
|
|
36
45
|
this.settingsService = settingsService;
|
|
46
|
+
this.reflector = reflector;
|
|
47
|
+
this.configService = configService;
|
|
37
48
|
}
|
|
38
49
|
async canActivate(context) {
|
|
39
50
|
const request = context.switchToHttp().getRequest();
|
|
40
|
-
|
|
41
|
-
|
|
51
|
+
// Use Express `req.ip` (trust-proxy aware). Never trust raw X-Forwarded-For.
|
|
52
|
+
const ip = (0, request_utils_1.extractIp)(request);
|
|
53
|
+
if (!ip) {
|
|
54
|
+
if ((0, node_env_util_1.isProductionNodeEnv)(this.configService.get('app.nodeEnv'))) {
|
|
55
|
+
throw new common_1.HttpException({
|
|
56
|
+
message: 'Unable to resolve client IP for rate limiting. Check trust-proxy configuration.',
|
|
57
|
+
}, common_1.HttpStatus.SERVICE_UNAVAILABLE);
|
|
58
|
+
}
|
|
42
59
|
return true;
|
|
43
|
-
|
|
44
|
-
const
|
|
45
|
-
|
|
60
|
+
}
|
|
61
|
+
const bucket = this.reflector.getAllAndOverride(ip_rate_limit_bucket_decorator_1.IP_RATE_LIMIT_BUCKET_KEY, [
|
|
62
|
+
context.getHandler(),
|
|
63
|
+
context.getClass(),
|
|
64
|
+
]) ?? 'login';
|
|
65
|
+
const { max, window, keyPrefix, label } = this.resolveBucket(bucket);
|
|
66
|
+
const key = `${keyPrefix}${ip}`;
|
|
46
67
|
const count = (await this.redis.eval(`local n = redis.call('INCR', KEYS[1])
|
|
47
68
|
if n == 1 then redis.call('EXPIRE', KEYS[1], ARGV[1]) end
|
|
48
69
|
return n`, 1, key, String(window)));
|
|
49
70
|
if (count > max) {
|
|
50
71
|
const ttl = await this.redis.ttl(key);
|
|
51
72
|
throw new common_1.HttpException({
|
|
52
|
-
message: `Too many
|
|
73
|
+
message: `Too many ${label} from this IP. Please try again in ${ttl}s.`,
|
|
53
74
|
retryAfter: ttl,
|
|
54
75
|
}, common_1.HttpStatus.TOO_MANY_REQUESTS);
|
|
55
76
|
}
|
|
56
77
|
return true;
|
|
57
78
|
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
.
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
79
|
+
resolveBucket(bucket) {
|
|
80
|
+
if (bucket === 'refresh') {
|
|
81
|
+
return {
|
|
82
|
+
max: this.settingsService.get(settings_keys_1.SETTING_KEYS.REFRESH_IP_RATE_LIMIT_MAX),
|
|
83
|
+
window: this.settingsService.get(settings_keys_1.SETTING_KEYS.REFRESH_IP_RATE_LIMIT_WINDOW_SECONDS),
|
|
84
|
+
keyPrefix: 'refresh:ip-rate:',
|
|
85
|
+
label: 'token refresh attempts',
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
if (bucket === 'auth_public') {
|
|
89
|
+
return {
|
|
90
|
+
max: this.settingsService.get(settings_keys_1.SETTING_KEYS.AUTH_PUBLIC_IP_RATE_LIMIT_MAX),
|
|
91
|
+
window: this.settingsService.get(settings_keys_1.SETTING_KEYS.AUTH_PUBLIC_IP_RATE_LIMIT_WINDOW_SECONDS),
|
|
92
|
+
keyPrefix: 'auth:public-ip-rate:',
|
|
93
|
+
label: 'auth requests',
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
if (bucket === 'profile_public') {
|
|
97
|
+
return {
|
|
98
|
+
max: this.settingsService.get(settings_keys_1.SETTING_KEYS.PROFILE_PUBLIC_IP_RATE_LIMIT_MAX),
|
|
99
|
+
window: this.settingsService.get(settings_keys_1.SETTING_KEYS.PROFILE_PUBLIC_IP_RATE_LIMIT_WINDOW_SECONDS),
|
|
100
|
+
keyPrefix: 'profile:public-ip-rate:',
|
|
101
|
+
label: 'public profile lookups',
|
|
102
|
+
};
|
|
66
103
|
}
|
|
67
|
-
return
|
|
104
|
+
return {
|
|
105
|
+
max: this.settingsService.get(settings_keys_1.SETTING_KEYS.LOGIN_IP_RATE_LIMIT_MAX),
|
|
106
|
+
window: this.settingsService.get(settings_keys_1.SETTING_KEYS.LOGIN_IP_RATE_LIMIT_WINDOW_SECONDS),
|
|
107
|
+
keyPrefix: 'login:ip-rate:',
|
|
108
|
+
label: 'login attempts',
|
|
109
|
+
};
|
|
68
110
|
}
|
|
69
111
|
};
|
|
70
112
|
exports.LoginIpRateLimitGuard = LoginIpRateLimitGuard;
|
|
@@ -72,6 +114,8 @@ exports.LoginIpRateLimitGuard = LoginIpRateLimitGuard = __decorate([
|
|
|
72
114
|
(0, common_1.Injectable)(),
|
|
73
115
|
__param(0, (0, common_1.Inject)(redis_module_1.REDIS_CLIENT)),
|
|
74
116
|
__metadata("design:paramtypes", [ioredis_1.default,
|
|
75
|
-
settings_service_1.SettingsService
|
|
117
|
+
settings_service_1.SettingsService,
|
|
118
|
+
core_1.Reflector,
|
|
119
|
+
config_1.ConfigService])
|
|
76
120
|
], LoginIpRateLimitGuard);
|
|
77
121
|
//# sourceMappingURL=login-ip-rate-limit.guard.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"login-ip-rate-limit.guard.js","sourceRoot":"","sources":["../../../src/common/guards/login-ip-rate-limit.guard.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,2CAOwB;
|
|
1
|
+
{"version":3,"file":"login-ip-rate-limit.guard.js","sourceRoot":"","sources":["../../../src/common/guards/login-ip-rate-limit.guard.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,2CAOwB;AACxB,2CAA+C;AAC/C,uCAAyC;AAEzC,sDAA8B;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G,CAC/B,4BAAY,CAAC,2CAA2C,CACxD;gBACD,SAAS,EAAE,yBAAyB;gBACpC,KAAK,EAAE,wBAAwB;aAC/B,CAAC;QACH,CAAC;QACD,OAAO;YACN,GAAG,EAAE,IAAI,CAAC,eAAe,CAAC,GAAG,CAAS,4BAAY,CAAC,uBAAuB,CAAC;YAC3E,MAAM,EAAE,IAAI,CAAC,eAAe,CAAC,GAAG,CAC/B,4BAAY,CAAC,kCAAkC,CAC/C;YACD,SAAS,EAAE,gBAAgB;YAC3B,KAAK,EAAE,gBAAgB;SACvB,CAAC;IACH,CAAC;CACD,CAAA;AA1GY,sDAAqB;gCAArB,qBAAqB;IADjC,IAAA,mBAAU,GAAE;IAGV,WAAA,IAAA,eAAM,EAAC,2BAAY,CAAC,CAAA;qCACG,iBAAO;QACG,kCAAe;QACrB,gBAAS;QACL,sBAAa;GANlC,qBAAqB,CA0GjC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { CanActivate, ExecutionContext } from '@nestjs/common';
|
|
2
|
+
import { ConfigService } from '@nestjs/config';
|
|
2
3
|
import IORedis from 'ioredis';
|
|
3
4
|
import { StructuredLoggerService } from '../../modules/observability/logging/structured-logger.service';
|
|
4
5
|
import { SettingsService } from '../../modules/settings/services/settings.service';
|
|
@@ -13,8 +14,8 @@ export declare class OtpIpRateLimitGuard implements CanActivate {
|
|
|
13
14
|
private readonly redis;
|
|
14
15
|
private readonly settingsService;
|
|
15
16
|
private readonly logger;
|
|
16
|
-
|
|
17
|
+
private readonly configService;
|
|
18
|
+
constructor(redis: IORedis, settingsService: SettingsService, logger: StructuredLoggerService, configService: ConfigService);
|
|
17
19
|
canActivate(context: ExecutionContext): Promise<boolean>;
|
|
18
|
-
private extractIp;
|
|
19
20
|
}
|
|
20
21
|
//# sourceMappingURL=otp-ip-rate-limit.guard.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"otp-ip-rate-limit.guard.d.ts","sourceRoot":"","sources":["../../../src/common/guards/otp-ip-rate-limit.guard.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,WAAW,EACX,gBAAgB,EAKhB,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"otp-ip-rate-limit.guard.d.ts","sourceRoot":"","sources":["../../../src/common/guards/otp-ip-rate-limit.guard.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,WAAW,EACX,gBAAgB,EAKhB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/C,OAAO,OAAO,MAAM,SAAS,CAAC;AAI9B,OAAO,EAAE,uBAAuB,EAAE,MAAM,+DAA+D,CAAC;AAExG,OAAO,EAAE,eAAe,EAAE,MAAM,kDAAkD,CAAC;AAGnF;;;;;;GAMG;AACH,qBACa,mBAAoB,YAAW,WAAW;IAGrD,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,eAAe;IAChC,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,aAAa;gBAHb,KAAK,EAAE,OAAO,EACd,eAAe,EAAE,eAAe,EAChC,MAAM,EAAE,uBAAuB,EAC/B,aAAa,EAAE,aAAa;IAGxC,WAAW,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,OAAO,CAAC;CAmD9D"}
|
|
@@ -17,11 +17,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports.OtpIpRateLimitGuard = void 0;
|
|
19
19
|
const common_1 = require("@nestjs/common");
|
|
20
|
+
const config_1 = require("@nestjs/config");
|
|
20
21
|
const ioredis_1 = __importDefault(require("ioredis"));
|
|
22
|
+
const node_env_util_1 = require("../../config/node-env.util");
|
|
21
23
|
const redis_module_1 = require("../../config/redis.module");
|
|
22
24
|
const structured_logger_service_1 = require("../../modules/observability/logging/structured-logger.service");
|
|
23
25
|
const settings_keys_1 = require("../../modules/settings/constants/settings.keys");
|
|
24
26
|
const settings_service_1 = require("../../modules/settings/services/settings.service");
|
|
27
|
+
const request_utils_1 = require("../utils/request.utils");
|
|
25
28
|
/**
|
|
26
29
|
* Per-IP rate limit guard for OTP endpoints.
|
|
27
30
|
*
|
|
@@ -33,16 +36,25 @@ let OtpIpRateLimitGuard = class OtpIpRateLimitGuard {
|
|
|
33
36
|
redis;
|
|
34
37
|
settingsService;
|
|
35
38
|
logger;
|
|
36
|
-
|
|
39
|
+
configService;
|
|
40
|
+
constructor(redis, settingsService, logger, configService) {
|
|
37
41
|
this.redis = redis;
|
|
38
42
|
this.settingsService = settingsService;
|
|
39
43
|
this.logger = logger;
|
|
44
|
+
this.configService = configService;
|
|
40
45
|
}
|
|
41
46
|
async canActivate(context) {
|
|
42
47
|
const request = context.switchToHttp().getRequest();
|
|
43
|
-
|
|
44
|
-
|
|
48
|
+
// Use Express `req.ip` (trust-proxy aware). Never trust raw X-Forwarded-For.
|
|
49
|
+
const ip = (0, request_utils_1.extractIp)(request);
|
|
50
|
+
if (!ip) {
|
|
51
|
+
if ((0, node_env_util_1.isProductionNodeEnv)(this.configService.get('app.nodeEnv'))) {
|
|
52
|
+
throw new common_1.HttpException({
|
|
53
|
+
message: 'Unable to resolve client IP for rate limiting. Check trust-proxy configuration.',
|
|
54
|
+
}, common_1.HttpStatus.SERVICE_UNAVAILABLE);
|
|
55
|
+
}
|
|
45
56
|
return true;
|
|
57
|
+
}
|
|
46
58
|
const max = this.settingsService.get(settings_keys_1.SETTING_KEYS.OTP_IP_RATE_LIMIT_MAX);
|
|
47
59
|
const window = this.settingsService.get(settings_keys_1.SETTING_KEYS.OTP_IP_RATE_LIMIT_WINDOW_SECONDS);
|
|
48
60
|
const key = `otp:ip-rate:${ip}`;
|
|
@@ -62,17 +74,6 @@ let OtpIpRateLimitGuard = class OtpIpRateLimitGuard {
|
|
|
62
74
|
}
|
|
63
75
|
return true;
|
|
64
76
|
}
|
|
65
|
-
extractIp(request) {
|
|
66
|
-
const forwarded = request.headers['x-forwarded-for'];
|
|
67
|
-
if (forwarded != null && forwarded !== '') {
|
|
68
|
-
const first = (Array.isArray(forwarded) ? forwarded[0] : forwarded)
|
|
69
|
-
.split(',')[0]
|
|
70
|
-
.trim();
|
|
71
|
-
if (first)
|
|
72
|
-
return first;
|
|
73
|
-
}
|
|
74
|
-
return request.ip ?? null;
|
|
75
|
-
}
|
|
76
77
|
};
|
|
77
78
|
exports.OtpIpRateLimitGuard = OtpIpRateLimitGuard;
|
|
78
79
|
exports.OtpIpRateLimitGuard = OtpIpRateLimitGuard = __decorate([
|
|
@@ -80,6 +81,7 @@ exports.OtpIpRateLimitGuard = OtpIpRateLimitGuard = __decorate([
|
|
|
80
81
|
__param(0, (0, common_1.Inject)(redis_module_1.REDIS_CLIENT)),
|
|
81
82
|
__metadata("design:paramtypes", [ioredis_1.default,
|
|
82
83
|
settings_service_1.SettingsService,
|
|
83
|
-
structured_logger_service_1.StructuredLoggerService
|
|
84
|
+
structured_logger_service_1.StructuredLoggerService,
|
|
85
|
+
config_1.ConfigService])
|
|
84
86
|
], OtpIpRateLimitGuard);
|
|
85
87
|
//# sourceMappingURL=otp-ip-rate-limit.guard.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"otp-ip-rate-limit.guard.js","sourceRoot":"","sources":["../../../src/common/guards/otp-ip-rate-limit.guard.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,2CAOwB;
|
|
1
|
+
{"version":3,"file":"otp-ip-rate-limit.guard.js","sourceRoot":"","sources":["../../../src/common/guards/otp-ip-rate-limit.guard.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,2CAOwB;AACxB,2CAA+C;AAE/C,sDAA8B;AAE9B,8DAAiE;AACjE,4DAAyD;AACzD,6GAAwG;AACxG,kFAA8E;AAC9E,uFAAmF;AACnF,0DAAmD;AAEnD;;;;;;GAMG;A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AAC,CAAC;YACtC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,4BAA4B,EAAE;gBAC9C,KAAK,EAAE,kCAAkC;gBACzC,QAAQ,EAAE,EAAE,UAAU,EAAE,GAAG,EAAE;aAC7B,CAAC,CAAC;YACH,MAAM,IAAI,sBAAa,CACtB;gBACC,OAAO,EAAE,2DAA2D,GAAG,IAAI;gBAC3E,UAAU,EAAE,GAAG;aACf,EACD,mBAAU,CAAC,iBAAiB,EAC5B,EAAE,WAAW,EAAE,gBAAgB,GAAG,EAAE,EAAE,CACtC,CAAC;QACH,CAAC;QAED,OAAO,IAAI,CAAC;IACb,CAAC;CACD,CAAA;AA5DY,kDAAmB;8BAAnB,mBAAmB;IAD/B,IAAA,mBAAU,GAAE;IAGV,WAAA,IAAA,eAAM,EAAC,2BAAY,CAAC,CAAA;qCACG,iBAAO;QACG,kCAAe;QACxB,mDAAuB;QAChB,sBAAa;GANlC,mBAAmB,CA4D/B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"permissions.guard.d.ts","sourceRoot":"","sources":["../../../src/common/guards/permissions.guard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAkC,MAAM,gBAAgB,CAAC;AAC/F,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAU5D,qBACa,gBAAiB,YAAW,WAAW;IAElD,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,YAAY;gBADZ,SAAS,EAAE,SAAS,EACpB,YAAY,EAAE,YAAY;IAG5C,WAAW,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO;
|
|
1
|
+
{"version":3,"file":"permissions.guard.d.ts","sourceRoot":"","sources":["../../../src/common/guards/permissions.guard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAkC,MAAM,gBAAgB,CAAC;AAC/F,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAU5D,qBACa,gBAAiB,YAAW,WAAW;IAElD,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,YAAY;gBADZ,SAAS,EAAE,SAAS,EACpB,YAAY,EAAE,YAAY;IAG5C,WAAW,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO;CAwC/C"}
|
|
@@ -22,12 +22,22 @@ let PermissionsGuard = class PermissionsGuard {
|
|
|
22
22
|
this.rolesService = rolesService;
|
|
23
23
|
}
|
|
24
24
|
canActivate(context) {
|
|
25
|
-
const
|
|
25
|
+
const isPublic = this.reflector.getAllAndOverride(decorators_1.IS_PUBLIC_KEY, [
|
|
26
26
|
context.getHandler(),
|
|
27
27
|
context.getClass(),
|
|
28
28
|
]);
|
|
29
|
-
if (
|
|
29
|
+
if (isPublic)
|
|
30
30
|
return true;
|
|
31
|
+
const requiredPermissions = this.reflector.getAllAndOverride(decorators_1.PERMISSIONS_KEY, [
|
|
32
|
+
context.getHandler(),
|
|
33
|
+
context.getClass(),
|
|
34
|
+
]);
|
|
35
|
+
const allowAuthenticated = this.reflector.getAllAndOverride(decorators_1.ALLOW_AUTHENTICATED_KEY, [context.getHandler(), context.getClass()]);
|
|
36
|
+
if (!requiredPermissions?.length) {
|
|
37
|
+
if (allowAuthenticated)
|
|
38
|
+
return true;
|
|
39
|
+
throw new common_1.ForbiddenException('Missing permission metadata. Annotate with @RequirePermission(...) or @AllowAuthenticated().');
|
|
40
|
+
}
|
|
31
41
|
const { user } = context.switchToHttp().getRequest();
|
|
32
42
|
if (!user?.id)
|
|
33
43
|
throw new common_1.ForbiddenException('Authenticated user is required');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"permissions.guard.js","sourceRoot":"","sources":["../../../src/common/guards/permissions.guard.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA+F;AAC/F,uCAAyC;AAEzC,2DAA4D;AAC5D,
|
|
1
|
+
{"version":3,"file":"permissions.guard.js","sourceRoot":"","sources":["../../../src/common/guards/permissions.guard.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA+F;AAC/F,uCAAyC;AAEzC,2DAA4D;AAC5D,8CAAwF;AAUjF,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;IAEV;IACA;IAFlB,YACkB,SAAoB,EACpB,YAA0B;QAD1B,cAAS,GAAT,SAAS,CAAW;QACpB,iBAAY,GAAZ,YAAY,CAAc;IACzC,CAAC;IAEJ,WAAW,CAAC,OAAyB;QACpC,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,iBAAiB,CAAU,0BAAa,EAAE;YACzE,OAAO,CAAC,UAAU,EAAE;YACpB,OAAO,CAAC,QAAQ,EAAE;SAClB,CAAC,CAAC;QACH,IAAI,QAAQ;YAAE,OAAO,IAAI,CAAC;QAE1B,MAAM,mBAAmB,GAAG,IAAI,CAAC,SAAS,CAAC,iBAAiB,CAAW,4BAAe,EAAE;YACvF,OAAO,CAAC,UAAU,EAAE;YACpB,OAAO,CAAC,QAAQ,EAAE;SAClB,CAAC,CAAC;QAEH,MAAM,kBAAkB,GAAG,IAAI,CAAC,SAAS,CAAC,iBAAiB,CAC1D,oCAAuB,EACvB,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC,CAC1C,CAAC;QAEF,IAAI,CAAC,mBAAmB,EAAE,MAAM,EAAE,CAAC;YAClC,IAAI,kBAAkB;gBAAE,OAAO,IAAI,CAAC;YACpC,MAAM,IAAI,2BAAkB,CAC3B,8FAA8F,CAC9F,CAAC;QACH,CAAC;QAED,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,UAAU,EAAwB,CAAC;QAC3E,IAAI,CAAC,IAAI,EAAE,EAAE;YAAE,MAAM,IAAI,2BAAkB,CAAC,gCAAgC,CAAC,CAAC;QAE9E,MAAM,SAAS,GAAa,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC;QAC7C,MAAM,eAAe,GAAG,SAAS,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC;QAE5F,MAAM,aAAa,GAAG,mBAAmB,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,eAAe,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;QAEzF,IAAI,CAAC,aAAa,EAAE,CAAC;YACpB,MAAM,IAAI,2BAAkB,CAC3B,wBAAwB,mBAAmB,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAC1D,CAAC;QACH,CAAC;QAED,OAAO,IAAI,CAAC;IACb,CAAC;CACD,CAAA;AA9CY,4CAAgB;2BAAhB,gBAAgB;IAD5B,IAAA,mBAAU,GAAE;qCAGiB,gBAAS;QACN,uBAAY;GAHhC,gBAAgB,CA8C5B"}
|
|
@@ -8,6 +8,6 @@ import { Observable } from 'rxjs';
|
|
|
8
8
|
export declare class TimeoutInterceptor implements NestInterceptor {
|
|
9
9
|
private readonly ms;
|
|
10
10
|
constructor(ms: number);
|
|
11
|
-
intercept(
|
|
11
|
+
intercept(context: ExecutionContext, next: CallHandler): Observable<unknown>;
|
|
12
12
|
}
|
|
13
13
|
//# sourceMappingURL=timeout.interceptor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timeout.interceptor.d.ts","sourceRoot":"","sources":["../../../src/common/interceptors/timeout.interceptor.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,WAAW,EACX,gBAAgB,EAEhB,eAAe,EAEf,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,UAAU,EAA4B,MAAM,MAAM,CAAC;AAG5D;;;;GAIG;AACH,qBACa,kBAAmB,YAAW,eAAe;IAC7C,OAAO,CAAC,QAAQ,CAAC,EAAE;gBAAF,EAAE,EAAE,MAAM;IAEvC,SAAS,CAAC,
|
|
1
|
+
{"version":3,"file":"timeout.interceptor.d.ts","sourceRoot":"","sources":["../../../src/common/interceptors/timeout.interceptor.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,WAAW,EACX,gBAAgB,EAEhB,eAAe,EAEf,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,UAAU,EAA4B,MAAM,MAAM,CAAC;AAG5D;;;;GAIG;AACH,qBACa,kBAAmB,YAAW,eAAe;IAC7C,OAAO,CAAC,QAAQ,CAAC,EAAE;gBAAF,EAAE,EAAE,MAAM;IAEvC,SAAS,CAAC,OAAO,EAAE,gBAAgB,EAAE,IAAI,EAAE,WAAW,GAAG,UAAU,CAAC,OAAO,CAAC;CAsB5E"}
|
|
@@ -23,7 +23,11 @@ let TimeoutInterceptor = class TimeoutInterceptor {
|
|
|
23
23
|
constructor(ms) {
|
|
24
24
|
this.ms = ms;
|
|
25
25
|
}
|
|
26
|
-
intercept(
|
|
26
|
+
intercept(context, next) {
|
|
27
|
+
// Long-lived WebSocket handlers must not be aborted by the HTTP request timeout.
|
|
28
|
+
if (context.getType() === 'ws') {
|
|
29
|
+
return next.handle();
|
|
30
|
+
}
|
|
27
31
|
return next.handle().pipe((0, operators_1.timeout)(this.ms), (0, operators_1.catchError)((err) => {
|
|
28
32
|
if (err instanceof rxjs_1.TimeoutError) {
|
|
29
33
|
return (0, rxjs_1.throwError)(() => new common_1.RequestTimeoutException({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timeout.interceptor.js","sourceRoot":"","sources":["../../../src/common/interceptors/timeout.interceptor.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAMwB;AACxB,+BAA4D;AAC5D,8CAAqD;AAErD;;;;GAIG;AAEI,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IACD;IAA7B,YAA6B,EAAU;QAAV,OAAE,GAAF,EAAE,CAAQ;IAAG,CAAC;IAE3C,SAAS,CAAC,
|
|
1
|
+
{"version":3,"file":"timeout.interceptor.js","sourceRoot":"","sources":["../../../src/common/interceptors/timeout.interceptor.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAMwB;AACxB,+BAA4D;AAC5D,8CAAqD;AAErD;;;;GAIG;AAEI,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IACD;IAA7B,YAA6B,EAAU;QAAV,OAAE,GAAF,EAAE,CAAQ;IAAG,CAAC;IAE3C,SAAS,CAAC,OAAyB,EAAE,IAAiB;QACrD,iFAAiF;QACjF,IAAI,OAAO,CAAC,OAAO,EAAE,KAAK,IAAI,EAAE,CAAC;YAChC,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC;QACtB,CAAC;QAED,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC,IAAI,CACxB,IAAA,mBAAO,EAAC,IAAI,CAAC,EAAE,CAAC,EAChB,IAAA,sBAAU,EAAC,CAAC,GAAY,EAAE,EAAE;YAC3B,IAAI,GAAG,YAAY,mBAAY,EAAE,CAAC;gBACjC,OAAO,IAAA,iBAAU,EAChB,GAAG,EAAE,CACJ,IAAI,gCAAuB,CAAC;oBAC3B,OAAO,EAAE,mBAAmB;oBAC5B,SAAS,EAAE,iBAAiB;iBAC5B,CAAC,CACH,CAAC;YACH,CAAC;YACD,OAAO,IAAA,iBAAU,EAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC;QAC9B,CAAC,CAAC,CACF,CAAC;IACH,CAAC;CACD,CAAA;AAzBY,gDAAkB;6BAAlB,kBAAkB;IAD9B,IAAA,mBAAU,GAAE;;GACA,kBAAkB,CAyB9B"}
|