@colveor/core 1.0.1 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -0
- package/README.md +6 -0
- package/dist/bootstrap/bootstrap-colveor-app.d.ts.map +1 -1
- package/dist/bootstrap/bootstrap-colveor-app.js +22 -3
- package/dist/bootstrap/bootstrap-colveor-app.js.map +1 -1
- package/dist/common/decorators/index.d.ts +6 -0
- package/dist/common/decorators/index.d.ts.map +1 -1
- package/dist/common/decorators/index.js +8 -1
- package/dist/common/decorators/index.js.map +1 -1
- package/dist/common/decorators/ip-rate-limit-bucket.decorator.d.ts +9 -0
- package/dist/common/decorators/ip-rate-limit-bucket.decorator.d.ts.map +1 -0
- package/dist/common/decorators/ip-rate-limit-bucket.decorator.js +12 -0
- package/dist/common/decorators/ip-rate-limit-bucket.decorator.js.map +1 -0
- package/dist/common/guards/login-ip-rate-limit.guard.d.ts +12 -6
- package/dist/common/guards/login-ip-rate-limit.guard.d.ts.map +1 -1
- package/dist/common/guards/login-ip-rate-limit.guard.js +65 -21
- package/dist/common/guards/login-ip-rate-limit.guard.js.map +1 -1
- package/dist/common/guards/otp-ip-rate-limit.guard.d.ts +3 -2
- package/dist/common/guards/otp-ip-rate-limit.guard.d.ts.map +1 -1
- package/dist/common/guards/otp-ip-rate-limit.guard.js +17 -15
- package/dist/common/guards/otp-ip-rate-limit.guard.js.map +1 -1
- package/dist/common/guards/permissions.guard.d.ts.map +1 -1
- package/dist/common/guards/permissions.guard.js +12 -2
- package/dist/common/guards/permissions.guard.js.map +1 -1
- package/dist/common/interceptors/timeout.interceptor.d.ts +1 -1
- package/dist/common/interceptors/timeout.interceptor.d.ts.map +1 -1
- package/dist/common/interceptors/timeout.interceptor.js +5 -1
- package/dist/common/interceptors/timeout.interceptor.js.map +1 -1
- package/dist/common/interfaces/request-user.d.ts +4 -3
- package/dist/common/interfaces/request-user.d.ts.map +1 -1
- package/dist/common/utils/cache-version.util.d.ts +12 -0
- package/dist/common/utils/cache-version.util.d.ts.map +1 -0
- package/dist/common/utils/cache-version.util.js +34 -0
- package/dist/common/utils/cache-version.util.js.map +1 -0
- package/dist/common/utils/postgres-error.util.d.ts +5 -0
- package/dist/common/utils/postgres-error.util.d.ts.map +1 -0
- package/dist/common/utils/postgres-error.util.js +13 -0
- package/dist/common/utils/postgres-error.util.js.map +1 -0
- package/dist/common/utils/singleflight.util.d.ts +6 -0
- package/dist/common/utils/singleflight.util.d.ts.map +1 -0
- package/dist/common/utils/singleflight.util.js +21 -0
- package/dist/common/utils/singleflight.util.js.map +1 -0
- package/dist/common/validators/is-exclusive-auth-params.validator.js +1 -1
- package/dist/common/validators/is-exclusive-auth-params.validator.js.map +1 -1
- package/dist/common/validators/is-exclusive-delete-confirm-params.validator.js +1 -1
- package/dist/common/validators/is-exclusive-delete-confirm-params.validator.js.map +1 -1
- package/dist/config/app.config.d.ts +38 -0
- package/dist/config/app.config.d.ts.map +1 -1
- package/dist/config/app.config.js +24 -0
- package/dist/config/app.config.js.map +1 -1
- package/dist/config/database.config.d.ts +6 -0
- package/dist/config/database.config.d.ts.map +1 -1
- package/dist/config/database.config.js +3 -0
- package/dist/config/database.config.js.map +1 -1
- package/dist/config/env-flags.util.d.ts +4 -0
- package/dist/config/env-flags.util.d.ts.map +1 -1
- package/dist/config/env-flags.util.js +7 -0
- package/dist/config/env-flags.util.js.map +1 -1
- package/dist/config/env.validation.d.ts +24 -1
- package/dist/config/env.validation.d.ts.map +1 -1
- package/dist/config/env.validation.js +92 -2
- package/dist/config/env.validation.js.map +1 -1
- package/dist/config/in-memory-redis.client.d.ts +23 -4
- package/dist/config/in-memory-redis.client.d.ts.map +1 -1
- package/dist/config/in-memory-redis.client.js +148 -4
- package/dist/config/in-memory-redis.client.js.map +1 -1
- package/dist/config/redis.module.d.ts.map +1 -1
- package/dist/config/redis.module.js +5 -0
- package/dist/config/redis.module.js.map +1 -1
- package/dist/core.module.d.ts +5 -0
- package/dist/core.module.d.ts.map +1 -1
- package/dist/core.module.js +5 -0
- package/dist/core.module.js.map +1 -1
- package/dist/database/migrations/1785006199371-auth-mfa-oauth.d.ts +7 -0
- package/dist/database/migrations/1785006199371-auth-mfa-oauth.d.ts.map +1 -0
- package/dist/database/migrations/1785006199371-auth-mfa-oauth.js +24 -0
- package/dist/database/migrations/1785006199371-auth-mfa-oauth.js.map +1 -0
- package/dist/database/migrations/1785006199372-auth-mfa-backup-codes.d.ts +7 -0
- package/dist/database/migrations/1785006199372-auth-mfa-backup-codes.d.ts.map +1 -0
- package/dist/database/migrations/1785006199372-auth-mfa-backup-codes.js +16 -0
- package/dist/database/migrations/1785006199372-auth-mfa-backup-codes.js.map +1 -0
- package/dist/database/migrations/1785006199373-auth-gap-fixes.d.ts +7 -0
- package/dist/database/migrations/1785006199373-auth-gap-fixes.d.ts.map +1 -0
- package/dist/database/migrations/1785006199373-auth-gap-fixes.js +14 -0
- package/dist/database/migrations/1785006199373-auth-gap-fixes.js.map +1 -0
- package/dist/database/migrations/1785006199374-auth-sessions-indexes.d.ts +13 -0
- package/dist/database/migrations/1785006199374-auth-sessions-indexes.d.ts.map +1 -0
- package/dist/database/migrations/1785006199374-auth-sessions-indexes.js +35 -0
- package/dist/database/migrations/1785006199374-auth-sessions-indexes.js.map +1 -0
- package/dist/database/migrations/1785006199375-auth-identity-and-audit.d.ts +11 -0
- package/dist/database/migrations/1785006199375-auth-identity-and-audit.d.ts.map +1 -0
- package/dist/database/migrations/1785006199375-auth-identity-and-audit.js +60 -0
- package/dist/database/migrations/1785006199375-auth-identity-and-audit.js.map +1 -0
- package/dist/database/migrations/1785006199376-auth-settings-security-defaults.d.ts +14 -0
- package/dist/database/migrations/1785006199376-auth-settings-security-defaults.d.ts.map +1 -0
- package/dist/database/migrations/1785006199376-auth-settings-security-defaults.js +39 -0
- package/dist/database/migrations/1785006199376-auth-settings-security-defaults.js.map +1 -0
- package/dist/database/migrations/1785006199377-auth-security-hardening.d.ts +13 -0
- package/dist/database/migrations/1785006199377-auth-security-hardening.d.ts.map +1 -0
- package/dist/database/migrations/1785006199377-auth-security-hardening.js +69 -0
- package/dist/database/migrations/1785006199377-auth-security-hardening.js.map +1 -0
- package/dist/database/migrations/1785006199378-auth-family-denylist-and-hardening.d.ts +11 -0
- package/dist/database/migrations/1785006199378-auth-family-denylist-and-hardening.d.ts.map +1 -0
- package/dist/database/migrations/1785006199378-auth-family-denylist-and-hardening.js +51 -0
- package/dist/database/migrations/1785006199378-auth-family-denylist-and-hardening.js.map +1 -0
- package/dist/database/migrations/1785006199379-authz-lifecycle-hardening.d.ts +12 -0
- package/dist/database/migrations/1785006199379-authz-lifecycle-hardening.d.ts.map +1 -0
- package/dist/database/migrations/1785006199379-authz-lifecycle-hardening.js +37 -0
- package/dist/database/migrations/1785006199379-authz-lifecycle-hardening.js.map +1 -0
- package/dist/database/migrations/1785006199380-auth-remaining-gaps.d.ts +12 -0
- package/dist/database/migrations/1785006199380-auth-remaining-gaps.d.ts.map +1 -0
- package/dist/database/migrations/1785006199380-auth-remaining-gaps.js +74 -0
- package/dist/database/migrations/1785006199380-auth-remaining-gaps.js.map +1 -0
- package/dist/database/migrations/1785006199381-settings-blast-radius.d.ts +12 -0
- package/dist/database/migrations/1785006199381-settings-blast-radius.d.ts.map +1 -0
- package/dist/database/migrations/1785006199381-settings-blast-radius.js +52 -0
- package/dist/database/migrations/1785006199381-settings-blast-radius.js.map +1 -0
- package/dist/database/migrations/1785006199382-oauth-client-ids-lock.d.ts +11 -0
- package/dist/database/migrations/1785006199382-oauth-client-ids-lock.d.ts.map +1 -0
- package/dist/database/migrations/1785006199382-oauth-client-ids-lock.js +36 -0
- package/dist/database/migrations/1785006199382-oauth-client-ids-lock.js.map +1 -0
- package/dist/database/migrations/1785006199383-settings-role-and-verified-lock.d.ts +12 -0
- package/dist/database/migrations/1785006199383-settings-role-and-verified-lock.d.ts.map +1 -0
- package/dist/database/migrations/1785006199383-settings-role-and-verified-lock.js +39 -0
- package/dist/database/migrations/1785006199383-settings-role-and-verified-lock.js.map +1 -0
- package/dist/database/migrations/1785006199384-settings-providers-and-test-otp-lock.d.ts +12 -0
- package/dist/database/migrations/1785006199384-settings-providers-and-test-otp-lock.d.ts.map +1 -0
- package/dist/database/migrations/1785006199384-settings-providers-and-test-otp-lock.js +39 -0
- package/dist/database/migrations/1785006199384-settings-providers-and-test-otp-lock.js.map +1 -0
- package/dist/database/migrations/1785006199385-settings-auth-surface-lock.d.ts +13 -0
- package/dist/database/migrations/1785006199385-settings-auth-surface-lock.d.ts.map +1 -0
- package/dist/database/migrations/1785006199385-settings-auth-surface-lock.js +72 -0
- package/dist/database/migrations/1785006199385-settings-auth-surface-lock.js.map +1 -0
- package/dist/database/migrations/1785006199386-audit-events.d.ts +10 -0
- package/dist/database/migrations/1785006199386-audit-events.d.ts.map +1 -0
- package/dist/database/migrations/1785006199386-audit-events.js +60 -0
- package/dist/database/migrations/1785006199386-audit-events.js.map +1 -0
- package/dist/database/migrations/1785006199387-audit-resource-id-varchar.d.ts +10 -0
- package/dist/database/migrations/1785006199387-audit-resource-id-varchar.d.ts.map +1 -0
- package/dist/database/migrations/1785006199387-audit-resource-id-varchar.js +25 -0
- package/dist/database/migrations/1785006199387-audit-resource-id-varchar.js.map +1 -0
- package/dist/database/migrations/1785006199388-audit-enterprise.d.ts +11 -0
- package/dist/database/migrations/1785006199388-audit-enterprise.d.ts.map +1 -0
- package/dist/database/migrations/1785006199388-audit-enterprise.js +157 -0
- package/dist/database/migrations/1785006199388-audit-enterprise.js.map +1 -0
- package/dist/database/migrations/1785006199389-drop-admin-logs.d.ts +10 -0
- package/dist/database/migrations/1785006199389-drop-admin-logs.d.ts.map +1 -0
- package/dist/database/migrations/1785006199389-drop-admin-logs.js +38 -0
- package/dist/database/migrations/1785006199389-drop-admin-logs.js.map +1 -0
- package/dist/database/migrations/1785006199390-audit-hardening.d.ts +14 -0
- package/dist/database/migrations/1785006199390-audit-hardening.d.ts.map +1 -0
- package/dist/database/migrations/1785006199390-audit-hardening.js +345 -0
- package/dist/database/migrations/1785006199390-audit-hardening.js.map +1 -0
- package/dist/database/migrations/1785006199391-audit-owner-schema-create.d.ts +10 -0
- package/dist/database/migrations/1785006199391-audit-owner-schema-create.d.ts.map +1 -0
- package/dist/database/migrations/1785006199391-audit-owner-schema-create.js +39 -0
- package/dist/database/migrations/1785006199391-audit-owner-schema-create.js.map +1 -0
- package/dist/database/migrations/1785006199392-profile-photo-url.d.ts +11 -0
- package/dist/database/migrations/1785006199392-profile-photo-url.d.ts.map +1 -0
- package/dist/database/migrations/1785006199392-profile-photo-url.js +33 -0
- package/dist/database/migrations/1785006199392-profile-photo-url.js.map +1 -0
- package/dist/database/migrations/1785006199393-profile-cover-url.d.ts +11 -0
- package/dist/database/migrations/1785006199393-profile-cover-url.d.ts.map +1 -0
- package/dist/database/migrations/1785006199393-profile-cover-url.js +33 -0
- package/dist/database/migrations/1785006199393-profile-cover-url.js.map +1 -0
- package/dist/database/migrations/1785006199394-profile-is-public-default-false.d.ts +11 -0
- package/dist/database/migrations/1785006199394-profile-is-public-default-false.d.ts.map +1 -0
- package/dist/database/migrations/1785006199394-profile-is-public-default-false.js +24 -0
- package/dist/database/migrations/1785006199394-profile-is-public-default-false.js.map +1 -0
- package/dist/database/migrations/1785006199395-delivery-scale-indexes.d.ts +10 -0
- package/dist/database/migrations/1785006199395-delivery-scale-indexes.d.ts.map +1 -0
- package/dist/database/migrations/1785006199395-delivery-scale-indexes.js +35 -0
- package/dist/database/migrations/1785006199395-delivery-scale-indexes.js.map +1 -0
- package/dist/database/migrations/1785006199396-delivery-recipient-index.d.ts +11 -0
- package/dist/database/migrations/1785006199396-delivery-recipient-index.d.ts.map +1 -0
- package/dist/database/migrations/1785006199396-delivery-recipient-index.js +23 -0
- package/dist/database/migrations/1785006199396-delivery-recipient-index.js.map +1 -0
- package/dist/database/seeds/roles.seed.d.ts +6 -0
- package/dist/database/seeds/roles.seed.d.ts.map +1 -1
- package/dist/database/seeds/roles.seed.js +22 -5
- package/dist/database/seeds/roles.seed.js.map +1 -1
- package/dist/database/seeds/settings.seed.d.ts +5 -0
- package/dist/database/seeds/settings.seed.d.ts.map +1 -1
- package/dist/database/seeds/settings.seed.js +500 -25
- package/dist/database/seeds/settings.seed.js.map +1 -1
- package/dist/database/seeds/templates/html-template.reader.d.ts +1 -0
- package/dist/database/seeds/templates/html-template.reader.d.ts.map +1 -1
- package/dist/database/seeds/templates/html-template.reader.js +3 -1
- package/dist/database/seeds/templates/html-template.reader.js.map +1 -1
- package/dist/database/seeds/templates/html-template.reader.ts +5 -1
- package/dist/database/typeorm.util.d.ts.map +1 -1
- package/dist/database/typeorm.util.js +6 -0
- package/dist/database/typeorm.util.js.map +1 -1
- package/dist/index.d.ts +8 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +39 -4
- package/dist/index.js.map +1 -1
- package/dist/modules/admin/controllers/admin.controller.d.ts +15 -7
- package/dist/modules/admin/controllers/admin.controller.d.ts.map +1 -1
- package/dist/modules/admin/controllers/admin.controller.js +74 -17
- package/dist/modules/admin/controllers/admin.controller.js.map +1 -1
- package/dist/modules/admin/services/admin-log.service.d.ts +14 -7
- package/dist/modules/admin/services/admin-log.service.d.ts.map +1 -1
- package/dist/modules/admin/services/admin-log.service.js +41 -38
- package/dist/modules/admin/services/admin-log.service.js.map +1 -1
- package/dist/modules/audit/audit.manifest.d.ts +8 -0
- package/dist/modules/audit/audit.manifest.d.ts.map +1 -0
- package/dist/modules/audit/audit.manifest.js +31 -0
- package/dist/modules/audit/audit.manifest.js.map +1 -0
- package/dist/modules/audit/audit.module.d.ts +8 -0
- package/dist/modules/audit/audit.module.d.ts.map +1 -0
- package/dist/modules/audit/audit.module.js +57 -0
- package/dist/modules/audit/audit.module.js.map +1 -0
- package/dist/modules/audit/constants/audit-actions.d.ts +79 -0
- package/dist/modules/audit/constants/audit-actions.d.ts.map +1 -0
- package/dist/modules/audit/constants/audit-actions.js +89 -0
- package/dist/modules/audit/constants/audit-actions.js.map +1 -0
- package/dist/modules/audit/constants/audit-mutation.d.ts +10 -0
- package/dist/modules/audit/constants/audit-mutation.d.ts.map +1 -0
- package/dist/modules/audit/constants/audit-mutation.js +13 -0
- package/dist/modules/audit/constants/audit-mutation.js.map +1 -0
- package/dist/modules/audit/controllers/audit.controller.d.ts +13 -0
- package/dist/modules/audit/controllers/audit.controller.d.ts.map +1 -0
- package/dist/modules/audit/controllers/audit.controller.js +149 -0
- package/dist/modules/audit/controllers/audit.controller.js.map +1 -0
- package/dist/modules/audit/decorators/audit.decorator.d.ts +27 -0
- package/dist/modules/audit/decorators/audit.decorator.d.ts.map +1 -0
- package/dist/modules/audit/decorators/audit.decorator.js +18 -0
- package/dist/modules/audit/decorators/audit.decorator.js.map +1 -0
- package/dist/modules/audit/dto/audit.dto.d.ts +54 -0
- package/dist/modules/audit/dto/audit.dto.d.ts.map +1 -0
- package/dist/modules/audit/dto/audit.dto.js +129 -0
- package/dist/modules/audit/dto/audit.dto.js.map +1 -0
- package/dist/modules/audit/entities/audit-event.entity.d.ts +33 -0
- package/dist/modules/audit/entities/audit-event.entity.d.ts.map +1 -0
- package/dist/modules/audit/entities/audit-event.entity.js +125 -0
- package/dist/modules/audit/entities/audit-event.entity.js.map +1 -0
- package/dist/modules/audit/entities/audit-outbox.entity.d.ts +16 -0
- package/dist/modules/audit/entities/audit-outbox.entity.d.ts.map +1 -0
- package/dist/modules/audit/entities/audit-outbox.entity.js +65 -0
- package/dist/modules/audit/entities/audit-outbox.entity.js.map +1 -0
- package/dist/modules/audit/index.d.ts +13 -0
- package/dist/modules/audit/index.d.ts.map +1 -0
- package/dist/modules/audit/index.js +23 -0
- package/dist/modules/audit/index.js.map +1 -0
- package/dist/modules/audit/interceptors/audit.interceptor.d.ts +11 -0
- package/dist/modules/audit/interceptors/audit.interceptor.d.ts.map +1 -0
- package/dist/modules/audit/interceptors/audit.interceptor.js +75 -0
- package/dist/modules/audit/interceptors/audit.interceptor.js.map +1 -0
- package/dist/modules/audit/listeners/auth-audit.listener.d.ts +31 -0
- package/dist/modules/audit/listeners/auth-audit.listener.d.ts.map +1 -0
- package/dist/modules/audit/listeners/auth-audit.listener.js +338 -0
- package/dist/modules/audit/listeners/auth-audit.listener.js.map +1 -0
- package/dist/modules/audit/services/audit-archive.service.d.ts +28 -0
- package/dist/modules/audit/services/audit-archive.service.d.ts.map +1 -0
- package/dist/modules/audit/services/audit-archive.service.js +132 -0
- package/dist/modules/audit/services/audit-archive.service.js.map +1 -0
- package/dist/modules/audit/services/audit-hash-backfill.service.d.ts +22 -0
- package/dist/modules/audit/services/audit-hash-backfill.service.d.ts.map +1 -0
- package/dist/modules/audit/services/audit-hash-backfill.service.js +79 -0
- package/dist/modules/audit/services/audit-hash-backfill.service.js.map +1 -0
- package/dist/modules/audit/services/audit-leader.service.d.ts +28 -0
- package/dist/modules/audit/services/audit-leader.service.d.ts.map +1 -0
- package/dist/modules/audit/services/audit-leader.service.js +99 -0
- package/dist/modules/audit/services/audit-leader.service.js.map +1 -0
- package/dist/modules/audit/services/audit-outbox.worker.d.ts +29 -0
- package/dist/modules/audit/services/audit-outbox.worker.d.ts.map +1 -0
- package/dist/modules/audit/services/audit-outbox.worker.js +144 -0
- package/dist/modules/audit/services/audit-outbox.worker.js.map +1 -0
- package/dist/modules/audit/services/audit-partition.service.d.ts +18 -0
- package/dist/modules/audit/services/audit-partition.service.d.ts.map +1 -0
- package/dist/modules/audit/services/audit-partition.service.js +70 -0
- package/dist/modules/audit/services/audit-partition.service.js.map +1 -0
- package/dist/modules/audit/services/audit-write.service.d.ts +60 -0
- package/dist/modules/audit/services/audit-write.service.d.ts.map +1 -0
- package/dist/modules/audit/services/audit-write.service.js +463 -0
- package/dist/modules/audit/services/audit-write.service.js.map +1 -0
- package/dist/modules/audit/services/audit.service.d.ts +60 -0
- package/dist/modules/audit/services/audit.service.d.ts.map +1 -0
- package/dist/modules/audit/services/audit.service.js +373 -0
- package/dist/modules/audit/services/audit.service.js.map +1 -0
- package/dist/modules/audit/utils/audit-hash.util.d.ts +20 -0
- package/dist/modules/audit/utils/audit-hash.util.d.ts.map +1 -0
- package/dist/modules/audit/utils/audit-hash.util.js +44 -0
- package/dist/modules/audit/utils/audit-hash.util.js.map +1 -0
- package/dist/modules/auth/auth-core/auth-core.module.d.ts.map +1 -1
- package/dist/modules/auth/auth-core/auth-core.module.js +16 -4
- package/dist/modules/auth/auth-core/auth-core.module.js.map +1 -1
- package/dist/modules/auth/auth-core/constants/jwt-redis.keys.d.ts +22 -0
- package/dist/modules/auth/auth-core/constants/jwt-redis.keys.d.ts.map +1 -0
- package/dist/modules/auth/auth-core/constants/jwt-redis.keys.js +25 -0
- package/dist/modules/auth/auth-core/constants/jwt-redis.keys.js.map +1 -0
- package/dist/modules/auth/auth-core/services/access-token.validator.d.ts +19 -0
- package/dist/modules/auth/auth-core/services/access-token.validator.d.ts.map +1 -0
- package/dist/modules/auth/auth-core/services/access-token.validator.js +110 -0
- package/dist/modules/auth/auth-core/services/access-token.validator.js.map +1 -0
- package/dist/modules/auth/auth-core/services/family-denylist.reader.d.ts +10 -0
- package/dist/modules/auth/auth-core/services/family-denylist.reader.d.ts.map +1 -0
- package/dist/modules/auth/auth-core/services/family-denylist.reader.js +44 -0
- package/dist/modules/auth/auth-core/services/family-denylist.reader.js.map +1 -0
- package/dist/modules/auth/auth-core/services/session-epoch.reader.d.ts +10 -0
- package/dist/modules/auth/auth-core/services/session-epoch.reader.d.ts.map +1 -0
- package/dist/modules/auth/auth-core/services/session-epoch.reader.js +44 -0
- package/dist/modules/auth/auth-core/services/session-epoch.reader.js.map +1 -0
- package/dist/modules/auth/auth-core/strategies/jwt.strategy.d.ts +7 -8
- package/dist/modules/auth/auth-core/strategies/jwt.strategy.d.ts.map +1 -1
- package/dist/modules/auth/auth-core/strategies/jwt.strategy.js +34 -34
- package/dist/modules/auth/auth-core/strategies/jwt.strategy.js.map +1 -1
- package/dist/modules/auth/auth.manifest.d.ts +6 -0
- package/dist/modules/auth/auth.manifest.d.ts.map +1 -1
- package/dist/modules/auth/auth.manifest.js +38 -2
- package/dist/modules/auth/auth.manifest.js.map +1 -1
- package/dist/modules/auth/auth.module.d.ts.map +1 -1
- package/dist/modules/auth/auth.module.js +39 -4
- package/dist/modules/auth/auth.module.js.map +1 -1
- package/dist/modules/auth/controllers/account.controller.d.ts +15 -1
- package/dist/modules/auth/controllers/account.controller.d.ts.map +1 -1
- package/dist/modules/auth/controllers/account.controller.js +65 -7
- package/dist/modules/auth/controllers/account.controller.js.map +1 -1
- package/dist/modules/auth/controllers/auth.controller.d.ts +7 -3
- package/dist/modules/auth/controllers/auth.controller.d.ts.map +1 -1
- package/dist/modules/auth/controllers/auth.controller.js +76 -16
- package/dist/modules/auth/controllers/auth.controller.js.map +1 -1
- package/dist/modules/auth/controllers/forgot-password.controller.d.ts +4 -2
- package/dist/modules/auth/controllers/forgot-password.controller.d.ts.map +1 -1
- package/dist/modules/auth/controllers/forgot-password.controller.js +32 -11
- package/dist/modules/auth/controllers/forgot-password.controller.js.map +1 -1
- package/dist/modules/auth/controllers/mfa.controller.d.ts +18 -0
- package/dist/modules/auth/controllers/mfa.controller.d.ts.map +1 -0
- package/dist/modules/auth/controllers/mfa.controller.js +192 -0
- package/dist/modules/auth/controllers/mfa.controller.js.map +1 -0
- package/dist/modules/auth/controllers/oauth.controller.d.ts +22 -0
- package/dist/modules/auth/controllers/oauth.controller.d.ts.map +1 -0
- package/dist/modules/auth/controllers/oauth.controller.js +192 -0
- package/dist/modules/auth/controllers/oauth.controller.js.map +1 -0
- package/dist/modules/auth/controllers/otp.controller.d.ts +6 -3
- package/dist/modules/auth/controllers/otp.controller.d.ts.map +1 -1
- package/dist/modules/auth/controllers/otp.controller.js +32 -33
- package/dist/modules/auth/controllers/otp.controller.js.map +1 -1
- package/dist/modules/auth/controllers/pin.controller.d.ts.map +1 -1
- package/dist/modules/auth/controllers/pin.controller.js +10 -2
- package/dist/modules/auth/controllers/pin.controller.js.map +1 -1
- package/dist/modules/auth/controllers/session.controller.d.ts +12 -4
- package/dist/modules/auth/controllers/session.controller.d.ts.map +1 -1
- package/dist/modules/auth/controllers/session.controller.js +130 -31
- package/dist/modules/auth/controllers/session.controller.js.map +1 -1
- package/dist/modules/auth/dto/auth-config.dto.d.ts +11 -2
- package/dist/modules/auth/dto/auth-config.dto.d.ts.map +1 -1
- package/dist/modules/auth/dto/auth-config.dto.js +78 -3
- package/dist/modules/auth/dto/auth-config.dto.js.map +1 -1
- package/dist/modules/auth/dto/index.d.ts +2 -0
- package/dist/modules/auth/dto/index.d.ts.map +1 -1
- package/dist/modules/auth/dto/index.js +2 -0
- package/dist/modules/auth/dto/index.js.map +1 -1
- package/dist/modules/auth/dto/login.dto.d.ts +8 -1
- package/dist/modules/auth/dto/login.dto.d.ts.map +1 -1
- package/dist/modules/auth/dto/login.dto.js +48 -3
- package/dist/modules/auth/dto/login.dto.js.map +1 -1
- package/dist/modules/auth/dto/mfa.dto.d.ts +61 -0
- package/dist/modules/auth/dto/mfa.dto.d.ts.map +1 -0
- package/dist/modules/auth/dto/mfa.dto.js +326 -0
- package/dist/modules/auth/dto/mfa.dto.js.map +1 -0
- package/dist/modules/auth/dto/oauth.dto.d.ts +45 -0
- package/dist/modules/auth/dto/oauth.dto.d.ts.map +1 -0
- package/dist/modules/auth/dto/oauth.dto.js +249 -0
- package/dist/modules/auth/dto/oauth.dto.js.map +1 -0
- package/dist/modules/auth/dto/otp.dto.d.ts +3 -1
- package/dist/modules/auth/dto/otp.dto.d.ts.map +1 -1
- package/dist/modules/auth/dto/otp.dto.js +19 -0
- package/dist/modules/auth/dto/otp.dto.js.map +1 -1
- package/dist/modules/auth/dto/password.dto.d.ts +28 -0
- package/dist/modules/auth/dto/password.dto.d.ts.map +1 -1
- package/dist/modules/auth/dto/password.dto.js +191 -5
- package/dist/modules/auth/dto/password.dto.js.map +1 -1
- package/dist/modules/auth/dto/register.dto.d.ts +1 -0
- package/dist/modules/auth/dto/register.dto.d.ts.map +1 -1
- package/dist/modules/auth/dto/register.dto.js +1 -0
- package/dist/modules/auth/dto/register.dto.js.map +1 -1
- package/dist/modules/auth/dto/session.dto.d.ts +20 -0
- package/dist/modules/auth/dto/session.dto.d.ts.map +1 -0
- package/dist/modules/auth/dto/session.dto.js +98 -0
- package/dist/modules/auth/dto/session.dto.js.map +1 -0
- package/dist/modules/auth/dto/token.dto.d.ts +38 -1
- package/dist/modules/auth/dto/token.dto.d.ts.map +1 -1
- package/dist/modules/auth/dto/token.dto.js +21 -1
- package/dist/modules/auth/dto/token.dto.js.map +1 -1
- package/dist/modules/auth/entities/index.d.ts +2 -0
- package/dist/modules/auth/entities/index.d.ts.map +1 -1
- package/dist/modules/auth/entities/index.js +2 -0
- package/dist/modules/auth/entities/index.js.map +1 -1
- package/dist/modules/auth/entities/password-reset-token.entity.d.ts +2 -0
- package/dist/modules/auth/entities/password-reset-token.entity.d.ts.map +1 -1
- package/dist/modules/auth/entities/password-reset-token.entity.js +6 -0
- package/dist/modules/auth/entities/password-reset-token.entity.js.map +1 -1
- package/dist/modules/auth/entities/user-mfa.entity.d.ts +19 -0
- package/dist/modules/auth/entities/user-mfa.entity.d.ts.map +1 -0
- package/dist/modules/auth/entities/user-mfa.entity.js +73 -0
- package/dist/modules/auth/entities/user-mfa.entity.js.map +1 -0
- package/dist/modules/auth/entities/user-oauth-identity.entity.d.ts +24 -0
- package/dist/modules/auth/entities/user-oauth-identity.entity.d.ts.map +1 -0
- package/dist/modules/auth/entities/user-oauth-identity.entity.js +84 -0
- package/dist/modules/auth/entities/user-oauth-identity.entity.js.map +1 -0
- package/dist/modules/auth/events/auth.events.d.ts +84 -19
- package/dist/modules/auth/events/auth.events.d.ts.map +1 -1
- package/dist/modules/auth/events/auth.events.js +17 -9
- package/dist/modules/auth/events/auth.events.js.map +1 -1
- package/dist/modules/auth/services/account.service.d.ts +74 -14
- package/dist/modules/auth/services/account.service.d.ts.map +1 -1
- package/dist/modules/auth/services/account.service.js +247 -31
- package/dist/modules/auth/services/account.service.js.map +1 -1
- package/dist/modules/auth/services/dpop.service.d.ts +41 -0
- package/dist/modules/auth/services/dpop.service.d.ts.map +1 -0
- package/dist/modules/auth/services/dpop.service.js +159 -0
- package/dist/modules/auth/services/dpop.service.js.map +1 -0
- package/dist/modules/auth/services/index.d.ts +2 -0
- package/dist/modules/auth/services/index.d.ts.map +1 -1
- package/dist/modules/auth/services/index.js +2 -0
- package/dist/modules/auth/services/index.js.map +1 -1
- package/dist/modules/auth/services/legacy-hash-cleanup.service.d.ts +28 -0
- package/dist/modules/auth/services/legacy-hash-cleanup.service.d.ts.map +1 -0
- package/dist/modules/auth/services/legacy-hash-cleanup.service.js +163 -0
- package/dist/modules/auth/services/legacy-hash-cleanup.service.js.map +1 -0
- package/dist/modules/auth/services/login.service.d.ts +29 -34
- package/dist/modules/auth/services/login.service.d.ts.map +1 -1
- package/dist/modules/auth/services/login.service.js +173 -61
- package/dist/modules/auth/services/login.service.js.map +1 -1
- package/dist/modules/auth/services/mfa.service.d.ts +111 -0
- package/dist/modules/auth/services/mfa.service.d.ts.map +1 -0
- package/dist/modules/auth/services/mfa.service.js +662 -0
- package/dist/modules/auth/services/mfa.service.js.map +1 -0
- package/dist/modules/auth/services/oauth/apple-id-token.verifier.d.ts +11 -0
- package/dist/modules/auth/services/oauth/apple-id-token.verifier.d.ts.map +1 -0
- package/dist/modules/auth/services/oauth/apple-id-token.verifier.js +56 -0
- package/dist/modules/auth/services/oauth/apple-id-token.verifier.js.map +1 -0
- package/dist/modules/auth/services/oauth/google-id-token.verifier.d.ts +12 -0
- package/dist/modules/auth/services/oauth/google-id-token.verifier.d.ts.map +1 -0
- package/dist/modules/auth/services/oauth/google-id-token.verifier.js +64 -0
- package/dist/modules/auth/services/oauth/google-id-token.verifier.js.map +1 -0
- package/dist/modules/auth/services/oauth/microsoft-id-token.verifier.d.ts +11 -0
- package/dist/modules/auth/services/oauth/microsoft-id-token.verifier.d.ts.map +1 -0
- package/dist/modules/auth/services/oauth/microsoft-id-token.verifier.js +76 -0
- package/dist/modules/auth/services/oauth/microsoft-id-token.verifier.js.map +1 -0
- package/dist/modules/auth/services/oauth/oidc-id-token.verifier.d.ts +16 -0
- package/dist/modules/auth/services/oauth/oidc-id-token.verifier.d.ts.map +1 -0
- package/dist/modules/auth/services/oauth/oidc-id-token.verifier.js +92 -0
- package/dist/modules/auth/services/oauth/oidc-id-token.verifier.js.map +1 -0
- package/dist/modules/auth/services/oauth/verified-oauth-identity.d.ts +9 -0
- package/dist/modules/auth/services/oauth/verified-oauth-identity.d.ts.map +1 -0
- package/dist/modules/auth/services/oauth/verified-oauth-identity.js +3 -0
- package/dist/modules/auth/services/oauth/verified-oauth-identity.js.map +1 -0
- package/dist/modules/auth/services/oauth.service.d.ts +83 -0
- package/dist/modules/auth/services/oauth.service.d.ts.map +1 -0
- package/dist/modules/auth/services/oauth.service.js +471 -0
- package/dist/modules/auth/services/oauth.service.js.map +1 -0
- package/dist/modules/auth/services/otp-auth.service.d.ts +13 -3
- package/dist/modules/auth/services/otp-auth.service.d.ts.map +1 -1
- package/dist/modules/auth/services/otp-auth.service.js +41 -7
- package/dist/modules/auth/services/otp-auth.service.js.map +1 -1
- package/dist/modules/auth/services/password-reset-audit-retention.service.d.ts +22 -0
- package/dist/modules/auth/services/password-reset-audit-retention.service.d.ts.map +1 -0
- package/dist/modules/auth/services/password-reset-audit-retention.service.js +117 -0
- package/dist/modules/auth/services/password-reset-audit-retention.service.js.map +1 -0
- package/dist/modules/auth/services/password.service.d.ts +25 -5
- package/dist/modules/auth/services/password.service.d.ts.map +1 -1
- package/dist/modules/auth/services/password.service.js +154 -20
- package/dist/modules/auth/services/password.service.js.map +1 -1
- package/dist/modules/auth/services/pin-auth.service.d.ts +10 -3
- package/dist/modules/auth/services/pin-auth.service.d.ts.map +1 -1
- package/dist/modules/auth/services/pin-auth.service.js +110 -13
- package/dist/modules/auth/services/pin-auth.service.js.map +1 -1
- package/dist/modules/auth/services/registration.service.d.ts +10 -2
- package/dist/modules/auth/services/registration.service.d.ts.map +1 -1
- package/dist/modules/auth/services/registration.service.js +113 -25
- package/dist/modules/auth/services/registration.service.js.map +1 -1
- package/dist/modules/auth/services/turnstile.service.d.ts +17 -0
- package/dist/modules/auth/services/turnstile.service.d.ts.map +1 -0
- package/dist/modules/auth/services/turnstile.service.js +94 -0
- package/dist/modules/auth/services/turnstile.service.js.map +1 -0
- package/dist/modules/auth/utils/auth-params.util.d.ts +13 -6
- package/dist/modules/auth/utils/auth-params.util.d.ts.map +1 -1
- package/dist/modules/auth/utils/auth-params.util.js +27 -4
- package/dist/modules/auth/utils/auth-params.util.js.map +1 -1
- package/dist/modules/auth/utils/auth-supported.util.d.ts +12 -1
- package/dist/modules/auth/utils/auth-supported.util.d.ts.map +1 -1
- package/dist/modules/auth/utils/auth-supported.util.js +36 -4
- package/dist/modules/auth/utils/auth-supported.util.js.map +1 -1
- package/dist/modules/auth/utils/backup-code-hash.util.d.ts +10 -0
- package/dist/modules/auth/utils/backup-code-hash.util.d.ts.map +1 -0
- package/dist/modules/auth/utils/backup-code-hash.util.js +31 -0
- package/dist/modules/auth/utils/backup-code-hash.util.js.map +1 -0
- package/dist/modules/auth/utils/backup-codes.util.d.ts +5 -0
- package/dist/modules/auth/utils/backup-codes.util.d.ts.map +1 -0
- package/dist/modules/auth/utils/backup-codes.util.js +22 -0
- package/dist/modules/auth/utils/backup-codes.util.js.map +1 -0
- package/dist/modules/auth/utils/dpop.util.d.ts +22 -0
- package/dist/modules/auth/utils/dpop.util.d.ts.map +1 -0
- package/dist/modules/auth/utils/dpop.util.js +73 -0
- package/dist/modules/auth/utils/dpop.util.js.map +1 -0
- package/dist/modules/auth/utils/mfa-secret.util.d.ts +22 -0
- package/dist/modules/auth/utils/mfa-secret.util.d.ts.map +1 -0
- package/dist/modules/auth/utils/mfa-secret.util.js +59 -0
- package/dist/modules/auth/utils/mfa-secret.util.js.map +1 -0
- package/dist/modules/auth/utils/mfa-verify-params.util.d.ts +26 -0
- package/dist/modules/auth/utils/mfa-verify-params.util.d.ts.map +1 -0
- package/dist/modules/auth/utils/mfa-verify-params.util.js +49 -0
- package/dist/modules/auth/utils/mfa-verify-params.util.js.map +1 -0
- package/dist/modules/auth/utils/step-up-purpose.util.d.ts +5 -0
- package/dist/modules/auth/utils/step-up-purpose.util.d.ts.map +1 -0
- package/dist/modules/auth/utils/step-up-purpose.util.js +18 -0
- package/dist/modules/auth/utils/step-up-purpose.util.js.map +1 -0
- package/dist/modules/auth/utils/totp.util.d.ts +16 -0
- package/dist/modules/auth/utils/totp.util.d.ts.map +1 -0
- package/dist/modules/auth/utils/totp.util.js +88 -0
- package/dist/modules/auth/utils/totp.util.js.map +1 -0
- package/dist/modules/delivery/composers/otp-delivery.composer.d.ts +28 -1
- package/dist/modules/delivery/composers/otp-delivery.composer.d.ts.map +1 -1
- package/dist/modules/delivery/composers/otp-delivery.composer.js +48 -2
- package/dist/modules/delivery/composers/otp-delivery.composer.js.map +1 -1
- package/dist/modules/delivery/constants/delivery-worker.constants.d.ts +29 -0
- package/dist/modules/delivery/constants/delivery-worker.constants.d.ts.map +1 -0
- package/dist/modules/delivery/constants/delivery-worker.constants.js +51 -0
- package/dist/modules/delivery/constants/delivery-worker.constants.js.map +1 -0
- package/dist/modules/delivery/delivery.module.d.ts.map +1 -1
- package/dist/modules/delivery/delivery.module.js +1 -15
- package/dist/modules/delivery/delivery.module.js.map +1 -1
- package/dist/modules/delivery/entities/notification-delivery-log.entity.d.ts.map +1 -1
- package/dist/modules/delivery/entities/notification-delivery-log.entity.js +3 -1
- package/dist/modules/delivery/entities/notification-delivery-log.entity.js.map +1 -1
- package/dist/modules/delivery/notification-delivery.service.d.ts +12 -1
- package/dist/modules/delivery/notification-delivery.service.d.ts.map +1 -1
- package/dist/modules/delivery/notification-delivery.service.js +121 -40
- package/dist/modules/delivery/notification-delivery.service.js.map +1 -1
- package/dist/modules/delivery/processors/delivery-job.runner.d.ts +22 -1
- package/dist/modules/delivery/processors/delivery-job.runner.d.ts.map +1 -1
- package/dist/modules/delivery/processors/delivery-job.runner.js +144 -42
- package/dist/modules/delivery/processors/delivery-job.runner.js.map +1 -1
- package/dist/modules/delivery/processors/delivery.processor.d.ts.map +1 -1
- package/dist/modules/delivery/processors/delivery.processor.js +6 -1
- package/dist/modules/delivery/processors/delivery.processor.js.map +1 -1
- package/dist/modules/delivery/processors/otp-delivery-job.runner.d.ts +11 -0
- package/dist/modules/delivery/processors/otp-delivery-job.runner.d.ts.map +1 -1
- package/dist/modules/delivery/processors/otp-delivery-job.runner.js +90 -16
- package/dist/modules/delivery/processors/otp-delivery-job.runner.js.map +1 -1
- package/dist/modules/delivery/processors/otp-delivery.processor.d.ts.map +1 -1
- package/dist/modules/delivery/processors/otp-delivery.processor.js +6 -1
- package/dist/modules/delivery/processors/otp-delivery.processor.js.map +1 -1
- package/dist/modules/delivery/queues/sync-jobs.queue.d.ts +7 -1
- package/dist/modules/delivery/queues/sync-jobs.queue.d.ts.map +1 -1
- package/dist/modules/delivery/queues/sync-jobs.queue.js +11 -2
- package/dist/modules/delivery/queues/sync-jobs.queue.js.map +1 -1
- package/dist/modules/delivery/services/delivery-audit-retention.service.d.ts +7 -3
- package/dist/modules/delivery/services/delivery-audit-retention.service.d.ts.map +1 -1
- package/dist/modules/delivery/services/delivery-audit-retention.service.js +33 -10
- package/dist/modules/delivery/services/delivery-audit-retention.service.js.map +1 -1
- package/dist/modules/delivery/services/notification-audit.service.d.ts +7 -4
- package/dist/modules/delivery/services/notification-audit.service.d.ts.map +1 -1
- package/dist/modules/delivery/services/notification-audit.service.js +83 -26
- package/dist/modules/delivery/services/notification-audit.service.js.map +1 -1
- package/dist/modules/delivery/utils/payload-snapshot.util.d.ts +2 -0
- package/dist/modules/delivery/utils/payload-snapshot.util.d.ts.map +1 -1
- package/dist/modules/delivery/utils/payload-snapshot.util.js +22 -3
- package/dist/modules/delivery/utils/payload-snapshot.util.js.map +1 -1
- package/dist/modules/file-upload/controllers/file-upload.controller.d.ts +7 -1
- package/dist/modules/file-upload/controllers/file-upload.controller.d.ts.map +1 -1
- package/dist/modules/file-upload/controllers/file-upload.controller.js +5 -7
- package/dist/modules/file-upload/controllers/file-upload.controller.js.map +1 -1
- package/dist/modules/file-upload/dto/file-upload.dto.d.ts +2 -0
- package/dist/modules/file-upload/dto/file-upload.dto.d.ts.map +1 -1
- package/dist/modules/file-upload/dto/file-upload.dto.js +20 -0
- package/dist/modules/file-upload/dto/file-upload.dto.js.map +1 -1
- package/dist/modules/file-upload/file-upload.module.d.ts.map +1 -1
- package/dist/modules/file-upload/file-upload.module.js +12 -2
- package/dist/modules/file-upload/file-upload.module.js.map +1 -1
- package/dist/modules/file-upload/services/file-upload.service.d.ts +24 -6
- package/dist/modules/file-upload/services/file-upload.service.d.ts.map +1 -1
- package/dist/modules/file-upload/services/file-upload.service.js +164 -36
- package/dist/modules/file-upload/services/file-upload.service.js.map +1 -1
- package/dist/modules/file-upload/services/upload-orphan-cleanup.service.d.ts +4 -2
- package/dist/modules/file-upload/services/upload-orphan-cleanup.service.d.ts.map +1 -1
- package/dist/modules/file-upload/services/upload-orphan-cleanup.service.js +30 -5
- package/dist/modules/file-upload/services/upload-orphan-cleanup.service.js.map +1 -1
- package/dist/modules/file-upload/utils/image-optimize.util.d.ts.map +1 -1
- package/dist/modules/file-upload/utils/image-optimize.util.js +7 -1
- package/dist/modules/file-upload/utils/image-optimize.util.js.map +1 -1
- package/dist/modules/health/health.controller.d.ts +5 -1
- package/dist/modules/health/health.controller.d.ts.map +1 -1
- package/dist/modules/health/health.controller.js +57 -3
- package/dist/modules/health/health.controller.js.map +1 -1
- package/dist/modules/invitations/controllers/invitations.controller.d.ts +19 -4
- package/dist/modules/invitations/controllers/invitations.controller.d.ts.map +1 -1
- package/dist/modules/invitations/controllers/invitations.controller.js +19 -10
- package/dist/modules/invitations/controllers/invitations.controller.js.map +1 -1
- package/dist/modules/invitations/dto/invitation.dto.d.ts +13 -0
- package/dist/modules/invitations/dto/invitation.dto.d.ts.map +1 -1
- package/dist/modules/invitations/dto/invitation.dto.js +69 -2
- package/dist/modules/invitations/dto/invitation.dto.js.map +1 -1
- package/dist/modules/invitations/services/invitations.service.d.ts +24 -6
- package/dist/modules/invitations/services/invitations.service.d.ts.map +1 -1
- package/dist/modules/invitations/services/invitations.service.js +96 -20
- package/dist/modules/invitations/services/invitations.service.js.map +1 -1
- package/dist/modules/jobs/queues/jobs.queue.d.ts +7 -2
- package/dist/modules/jobs/queues/jobs.queue.d.ts.map +1 -1
- package/dist/modules/jobs/queues/jobs.queue.js +25 -10
- package/dist/modules/jobs/queues/jobs.queue.js.map +1 -1
- package/dist/modules/notifications/controllers/notifications.controller.d.ts +3 -1
- package/dist/modules/notifications/controllers/notifications.controller.d.ts.map +1 -1
- package/dist/modules/notifications/controllers/notifications.controller.js +25 -2
- package/dist/modules/notifications/controllers/notifications.controller.js.map +1 -1
- package/dist/modules/notifications/dto/notification-query.dto.d.ts.map +1 -1
- package/dist/modules/notifications/dto/notification-query.dto.js +1 -0
- package/dist/modules/notifications/dto/notification-query.dto.js.map +1 -1
- package/dist/modules/notifications/entities/device-token.entity.d.ts.map +1 -1
- package/dist/modules/notifications/entities/device-token.entity.js +3 -1
- package/dist/modules/notifications/entities/device-token.entity.js.map +1 -1
- package/dist/modules/notifications/services/fcm.service.d.ts +2 -0
- package/dist/modules/notifications/services/fcm.service.d.ts.map +1 -1
- package/dist/modules/notifications/services/fcm.service.js +28 -7
- package/dist/modules/notifications/services/fcm.service.js.map +1 -1
- package/dist/modules/notifications/services/notifications.service.d.ts +16 -3
- package/dist/modules/notifications/services/notifications.service.d.ts.map +1 -1
- package/dist/modules/notifications/services/notifications.service.js +95 -24
- package/dist/modules/notifications/services/notifications.service.js.map +1 -1
- package/dist/modules/observability/metrics/metrics.service.d.ts +2 -0
- package/dist/modules/observability/metrics/metrics.service.d.ts.map +1 -1
- package/dist/modules/observability/metrics/metrics.service.js +11 -0
- package/dist/modules/observability/metrics/metrics.service.js.map +1 -1
- package/dist/modules/otp/constants/otp.constants.d.ts +7 -5
- package/dist/modules/otp/constants/otp.constants.d.ts.map +1 -1
- package/dist/modules/otp/constants/otp.constants.js +11 -8
- package/dist/modules/otp/constants/otp.constants.js.map +1 -1
- package/dist/modules/otp/interfaces/otp.service.interface.d.ts +1 -1
- package/dist/modules/otp/interfaces/otp.service.interface.d.ts.map +1 -1
- package/dist/modules/otp/otp.service.d.ts +10 -2
- package/dist/modules/otp/otp.service.d.ts.map +1 -1
- package/dist/modules/otp/otp.service.js +48 -4
- package/dist/modules/otp/otp.service.js.map +1 -1
- package/dist/modules/otp/services/otp.rate-limiter.d.ts +2 -0
- package/dist/modules/otp/services/otp.rate-limiter.d.ts.map +1 -1
- package/dist/modules/otp/services/otp.rate-limiter.js +19 -0
- package/dist/modules/otp/services/otp.rate-limiter.js.map +1 -1
- package/dist/modules/otp/services/otp.session.store.d.ts +9 -3
- package/dist/modules/otp/services/otp.session.store.d.ts.map +1 -1
- package/dist/modules/otp/services/otp.session.store.js +34 -42
- package/dist/modules/otp/services/otp.session.store.js.map +1 -1
- package/dist/modules/otp/utils/otp-code-hash.util.d.ts +11 -0
- package/dist/modules/otp/utils/otp-code-hash.util.d.ts.map +1 -0
- package/dist/modules/otp/utils/otp-code-hash.util.js +68 -0
- package/dist/modules/otp/utils/otp-code-hash.util.js.map +1 -0
- package/dist/modules/profile/controllers/profile.controller.d.ts +9 -3
- package/dist/modules/profile/controllers/profile.controller.d.ts.map +1 -1
- package/dist/modules/profile/controllers/profile.controller.js +140 -8
- package/dist/modules/profile/controllers/profile.controller.js.map +1 -1
- package/dist/modules/profile/dto/create-user-profile.dto.d.ts +10 -0
- package/dist/modules/profile/dto/create-user-profile.dto.d.ts.map +1 -1
- package/dist/modules/profile/dto/create-user-profile.dto.js +43 -1
- package/dist/modules/profile/dto/create-user-profile.dto.js.map +1 -1
- package/dist/modules/profile/dto/public-user-profile.dto.d.ts +24 -0
- package/dist/modules/profile/dto/public-user-profile.dto.d.ts.map +1 -0
- package/dist/modules/profile/dto/public-user-profile.dto.js +115 -0
- package/dist/modules/profile/dto/public-user-profile.dto.js.map +1 -0
- package/dist/modules/profile/dto/user-profile-response.dto.d.ts +4 -0
- package/dist/modules/profile/dto/user-profile-response.dto.d.ts.map +1 -1
- package/dist/modules/profile/dto/user-profile-response.dto.js +4 -0
- package/dist/modules/profile/dto/user-profile-response.dto.js.map +1 -1
- package/dist/modules/profile/dto/username-available.dto.d.ts +6 -0
- package/dist/modules/profile/dto/username-available.dto.d.ts.map +1 -0
- package/dist/modules/profile/dto/username-available.dto.js +31 -0
- package/dist/modules/profile/dto/username-available.dto.js.map +1 -0
- package/dist/modules/profile/entities/user-profiles.entity.d.ts +10 -0
- package/dist/modules/profile/entities/user-profiles.entity.d.ts.map +1 -1
- package/dist/modules/profile/entities/user-profiles.entity.js +29 -1
- package/dist/modules/profile/entities/user-profiles.entity.js.map +1 -1
- package/dist/modules/profile/index.d.ts +1 -0
- package/dist/modules/profile/index.d.ts.map +1 -1
- package/dist/modules/profile/index.js +1 -0
- package/dist/modules/profile/index.js.map +1 -1
- package/dist/modules/profile/profile.manifest.d.ts +2 -2
- package/dist/modules/profile/profile.manifest.js +2 -2
- package/dist/modules/profile/profile.manifest.js.map +1 -1
- package/dist/modules/profile/profile.module.d.ts.map +1 -1
- package/dist/modules/profile/profile.module.js +7 -2
- package/dist/modules/profile/profile.module.js.map +1 -1
- package/dist/modules/profile/services/profile.service.d.ts +56 -4
- package/dist/modules/profile/services/profile.service.d.ts.map +1 -1
- package/dist/modules/profile/services/profile.service.js +247 -20
- package/dist/modules/profile/services/profile.service.js.map +1 -1
- package/dist/modules/realtime/adapters/redis-io.adapter.d.ts +26 -0
- package/dist/modules/realtime/adapters/redis-io.adapter.d.ts.map +1 -0
- package/dist/modules/realtime/adapters/redis-io.adapter.js +124 -0
- package/dist/modules/realtime/adapters/redis-io.adapter.js.map +1 -0
- package/dist/modules/realtime/constants/realtime.constants.d.ts +36 -0
- package/dist/modules/realtime/constants/realtime.constants.d.ts.map +1 -0
- package/dist/modules/realtime/constants/realtime.constants.js +42 -0
- package/dist/modules/realtime/constants/realtime.constants.js.map +1 -0
- package/dist/modules/realtime/controllers/realtime.controller.d.ts +21 -0
- package/dist/modules/realtime/controllers/realtime.controller.d.ts.map +1 -0
- package/dist/modules/realtime/controllers/realtime.controller.js +113 -0
- package/dist/modules/realtime/controllers/realtime.controller.js.map +1 -0
- package/dist/modules/realtime/gateway/realtime.gateway.d.ts +42 -0
- package/dist/modules/realtime/gateway/realtime.gateway.d.ts.map +1 -0
- package/dist/modules/realtime/gateway/realtime.gateway.js +289 -0
- package/dist/modules/realtime/gateway/realtime.gateway.js.map +1 -0
- package/dist/modules/realtime/index.d.ts +12 -0
- package/dist/modules/realtime/index.d.ts.map +1 -0
- package/dist/modules/realtime/index.js +35 -0
- package/dist/modules/realtime/index.js.map +1 -0
- package/dist/modules/realtime/realtime.manifest.d.ts +8 -0
- package/dist/modules/realtime/realtime.manifest.d.ts.map +1 -0
- package/dist/modules/realtime/realtime.manifest.js +31 -0
- package/dist/modules/realtime/realtime.manifest.js.map +1 -0
- package/dist/modules/realtime/realtime.module.d.ts +14 -0
- package/dist/modules/realtime/realtime.module.d.ts.map +1 -0
- package/dist/modules/realtime/realtime.module.js +126 -0
- package/dist/modules/realtime/realtime.module.js.map +1 -0
- package/dist/modules/realtime/services/realtime-handler.registry.d.ts +16 -0
- package/dist/modules/realtime/services/realtime-handler.registry.d.ts.map +1 -0
- package/dist/modules/realtime/services/realtime-handler.registry.js +55 -0
- package/dist/modules/realtime/services/realtime-handler.registry.js.map +1 -0
- package/dist/modules/realtime/services/realtime-presence.service.d.ts +15 -0
- package/dist/modules/realtime/services/realtime-presence.service.d.ts.map +1 -0
- package/dist/modules/realtime/services/realtime-presence.service.js +86 -0
- package/dist/modules/realtime/services/realtime-presence.service.js.map +1 -0
- package/dist/modules/realtime/services/realtime-rate-limiter.service.d.ts +12 -0
- package/dist/modules/realtime/services/realtime-rate-limiter.service.d.ts.map +1 -0
- package/dist/modules/realtime/services/realtime-rate-limiter.service.js +63 -0
- package/dist/modules/realtime/services/realtime-rate-limiter.service.js.map +1 -0
- package/dist/modules/realtime/services/realtime.service.d.ts +88 -0
- package/dist/modules/realtime/services/realtime.service.d.ts.map +1 -0
- package/dist/modules/realtime/services/realtime.service.js +343 -0
- package/dist/modules/realtime/services/realtime.service.js.map +1 -0
- package/dist/modules/realtime/types/realtime.types.d.ts +50 -0
- package/dist/modules/realtime/types/realtime.types.d.ts.map +1 -0
- package/dist/modules/realtime/types/realtime.types.js +14 -0
- package/dist/modules/realtime/types/realtime.types.js.map +1 -0
- package/dist/modules/realtime/utils/handshake-error.util.d.ts +5 -0
- package/dist/modules/realtime/utils/handshake-error.util.d.ts.map +1 -0
- package/dist/modules/realtime/utils/handshake-error.util.js +45 -0
- package/dist/modules/realtime/utils/handshake-error.util.js.map +1 -0
- package/dist/modules/roles/controllers/modules.controller.d.ts +4 -3
- package/dist/modules/roles/controllers/modules.controller.d.ts.map +1 -1
- package/dist/modules/roles/controllers/modules.controller.js +21 -10
- package/dist/modules/roles/controllers/modules.controller.js.map +1 -1
- package/dist/modules/roles/controllers/permissions.controller.d.ts +4 -3
- package/dist/modules/roles/controllers/permissions.controller.d.ts.map +1 -1
- package/dist/modules/roles/controllers/permissions.controller.js +21 -10
- package/dist/modules/roles/controllers/permissions.controller.js.map +1 -1
- package/dist/modules/roles/controllers/roles.controller.d.ts +5 -4
- package/dist/modules/roles/controllers/roles.controller.d.ts.map +1 -1
- package/dist/modules/roles/controllers/roles.controller.js +26 -13
- package/dist/modules/roles/controllers/roles.controller.js.map +1 -1
- package/dist/modules/roles/controllers/user-roles.controller.d.ts +3 -2
- package/dist/modules/roles/controllers/user-roles.controller.d.ts.map +1 -1
- package/dist/modules/roles/controllers/user-roles.controller.js +14 -6
- package/dist/modules/roles/controllers/user-roles.controller.js.map +1 -1
- package/dist/modules/roles/services/modules.service.d.ts +8 -5
- package/dist/modules/roles/services/modules.service.d.ts.map +1 -1
- package/dist/modules/roles/services/modules.service.js +58 -12
- package/dist/modules/roles/services/modules.service.js.map +1 -1
- package/dist/modules/roles/services/permissions.service.d.ts +8 -5
- package/dist/modules/roles/services/permissions.service.d.ts.map +1 -1
- package/dist/modules/roles/services/permissions.service.js +61 -12
- package/dist/modules/roles/services/permissions.service.js.map +1 -1
- package/dist/modules/roles/services/roles.service.d.ts +19 -9
- package/dist/modules/roles/services/roles.service.d.ts.map +1 -1
- package/dist/modules/roles/services/roles.service.js +137 -47
- package/dist/modules/roles/services/roles.service.js.map +1 -1
- package/dist/modules/roles/services/user-roles.service.d.ts +12 -4
- package/dist/modules/roles/services/user-roles.service.d.ts.map +1 -1
- package/dist/modules/roles/services/user-roles.service.js +58 -26
- package/dist/modules/roles/services/user-roles.service.js.map +1 -1
- package/dist/modules/sessions/entities/refresh-token.entity.d.ts +7 -1
- package/dist/modules/sessions/entities/refresh-token.entity.d.ts.map +1 -1
- package/dist/modules/sessions/entities/refresh-token.entity.js +10 -0
- package/dist/modules/sessions/entities/refresh-token.entity.js.map +1 -1
- package/dist/modules/sessions/entities/revoked-refresh-family.entity.d.ts +12 -0
- package/dist/modules/sessions/entities/revoked-refresh-family.entity.d.ts.map +1 -0
- package/dist/modules/sessions/entities/revoked-refresh-family.entity.js +46 -0
- package/dist/modules/sessions/entities/revoked-refresh-family.entity.js.map +1 -0
- package/dist/modules/sessions/services/refresh-token-retention.service.d.ts +20 -0
- package/dist/modules/sessions/services/refresh-token-retention.service.d.ts.map +1 -0
- package/dist/modules/sessions/services/refresh-token-retention.service.js +97 -0
- package/dist/modules/sessions/services/refresh-token-retention.service.js.map +1 -0
- package/dist/modules/sessions/services/token.service.d.ts +150 -16
- package/dist/modules/sessions/services/token.service.d.ts.map +1 -1
- package/dist/modules/sessions/services/token.service.js +505 -74
- package/dist/modules/sessions/services/token.service.js.map +1 -1
- package/dist/modules/sessions/sessions.module.d.ts.map +1 -1
- package/dist/modules/sessions/sessions.module.js +4 -2
- package/dist/modules/sessions/sessions.module.js.map +1 -1
- package/dist/modules/sessions/utils/refresh-token-hash.util.d.ts +13 -0
- package/dist/modules/sessions/utils/refresh-token-hash.util.d.ts.map +1 -0
- package/dist/modules/sessions/utils/refresh-token-hash.util.js +37 -0
- package/dist/modules/sessions/utils/refresh-token-hash.util.js.map +1 -0
- package/dist/modules/settings/constants/settings.defaults.d.ts +57 -3
- package/dist/modules/settings/constants/settings.defaults.d.ts.map +1 -1
- package/dist/modules/settings/constants/settings.defaults.js +58 -3
- package/dist/modules/settings/constants/settings.defaults.js.map +1 -1
- package/dist/modules/settings/constants/settings.keys.d.ts +138 -2
- package/dist/modules/settings/constants/settings.keys.d.ts.map +1 -1
- package/dist/modules/settings/constants/settings.keys.js +140 -2
- package/dist/modules/settings/constants/settings.keys.js.map +1 -1
- package/dist/modules/settings/controllers/settings.controller.d.ts +5 -1
- package/dist/modules/settings/controllers/settings.controller.d.ts.map +1 -1
- package/dist/modules/settings/controllers/settings.controller.js +134 -5
- package/dist/modules/settings/controllers/settings.controller.js.map +1 -1
- package/dist/modules/settings/services/settings.service.d.ts +17 -7
- package/dist/modules/settings/services/settings.service.d.ts.map +1 -1
- package/dist/modules/settings/services/settings.service.js +80 -14
- package/dist/modules/settings/services/settings.service.js.map +1 -1
- package/dist/modules/settings/utils/settings-secret.util.d.ts +13 -0
- package/dist/modules/settings/utils/settings-secret.util.d.ts.map +1 -0
- package/dist/modules/settings/utils/settings-secret.util.js +80 -0
- package/dist/modules/settings/utils/settings-secret.util.js.map +1 -0
- package/dist/modules/users/controllers/users.controller.d.ts +4 -2
- package/dist/modules/users/controllers/users.controller.d.ts.map +1 -1
- package/dist/modules/users/controllers/users.controller.js +89 -10
- package/dist/modules/users/controllers/users.controller.js.map +1 -1
- package/dist/modules/users/dto/user.dto.d.ts +5 -0
- package/dist/modules/users/dto/user.dto.d.ts.map +1 -1
- package/dist/modules/users/dto/user.dto.js +46 -5
- package/dist/modules/users/dto/user.dto.js.map +1 -1
- package/dist/modules/users/entities/user.entity.d.ts +7 -1
- package/dist/modules/users/entities/user.entity.d.ts.map +1 -1
- package/dist/modules/users/entities/user.entity.js +10 -0
- package/dist/modules/users/entities/user.entity.js.map +1 -1
- package/dist/modules/users/services/users.service.d.ts +15 -2
- package/dist/modules/users/services/users.service.d.ts.map +1 -1
- package/dist/modules/users/services/users.service.js +152 -37
- package/dist/modules/users/services/users.service.js.map +1 -1
- package/dist/modules/users/users.module.d.ts.map +1 -1
- package/dist/modules/users/users.module.js +1 -2
- package/dist/modules/users/users.module.js.map +1 -1
- package/package.json +19 -7
- package/dist/modules/admin/entities/admin-log.entity.d.ts +0 -20
- package/dist/modules/admin/entities/admin-log.entity.d.ts.map +0 -1
- package/dist/modules/admin/entities/admin-log.entity.js +0 -65
- package/dist/modules/admin/entities/admin-log.entity.js.map +0 -1
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Request } from 'express';
|
|
2
|
+
import { RequestUser } from '../../../common/interfaces/request-user';
|
|
3
|
+
import { MfaBackupCodesResponseDto, MfaDisableDto, MfaStatusResponseDto, MfaStepUpDto, MfaStepUpResponseDto, MfaTotpConfirmDto, MfaTotpConfirmResponseDto, MfaTotpSetupResponseDto, MfaVerifyDto } from '../dto/mfa.dto';
|
|
4
|
+
import { DpopService } from '../services/dpop.service';
|
|
5
|
+
import { MfaService } from '../services/mfa.service';
|
|
6
|
+
export declare class MfaController {
|
|
7
|
+
private readonly mfaService;
|
|
8
|
+
private readonly dpopService;
|
|
9
|
+
constructor(mfaService: MfaService, dpopService: DpopService);
|
|
10
|
+
getStatus(user: RequestUser): Promise<MfaStatusResponseDto>;
|
|
11
|
+
setupTotp(user: RequestUser): Promise<MfaTotpSetupResponseDto>;
|
|
12
|
+
confirmTotp(user: RequestUser, body: MfaTotpConfirmDto): Promise<MfaTotpConfirmResponseDto>;
|
|
13
|
+
regenerateBackupCodes(user: RequestUser, body: MfaDisableDto): Promise<MfaBackupCodesResponseDto>;
|
|
14
|
+
disable(user: RequestUser, body: MfaDisableDto): Promise<MfaStatusResponseDto>;
|
|
15
|
+
verify(body: MfaVerifyDto, req: Request): Promise<import("../dto/token.dto").TokenResponse>;
|
|
16
|
+
stepUp(user: RequestUser, body: MfaStepUpDto): Promise<MfaStepUpResponseDto>;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=mfa.controller.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mfa.controller.d.ts","sourceRoot":"","sources":["../../../../src/modules/auth/controllers/mfa.controller.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAMlC,OAAO,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAC;AAItE,OAAO,EACN,yBAAyB,EACzB,aAAa,EACb,oBAAoB,EACpB,YAAY,EACZ,oBAAoB,EACpB,iBAAiB,EACjB,yBAAyB,EACzB,uBAAuB,EACvB,YAAY,EACZ,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAErD,qBAEa,aAAa;IAExB,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,WAAW;gBADX,UAAU,EAAE,UAAU,EACtB,WAAW,EAAE,WAAW;IAS1C,SAAS,CAAgB,IAAI,EAAE,WAAW;IAiB1C,SAAS,CAAgB,IAAI,EAAE,WAAW;IAkB1C,WAAW,CACK,IAAI,EAAE,WAAW,EACC,IAAI,EAAE,iBAAiB;IAgBzD,qBAAqB,CACL,IAAI,EAAE,WAAW,EACC,IAAI,EAAE,aAAa;IAkBrD,OAAO,CACS,IAAI,EAAE,WAAW,EACC,IAAI,EAAE,aAAa;IAkB/C,MAAM,CAAkC,IAAI,EAAE,YAAY,EAAS,GAAG,EAAE,OAAO;IAmBrF,MAAM,CAAgB,IAAI,EAAE,WAAW,EAAmC,IAAI,EAAE,YAAY;CAG5F"}
|
|
@@ -0,0 +1,192 @@
|
|
|
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.MfaController = void 0;
|
|
16
|
+
const common_1 = require("@nestjs/common");
|
|
17
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
18
|
+
const decorators_1 = require("../../../common/decorators");
|
|
19
|
+
const guards_1 = require("../../../common/guards");
|
|
20
|
+
const auth_guard_1 = require("../../../common/guards/auth.guard");
|
|
21
|
+
const permissions_guard_1 = require("../../../common/guards/permissions.guard");
|
|
22
|
+
const config_aware_validation_pipe_1 = require("../../../common/pipes/config-aware-validation.pipe");
|
|
23
|
+
const request_utils_1 = require("../../../common/utils/request.utils");
|
|
24
|
+
const auth_manifest_1 = require("../auth.manifest");
|
|
25
|
+
const mfa_dto_1 = require("../dto/mfa.dto");
|
|
26
|
+
const token_dto_1 = require("../dto/token.dto");
|
|
27
|
+
const dpop_service_1 = require("../services/dpop.service");
|
|
28
|
+
const mfa_service_1 = require("../services/mfa.service");
|
|
29
|
+
let MfaController = class MfaController {
|
|
30
|
+
mfaService;
|
|
31
|
+
dpopService;
|
|
32
|
+
constructor(mfaService, dpopService) {
|
|
33
|
+
this.mfaService = mfaService;
|
|
34
|
+
this.dpopService = dpopService;
|
|
35
|
+
}
|
|
36
|
+
getStatus(user) {
|
|
37
|
+
return this.mfaService.getStatus(user.id);
|
|
38
|
+
}
|
|
39
|
+
setupTotp(user) {
|
|
40
|
+
return this.mfaService.setupTotp(user.id);
|
|
41
|
+
}
|
|
42
|
+
confirmTotp(user, body) {
|
|
43
|
+
return this.mfaService.confirmTotp(user.id, body);
|
|
44
|
+
}
|
|
45
|
+
regenerateBackupCodes(user, body) {
|
|
46
|
+
return this.mfaService.regenerateBackupCodes(user.id, body);
|
|
47
|
+
}
|
|
48
|
+
disable(user, body) {
|
|
49
|
+
return this.mfaService.disable(user.id, body);
|
|
50
|
+
}
|
|
51
|
+
async verify(body, req) {
|
|
52
|
+
const { ip, deviceInfo } = (0, request_utils_1.extractRequestInfo)(req);
|
|
53
|
+
const dpopJkt = await this.dpopService.resolveJktForIssuance(req);
|
|
54
|
+
return this.mfaService.verifyChallenge(body, deviceInfo, ip, dpopJkt);
|
|
55
|
+
}
|
|
56
|
+
stepUp(user, body) {
|
|
57
|
+
return this.mfaService.stepUp(user.id, body);
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
exports.MfaController = MfaController;
|
|
61
|
+
__decorate([
|
|
62
|
+
(0, common_1.Get)('status'),
|
|
63
|
+
(0, common_1.UseGuards)(auth_guard_1.JwtAuthGuard, permissions_guard_1.PermissionsGuard),
|
|
64
|
+
(0, decorators_1.RequirePermission)(auth_manifest_1.AUTH_PERMISSIONS.MFA_MANAGE),
|
|
65
|
+
(0, swagger_1.ApiBearerAuth)(),
|
|
66
|
+
(0, swagger_1.ApiOperation)({ summary: 'MFA status for the authenticated user' }),
|
|
67
|
+
(0, swagger_1.ApiOkResponse)({ type: mfa_dto_1.MfaStatusResponseDto }),
|
|
68
|
+
__param(0, (0, decorators_1.CurrentUser)()),
|
|
69
|
+
__metadata("design:type", Function),
|
|
70
|
+
__metadata("design:paramtypes", [Object]),
|
|
71
|
+
__metadata("design:returntype", void 0)
|
|
72
|
+
], MfaController.prototype, "getStatus", null);
|
|
73
|
+
__decorate([
|
|
74
|
+
(0, common_1.Post)('totp/setup'),
|
|
75
|
+
(0, common_1.UseGuards)(auth_guard_1.JwtAuthGuard, permissions_guard_1.PermissionsGuard),
|
|
76
|
+
(0, decorators_1.RequirePermission)(auth_manifest_1.AUTH_PERMISSIONS.MFA_MANAGE),
|
|
77
|
+
(0, swagger_1.ApiBearerAuth)(),
|
|
78
|
+
(0, common_1.HttpCode)(common_1.HttpStatus.OK),
|
|
79
|
+
(0, swagger_1.ApiOperation)({
|
|
80
|
+
summary: 'Start TOTP enrollment',
|
|
81
|
+
description: 'Returns a base32 secret and otpauth URI. Confirm with POST /auth/mfa/totp/confirm within the challenge TTL.',
|
|
82
|
+
}),
|
|
83
|
+
(0, swagger_1.ApiOkResponse)({ type: mfa_dto_1.MfaTotpSetupResponseDto }),
|
|
84
|
+
(0, swagger_1.ApiConflictResponse)({ description: 'MFA already enabled' }),
|
|
85
|
+
(0, swagger_1.ApiBadRequestResponse)({ description: 'MFA_ENCRYPTION_KEY / ENCRYPTION_KEY not configured' }),
|
|
86
|
+
__param(0, (0, decorators_1.CurrentUser)()),
|
|
87
|
+
__metadata("design:type", Function),
|
|
88
|
+
__metadata("design:paramtypes", [Object]),
|
|
89
|
+
__metadata("design:returntype", void 0)
|
|
90
|
+
], MfaController.prototype, "setupTotp", null);
|
|
91
|
+
__decorate([
|
|
92
|
+
(0, common_1.Post)('totp/confirm'),
|
|
93
|
+
(0, common_1.UseGuards)(auth_guard_1.JwtAuthGuard, permissions_guard_1.PermissionsGuard),
|
|
94
|
+
(0, decorators_1.RequirePermission)(auth_manifest_1.AUTH_PERMISSIONS.MFA_MANAGE),
|
|
95
|
+
(0, swagger_1.ApiBearerAuth)(),
|
|
96
|
+
(0, common_1.HttpCode)(common_1.HttpStatus.OK),
|
|
97
|
+
(0, swagger_1.ApiOperation)({
|
|
98
|
+
summary: 'Confirm TOTP enrollment and enable MFA',
|
|
99
|
+
description: 'Returns status plus one-time backup codes (shown only once). ' +
|
|
100
|
+
'Requires password (or phone OTP) re-auth in the body.',
|
|
101
|
+
}),
|
|
102
|
+
(0, swagger_1.ApiBody)({ type: mfa_dto_1.MfaTotpConfirmDto }),
|
|
103
|
+
(0, swagger_1.ApiOkResponse)({ type: mfa_dto_1.MfaTotpConfirmResponseDto }),
|
|
104
|
+
(0, swagger_1.ApiUnauthorizedResponse)({ description: 'Invalid TOTP code' }),
|
|
105
|
+
__param(0, (0, decorators_1.CurrentUser)()),
|
|
106
|
+
__param(1, (0, common_1.Body)(config_aware_validation_pipe_1.ConfigAwareValidationPipe)),
|
|
107
|
+
__metadata("design:type", Function),
|
|
108
|
+
__metadata("design:paramtypes", [Object, mfa_dto_1.MfaTotpConfirmDto]),
|
|
109
|
+
__metadata("design:returntype", void 0)
|
|
110
|
+
], MfaController.prototype, "confirmTotp", null);
|
|
111
|
+
__decorate([
|
|
112
|
+
(0, common_1.Post)('backup-codes/regenerate'),
|
|
113
|
+
(0, common_1.UseGuards)(auth_guard_1.JwtAuthGuard, permissions_guard_1.PermissionsGuard),
|
|
114
|
+
(0, decorators_1.RequirePermission)(auth_manifest_1.AUTH_PERMISSIONS.MFA_MANAGE),
|
|
115
|
+
(0, swagger_1.ApiBearerAuth)(),
|
|
116
|
+
(0, common_1.HttpCode)(common_1.HttpStatus.OK),
|
|
117
|
+
(0, swagger_1.ApiOperation)({
|
|
118
|
+
summary: 'Regenerate MFA backup codes',
|
|
119
|
+
description: 'Requires a valid TOTP code. Invalidates all previous backup codes.',
|
|
120
|
+
}),
|
|
121
|
+
(0, swagger_1.ApiBody)({ type: mfa_dto_1.MfaDisableDto }),
|
|
122
|
+
(0, swagger_1.ApiOkResponse)({ type: mfa_dto_1.MfaBackupCodesResponseDto }),
|
|
123
|
+
__param(0, (0, decorators_1.CurrentUser)()),
|
|
124
|
+
__param(1, (0, common_1.Body)(config_aware_validation_pipe_1.ConfigAwareValidationPipe)),
|
|
125
|
+
__metadata("design:type", Function),
|
|
126
|
+
__metadata("design:paramtypes", [Object, mfa_dto_1.MfaDisableDto]),
|
|
127
|
+
__metadata("design:returntype", void 0)
|
|
128
|
+
], MfaController.prototype, "regenerateBackupCodes", null);
|
|
129
|
+
__decorate([
|
|
130
|
+
(0, common_1.Post)('disable'),
|
|
131
|
+
(0, common_1.UseGuards)(auth_guard_1.JwtAuthGuard, permissions_guard_1.PermissionsGuard),
|
|
132
|
+
(0, decorators_1.RequirePermission)(auth_manifest_1.AUTH_PERMISSIONS.MFA_MANAGE),
|
|
133
|
+
(0, swagger_1.ApiBearerAuth)(),
|
|
134
|
+
(0, common_1.HttpCode)(common_1.HttpStatus.OK),
|
|
135
|
+
(0, swagger_1.ApiOperation)({
|
|
136
|
+
summary: 'Disable MFA',
|
|
137
|
+
description: 'Provide `{ code }` (TOTP) or `{ backupCode }` for recovery when the authenticator is lost. ' +
|
|
138
|
+
'Revokes all sessions after disable.',
|
|
139
|
+
}),
|
|
140
|
+
(0, swagger_1.ApiBody)({ type: mfa_dto_1.MfaDisableDto }),
|
|
141
|
+
(0, swagger_1.ApiOkResponse)({ type: mfa_dto_1.MfaStatusResponseDto }),
|
|
142
|
+
__param(0, (0, decorators_1.CurrentUser)()),
|
|
143
|
+
__param(1, (0, common_1.Body)(config_aware_validation_pipe_1.ConfigAwareValidationPipe)),
|
|
144
|
+
__metadata("design:type", Function),
|
|
145
|
+
__metadata("design:paramtypes", [Object, mfa_dto_1.MfaDisableDto]),
|
|
146
|
+
__metadata("design:returntype", void 0)
|
|
147
|
+
], MfaController.prototype, "disable", null);
|
|
148
|
+
__decorate([
|
|
149
|
+
(0, common_1.Post)('verify'),
|
|
150
|
+
(0, decorators_1.Public)(),
|
|
151
|
+
(0, common_1.UseGuards)(guards_1.LoginIpRateLimitGuard),
|
|
152
|
+
(0, common_1.HttpCode)(common_1.HttpStatus.OK),
|
|
153
|
+
(0, swagger_1.ApiOperation)({
|
|
154
|
+
summary: 'Complete MFA challenge after login',
|
|
155
|
+
description: 'Exchange `{ mfaToken, totp }` or `{ mfaToken, backupCode }` from a login `mfaRequired` response for session tokens.',
|
|
156
|
+
}),
|
|
157
|
+
(0, swagger_1.ApiBody)({ type: mfa_dto_1.MfaVerifyDto }),
|
|
158
|
+
(0, swagger_1.ApiOkResponse)({ type: token_dto_1.TokenResponseDto }),
|
|
159
|
+
(0, swagger_1.ApiUnauthorizedResponse)({ description: 'Invalid mfaToken or second factor' }),
|
|
160
|
+
(0, swagger_1.ApiTooManyRequestsResponse)({ description: 'MFA lockout' }),
|
|
161
|
+
__param(0, (0, common_1.Body)(config_aware_validation_pipe_1.ConfigAwareValidationPipe)),
|
|
162
|
+
__param(1, (0, common_1.Req)()),
|
|
163
|
+
__metadata("design:type", Function),
|
|
164
|
+
__metadata("design:paramtypes", [mfa_dto_1.MfaVerifyDto, Object]),
|
|
165
|
+
__metadata("design:returntype", Promise)
|
|
166
|
+
], MfaController.prototype, "verify", null);
|
|
167
|
+
__decorate([
|
|
168
|
+
(0, common_1.Post)('step-up'),
|
|
169
|
+
(0, common_1.UseGuards)(auth_guard_1.JwtAuthGuard, permissions_guard_1.PermissionsGuard),
|
|
170
|
+
(0, decorators_1.RequirePermission)(auth_manifest_1.AUTH_PERMISSIONS.MFA_MANAGE),
|
|
171
|
+
(0, swagger_1.ApiBearerAuth)(),
|
|
172
|
+
(0, common_1.HttpCode)(common_1.HttpStatus.OK),
|
|
173
|
+
(0, swagger_1.ApiOperation)({
|
|
174
|
+
summary: 'Step-up MFA for sensitive actions',
|
|
175
|
+
description: 'Confirm MFA again while already authenticated. Returns a short-lived `stepUpToken` that other modules can consume via TokenService.consumeStepUpToken.',
|
|
176
|
+
}),
|
|
177
|
+
(0, swagger_1.ApiBody)({ type: mfa_dto_1.MfaStepUpDto }),
|
|
178
|
+
(0, swagger_1.ApiOkResponse)({ type: mfa_dto_1.MfaStepUpResponseDto }),
|
|
179
|
+
(0, swagger_1.ApiUnauthorizedResponse)({ description: 'Invalid TOTP or backup code' }),
|
|
180
|
+
__param(0, (0, decorators_1.CurrentUser)()),
|
|
181
|
+
__param(1, (0, common_1.Body)(config_aware_validation_pipe_1.ConfigAwareValidationPipe)),
|
|
182
|
+
__metadata("design:type", Function),
|
|
183
|
+
__metadata("design:paramtypes", [Object, mfa_dto_1.MfaStepUpDto]),
|
|
184
|
+
__metadata("design:returntype", void 0)
|
|
185
|
+
], MfaController.prototype, "stepUp", null);
|
|
186
|
+
exports.MfaController = MfaController = __decorate([
|
|
187
|
+
(0, swagger_1.ApiTags)('MFA'),
|
|
188
|
+
(0, common_1.Controller)('auth/mfa'),
|
|
189
|
+
__metadata("design:paramtypes", [mfa_service_1.MfaService,
|
|
190
|
+
dpop_service_1.DpopService])
|
|
191
|
+
], MfaController);
|
|
192
|
+
//# sourceMappingURL=mfa.controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mfa.controller.js","sourceRoot":"","sources":["../../../../src/modules/auth/controllers/mfa.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAmG;AACnG,6CAUyB;AAGzB,2DAAoF;AACpF,mDAA+D;AAC/D,kEAAiE;AACjE,gFAA4E;AAE5E,qGAA+F;AAC/F,uEAAyE;AACzE,oDAAoD;AACpD,4CAUwB;AACxB,gDAAoD;AACpD,2DAAuD;AACvD,yDAAqD;AAI9C,IAAM,aAAa,GAAnB,MAAM,aAAa;IAEP;IACA;IAFlB,YACkB,UAAsB,EACtB,WAAwB;QADxB,eAAU,GAAV,UAAU,CAAY;QACtB,gBAAW,GAAX,WAAW,CAAa;IACvC,CAAC;IAQJ,SAAS,CAAgB,IAAiB;QACzC,OAAO,IAAI,CAAC,U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wBAAW,GAAE,CAAA;IAAqB,WAAA,IAAA,aAAI,EAAC,wDAAyB,CAAC,CAAA;;6CAAO,sBAAY;;2CAE3F;wBA9HW,aAAa;IAFzB,IAAA,iBAAO,EAAC,KAAK,CAAC;IACd,IAAA,mBAAU,EAAC,UAAU,CAAC;qCAGQ,wBAAU;QACT,0BAAW;GAH9B,aAAa,CA+HzB"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Request } from 'express';
|
|
2
|
+
import { RequestUser } from '../../../common/interfaces/request-user';
|
|
3
|
+
import { OAuthCallbackDto, OAuthIdentityResponseDto, OAuthLinkDto, OAuthProviderInfoDto, OAuthStartDto, OAuthStartResponseDto, OAuthUnlinkDto } from '../dto/oauth.dto';
|
|
4
|
+
import { OAuthProvider } from '../entities/user-oauth-identity.entity';
|
|
5
|
+
import { DpopService } from '../services/dpop.service';
|
|
6
|
+
import { LoginService } from '../services/login.service';
|
|
7
|
+
import { OAuthService } from '../services/oauth.service';
|
|
8
|
+
export declare class OAuthController {
|
|
9
|
+
private readonly oauthService;
|
|
10
|
+
private readonly loginService;
|
|
11
|
+
private readonly dpopService;
|
|
12
|
+
constructor(oauthService: OAuthService, loginService: LoginService, dpopService: DpopService);
|
|
13
|
+
listProviders(): OAuthProviderInfoDto[];
|
|
14
|
+
listLinks(user: RequestUser): Promise<OAuthIdentityResponseDto[]>;
|
|
15
|
+
link(user: RequestUser, body: OAuthLinkDto): Promise<OAuthIdentityResponseDto>;
|
|
16
|
+
unlink(user: RequestUser, provider: OAuthProvider, body?: OAuthUnlinkDto): Promise<{
|
|
17
|
+
message: string;
|
|
18
|
+
}>;
|
|
19
|
+
start(provider: OAuthProvider, body: OAuthStartDto): Promise<OAuthStartResponseDto>;
|
|
20
|
+
callback(provider: OAuthProvider, body: OAuthCallbackDto, req: Request): Promise<import("..").LoginResult>;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=oauth.controller.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oauth.controller.d.ts","sourceRoot":"","sources":["../../../../src/modules/auth/controllers/oauth.controller.ts"],"names":[],"mappings":"AAwBA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAOlC,OAAO,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAC;AAKtE,OAAO,EACN,gBAAgB,EAChB,wBAAwB,EACxB,YAAY,EACZ,oBAAoB,EACpB,aAAa,EACb,qBAAqB,EACrB,cAAc,EACd,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AACvE,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAEzD,qBAEa,eAAe;IAE1B,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,OAAO,CAAC,QAAQ,CAAC,WAAW;gBAFX,YAAY,EAAE,YAAY,EAC1B,YAAY,EAAE,YAAY,EAC1B,WAAW,EAAE,WAAW;IAY1C,aAAa;IAUb,SAAS,CAAgB,IAAI,EAAE,WAAW;IAkB1C,IAAI,CAAgB,IAAI,EAAE,WAAW,EAAmC,IAAI,EAAE,YAAY;IAoB1F,MAAM,CACU,IAAI,EAAE,WAAW,EACqB,QAAQ,EAAE,aAAa,EACpE,IAAI,CAAC,EAAE,cAAc;;;IAqB9B,KAAK,CACiD,QAAQ,EAAE,aAAa,EAC3C,IAAI,EAAE,aAAa;IAwB/C,QAAQ,CACwC,QAAQ,EAAE,aAAa,EAC3C,IAAI,EAAE,gBAAgB,EAChD,GAAG,EAAE,OAAO;CAqBpB"}
|
|
@@ -0,0 +1,192 @@
|
|
|
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.OAuthController = void 0;
|
|
16
|
+
const common_1 = require("@nestjs/common");
|
|
17
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
18
|
+
const decorators_1 = require("../../../common/decorators");
|
|
19
|
+
const ip_rate_limit_bucket_decorator_1 = require("../../../common/decorators/ip-rate-limit-bucket.decorator");
|
|
20
|
+
const guards_1 = require("../../../common/guards");
|
|
21
|
+
const auth_guard_1 = require("../../../common/guards/auth.guard");
|
|
22
|
+
const permissions_guard_1 = require("../../../common/guards/permissions.guard");
|
|
23
|
+
const config_aware_validation_pipe_1 = require("../../../common/pipes/config-aware-validation.pipe");
|
|
24
|
+
const request_utils_1 = require("../../../common/utils/request.utils");
|
|
25
|
+
const user_entity_1 = require("../../users/entities/user.entity");
|
|
26
|
+
const auth_manifest_1 = require("../auth.manifest");
|
|
27
|
+
const oauth_dto_1 = require("../dto/oauth.dto");
|
|
28
|
+
const user_oauth_identity_entity_1 = require("../entities/user-oauth-identity.entity");
|
|
29
|
+
const dpop_service_1 = require("../services/dpop.service");
|
|
30
|
+
const login_service_1 = require("../services/login.service");
|
|
31
|
+
const oauth_service_1 = require("../services/oauth.service");
|
|
32
|
+
let OAuthController = class OAuthController {
|
|
33
|
+
oauthService;
|
|
34
|
+
loginService;
|
|
35
|
+
dpopService;
|
|
36
|
+
constructor(oauthService, loginService, dpopService) {
|
|
37
|
+
this.oauthService = oauthService;
|
|
38
|
+
this.loginService = loginService;
|
|
39
|
+
this.dpopService = dpopService;
|
|
40
|
+
}
|
|
41
|
+
listProviders() {
|
|
42
|
+
return this.oauthService.listEnabledProviders();
|
|
43
|
+
}
|
|
44
|
+
listLinks(user) {
|
|
45
|
+
return this.oauthService.listLinks(user.id);
|
|
46
|
+
}
|
|
47
|
+
link(user, body) {
|
|
48
|
+
return this.oauthService.link(user.id, body);
|
|
49
|
+
}
|
|
50
|
+
unlink(user, provider, body) {
|
|
51
|
+
return this.oauthService.unlink(user.id, provider, body);
|
|
52
|
+
}
|
|
53
|
+
start(provider, body) {
|
|
54
|
+
return this.oauthService.startAuthorizationCode(provider, body);
|
|
55
|
+
}
|
|
56
|
+
async callback(provider, body, req) {
|
|
57
|
+
const resolved = await this.oauthService.exchangeAuthorizationCode(provider, body.code, body.state);
|
|
58
|
+
const { ip, deviceInfo } = (0, request_utils_1.extractRequestInfo)(req);
|
|
59
|
+
const dpopJkt = await this.dpopService.resolveJktForIssuance(req);
|
|
60
|
+
return this.loginService.continueAfterFirstFactor(resolved.user, user_entity_1.UserAuthMethod.OAUTH, deviceInfo, ip, {
|
|
61
|
+
skipAuthMethodCheck: resolved.linkedIdentity,
|
|
62
|
+
provider: resolved.provider,
|
|
63
|
+
dpopJkt,
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
exports.OAuthController = OAuthController;
|
|
68
|
+
__decorate([
|
|
69
|
+
(0, common_1.Get)('providers'),
|
|
70
|
+
(0, decorators_1.Public)(),
|
|
71
|
+
(0, ip_rate_limit_bucket_decorator_1.IpRateLimitBucket)('auth_public'),
|
|
72
|
+
(0, common_1.UseGuards)(guards_1.LoginIpRateLimitGuard),
|
|
73
|
+
(0, swagger_1.ApiOperation)({
|
|
74
|
+
summary: 'List enabled OAuth providers',
|
|
75
|
+
description: 'Public discovery endpoint for client SDKs (client IDs + web flow support).',
|
|
76
|
+
}),
|
|
77
|
+
(0, swagger_1.ApiOkResponse)({ type: [oauth_dto_1.OAuthProviderInfoDto] }),
|
|
78
|
+
__metadata("design:type", Function),
|
|
79
|
+
__metadata("design:paramtypes", []),
|
|
80
|
+
__metadata("design:returntype", void 0)
|
|
81
|
+
], OAuthController.prototype, "listProviders", null);
|
|
82
|
+
__decorate([
|
|
83
|
+
(0, common_1.Get)('links'),
|
|
84
|
+
(0, common_1.UseGuards)(auth_guard_1.JwtAuthGuard, permissions_guard_1.PermissionsGuard),
|
|
85
|
+
(0, decorators_1.RequirePermission)(auth_manifest_1.AUTH_PERMISSIONS.OAUTH_LINK),
|
|
86
|
+
(0, swagger_1.ApiBearerAuth)(),
|
|
87
|
+
(0, swagger_1.ApiOperation)({ summary: 'List linked OAuth providers for the current user' }),
|
|
88
|
+
(0, swagger_1.ApiOkResponse)({ type: [oauth_dto_1.OAuthIdentityResponseDto] }),
|
|
89
|
+
__param(0, (0, decorators_1.CurrentUser)()),
|
|
90
|
+
__metadata("design:type", Function),
|
|
91
|
+
__metadata("design:paramtypes", [Object]),
|
|
92
|
+
__metadata("design:returntype", void 0)
|
|
93
|
+
], OAuthController.prototype, "listLinks", null);
|
|
94
|
+
__decorate([
|
|
95
|
+
(0, common_1.Post)('link'),
|
|
96
|
+
(0, common_1.UseGuards)(auth_guard_1.JwtAuthGuard, permissions_guard_1.PermissionsGuard),
|
|
97
|
+
(0, decorators_1.RequirePermission)(auth_manifest_1.AUTH_PERMISSIONS.OAUTH_LINK),
|
|
98
|
+
(0, swagger_1.ApiBearerAuth)(),
|
|
99
|
+
(0, common_1.HttpCode)(common_1.HttpStatus.OK),
|
|
100
|
+
(0, swagger_1.ApiOperation)({
|
|
101
|
+
summary: 'Link an OAuth provider to the current account',
|
|
102
|
+
description: 'Pass a provider ID token from the client SDK. Requires MFA step-up (or password when MFA is off).',
|
|
103
|
+
}),
|
|
104
|
+
(0, swagger_1.ApiBody)({ type: oauth_dto_1.OAuthLinkDto }),
|
|
105
|
+
(0, swagger_1.ApiOkResponse)({ type: oauth_dto_1.OAuthIdentityResponseDto }),
|
|
106
|
+
(0, swagger_1.ApiConflictResponse)({ description: 'Provider already linked to this or another account' }),
|
|
107
|
+
(0, swagger_1.ApiUnauthorizedResponse)({ description: 'Invalid ID token' }),
|
|
108
|
+
__param(0, (0, decorators_1.CurrentUser)()),
|
|
109
|
+
__param(1, (0, common_1.Body)(config_aware_validation_pipe_1.ConfigAwareValidationPipe)),
|
|
110
|
+
__metadata("design:type", Function),
|
|
111
|
+
__metadata("design:paramtypes", [Object, oauth_dto_1.OAuthLinkDto]),
|
|
112
|
+
__metadata("design:returntype", void 0)
|
|
113
|
+
], OAuthController.prototype, "link", null);
|
|
114
|
+
__decorate([
|
|
115
|
+
(0, common_1.Delete)('link/:provider'),
|
|
116
|
+
(0, common_1.UseGuards)(auth_guard_1.JwtAuthGuard, permissions_guard_1.PermissionsGuard),
|
|
117
|
+
(0, decorators_1.RequirePermission)(auth_manifest_1.AUTH_PERMISSIONS.OAUTH_LINK),
|
|
118
|
+
(0, swagger_1.ApiBearerAuth)(),
|
|
119
|
+
(0, common_1.HttpCode)(common_1.HttpStatus.OK),
|
|
120
|
+
(0, swagger_1.ApiOperation)({
|
|
121
|
+
summary: 'Unlink an OAuth provider from the current account',
|
|
122
|
+
description: 'Re-auth required: MFA step-up (`purpose=oauth_unlink`) or password / phone OTP / linked OAuth proof. Revokes all sessions.',
|
|
123
|
+
}),
|
|
124
|
+
(0, swagger_1.ApiParam)({ name: 'provider', enum: user_oauth_identity_entity_1.OAuthProvider }),
|
|
125
|
+
(0, swagger_1.ApiBody)({ type: oauth_dto_1.OAuthUnlinkDto, required: false }),
|
|
126
|
+
(0, swagger_1.ApiOkResponse)({ schema: { example: { message: 'google identity unlinked.' } } }),
|
|
127
|
+
(0, swagger_1.ApiBadRequestResponse)({
|
|
128
|
+
description: 'Not linked, or would remove the last factor for an OAuth-only account',
|
|
129
|
+
}),
|
|
130
|
+
__param(0, (0, decorators_1.CurrentUser)()),
|
|
131
|
+
__param(1, (0, common_1.Param)('provider', new common_1.ParseEnumPipe(user_oauth_identity_entity_1.OAuthProvider))),
|
|
132
|
+
__param(2, (0, common_1.Body)()),
|
|
133
|
+
__metadata("design:type", Function),
|
|
134
|
+
__metadata("design:paramtypes", [Object, String, oauth_dto_1.OAuthUnlinkDto]),
|
|
135
|
+
__metadata("design:returntype", void 0)
|
|
136
|
+
], OAuthController.prototype, "unlink", null);
|
|
137
|
+
__decorate([
|
|
138
|
+
(0, common_1.Post)(':provider/start'),
|
|
139
|
+
(0, decorators_1.Public)(),
|
|
140
|
+
(0, ip_rate_limit_bucket_decorator_1.IpRateLimitBucket)('auth_public'),
|
|
141
|
+
(0, common_1.UseGuards)(guards_1.LoginIpRateLimitGuard),
|
|
142
|
+
(0, common_1.HttpCode)(common_1.HttpStatus.OK),
|
|
143
|
+
(0, swagger_1.ApiOperation)({
|
|
144
|
+
summary: 'Start OAuth authorization-code + PKCE (web)',
|
|
145
|
+
description: 'Returns an authorization URL. After redirect, call POST /auth/oauth/:provider/callback with the code and state. Apple is ID-token only.',
|
|
146
|
+
}),
|
|
147
|
+
(0, swagger_1.ApiParam)({ name: 'provider', enum: user_oauth_identity_entity_1.OAuthProvider }),
|
|
148
|
+
(0, swagger_1.ApiBody)({ type: oauth_dto_1.OAuthStartDto }),
|
|
149
|
+
(0, swagger_1.ApiOkResponse)({ type: oauth_dto_1.OAuthStartResponseDto }),
|
|
150
|
+
(0, swagger_1.ApiBadRequestResponse)({
|
|
151
|
+
description: 'Provider/web flow not configured or redirectUri denied',
|
|
152
|
+
}),
|
|
153
|
+
__param(0, (0, common_1.Param)('provider', new common_1.ParseEnumPipe(user_oauth_identity_entity_1.OAuthProvider))),
|
|
154
|
+
__param(1, (0, common_1.Body)(config_aware_validation_pipe_1.ConfigAwareValidationPipe)),
|
|
155
|
+
__metadata("design:type", Function),
|
|
156
|
+
__metadata("design:paramtypes", [String, oauth_dto_1.OAuthStartDto]),
|
|
157
|
+
__metadata("design:returntype", void 0)
|
|
158
|
+
], OAuthController.prototype, "start", null);
|
|
159
|
+
__decorate([
|
|
160
|
+
(0, common_1.Post)(':provider/callback'),
|
|
161
|
+
(0, decorators_1.Public)(),
|
|
162
|
+
(0, common_1.UseGuards)(guards_1.LoginIpRateLimitGuard),
|
|
163
|
+
(0, common_1.HttpCode)(common_1.HttpStatus.OK),
|
|
164
|
+
(0, swagger_1.ApiOperation)({
|
|
165
|
+
summary: 'Complete OAuth authorization-code + PKCE (web)',
|
|
166
|
+
description: 'Exchanges the code for an ID token, then returns session tokens or an MFA challenge (same as POST /auth/login).',
|
|
167
|
+
}),
|
|
168
|
+
(0, swagger_1.ApiParam)({ name: 'provider', enum: user_oauth_identity_entity_1.OAuthProvider }),
|
|
169
|
+
(0, swagger_1.ApiBody)({ type: oauth_dto_1.OAuthCallbackDto }),
|
|
170
|
+
(0, swagger_1.ApiOkResponse)({
|
|
171
|
+
schema: {
|
|
172
|
+
oneOf: [
|
|
173
|
+
{ $ref: '#/components/schemas/TokenResponseDto' },
|
|
174
|
+
{ $ref: '#/components/schemas/MfaChallengeResponseDto' },
|
|
175
|
+
],
|
|
176
|
+
},
|
|
177
|
+
}),
|
|
178
|
+
__param(0, (0, common_1.Param)('provider', new common_1.ParseEnumPipe(user_oauth_identity_entity_1.OAuthProvider))),
|
|
179
|
+
__param(1, (0, common_1.Body)(config_aware_validation_pipe_1.ConfigAwareValidationPipe)),
|
|
180
|
+
__param(2, (0, common_1.Req)()),
|
|
181
|
+
__metadata("design:type", Function),
|
|
182
|
+
__metadata("design:paramtypes", [String, oauth_dto_1.OAuthCallbackDto, Object]),
|
|
183
|
+
__metadata("design:returntype", Promise)
|
|
184
|
+
], OAuthController.prototype, "callback", null);
|
|
185
|
+
exports.OAuthController = OAuthController = __decorate([
|
|
186
|
+
(0, swagger_1.ApiTags)('OAuth'),
|
|
187
|
+
(0, common_1.Controller)('auth/oauth'),
|
|
188
|
+
__metadata("design:paramtypes", [oauth_service_1.OAuthService,
|
|
189
|
+
login_service_1.LoginService,
|
|
190
|
+
dpop_service_1.DpopService])
|
|
191
|
+
], OAuthController);
|
|
192
|
+
//# sourceMappingURL=oauth.controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oauth.controller.js","sourceRoot":"","sources":["../../../../src/modules/auth/controllers/oauth.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAYwB;AACxB,6CAUyB;AAGzB,2DAAoF;AACpF,8GAA8F;AAC9F,mDAA+D;AAC/D,kEAAiE;AACjE,gFAA4E;AAE5E,qGAA+F;AAC/F,uEAAyE;AACzE,kEAAkE;AAClE,oDAAoD;AACpD,gDAQ0B;AAC1B,uFAAuE;AACvE,2DAAuD;AACvD,6DAAyD;AACzD,6DAAyD;AAIlD,IAAM,eAAe,GAArB,MAAM,eAAe;IAET;IACA;IACA;IAHlB,YACkB,YAA0B,EAC1B,YAA0B,EAC1B,WAAwB;QAFxB,iBAAY,GAAZ,YAAY,CAAc;QAC1B,iBAAY,GAAZ,YAAY,CAAc;QAC1B,gBAAW,GAAX,WAAW,CAAa;IACvC,CAAC;IAWJ,aAAa;QACZ,OAAO,IAAI,CAAC,YAAY,CAAC,oBAAoB,EAAE,CAAC;IACjD,CAAC;IAQD,SAAS,CAAgB,IAAiB;QACzC,OAAO,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC7C,CAAC;IAgBD,IAAI,CAAgB,IAAiB,EAAmC,IAAkB;QACzF,OAAO,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;IAC9C,CA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} from '../dto/otp.dto';
|
|
2
3
|
import { OtpAuthService } from '../services/otp-auth.service';
|
|
4
|
+
import { TurnstileService } from '../services/turnstile.service';
|
|
3
5
|
export declare class OtpController {
|
|
4
6
|
private readonly otpAuthService;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
+
private readonly turnstileService;
|
|
8
|
+
constructor(otpAuthService: OtpAuthService, turnstileService: TurnstileService);
|
|
9
|
+
sendOtp(body: SendOtpDto, req: Request): Promise<import("../../otp").OtpGenerateResult>;
|
|
7
10
|
verifyOtp(body: VerifyOtpDto): Promise<import("../../otp").OtpVerifyResult>;
|
|
8
|
-
resendOtp(body: ResendOtpDto): Promise<import("../../otp").OtpGenerateResult>;
|
|
11
|
+
resendOtp(body: ResendOtpDto, req: Request): Promise<import("../../otp").OtpGenerateResult>;
|
|
9
12
|
}
|
|
10
13
|
//# sourceMappingURL=otp.controller.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"otp.controller.d.ts","sourceRoot":"","sources":["../../../../src/modules/auth/controllers/otp.controller.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"otp.controller.d.ts","sourceRoot":"","sources":["../../../../src/modules/auth/controllers/otp.controller.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAMlC,OAAO,EAGN,YAAY,EAEZ,UAAU,EACV,YAAY,EACZ,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEjE,qBAGa,aAAa;IAExB,OAAO,CAAC,QAAQ,CAAC,cAAc;IAC/B,OAAO,CAAC,QAAQ,CAAC,gBAAgB;gBADhB,cAAc,EAAE,cAAc,EAC9B,gBAAgB,EAAE,gBAAgB;IA6C9C,OAAO,CAAkC,IAAI,EAAE,UAAU,EAAS,GAAG,EAAE,OAAO;IA4CpF,SAAS,CAAkC,IAAI,EAAE,YAAY;IAoBvD,SAAS,CAAkC,IAAI,EAAE,YAAY,EAAS,GAAG,EAAE,OAAO;CAKxF"}
|
|
@@ -18,14 +18,20 @@ const swagger_1 = require("@nestjs/swagger");
|
|
|
18
18
|
const decorators_1 = require("../../../common/decorators");
|
|
19
19
|
const guards_1 = require("../../../common/guards");
|
|
20
20
|
const config_aware_validation_pipe_1 = require("../../../common/pipes/config-aware-validation.pipe");
|
|
21
|
+
const request_utils_1 = require("../../../common/utils/request.utils");
|
|
21
22
|
const otp_dto_1 = require("../dto/otp.dto");
|
|
22
23
|
const otp_auth_service_1 = require("../services/otp-auth.service");
|
|
24
|
+
const turnstile_service_1 = require("../services/turnstile.service");
|
|
23
25
|
let OtpController = class OtpController {
|
|
24
26
|
otpAuthService;
|
|
25
|
-
|
|
27
|
+
turnstileService;
|
|
28
|
+
constructor(otpAuthService, turnstileService) {
|
|
26
29
|
this.otpAuthService = otpAuthService;
|
|
30
|
+
this.turnstileService = turnstileService;
|
|
27
31
|
}
|
|
28
|
-
sendOtp(body) {
|
|
32
|
+
async sendOtp(body, req) {
|
|
33
|
+
const { ip } = (0, request_utils_1.extractRequestInfo)(req);
|
|
34
|
+
await this.turnstileService.assertValid(body.turnstileToken, ip);
|
|
29
35
|
const channel = (0, otp_dto_1.resolveChannel)(body);
|
|
30
36
|
const identifier = channel === 'sms' ? body.phone : body.email;
|
|
31
37
|
return this.otpAuthService.sendOtp(identifier, channel);
|
|
@@ -33,7 +39,9 @@ let OtpController = class OtpController {
|
|
|
33
39
|
verifyOtp(body) {
|
|
34
40
|
return this.otpAuthService.verifyOtp(body.verificationId, body.otp);
|
|
35
41
|
}
|
|
36
|
-
resendOtp(body) {
|
|
42
|
+
async resendOtp(body, req) {
|
|
43
|
+
const { ip } = (0, request_utils_1.extractRequestInfo)(req);
|
|
44
|
+
await this.turnstileService.assertValid(body.turnstileToken, ip);
|
|
37
45
|
return this.otpAuthService.resendOtp(body.verificationId);
|
|
38
46
|
}
|
|
39
47
|
};
|
|
@@ -46,6 +54,7 @@ __decorate([
|
|
|
46
54
|
summary: 'Send OTP',
|
|
47
55
|
description: 'Step 1 of phone/email verification. Generates an OTP (length from otp.code_length setting, 4–6 digits), ' +
|
|
48
56
|
'delivers it via SMS or email, and returns a **verificationId** for verify-otp/resend-otp. ' +
|
|
57
|
+
'When Turnstile is enabled, pass `turnstileToken` (mitigates SMS drain and hasAccount enumeration). ' +
|
|
49
58
|
'Test identifiers in test.otp_identifiers use a fixed code in non-production environments.',
|
|
50
59
|
}),
|
|
51
60
|
(0, swagger_1.ApiBody)({
|
|
@@ -71,16 +80,17 @@ __decorate([
|
|
|
71
80
|
}),
|
|
72
81
|
(0, swagger_1.ApiOkResponse)({ type: otp_dto_1.OtpGenerateResponseDto }),
|
|
73
82
|
(0, swagger_1.ApiBadRequestResponse)({
|
|
74
|
-
description: 'Invalid phone number or email format,
|
|
83
|
+
description: 'Invalid phone number or email format, missing identifier, or Turnstile failed',
|
|
75
84
|
}),
|
|
76
85
|
(0, swagger_1.ApiTooManyRequestsResponse)({
|
|
77
86
|
description: 'Rate limit exceeded — max 3 sends per 10 minutes per identifier, or max 20 per IP',
|
|
78
87
|
}),
|
|
79
88
|
(0, swagger_1.ApiServiceUnavailableResponse)({ description: 'Redis or delivery service unavailable' }),
|
|
80
89
|
__param(0, (0, common_1.Body)(config_aware_validation_pipe_1.ConfigAwareValidationPipe)),
|
|
90
|
+
__param(1, (0, common_1.Req)()),
|
|
81
91
|
__metadata("design:type", Function),
|
|
82
|
-
__metadata("design:paramtypes", [otp_dto_1.SendOtpDto]),
|
|
83
|
-
__metadata("design:returntype",
|
|
92
|
+
__metadata("design:paramtypes", [otp_dto_1.SendOtpDto, Object]),
|
|
93
|
+
__metadata("design:returntype", Promise)
|
|
84
94
|
], OtpController.prototype, "sendOtp", null);
|
|
85
95
|
__decorate([
|
|
86
96
|
(0, common_1.Post)('verify-otp'),
|
|
@@ -92,7 +102,8 @@ __decorate([
|
|
|
92
102
|
'Returns a **verificationToken** for the next step:\n' +
|
|
93
103
|
'- `hasAccount: true` → POST /auth/login\n' +
|
|
94
104
|
'- `hasAccount: false` → POST /auth/register (phone auth)\n\n' +
|
|
95
|
-
'Do not confuse verificationId (input) with verificationToken (output).'
|
|
105
|
+
'Do not confuse verificationId (input) with verificationToken (output). ' +
|
|
106
|
+
'`hasAccount` remains for UX routing; cheap enumeration is blocked by Turnstile on send-otp.',
|
|
96
107
|
}),
|
|
97
108
|
(0, swagger_1.ApiBody)({ type: otp_dto_1.VerifyOtpDto }),
|
|
98
109
|
(0, swagger_1.ApiOkResponse)({
|
|
@@ -106,32 +117,17 @@ __decorate([
|
|
|
106
117
|
data: {
|
|
107
118
|
subject: '+2348012345678',
|
|
108
119
|
channel: 'sms',
|
|
109
|
-
verificationToken: 'e860bc81-245b-470b-9fac-a484cf93f457',
|
|
110
|
-
expiresAt: 1782245811728,
|
|
111
|
-
hasAccount: true,
|
|
112
|
-
},
|
|
113
|
-
},
|
|
114
|
-
},
|
|
115
|
-
new_user: {
|
|
116
|
-
summary: 'New user — proceed to register',
|
|
117
|
-
value: {
|
|
118
|
-
success: true,
|
|
119
|
-
message: 'OTP verified successfully',
|
|
120
|
-
data: {
|
|
121
|
-
subject: '+2349023456789',
|
|
122
|
-
channel: 'sms',
|
|
123
120
|
verificationToken: 'c498758c-eec1-4a3b-b496-a6eddf498d4c',
|
|
124
|
-
expiresAt:
|
|
125
|
-
hasAccount:
|
|
121
|
+
expiresAt: 1_700_000_000_000,
|
|
122
|
+
hasAccount: true,
|
|
123
|
+
authMethod: 'phone',
|
|
126
124
|
},
|
|
127
125
|
},
|
|
128
126
|
},
|
|
129
127
|
},
|
|
130
128
|
}),
|
|
131
|
-
(0, swagger_1.ApiBadRequestResponse)({
|
|
132
|
-
|
|
133
|
-
}),
|
|
134
|
-
(0, swagger_1.ApiTooManyRequestsResponse)({ description: 'IP rate limit exceeded' }),
|
|
129
|
+
(0, swagger_1.ApiBadRequestResponse)({ description: 'Invalid OTP or verificationId' }),
|
|
130
|
+
(0, swagger_1.ApiTooManyRequestsResponse)({ description: 'Too many verify attempts' }),
|
|
135
131
|
__param(0, (0, common_1.Body)(config_aware_validation_pipe_1.ConfigAwareValidationPipe)),
|
|
136
132
|
__metadata("design:type", Function),
|
|
137
133
|
__metadata("design:paramtypes", [otp_dto_1.VerifyOtpDto]),
|
|
@@ -143,24 +139,27 @@ __decorate([
|
|
|
143
139
|
(0, common_1.UseGuards)(guards_1.OtpIpRateLimitGuard),
|
|
144
140
|
(0, swagger_1.ApiOperation)({
|
|
145
141
|
summary: 'Resend OTP',
|
|
146
|
-
description: '
|
|
147
|
-
'Subject to otp.resend_cooldown_seconds between resends.'
|
|
142
|
+
description: 'Resend the OTP for an existing verificationId. ' +
|
|
143
|
+
'Subject to otp.resend_cooldown_seconds between resends. ' +
|
|
144
|
+
'When Turnstile is enabled, pass `turnstileToken`.',
|
|
148
145
|
}),
|
|
149
146
|
(0, swagger_1.ApiBody)({ type: otp_dto_1.ResendOtpDto }),
|
|
150
147
|
(0, swagger_1.ApiOkResponse)({ type: otp_dto_1.OtpGenerateResponseDto }),
|
|
151
|
-
(0, swagger_1.ApiBadRequestResponse)({ description: 'Invalid or
|
|
148
|
+
(0, swagger_1.ApiBadRequestResponse)({ description: 'Invalid verificationId or Turnstile failed' }),
|
|
152
149
|
(0, swagger_1.ApiTooManyRequestsResponse)({
|
|
153
150
|
description: 'Resend cooldown active — wait before requesting another code',
|
|
154
151
|
}),
|
|
155
152
|
__param(0, (0, common_1.Body)(config_aware_validation_pipe_1.ConfigAwareValidationPipe)),
|
|
153
|
+
__param(1, (0, common_1.Req)()),
|
|
156
154
|
__metadata("design:type", Function),
|
|
157
|
-
__metadata("design:paramtypes", [otp_dto_1.ResendOtpDto]),
|
|
158
|
-
__metadata("design:returntype",
|
|
155
|
+
__metadata("design:paramtypes", [otp_dto_1.ResendOtpDto, Object]),
|
|
156
|
+
__metadata("design:returntype", Promise)
|
|
159
157
|
], OtpController.prototype, "resendOtp", null);
|
|
160
158
|
exports.OtpController = OtpController = __decorate([
|
|
161
159
|
(0, swagger_1.ApiTags)('Auth'),
|
|
162
160
|
(0, common_1.Controller)('auth'),
|
|
163
161
|
(0, decorators_1.Public)(),
|
|
164
|
-
__metadata("design:paramtypes", [otp_auth_service_1.OtpAuthService
|
|
162
|
+
__metadata("design:paramtypes", [otp_auth_service_1.OtpAuthService,
|
|
163
|
+
turnstile_service_1.TurnstileService])
|
|
165
164
|
], OtpController);
|
|
166
165
|
//# sourceMappingURL=otp.controller.js.map
|