@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,471 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
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;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.OAuthService = void 0;
|
|
16
|
+
const common_1 = require("@nestjs/common");
|
|
17
|
+
const typeorm_1 = require("@nestjs/typeorm");
|
|
18
|
+
const crypto_1 = require("crypto");
|
|
19
|
+
const typeorm_2 = require("typeorm");
|
|
20
|
+
const postgres_error_util_1 = require("../../../common/utils/postgres-error.util");
|
|
21
|
+
const structured_logger_service_1 = require("../../observability/logging/structured-logger.service");
|
|
22
|
+
const metrics_service_1 = require("../../observability/metrics/metrics.service");
|
|
23
|
+
const refresh_token_entity_1 = require("../../sessions/entities/refresh-token.entity");
|
|
24
|
+
const token_service_1 = require("../../sessions/services/token.service");
|
|
25
|
+
const settings_keys_1 = require("../../settings/constants/settings.keys");
|
|
26
|
+
const settings_service_1 = require("../../settings/services/settings.service");
|
|
27
|
+
const user_entity_1 = require("../../users/entities/user.entity");
|
|
28
|
+
const users_service_1 = require("../../users/services/users.service");
|
|
29
|
+
const user_oauth_identity_entity_1 = require("../entities/user-oauth-identity.entity");
|
|
30
|
+
const auth_events_1 = require("../events/auth.events");
|
|
31
|
+
const auth_supported_util_1 = require("../utils/auth-supported.util");
|
|
32
|
+
const mfa_service_1 = require("./mfa.service");
|
|
33
|
+
const apple_id_token_verifier_1 = require("./oauth/apple-id-token.verifier");
|
|
34
|
+
const google_id_token_verifier_1 = require("./oauth/google-id-token.verifier");
|
|
35
|
+
const microsoft_id_token_verifier_1 = require("./oauth/microsoft-id-token.verifier");
|
|
36
|
+
let OAuthService = class OAuthService {
|
|
37
|
+
identityRepo;
|
|
38
|
+
usersService;
|
|
39
|
+
googleVerifier;
|
|
40
|
+
appleVerifier;
|
|
41
|
+
microsoftVerifier;
|
|
42
|
+
tokenService;
|
|
43
|
+
settingsService;
|
|
44
|
+
logger;
|
|
45
|
+
metrics;
|
|
46
|
+
mfaService;
|
|
47
|
+
eventEmitter;
|
|
48
|
+
constructor(identityRepo, usersService, googleVerifier, appleVerifier, microsoftVerifier, tokenService, settingsService, logger, metrics, mfaService, eventEmitter = null) {
|
|
49
|
+
this.identityRepo = identityRepo;
|
|
50
|
+
this.usersService = usersService;
|
|
51
|
+
this.googleVerifier = googleVerifier;
|
|
52
|
+
this.appleVerifier = appleVerifier;
|
|
53
|
+
this.microsoftVerifier = microsoftVerifier;
|
|
54
|
+
this.tokenService = tokenService;
|
|
55
|
+
this.settingsService = settingsService;
|
|
56
|
+
this.logger = logger;
|
|
57
|
+
this.metrics = metrics;
|
|
58
|
+
this.mfaService = mfaService;
|
|
59
|
+
this.eventEmitter = eventEmitter;
|
|
60
|
+
}
|
|
61
|
+
assertProviderEnabled(provider) {
|
|
62
|
+
const enabled = (0, auth_supported_util_1.parseOAuthProviders)(this.settingsService.get(settings_keys_1.SETTING_KEYS.AUTH_OAUTH_PROVIDERS));
|
|
63
|
+
if (!enabled.includes(provider)) {
|
|
64
|
+
throw new common_1.ForbiddenException(`OAuth provider "${provider}" is not enabled. Supported: ${enabled.join(', ') || '(none)'}.`);
|
|
65
|
+
}
|
|
66
|
+
const known = Object.values(user_oauth_identity_entity_1.OAuthProvider);
|
|
67
|
+
if (!known.includes(provider)) {
|
|
68
|
+
throw new common_1.BadRequestException(`Unsupported OAuth provider: ${provider}`);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
listEnabledProviders() {
|
|
72
|
+
const enabled = (0, auth_supported_util_1.parseOAuthProviders)(this.settingsService.get(settings_keys_1.SETTING_KEYS.AUTH_OAUTH_PROVIDERS));
|
|
73
|
+
const redirectUris = this.getRedirectUris();
|
|
74
|
+
return enabled.map((provider) => ({
|
|
75
|
+
provider,
|
|
76
|
+
clientIds: this.getClientIds(provider),
|
|
77
|
+
webAuthCodeSupported: redirectUris.length > 0 &&
|
|
78
|
+
(provider === user_oauth_identity_entity_1.OAuthProvider.GOOGLE || provider === user_oauth_identity_entity_1.OAuthProvider.MICROSOFT) &&
|
|
79
|
+
Boolean(this.getClientSecret(provider)),
|
|
80
|
+
}));
|
|
81
|
+
}
|
|
82
|
+
async verifyIdToken(provider, idToken, opts) {
|
|
83
|
+
this.assertProviderEnabled(provider);
|
|
84
|
+
const requireNonce = opts?.requireNonce ??
|
|
85
|
+
this.settingsService.get(settings_keys_1.SETTING_KEYS.AUTH_OAUTH_REQUIRE_ID_TOKEN_NONCE) ===
|
|
86
|
+
true;
|
|
87
|
+
const nonceOpts = { nonce: opts?.nonce, requireNonce };
|
|
88
|
+
switch (provider) {
|
|
89
|
+
case user_oauth_identity_entity_1.OAuthProvider.GOOGLE:
|
|
90
|
+
return this.googleVerifier.verify(idToken, nonceOpts);
|
|
91
|
+
case user_oauth_identity_entity_1.OAuthProvider.APPLE:
|
|
92
|
+
return this.appleVerifier.verify(idToken, nonceOpts);
|
|
93
|
+
case user_oauth_identity_entity_1.OAuthProvider.MICROSOFT:
|
|
94
|
+
return this.microsoftVerifier.verify(idToken, nonceOpts);
|
|
95
|
+
default: {
|
|
96
|
+
const _exhaustive = provider;
|
|
97
|
+
throw new common_1.BadRequestException(`Unsupported OAuth provider: ${String(_exhaustive)}`);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
async findByProviderSubject(provider, providerSubject) {
|
|
102
|
+
return this.identityRepo.findOne({ where: { provider, providerSubject } });
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Resolve an existing user for OAuth login (identity row or optional email auto-link).
|
|
106
|
+
*/
|
|
107
|
+
async resolveLoginUser(provider, idToken, opts) {
|
|
108
|
+
const identity = await this.verifyIdToken(provider, idToken, opts);
|
|
109
|
+
return this.resolveFromVerifiedIdentity(provider, identity);
|
|
110
|
+
}
|
|
111
|
+
async resolveFromVerifiedIdentity(provider, identity) {
|
|
112
|
+
// One round-trip: identity + user (+ roles/profile needed for token envelope).
|
|
113
|
+
const existing = await this.identityRepo.findOne({
|
|
114
|
+
where: { provider, providerSubject: identity.subject },
|
|
115
|
+
relations: ['user', 'user.roles', 'user.profile'],
|
|
116
|
+
});
|
|
117
|
+
if (existing) {
|
|
118
|
+
const user = existing.user ?? (await this.usersService.findById(existing.userId));
|
|
119
|
+
if (!user) {
|
|
120
|
+
throw new common_1.UnauthorizedException('User not found');
|
|
121
|
+
}
|
|
122
|
+
// Non-blocking bookkeeping — do not add latency to the OAuth login path.
|
|
123
|
+
void this.identityRepo
|
|
124
|
+
.update({ id: existing.id }, { lastUsedAt: new Date() })
|
|
125
|
+
.catch((err) => {
|
|
126
|
+
this.logger.warn('Failed to update OAuth lastUsedAt', {
|
|
127
|
+
event: 'auth.oauth.last_used_update_failed',
|
|
128
|
+
metadata: { provider, userId: existing.userId },
|
|
129
|
+
err: err instanceof Error ? err : undefined,
|
|
130
|
+
});
|
|
131
|
+
});
|
|
132
|
+
return {
|
|
133
|
+
user,
|
|
134
|
+
linkedIdentity: user.authMethod !== user_entity_1.UserAuthMethod.OAUTH,
|
|
135
|
+
provider,
|
|
136
|
+
identity,
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
const autoLink = this.settingsService.get(settings_keys_1.SETTING_KEYS.AUTH_OAUTH_AUTO_LINK_VERIFIED_EMAIL);
|
|
140
|
+
const byEmail = identity.email != null
|
|
141
|
+
? await this.usersService.findBy({ email: identity.email })
|
|
142
|
+
: null;
|
|
143
|
+
if (autoLink && identity.email && identity.emailVerified && byEmail) {
|
|
144
|
+
await this.createIdentity(byEmail.id, provider, identity);
|
|
145
|
+
this.metrics.recordBusinessEvent('auth', 'oauth', 'auto_linked');
|
|
146
|
+
this.logger.info('OAuth identity auto-linked by verified email', {
|
|
147
|
+
event: 'auth.oauth.auto_linked',
|
|
148
|
+
metadata: { userId: byEmail.id, provider },
|
|
149
|
+
});
|
|
150
|
+
return {
|
|
151
|
+
user: byEmail,
|
|
152
|
+
linkedIdentity: true,
|
|
153
|
+
provider,
|
|
154
|
+
identity,
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
if (byEmail) {
|
|
158
|
+
throw new common_1.ConflictException({
|
|
159
|
+
message: 'An account with this email already exists. Sign in and link the provider from account settings, or enable auto-link.',
|
|
160
|
+
code: 'account_exists_link_required',
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
throw new common_1.UnauthorizedException('No account linked to this OAuth identity. Register with POST /auth/register first.');
|
|
164
|
+
}
|
|
165
|
+
async startAuthorizationCode(provider, dto) {
|
|
166
|
+
this.assertProviderEnabled(provider);
|
|
167
|
+
if (provider === user_oauth_identity_entity_1.OAuthProvider.APPLE) {
|
|
168
|
+
throw new common_1.BadRequestException('Apple web authorization-code flow is not supported. Use { provider, idToken } on POST /auth/login.');
|
|
169
|
+
}
|
|
170
|
+
this.assertRedirectUriAllowed(dto.redirectUri);
|
|
171
|
+
const clientId = this.getPrimaryClientId(provider);
|
|
172
|
+
const clientSecret = this.getClientSecret(provider);
|
|
173
|
+
if (!clientId || !clientSecret) {
|
|
174
|
+
throw new common_1.BadRequestException(`Web OAuth for ${provider} requires client id and client secret to be configured.`);
|
|
175
|
+
}
|
|
176
|
+
const codeVerifier = base64Url((0, crypto_1.randomBytes)(32));
|
|
177
|
+
const codeChallenge = base64Url((0, crypto_1.createHash)('sha256').update(codeVerifier).digest());
|
|
178
|
+
const nonce = base64Url((0, crypto_1.randomBytes)(32));
|
|
179
|
+
const { state, expiresIn } = await this.tokenService.createOAuthPkceState({
|
|
180
|
+
provider,
|
|
181
|
+
redirectUri: dto.redirectUri,
|
|
182
|
+
codeVerifier,
|
|
183
|
+
nonce,
|
|
184
|
+
});
|
|
185
|
+
const authorizationUrl = this.buildAuthorizeUrl(provider, {
|
|
186
|
+
clientId,
|
|
187
|
+
redirectUri: dto.redirectUri,
|
|
188
|
+
state,
|
|
189
|
+
codeChallenge,
|
|
190
|
+
nonce,
|
|
191
|
+
});
|
|
192
|
+
return { authorizationUrl, state, expiresIn };
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Exchange authorization code (+ stored PKCE verifier) for an ID token, then resolve login user.
|
|
196
|
+
*/
|
|
197
|
+
async exchangeAuthorizationCode(provider, code, state) {
|
|
198
|
+
this.assertProviderEnabled(provider);
|
|
199
|
+
const stored = await this.tokenService.consumeOAuthPkceState(state);
|
|
200
|
+
if (stored.provider !== provider) {
|
|
201
|
+
throw new common_1.UnauthorizedException('OAuth state provider mismatch');
|
|
202
|
+
}
|
|
203
|
+
const idToken = await this.exchangeCodeForIdToken(provider, {
|
|
204
|
+
code,
|
|
205
|
+
redirectUri: stored.redirectUri,
|
|
206
|
+
codeVerifier: stored.codeVerifier,
|
|
207
|
+
});
|
|
208
|
+
return this.resolveLoginUser(provider, idToken, { nonce: stored.nonce });
|
|
209
|
+
}
|
|
210
|
+
async link(userId, dto) {
|
|
211
|
+
await this.mfaService.assertSensitiveReauth(userId, {
|
|
212
|
+
purpose: 'oauth_link',
|
|
213
|
+
stepUpToken: dto.stepUpToken,
|
|
214
|
+
password: dto.password,
|
|
215
|
+
verificationId: dto.verificationId,
|
|
216
|
+
otp: dto.otp,
|
|
217
|
+
provider: dto.reauthProvider,
|
|
218
|
+
idToken: dto.reauthIdToken,
|
|
219
|
+
});
|
|
220
|
+
const identity = await this.verifyIdToken(dto.provider, dto.idToken, {
|
|
221
|
+
nonce: dto.nonce,
|
|
222
|
+
});
|
|
223
|
+
const already = await this.identityRepo.findOne({
|
|
224
|
+
where: { provider: dto.provider, providerSubject: identity.subject },
|
|
225
|
+
});
|
|
226
|
+
if (already && already.userId !== userId) {
|
|
227
|
+
throw new common_1.ConflictException('This OAuth account is already linked to another user.');
|
|
228
|
+
}
|
|
229
|
+
if (already && already.userId === userId) {
|
|
230
|
+
return this.toDto(already);
|
|
231
|
+
}
|
|
232
|
+
const sameProvider = await this.identityRepo.findOne({
|
|
233
|
+
where: { userId, provider: dto.provider },
|
|
234
|
+
});
|
|
235
|
+
if (sameProvider) {
|
|
236
|
+
throw new common_1.ConflictException(`Provider ${dto.provider} is already linked to this account.`);
|
|
237
|
+
}
|
|
238
|
+
const row = await this.createIdentity(userId, dto.provider, identity);
|
|
239
|
+
this.metrics.recordBusinessEvent('auth', 'oauth', 'linked');
|
|
240
|
+
this.logger.info('OAuth identity linked', {
|
|
241
|
+
event: 'auth.oauth.linked',
|
|
242
|
+
metadata: { userId, provider: dto.provider },
|
|
243
|
+
});
|
|
244
|
+
await this.emitOAuthEvent(auth_events_1.AUTH_EVENTS.OAUTH_LINKED, userId, dto.provider);
|
|
245
|
+
return this.toDto(row);
|
|
246
|
+
}
|
|
247
|
+
async unlink(userId, provider, reauth) {
|
|
248
|
+
await this.mfaService.assertSensitiveReauth(userId, {
|
|
249
|
+
purpose: 'oauth_unlink',
|
|
250
|
+
stepUpToken: reauth?.stepUpToken,
|
|
251
|
+
password: reauth?.password,
|
|
252
|
+
verificationId: reauth?.verificationId,
|
|
253
|
+
otp: reauth?.otp,
|
|
254
|
+
provider: reauth?.provider,
|
|
255
|
+
idToken: reauth?.idToken,
|
|
256
|
+
});
|
|
257
|
+
this.assertProviderEnabled(provider);
|
|
258
|
+
const row = await this.identityRepo.findOne({ where: { userId, provider } });
|
|
259
|
+
if (!row) {
|
|
260
|
+
throw new common_1.BadRequestException(`No ${provider} identity linked.`);
|
|
261
|
+
}
|
|
262
|
+
const user = await this.usersService.findByIdWithPassword(userId);
|
|
263
|
+
if (!user)
|
|
264
|
+
throw new common_1.BadRequestException('User not found.');
|
|
265
|
+
if (user.authMethod === user_entity_1.UserAuthMethod.OAUTH) {
|
|
266
|
+
const count = await this.identityRepo.count({ where: { userId } });
|
|
267
|
+
if (count <= 1 && !user.passwordHash) {
|
|
268
|
+
throw new common_1.BadRequestException('Cannot unlink the last OAuth identity without a password. ' +
|
|
269
|
+
'Call POST /auth/account/set-password first, then unlink.');
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
await this.identityRepo.remove(row);
|
|
273
|
+
await this.tokenService.revokeAllUserTokens(userId, refresh_token_entity_1.RevokeReason.LOGOUT);
|
|
274
|
+
this.metrics.recordBusinessEvent('auth', 'oauth', 'unlinked');
|
|
275
|
+
this.logger.info('OAuth identity unlinked', {
|
|
276
|
+
event: 'auth.oauth.unlinked',
|
|
277
|
+
metadata: { userId, provider },
|
|
278
|
+
});
|
|
279
|
+
await this.emitOAuthEvent(auth_events_1.AUTH_EVENTS.OAUTH_UNLINKED, userId, provider);
|
|
280
|
+
return { message: `${provider} identity unlinked.` };
|
|
281
|
+
}
|
|
282
|
+
async listLinks(userId) {
|
|
283
|
+
const rows = await this.identityRepo.find({ where: { userId } });
|
|
284
|
+
return rows.map((r) => this.toDto(r));
|
|
285
|
+
}
|
|
286
|
+
async createIdentity(userId, provider, identity, manager) {
|
|
287
|
+
const repo = manager ? manager.getRepository(user_oauth_identity_entity_1.UserOAuthIdentity) : this.identityRepo;
|
|
288
|
+
const row = repo.create({
|
|
289
|
+
userId,
|
|
290
|
+
provider,
|
|
291
|
+
providerSubject: identity.subject,
|
|
292
|
+
email: identity.email,
|
|
293
|
+
emailVerified: identity.emailVerified,
|
|
294
|
+
linkedAt: new Date(),
|
|
295
|
+
lastUsedAt: new Date(),
|
|
296
|
+
});
|
|
297
|
+
try {
|
|
298
|
+
return await repo.save(row);
|
|
299
|
+
}
|
|
300
|
+
catch (err) {
|
|
301
|
+
if ((0, postgres_error_util_1.isPostgresUniqueViolation)(err)) {
|
|
302
|
+
throw new common_1.ConflictException('This OAuth identity is already linked to an account.');
|
|
303
|
+
}
|
|
304
|
+
throw err;
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
/**
|
|
308
|
+
* Confirm the ID token belongs to a provider identity already linked to this user.
|
|
309
|
+
*/
|
|
310
|
+
async assertLinkedIdentity(userId, provider, idToken) {
|
|
311
|
+
// Account-deletion / step-up proofs: bind subject only (nonce optional).
|
|
312
|
+
const identity = await this.verifyIdToken(provider, idToken, { requireNonce: false });
|
|
313
|
+
const row = await this.identityRepo.findOne({
|
|
314
|
+
where: { userId, provider, providerSubject: identity.subject },
|
|
315
|
+
});
|
|
316
|
+
if (!row) {
|
|
317
|
+
throw new common_1.UnauthorizedException('OAuth token does not match a provider linked to this account.');
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
async exchangeCodeForIdToken(provider, args) {
|
|
321
|
+
const clientId = this.getPrimaryClientId(provider);
|
|
322
|
+
const clientSecret = this.getClientSecret(provider);
|
|
323
|
+
if (!clientId || !clientSecret) {
|
|
324
|
+
throw new common_1.BadRequestException(`OAuth client credentials missing for ${provider}`);
|
|
325
|
+
}
|
|
326
|
+
const tokenUrl = provider === user_oauth_identity_entity_1.OAuthProvider.GOOGLE
|
|
327
|
+
? 'https://oauth2.googleapis.com/token'
|
|
328
|
+
: `https://login.microsoftonline.com/${this.microsoftTenant()}/oauth2/v2.0/token`;
|
|
329
|
+
const body = new URLSearchParams({
|
|
330
|
+
grant_type: 'authorization_code',
|
|
331
|
+
code: args.code,
|
|
332
|
+
redirect_uri: args.redirectUri,
|
|
333
|
+
client_id: clientId,
|
|
334
|
+
client_secret: clientSecret,
|
|
335
|
+
code_verifier: args.codeVerifier,
|
|
336
|
+
});
|
|
337
|
+
let response;
|
|
338
|
+
try {
|
|
339
|
+
response = await fetch(tokenUrl, {
|
|
340
|
+
method: 'POST',
|
|
341
|
+
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
|
|
342
|
+
body,
|
|
343
|
+
});
|
|
344
|
+
}
|
|
345
|
+
catch {
|
|
346
|
+
throw new common_1.UnauthorizedException('Failed to exchange OAuth authorization code');
|
|
347
|
+
}
|
|
348
|
+
const json = (await response.json());
|
|
349
|
+
if (!response.ok || !json.id_token) {
|
|
350
|
+
throw new common_1.UnauthorizedException(json.error
|
|
351
|
+
? `OAuth token exchange failed: ${json.error}`
|
|
352
|
+
: 'OAuth token exchange failed');
|
|
353
|
+
}
|
|
354
|
+
return json.id_token;
|
|
355
|
+
}
|
|
356
|
+
buildAuthorizeUrl(provider, args) {
|
|
357
|
+
if (provider === user_oauth_identity_entity_1.OAuthProvider.GOOGLE) {
|
|
358
|
+
const url = new URL('https://accounts.google.com/o/oauth2/v2/auth');
|
|
359
|
+
url.searchParams.set('client_id', args.clientId);
|
|
360
|
+
url.searchParams.set('redirect_uri', args.redirectUri);
|
|
361
|
+
url.searchParams.set('response_type', 'code');
|
|
362
|
+
url.searchParams.set('scope', 'openid email profile');
|
|
363
|
+
url.searchParams.set('state', args.state);
|
|
364
|
+
url.searchParams.set('nonce', args.nonce);
|
|
365
|
+
url.searchParams.set('code_challenge', args.codeChallenge);
|
|
366
|
+
url.searchParams.set('code_challenge_method', 'S256');
|
|
367
|
+
url.searchParams.set('access_type', 'online');
|
|
368
|
+
const hd = (this.settingsService.get(settings_keys_1.SETTING_KEYS.AUTH_OAUTH_GOOGLE_HOSTED_DOMAIN) ?? '').trim();
|
|
369
|
+
if (hd)
|
|
370
|
+
url.searchParams.set('hd', hd);
|
|
371
|
+
return url.toString();
|
|
372
|
+
}
|
|
373
|
+
const url = new URL(`https://login.microsoftonline.com/${this.microsoftTenant()}/oauth2/v2.0/authorize`);
|
|
374
|
+
url.searchParams.set('client_id', args.clientId);
|
|
375
|
+
url.searchParams.set('redirect_uri', args.redirectUri);
|
|
376
|
+
url.searchParams.set('response_type', 'code');
|
|
377
|
+
url.searchParams.set('response_mode', 'query');
|
|
378
|
+
url.searchParams.set('scope', 'openid profile email offline_access');
|
|
379
|
+
url.searchParams.set('state', args.state);
|
|
380
|
+
url.searchParams.set('nonce', args.nonce);
|
|
381
|
+
url.searchParams.set('code_challenge', args.codeChallenge);
|
|
382
|
+
url.searchParams.set('code_challenge_method', 'S256');
|
|
383
|
+
return url.toString();
|
|
384
|
+
}
|
|
385
|
+
getClientIds(provider) {
|
|
386
|
+
const key = provider === user_oauth_identity_entity_1.OAuthProvider.GOOGLE
|
|
387
|
+
? settings_keys_1.SETTING_KEYS.AUTH_OAUTH_GOOGLE_CLIENT_IDS
|
|
388
|
+
: provider === user_oauth_identity_entity_1.OAuthProvider.APPLE
|
|
389
|
+
? settings_keys_1.SETTING_KEYS.AUTH_OAUTH_APPLE_CLIENT_IDS
|
|
390
|
+
: settings_keys_1.SETTING_KEYS.AUTH_OAUTH_MICROSOFT_CLIENT_IDS;
|
|
391
|
+
const ids = this.settingsService.get(key);
|
|
392
|
+
return Array.isArray(ids)
|
|
393
|
+
? ids.filter((id) => typeof id === 'string' && id.length > 0)
|
|
394
|
+
: [];
|
|
395
|
+
}
|
|
396
|
+
getPrimaryClientId(provider) {
|
|
397
|
+
return this.getClientIds(provider)[0];
|
|
398
|
+
}
|
|
399
|
+
getClientSecret(provider) {
|
|
400
|
+
if (provider === user_oauth_identity_entity_1.OAuthProvider.GOOGLE) {
|
|
401
|
+
return (this.settingsService.get(settings_keys_1.SETTING_KEYS.AUTH_OAUTH_GOOGLE_CLIENT_SECRET) ?? '');
|
|
402
|
+
}
|
|
403
|
+
if (provider === user_oauth_identity_entity_1.OAuthProvider.MICROSOFT) {
|
|
404
|
+
return (this.settingsService.get(settings_keys_1.SETTING_KEYS.AUTH_OAUTH_MICROSOFT_CLIENT_SECRET) ??
|
|
405
|
+
'');
|
|
406
|
+
}
|
|
407
|
+
return '';
|
|
408
|
+
}
|
|
409
|
+
getRedirectUris() {
|
|
410
|
+
const raw = this.settingsService.get(settings_keys_1.SETTING_KEYS.AUTH_OAUTH_REDIRECT_URIS);
|
|
411
|
+
return Array.isArray(raw) ? raw.filter((u) => typeof u === 'string' && u.length > 0) : [];
|
|
412
|
+
}
|
|
413
|
+
assertRedirectUriAllowed(redirectUri) {
|
|
414
|
+
const allowed = this.getRedirectUris();
|
|
415
|
+
if (allowed.length === 0) {
|
|
416
|
+
throw new common_1.BadRequestException('Web OAuth is not configured (auth.oauth.redirect_uris is empty).');
|
|
417
|
+
}
|
|
418
|
+
if (!allowed.includes(redirectUri)) {
|
|
419
|
+
throw new common_1.BadRequestException('redirectUri is not in the allow-list.');
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
microsoftTenant() {
|
|
423
|
+
return (this.settingsService.get(settings_keys_1.SETTING_KEYS.AUTH_OAUTH_MICROSOFT_TENANT) || 'common');
|
|
424
|
+
}
|
|
425
|
+
toDto(row) {
|
|
426
|
+
return {
|
|
427
|
+
provider: row.provider,
|
|
428
|
+
email: row.email,
|
|
429
|
+
emailVerified: row.emailVerified,
|
|
430
|
+
linkedAt: row.linkedAt,
|
|
431
|
+
lastUsedAt: row.lastUsedAt,
|
|
432
|
+
};
|
|
433
|
+
}
|
|
434
|
+
async emitOAuthEvent(event, userId, provider) {
|
|
435
|
+
if (!this.eventEmitter)
|
|
436
|
+
return;
|
|
437
|
+
const payload = {
|
|
438
|
+
userId,
|
|
439
|
+
provider,
|
|
440
|
+
at: new Date(),
|
|
441
|
+
};
|
|
442
|
+
void this.eventEmitter.emitAsync(event, payload).catch((err) => {
|
|
443
|
+
this.logger.error('Auth OAuth event listener failed', {
|
|
444
|
+
event: 'auth.oauth.event_failed',
|
|
445
|
+
metadata: { listener: event },
|
|
446
|
+
err: err instanceof Error ? err : undefined,
|
|
447
|
+
});
|
|
448
|
+
});
|
|
449
|
+
}
|
|
450
|
+
};
|
|
451
|
+
exports.OAuthService = OAuthService;
|
|
452
|
+
exports.OAuthService = OAuthService = __decorate([
|
|
453
|
+
(0, common_1.Injectable)(),
|
|
454
|
+
__param(0, (0, typeorm_1.InjectRepository)(user_oauth_identity_entity_1.UserOAuthIdentity)),
|
|
455
|
+
__param(9, (0, common_1.Inject)((0, common_1.forwardRef)(() => mfa_service_1.MfaService))),
|
|
456
|
+
__param(10, (0, common_1.Optional)()),
|
|
457
|
+
__metadata("design:paramtypes", [typeorm_2.Repository,
|
|
458
|
+
users_service_1.UsersService,
|
|
459
|
+
google_id_token_verifier_1.GoogleIdTokenVerifier,
|
|
460
|
+
apple_id_token_verifier_1.AppleIdTokenVerifier,
|
|
461
|
+
microsoft_id_token_verifier_1.MicrosoftIdTokenVerifier,
|
|
462
|
+
token_service_1.TokenService,
|
|
463
|
+
settings_service_1.SettingsService,
|
|
464
|
+
structured_logger_service_1.StructuredLoggerService,
|
|
465
|
+
metrics_service_1.MetricsService,
|
|
466
|
+
mfa_service_1.MfaService, Object])
|
|
467
|
+
], OAuthService);
|
|
468
|
+
function base64Url(buf) {
|
|
469
|
+
return buf.toString('base64url');
|
|
470
|
+
}
|
|
471
|
+
//# sourceMappingURL=oauth.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oauth.service.js","sourceRoot":"","sources":["../../../../src/modules/auth/services/oauth.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CASwB;AAExB,6CAAmD;AACnD,mCAAiD;AACjD,qCAAoD;AAEpD,mFAAsF;AACtF,qGAAgG;AAChG,iFAA6E;AAC7E,uFAA4E;AAC5E,yEAAqE;AACrE,0EAAsE;AACtE,+EAA2E;AAC3E,kEAAwE;AACxE,sEAAkE;AAQlE,uFAA0F;AAC1F,uDAI+B;AAC/B,sEAAmE;AACnE,+CAA2C;AAC3C,6EAAuE;AACvE,+EAAyE;AACzE,qFAA+E;AAYxE,IAAM,YAAY,GAAlB,MAAM,YAAY;IAGN;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IAEA;IAEA;IAdlB,YAEkB,YAA2C,EAC3C,YAA0B,EAC1B,cAAqC,EACrC,aAAmC,EACnC,iBAA2C,EAC3C,YAA0B,EAC1B,eAAgC,EAChC,MAA+B,EAC/B,OAAuB,EAEvB,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BAAU,EAAC,GAAG,EAAE,CAAC,wBAAU,CAAC,CAAC,CAAA;IAEpC,YAAA,IAAA,iBAAQ,GAAE,CAAA;qCAXoB,oBAAU;QACV,4BAAY;QACV,gDAAqB;QACtB,8CAAoB;QAChB,sDAAwB;QAC7B,4BAAY;QACT,kCAAe;QACxB,mDAAuB;QACtB,gCAAc;QAEX,wBAAU;GAb5B,YAAY,CA6hBxB;AAED,SAAS,SAAS,CAAC,GAAW;IAC7B,OAAO,GAAG,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;AAClC,CAAC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { AuditService } from '../../audit/services/audit.service';
|
|
1
2
|
import { StructuredLoggerService } from '../../observability/logging/structured-logger.service';
|
|
2
3
|
import { IOtpService, OtpGenerateResult, OtpVerifyResult } from '../../otp/interfaces/otp.service.interface';
|
|
3
4
|
import { TokenService } from '../../sessions/services/token.service';
|
|
4
5
|
import { SettingsService } from '../../settings/services/settings.service';
|
|
5
6
|
import { UsersService } from '../../users/services/users.service';
|
|
6
|
-
import {
|
|
7
|
+
import { LoginResult } from '../dto/token.dto';
|
|
7
8
|
import { LoginService } from './login.service';
|
|
8
9
|
export declare class OtpAuthService {
|
|
9
10
|
private readonly otpService;
|
|
@@ -12,10 +13,19 @@ export declare class OtpAuthService {
|
|
|
12
13
|
private readonly settingsService;
|
|
13
14
|
private readonly loginService;
|
|
14
15
|
private readonly logger;
|
|
15
|
-
|
|
16
|
+
private readonly audit;
|
|
17
|
+
constructor(otpService: IOtpService, usersService: UsersService, tokenService: TokenService, settingsService: SettingsService, loginService: LoginService, logger: StructuredLoggerService, audit: AuditService);
|
|
16
18
|
sendOtp(identifier: string, channel: 'sms' | 'email'): Promise<OtpGenerateResult>;
|
|
17
19
|
resendOtp(verificationId: string): Promise<OtpGenerateResult>;
|
|
18
20
|
verifyOtp(verificationId: string, otp: string): Promise<OtpVerifyResult>;
|
|
21
|
+
/**
|
|
22
|
+
* Validates an OTP and returns the verified subject + channel (no auth bridge tokens).
|
|
23
|
+
* Used by change-email / change-phone style identity updates.
|
|
24
|
+
*/
|
|
25
|
+
verifyOtpChallengeWithSubject(verificationId: string, otp: string): Promise<{
|
|
26
|
+
subject: string;
|
|
27
|
+
channel: 'sms' | 'email';
|
|
28
|
+
}>;
|
|
19
29
|
/**
|
|
20
30
|
* Validates an OTP code against a session token as a security challenge.
|
|
21
31
|
* Used by flows that need identity proof without user lookup (e.g. account deletion).
|
|
@@ -25,6 +35,6 @@ export declare class OtpAuthService {
|
|
|
25
35
|
/**
|
|
26
36
|
* Dev-only: send-otp → verify-otp → login in one call for test.otp_identifiers entries.
|
|
27
37
|
*/
|
|
28
|
-
testLogin(identifier: string, channel: 'sms' | 'email', otp: string, deviceInfo?: string, ipAddress?: string): Promise<
|
|
38
|
+
testLogin(identifier: string, channel: 'sms' | 'email', otp: string, deviceInfo?: string, ipAddress?: string, dpopJkt?: string): Promise<LoginResult>;
|
|
29
39
|
}
|
|
30
40
|
//# sourceMappingURL=otp-auth.service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"otp-auth.service.d.ts","sourceRoot":"","sources":["../../../../src/modules/auth/services/otp-auth.service.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"otp-auth.service.d.ts","sourceRoot":"","sources":["../../../../src/modules/auth/services/otp-auth.service.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAClE,OAAO,EAAE,uBAAuB,EAAE,MAAM,uDAAuD,CAAC;AAChG,OAAO,EACN,WAAW,EACX,iBAAiB,EACjB,eAAe,EACf,MAAM,4CAA4C,CAAC;AAEpD,OAAO,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AAErE,OAAO,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAC;AAE3E,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAClE,OAAO,EAAE,WAAW,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