@acorex-platform/module-security-management-server 0.0.18 → 2.0.0-next.42
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/contracts/src/AXM_USER_ACCESS_STATE_DEFINITION_KEY.js.map +1 -1
- package/contracts/src/AXM_USER_EFFECTIVE_STATE_DEFINITION_KEY.js.map +1 -1
- package/contracts/src/ROLE_PERMISSIONS_PAGE_COMPONENT_KEY.d.ts +2 -0
- package/contracts/src/ROLE_PERMISSIONS_PAGE_COMPONENT_KEY.js +6 -0
- package/contracts/src/ROLE_PERMISSIONS_PAGE_COMPONENT_KEY.js.map +1 -0
- package/contracts/src/USER_ROLES_PAGE_COMPONENT_KEY.d.ts +1 -0
- package/contracts/src/USER_ROLES_PAGE_COMPONENT_KEY.js +5 -0
- package/contracts/src/USER_ROLES_PAGE_COMPONENT_KEY.js.map +1 -0
- package/contracts/src/create-application-role-rows.util.d.ts +15 -0
- package/contracts/src/create-application-role-rows.util.js +67 -0
- package/contracts/src/create-application-role-rows.util.js.map +1 -0
- package/contracts/src/device-session-admin-scope.d.ts +15 -0
- package/contracts/src/device-session-admin-scope.js +16 -0
- package/contracts/src/device-session-admin-scope.js.map +1 -0
- package/contracts/src/entities/device-sessions/device-sessions.entity.js +50 -1
- package/contracts/src/entities/device-sessions/device-sessions.entity.js.map +1 -1
- package/contracts/src/entities/device-sessions/device-sessions.types.d.ts +7 -0
- package/contracts/src/entities/device-sessions/device-sessions.types.js.map +1 -1
- package/contracts/src/entities/device-sessions/index.d.ts +0 -1
- package/contracts/src/entities/device-sessions/index.js +0 -1
- package/contracts/src/entities/device-sessions/index.js.map +1 -1
- package/contracts/src/entities/identity-provider/identity-provider.entity.d.ts +2 -0
- package/contracts/src/entities/identity-provider/identity-provider.entity.js +453 -0
- package/contracts/src/entities/identity-provider/identity-provider.entity.js.map +1 -0
- package/contracts/src/entities/identity-provider/identity-provider.types.d.ts +61 -0
- package/contracts/src/entities/identity-provider/identity-provider.types.js +14 -0
- package/contracts/src/entities/identity-provider/identity-provider.types.js.map +1 -0
- package/contracts/src/entities/identity-provider/index.d.ts +1 -0
- package/contracts/src/entities/identity-provider/index.js +5 -0
- package/contracts/src/entities/identity-provider/index.js.map +1 -0
- package/contracts/src/entities/index.d.ts +4 -0
- package/contracts/src/entities/index.js +4 -0
- package/contracts/src/entities/index.js.map +1 -1
- package/contracts/src/entities/policy/index.d.ts +0 -1
- package/contracts/src/entities/policy/index.js +0 -1
- package/contracts/src/entities/policy/index.js.map +1 -1
- package/contracts/src/entities/policy/policy.entity.js +15 -0
- package/contracts/src/entities/policy/policy.entity.js.map +1 -1
- package/contracts/src/entities/policy/policy.types.js.map +1 -1
- package/contracts/src/entities/profile/index.d.ts +0 -1
- package/contracts/src/entities/profile/index.js +0 -1
- package/contracts/src/entities/profile/index.js.map +1 -1
- package/contracts/src/entities/profile/profile.entity.js +15 -0
- package/contracts/src/entities/profile/profile.entity.js.map +1 -1
- package/contracts/src/entities/profile/profile.types.js.map +1 -1
- package/contracts/src/entities/role-permission/index.d.ts +1 -0
- package/contracts/src/entities/role-permission/index.js +5 -0
- package/contracts/src/entities/role-permission/index.js.map +1 -0
- package/contracts/src/entities/role-permission/role-permission.entity.d.ts +2 -0
- package/contracts/src/entities/role-permission/role-permission.entity.js +163 -0
- package/contracts/src/entities/role-permission/role-permission.entity.js.map +1 -0
- package/contracts/src/entities/role-permission/role-permission.types.d.ts +11 -0
- package/contracts/src/entities/role-permission/role-permission.types.js +5 -0
- package/contracts/src/entities/role-permission/role-permission.types.js.map +1 -0
- package/contracts/src/entities/roles/index.d.ts +0 -1
- package/contracts/src/entities/roles/index.js +0 -1
- package/contracts/src/entities/roles/index.js.map +1 -1
- package/contracts/src/entities/roles/roles.entity.js +73 -144
- package/contracts/src/entities/roles/roles.entity.js.map +1 -1
- package/contracts/src/entities/roles/roles.types.d.ts +4 -1
- package/contracts/src/entities/roles/roles.types.js.map +1 -1
- package/contracts/src/entities/user-role/index.d.ts +1 -0
- package/{src/lib/seed/tenant → contracts/src/entities/user-role}/index.js +1 -1
- package/contracts/src/entities/user-role/index.js.map +1 -0
- package/contracts/src/entities/user-role/user-role.entity.d.ts +2 -0
- package/contracts/src/entities/user-role/user-role.entity.js +164 -0
- package/contracts/src/entities/user-role/user-role.entity.js.map +1 -0
- package/contracts/src/entities/user-role/user-role.types.d.ts +11 -0
- package/contracts/src/entities/user-role/user-role.types.js +5 -0
- package/contracts/src/entities/user-role/user-role.types.js.map +1 -0
- package/contracts/src/entities/user-two-factor/index.d.ts +2 -0
- package/contracts/src/entities/user-two-factor/index.js +8 -0
- package/contracts/src/entities/user-two-factor/index.js.map +1 -0
- package/contracts/src/entities/user-two-factor/user-two-factor.entity.d.ts +6 -0
- package/contracts/src/entities/user-two-factor/user-two-factor.entity.js +103 -0
- package/contracts/src/entities/user-two-factor/user-two-factor.entity.js.map +1 -0
- package/contracts/src/entities/user-two-factor/user-two-factor.types.d.ts +24 -0
- package/contracts/src/entities/user-two-factor/user-two-factor.types.js +4 -0
- package/contracts/src/entities/user-two-factor/user-two-factor.types.js.map +1 -0
- package/contracts/src/entities/users/index.d.ts +1 -1
- package/contracts/src/entities/users/index.js +1 -1
- package/contracts/src/entities/users/index.js.map +1 -1
- package/contracts/src/entities/users/user-provisioning-list-actions.d.ts +8 -0
- package/contracts/src/entities/users/user-provisioning-list-actions.js +95 -0
- package/contracts/src/entities/users/user-provisioning-list-actions.js.map +1 -0
- package/contracts/src/entities/users/users.entity.js +244 -83
- package/contracts/src/entities/users/users.entity.js.map +1 -1
- package/contracts/src/entities/users/users.types.d.ts +15 -0
- package/contracts/src/entities/users/users.types.js.map +1 -1
- package/contracts/src/entity-catalog.d.ts +7 -0
- package/contracts/src/entity-catalog.js +28 -0
- package/contracts/src/entity-catalog.js.map +1 -0
- package/contracts/src/entity-entry.device-sessions.d.ts +1 -0
- package/contracts/src/entity-entry.device-sessions.js +6 -0
- package/contracts/src/entity-entry.device-sessions.js.map +1 -0
- package/contracts/src/entity-entry.identity-provider.d.ts +1 -0
- package/contracts/src/entity-entry.identity-provider.js +6 -0
- package/contracts/src/entity-entry.identity-provider.js.map +1 -0
- package/contracts/src/entity-entry.policy.d.ts +1 -0
- package/contracts/src/entity-entry.policy.js +6 -0
- package/contracts/src/entity-entry.policy.js.map +1 -0
- package/contracts/src/entity-entry.profile.d.ts +1 -0
- package/contracts/src/entity-entry.profile.js +6 -0
- package/contracts/src/entity-entry.profile.js.map +1 -0
- package/contracts/src/entity-entry.role-permission.d.ts +1 -0
- package/contracts/src/entity-entry.role-permission.js +6 -0
- package/contracts/src/entity-entry.role-permission.js.map +1 -0
- package/contracts/src/entity-entry.roles.d.ts +1 -0
- package/contracts/src/entity-entry.roles.js +6 -0
- package/contracts/src/entity-entry.roles.js.map +1 -0
- package/contracts/src/entity-entry.user-role.d.ts +1 -0
- package/contracts/src/entity-entry.user-role.js +6 -0
- package/contracts/src/entity-entry.user-role.js.map +1 -0
- package/contracts/src/entity-entry.user-two-factor.d.ts +1 -0
- package/contracts/src/entity-entry.user-two-factor.js +6 -0
- package/contracts/src/entity-entry.user-two-factor.js.map +1 -0
- package/contracts/src/entity-entry.users.d.ts +1 -0
- package/contracts/src/entity-entry.users.js +6 -0
- package/contracts/src/entity-entry.users.js.map +1 -0
- package/contracts/src/features.keys.d.ts +4 -0
- package/contracts/src/features.keys.js +4 -0
- package/contracts/src/features.keys.js.map +1 -1
- package/contracts/src/index.d.ts +10 -1
- package/contracts/src/index.js +10 -1
- package/contracts/src/index.js.map +1 -1
- package/contracts/src/invite-application-role-rows.util.d.ts +16 -0
- package/contracts/src/invite-application-role-rows.util.js +68 -0
- package/contracts/src/invite-application-role-rows.util.js.map +1 -0
- package/contracts/src/invite-assignable-roles.util.d.ts +34 -0
- package/contracts/src/invite-assignable-roles.util.js +75 -0
- package/contracts/src/invite-assignable-roles.util.js.map +1 -0
- package/contracts/src/lib/context.definitions.d.ts +2 -0
- package/contracts/src/lib/context.definitions.js +15 -0
- package/contracts/src/lib/context.definitions.js.map +1 -0
- package/contracts/src/manifest.d.ts +6 -0
- package/contracts/src/manifest.js +24 -0
- package/contracts/src/manifest.js.map +1 -0
- package/contracts/src/menu.keys.d.ts +1 -0
- package/contracts/src/menu.keys.js +1 -0
- package/contracts/src/menu.keys.js.map +1 -1
- package/contracts/src/permission.keys.d.ts +48 -18
- package/contracts/src/permission.keys.js +49 -21
- package/contracts/src/permission.keys.js.map +1 -1
- package/contracts/src/resolve-user-effective-state.js.map +1 -1
- package/contracts/src/root-config.d.ts +33 -0
- package/contracts/src/root-config.js +33 -0
- package/contracts/src/root-config.js.map +1 -1
- package/contracts/src/server-commands.d.ts +322 -0
- package/contracts/src/server-commands.js +77 -1
- package/contracts/src/server-commands.js.map +1 -1
- package/contracts/src/settings.keys.d.ts +16 -0
- package/contracts/src/settings.keys.js +21 -0
- package/contracts/src/settings.keys.js.map +1 -0
- package/contracts/src/user-access-state.js.map +1 -1
- package/contracts/src/user-effective-state.js.map +1 -1
- package/contracts/src/user-invitation.d.ts +41 -0
- package/contracts/src/user-invitation.js +18 -0
- package/contracts/src/user-invitation.js.map +1 -0
- package/contracts/src/user-password-reset.js.map +1 -1
- package/package.json +16 -18
- package/server/src/index.d.ts +3 -0
- package/server/src/index.js +11 -0
- package/server/src/index.js.map +1 -0
- package/server/src/lib/effective-access-history/effective-access-history.service.d.ts +35 -0
- package/server/src/lib/effective-access-history/effective-access-history.service.js +486 -0
- package/server/src/lib/effective-access-history/effective-access-history.service.js.map +1 -0
- package/server/src/lib/effective-access-history/effective-access-history.types.d.ts +64 -0
- package/server/src/lib/effective-access-history/effective-access-history.types.js +5 -0
- package/server/src/lib/effective-access-history/effective-access-history.types.js.map +1 -0
- package/server/src/lib/effective-access-history/version-as-of.util.d.ts +37 -0
- package/server/src/lib/effective-access-history/version-as-of.util.js +167 -0
- package/server/src/lib/effective-access-history/version-as-of.util.js.map +1 -0
- package/server/src/lib/entities/index.d.ts +1 -0
- package/server/src/lib/entities/index.js +5 -0
- package/{src/lib/seed/tenant → server/src/lib/entities}/index.js.map +1 -1
- package/server/src/lib/entities/security-management.entity-catalog.d.ts +1 -0
- package/server/src/lib/entities/security-management.entity-catalog.js +12 -0
- package/server/src/lib/entities/security-management.entity-catalog.js.map +1 -0
- package/server/src/lib/handlers/security-report.handlers.d.ts +36 -0
- package/server/src/lib/handlers/security-report.handlers.js +164 -0
- package/server/src/lib/handlers/security-report.handlers.js.map +1 -0
- package/server/src/lib/identity-provider/auth-oauth-clients.constants.d.ts +5 -0
- package/server/src/lib/identity-provider/auth-oauth-clients.constants.js +11 -0
- package/server/src/lib/identity-provider/auth-oauth-clients.constants.js.map +1 -0
- package/server/src/lib/identity-provider/identity-provider-catalog.service.d.ts +20 -0
- package/server/src/lib/identity-provider/identity-provider-catalog.service.js +169 -0
- package/server/src/lib/identity-provider/identity-provider-catalog.service.js.map +1 -0
- package/server/src/lib/identity-provider/identity-provider-ids.constants.d.ts +8 -0
- package/server/src/lib/identity-provider/identity-provider-ids.constants.js +19 -0
- package/server/src/lib/identity-provider/identity-provider-ids.constants.js.map +1 -0
- package/server/src/lib/identity-provider/identity-provider-stub.bootstrap.d.ts +12 -0
- package/server/src/lib/identity-provider/identity-provider-stub.bootstrap.js +48 -0
- package/server/src/lib/identity-provider/identity-provider-stub.bootstrap.js.map +1 -0
- package/server/src/lib/identity-provider/identity-provider.constants.d.ts +1 -0
- package/server/src/lib/identity-provider/identity-provider.constants.js +7 -0
- package/server/src/lib/identity-provider/identity-provider.constants.js.map +1 -0
- package/server/src/lib/middlewares/device-sessions-active.middleware.d.ts +15 -0
- package/server/src/lib/middlewares/device-sessions-active.middleware.js +76 -0
- package/server/src/lib/middlewares/device-sessions-active.middleware.js.map +1 -0
- package/server/src/lib/middlewares/device-sessions-app-scope.middleware.d.ts +29 -0
- package/server/src/lib/middlewares/device-sessions-app-scope.middleware.js +137 -0
- package/server/src/lib/middlewares/device-sessions-app-scope.middleware.js.map +1 -0
- package/server/src/lib/middlewares/device-sessions-app-scope.util.d.ts +41 -0
- package/server/src/lib/middlewares/device-sessions-app-scope.util.js +69 -0
- package/server/src/lib/middlewares/device-sessions-app-scope.util.js.map +1 -0
- package/server/src/lib/middlewares/device-sessions-token-revoke.middleware.d.ts +18 -0
- package/server/src/lib/middlewares/device-sessions-token-revoke.middleware.js +90 -0
- package/server/src/lib/middlewares/device-sessions-token-revoke.middleware.js.map +1 -0
- package/server/src/lib/middlewares/user-assigned-roles.middleware.d.ts +36 -0
- package/server/src/lib/middlewares/user-assigned-roles.middleware.js +359 -0
- package/server/src/lib/middlewares/user-assigned-roles.middleware.js.map +1 -0
- package/{src → server/src}/lib/middlewares/user-effective-state.middleware.js +1 -1
- package/server/src/lib/middlewares/user-effective-state.middleware.js.map +1 -0
- package/server/src/lib/middlewares/user-invitation-list.middleware.d.ts +32 -0
- package/server/src/lib/middlewares/user-invitation-list.middleware.js +250 -0
- package/server/src/lib/middlewares/user-invitation-list.middleware.js.map +1 -0
- package/server/src/lib/middlewares/user-profile-write.middleware.d.ts +18 -0
- package/server/src/lib/middlewares/user-profile-write.middleware.js +206 -0
- package/server/src/lib/middlewares/user-profile-write.middleware.js.map +1 -0
- package/server/src/lib/password-reset/change-own-password.command.d.ts +8 -0
- package/server/src/lib/password-reset/change-own-password.command.js +38 -0
- package/server/src/lib/password-reset/change-own-password.command.js.map +1 -0
- package/{src → server/src}/lib/password-reset/complete-password-reset.command.d.ts +3 -4
- package/{src → server/src}/lib/password-reset/complete-password-reset.command.js +8 -12
- package/server/src/lib/password-reset/complete-password-reset.command.js.map +1 -0
- package/server/src/lib/password-reset/get-own-password-status.command.d.ts +8 -0
- package/server/src/lib/password-reset/get-own-password-status.command.js +31 -0
- package/server/src/lib/password-reset/get-own-password-status.command.js.map +1 -0
- package/{src → server/src}/lib/password-reset/send-password-reset-email.command.d.ts +12 -13
- package/{src → server/src}/lib/password-reset/send-password-reset-email.command.js +10 -15
- package/server/src/lib/password-reset/send-password-reset-email.command.js.map +1 -0
- package/server/src/lib/password-reset/user-change-password.service.d.ts +24 -0
- package/server/src/lib/password-reset/user-change-password.service.js +92 -0
- package/server/src/lib/password-reset/user-change-password.service.js.map +1 -0
- package/{src → server/src}/lib/password-reset/user-password-reset.service.d.ts +2 -7
- package/{src → server/src}/lib/password-reset/user-password-reset.service.js +29 -90
- package/server/src/lib/password-reset/user-password-reset.service.js.map +1 -0
- package/server/src/lib/queries/get-permission-holders-history.query.d.ts +4 -0
- package/server/src/lib/queries/get-permission-holders-history.query.definition.d.ts +5 -0
- package/server/src/lib/queries/get-permission-holders-history.query.definition.js +38 -0
- package/server/src/lib/queries/get-permission-holders-history.query.definition.js.map +1 -0
- package/server/src/lib/queries/get-permission-holders-history.query.js +25 -0
- package/server/src/lib/queries/get-permission-holders-history.query.js.map +1 -0
- package/server/src/lib/queries/get-role-holders-history.query.d.ts +4 -0
- package/server/src/lib/queries/get-role-holders-history.query.definition.d.ts +5 -0
- package/server/src/lib/queries/get-role-holders-history.query.definition.js +38 -0
- package/server/src/lib/queries/get-role-holders-history.query.definition.js.map +1 -0
- package/server/src/lib/queries/get-role-holders-history.query.js +25 -0
- package/server/src/lib/queries/get-role-holders-history.query.js.map +1 -0
- package/server/src/lib/queries/get-user-effective-permissions-history.query.d.ts +4 -0
- package/server/src/lib/queries/get-user-effective-permissions-history.query.definition.d.ts +5 -0
- package/server/src/lib/queries/get-user-effective-permissions-history.query.definition.js +35 -0
- package/server/src/lib/queries/get-user-effective-permissions-history.query.definition.js.map +1 -0
- package/server/src/lib/queries/get-user-effective-permissions-history.query.js +26 -0
- package/server/src/lib/queries/get-user-effective-permissions-history.query.js.map +1 -0
- package/server/src/lib/queries/get-user-effective-roles-history.query.d.ts +4 -0
- package/server/src/lib/queries/get-user-effective-roles-history.query.definition.d.ts +5 -0
- package/server/src/lib/queries/get-user-effective-roles-history.query.definition.js +36 -0
- package/server/src/lib/queries/get-user-effective-roles-history.query.definition.js.map +1 -0
- package/server/src/lib/queries/get-user-effective-roles-history.query.js +25 -0
- package/server/src/lib/queries/get-user-effective-roles-history.query.js.map +1 -0
- package/server/src/lib/queries/get-user-password-change-history.query.d.ts +4 -0
- package/server/src/lib/queries/get-user-password-change-history.query.definition.d.ts +5 -0
- package/server/src/lib/queries/get-user-password-change-history.query.definition.js +33 -0
- package/server/src/lib/queries/get-user-password-change-history.query.definition.js.map +1 -0
- package/server/src/lib/queries/get-user-password-change-history.query.js +23 -0
- package/server/src/lib/queries/get-user-password-change-history.query.js.map +1 -0
- package/server/src/lib/queries/security-query.helpers.d.ts +47 -0
- package/server/src/lib/queries/security-query.helpers.js +184 -0
- package/server/src/lib/queries/security-query.helpers.js.map +1 -0
- package/server/src/lib/reports/password-change-history.service.d.ts +14 -0
- package/server/src/lib/reports/password-change-history.service.js +74 -0
- package/server/src/lib/reports/password-change-history.service.js.map +1 -0
- package/server/src/lib/reports/permission-display-catalog.d.ts +7 -0
- package/server/src/lib/reports/permission-display-catalog.js +101 -0
- package/server/src/lib/reports/permission-display-catalog.js.map +1 -0
- package/server/src/lib/reports/security-report-definition.provider.d.ts +5 -0
- package/server/src/lib/reports/security-report-definition.provider.js +23 -0
- package/server/src/lib/reports/security-report-definition.provider.js.map +1 -0
- package/server/src/lib/reports/security-report-parameter-groups.d.ts +343 -0
- package/server/src/lib/reports/security-report-parameter-groups.js +167 -0
- package/server/src/lib/reports/security-report-parameter-groups.js.map +1 -0
- package/server/src/lib/reports/security-report-scope.constants.d.ts +5 -0
- package/server/src/lib/reports/security-report-scope.constants.js +11 -0
- package/server/src/lib/reports/security-report-scope.constants.js.map +1 -0
- package/server/src/lib/reports/security-report.definitions.d.ts +12 -0
- package/server/src/lib/reports/security-report.definitions.js +386 -0
- package/server/src/lib/reports/security-report.definitions.js.map +1 -0
- package/server/src/lib/security-management-entity-storage.bootstrap.d.ts +26 -0
- package/server/src/lib/security-management-entity-storage.bootstrap.js +56 -0
- package/server/src/lib/security-management-entity-storage.bootstrap.js.map +1 -0
- package/server/src/lib/security-management-server.module.d.ts +7 -0
- package/server/src/lib/security-management-server.module.js +190 -0
- package/server/src/lib/security-management-server.module.js.map +1 -0
- package/server/src/lib/two-factor/admin-reset-two-factor.command.d.ts +8 -0
- package/server/src/lib/two-factor/admin-reset-two-factor.command.js +35 -0
- package/server/src/lib/two-factor/admin-reset-two-factor.command.js.map +1 -0
- package/server/src/lib/two-factor/confirm-two-factor-enrollment.command.d.ts +8 -0
- package/server/src/lib/two-factor/confirm-two-factor-enrollment.command.js +34 -0
- package/server/src/lib/two-factor/confirm-two-factor-enrollment.command.js.map +1 -0
- package/server/src/lib/two-factor/disable-two-factor.command.d.ts +8 -0
- package/server/src/lib/two-factor/disable-two-factor.command.js +31 -0
- package/server/src/lib/two-factor/disable-two-factor.command.js.map +1 -0
- package/server/src/lib/two-factor/generate-two-factor-recovery-codes.command.d.ts +8 -0
- package/server/src/lib/two-factor/generate-two-factor-recovery-codes.command.js +34 -0
- package/server/src/lib/two-factor/generate-two-factor-recovery-codes.command.js.map +1 -0
- package/server/src/lib/two-factor/get-two-factor-status.command.d.ts +8 -0
- package/server/src/lib/two-factor/get-two-factor-status.command.js +31 -0
- package/server/src/lib/two-factor/get-two-factor-status.command.js.map +1 -0
- package/server/src/lib/two-factor/recovery-codes.util.d.ts +11 -0
- package/server/src/lib/two-factor/recovery-codes.util.js +73 -0
- package/server/src/lib/two-factor/recovery-codes.util.js.map +1 -0
- package/server/src/lib/two-factor/start-two-factor-enrollment.command.d.ts +8 -0
- package/server/src/lib/two-factor/start-two-factor-enrollment.command.js +31 -0
- package/server/src/lib/two-factor/start-two-factor-enrollment.command.js.map +1 -0
- package/server/src/lib/two-factor/totp.util.d.ts +32 -0
- package/server/src/lib/two-factor/totp.util.js +128 -0
- package/server/src/lib/two-factor/totp.util.js.map +1 -0
- package/server/src/lib/two-factor/two-factor-encryption.util.d.ts +25 -0
- package/server/src/lib/two-factor/two-factor-encryption.util.js +123 -0
- package/server/src/lib/two-factor/two-factor-encryption.util.js.map +1 -0
- package/server/src/lib/two-factor/two-factor-gate.bootstrap.d.ts +9 -0
- package/server/src/lib/two-factor/two-factor-gate.bootstrap.js +65 -0
- package/server/src/lib/two-factor/two-factor-gate.bootstrap.js.map +1 -0
- package/server/src/lib/two-factor/two-factor-redis.store.d.ts +63 -0
- package/server/src/lib/two-factor/two-factor-redis.store.js +321 -0
- package/server/src/lib/two-factor/two-factor-redis.store.js.map +1 -0
- package/server/src/lib/two-factor/user-two-factor.service.d.ts +62 -0
- package/server/src/lib/two-factor/user-two-factor.service.js +573 -0
- package/server/src/lib/two-factor/user-two-factor.service.js.map +1 -0
- package/server/src/lib/two-factor/verify-two-factor-login.command.d.ts +18 -0
- package/server/src/lib/two-factor/verify-two-factor-login.command.js +54 -0
- package/server/src/lib/two-factor/verify-two-factor-login.command.js.map +1 -0
- package/server/src/lib/user-invitation/accept-invitation.command.d.ts +8 -0
- package/server/src/lib/user-invitation/accept-invitation.command.js +41 -0
- package/server/src/lib/user-invitation/accept-invitation.command.js.map +1 -0
- package/server/src/lib/user-invitation/accept-my-invitation.command.d.ts +8 -0
- package/server/src/lib/user-invitation/accept-my-invitation.command.js +40 -0
- package/server/src/lib/user-invitation/accept-my-invitation.command.js.map +1 -0
- package/server/src/lib/user-invitation/approve-join-request.command.d.ts +8 -0
- package/server/src/lib/user-invitation/approve-join-request.command.js +41 -0
- package/server/src/lib/user-invitation/approve-join-request.command.js.map +1 -0
- package/server/src/lib/user-invitation/cancel-invitation.command.d.ts +8 -0
- package/server/src/lib/user-invitation/cancel-invitation.command.js +37 -0
- package/server/src/lib/user-invitation/cancel-invitation.command.js.map +1 -0
- package/server/src/lib/user-invitation/cancel-my-join-request.command.d.ts +8 -0
- package/server/src/lib/user-invitation/cancel-my-join-request.command.js +40 -0
- package/server/src/lib/user-invitation/cancel-my-join-request.command.js.map +1 -0
- package/server/src/lib/user-invitation/create-user-in-tenant.command.d.ts +8 -0
- package/server/src/lib/user-invitation/create-user-in-tenant.command.js +37 -0
- package/server/src/lib/user-invitation/create-user-in-tenant.command.js.map +1 -0
- package/server/src/lib/user-invitation/decline-invitation.command.d.ts +8 -0
- package/server/src/lib/user-invitation/decline-invitation.command.js +37 -0
- package/server/src/lib/user-invitation/decline-invitation.command.js.map +1 -0
- package/server/src/lib/user-invitation/invite-user.command.d.ts +8 -0
- package/server/src/lib/user-invitation/invite-user.command.js +37 -0
- package/server/src/lib/user-invitation/invite-user.command.js.map +1 -0
- package/server/src/lib/user-invitation/list-invite-assignable-roles.command.d.ts +8 -0
- package/server/src/lib/user-invitation/list-invite-assignable-roles.command.js +41 -0
- package/server/src/lib/user-invitation/list-invite-assignable-roles.command.js.map +1 -0
- package/server/src/lib/user-invitation/list-my-join-requests.command.d.ts +8 -0
- package/server/src/lib/user-invitation/list-my-join-requests.command.js +40 -0
- package/server/src/lib/user-invitation/list-my-join-requests.command.js.map +1 -0
- package/server/src/lib/user-invitation/list-my-pending-invitations.command.d.ts +8 -0
- package/server/src/lib/user-invitation/list-my-pending-invitations.command.js +37 -0
- package/server/src/lib/user-invitation/list-my-pending-invitations.command.js.map +1 -0
- package/server/src/lib/user-invitation/list-tenant-entitled-applications.command.d.ts +8 -0
- package/server/src/lib/user-invitation/list-tenant-entitled-applications.command.js +41 -0
- package/server/src/lib/user-invitation/list-tenant-entitled-applications.command.js.map +1 -0
- package/server/src/lib/user-invitation/lookup-tenant-by-unique-name.command.d.ts +8 -0
- package/server/src/lib/user-invitation/lookup-tenant-by-unique-name.command.js +40 -0
- package/server/src/lib/user-invitation/lookup-tenant-by-unique-name.command.js.map +1 -0
- package/server/src/lib/user-invitation/reject-join-request.command.d.ts +8 -0
- package/server/src/lib/user-invitation/reject-join-request.command.js +41 -0
- package/server/src/lib/user-invitation/reject-join-request.command.js.map +1 -0
- package/server/src/lib/user-invitation/request-tenant-membership.command.d.ts +8 -0
- package/server/src/lib/user-invitation/request-tenant-membership.command.js +40 -0
- package/server/src/lib/user-invitation/request-tenant-membership.command.js.map +1 -0
- package/server/src/lib/user-invitation/resend-invitation.command.d.ts +12 -0
- package/server/src/lib/user-invitation/resend-invitation.command.js +37 -0
- package/server/src/lib/user-invitation/resend-invitation.command.js.map +1 -0
- package/server/src/lib/user-invitation/user-invitation-application-access.util.d.ts +25 -0
- package/server/src/lib/user-invitation/user-invitation-application-access.util.js +121 -0
- package/server/src/lib/user-invitation/user-invitation-application-access.util.js.map +1 -0
- package/server/src/lib/user-invitation/user-invitation.service.d.ts +162 -0
- package/server/src/lib/user-invitation/user-invitation.service.js +1658 -0
- package/server/src/lib/user-invitation/user-invitation.service.js.map +1 -0
- package/contracts/src/datasource.keys.d.ts +0 -4
- package/contracts/src/datasource.keys.js +0 -10
- package/contracts/src/datasource.keys.js.map +0 -1
- package/src/index.d.ts +0 -5
- package/src/index.js +0 -13
- package/src/index.js.map +0 -1
- package/src/lib/middlewares/user-effective-state.middleware.js.map +0 -1
- package/src/lib/password-reset/complete-password-reset.command.js.map +0 -1
- package/src/lib/password-reset/send-password-reset-email.command.js.map +0 -1
- package/src/lib/password-reset/user-password-reset.service.js.map +0 -1
- package/src/lib/security-management-server.module.d.ts +0 -2
- package/src/lib/security-management-server.module.js +0 -48
- package/src/lib/security-management-server.module.js.map +0 -1
- package/src/lib/seed/index.d.ts +0 -22
- package/src/lib/seed/index.js +0 -24
- package/src/lib/seed/index.js.map +0 -1
- package/src/lib/seed/policy/index.d.ts +0 -2
- package/src/lib/seed/policy/index.js +0 -6
- package/src/lib/seed/policy/index.js.map +0 -1
- package/src/lib/seed/policy/policy.mock.d.ts +0 -7
- package/src/lib/seed/policy/policy.mock.js +0 -40
- package/src/lib/seed/policy/policy.mock.js.map +0 -1
- package/src/lib/seed/policy/policy.seed.d.ts +0 -5
- package/src/lib/seed/policy/policy.seed.js +0 -31
- package/src/lib/seed/policy/policy.seed.js.map +0 -1
- package/src/lib/seed/role/index.d.ts +0 -4
- package/src/lib/seed/role/index.js +0 -8
- package/src/lib/seed/role/index.js.map +0 -1
- package/src/lib/seed/role/role-ids.constants.d.ts +0 -14
- package/src/lib/seed/role/role-ids.constants.js +0 -20
- package/src/lib/seed/role/role-ids.constants.js.map +0 -1
- package/src/lib/seed/role/role-permission-keys.constants.d.ts +0 -578
- package/src/lib/seed/role/role-permission-keys.constants.js +0 -620
- package/src/lib/seed/role/role-permission-keys.constants.js.map +0 -1
- package/src/lib/seed/role/role.mock.d.ts +0 -4
- package/src/lib/seed/role/role.mock.js +0 -321
- package/src/lib/seed/role/role.mock.js.map +0 -1
- package/src/lib/seed/role/role.seed.d.ts +0 -5
- package/src/lib/seed/role/role.seed.js +0 -31
- package/src/lib/seed/role/role.seed.js.map +0 -1
- package/src/lib/seed/security-management-seed.provider.d.ts +0 -4
- package/src/lib/seed/security-management-seed.provider.js +0 -18
- package/src/lib/seed/security-management-seed.provider.js.map +0 -1
- package/src/lib/seed/security-management-seed.tokens.d.ts +0 -1
- package/src/lib/seed/security-management-seed.tokens.js +0 -7
- package/src/lib/seed/security-management-seed.tokens.js.map +0 -1
- package/src/lib/seed/security-management.seed-catalog.d.ts +0 -2
- package/src/lib/seed/security-management.seed-catalog.js +0 -17
- package/src/lib/seed/security-management.seed-catalog.js.map +0 -1
- package/src/lib/seed/tenant/index.d.ts +0 -1
- package/src/lib/seed/tenant/tenant-ids.constants.d.ts +0 -11
- package/src/lib/seed/tenant/tenant-ids.constants.js +0 -17
- package/src/lib/seed/tenant/tenant-ids.constants.js.map +0 -1
- package/src/lib/seed/user/index.d.ts +0 -4
- package/src/lib/seed/user/index.js +0 -13
- package/src/lib/seed/user/index.js.map +0 -1
- package/src/lib/seed/user/resolve-user-effective-state.util.d.ts +0 -4
- package/src/lib/seed/user/resolve-user-effective-state.util.js +0 -10
- package/src/lib/seed/user/resolve-user-effective-state.util.js.map +0 -1
- package/src/lib/seed/user/user.mock.d.ts +0 -21
- package/src/lib/seed/user/user.mock.js +0 -338
- package/src/lib/seed/user/user.mock.js.map +0 -1
- package/src/lib/seed/user/user.seed.d.ts +0 -5
- package/src/lib/seed/user/user.seed.js +0 -31
- package/src/lib/seed/user/user.seed.js.map +0 -1
- /package/{src → server/src}/lib/middlewares/user-effective-state.middleware.d.ts +0 -0
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
//#region ----- Imports -----
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.SecurityManagementEntityStorageBootstrap = void 0;
|
|
5
|
+
const tslib_1 = require("tslib");
|
|
6
|
+
const common_1 = require("@nestjs/common");
|
|
7
|
+
const core_1 = require("@acorex-platform/framework-server/core");
|
|
8
|
+
const user_assigned_roles_middleware_1 = require("./middlewares/user-assigned-roles.middleware");
|
|
9
|
+
const device_sessions_active_middleware_1 = require("./middlewares/device-sessions-active.middleware");
|
|
10
|
+
const device_sessions_app_scope_middleware_1 = require("./middlewares/device-sessions-app-scope.middleware");
|
|
11
|
+
const device_sessions_token_revoke_middleware_1 = require("./middlewares/device-sessions-token-revoke.middleware");
|
|
12
|
+
const user_effective_state_middleware_1 = require("./middlewares/user-effective-state.middleware");
|
|
13
|
+
const user_invitation_list_middleware_1 = require("./middlewares/user-invitation-list.middleware");
|
|
14
|
+
const user_profile_write_middleware_1 = require("./middlewares/user-profile-write.middleware");
|
|
15
|
+
//#endregion
|
|
16
|
+
//#region ----- Entity storage middleware bootstrap -----
|
|
17
|
+
/**
|
|
18
|
+
* Ensures User middlewares join the server pipeline.
|
|
19
|
+
* Webpack can split `ENTITY_STORAGE_MIDDLEWARE` tokens so `useExisting` aliases
|
|
20
|
+
* are not discovered — register the instances the same way other modules do.
|
|
21
|
+
*/
|
|
22
|
+
let SecurityManagementEntityStorageBootstrap = class SecurityManagementEntityStorageBootstrap {
|
|
23
|
+
constructor(storage, userAssignedRoles, userProfileWrite, userEffectiveState, userInvitationList, deviceSessionsAppScope, deviceSessionsActive, deviceSessionsTokenRevoke) {
|
|
24
|
+
this.storage = storage;
|
|
25
|
+
this.userAssignedRoles = userAssignedRoles;
|
|
26
|
+
this.userProfileWrite = userProfileWrite;
|
|
27
|
+
this.userEffectiveState = userEffectiveState;
|
|
28
|
+
this.userInvitationList = userInvitationList;
|
|
29
|
+
this.deviceSessionsAppScope = deviceSessionsAppScope;
|
|
30
|
+
this.deviceSessionsActive = deviceSessionsActive;
|
|
31
|
+
this.deviceSessionsTokenRevoke = deviceSessionsTokenRevoke;
|
|
32
|
+
}
|
|
33
|
+
onModuleInit() {
|
|
34
|
+
this.storage.registerLateMiddleware(this.userAssignedRoles);
|
|
35
|
+
this.storage.registerLateMiddleware(this.userProfileWrite);
|
|
36
|
+
this.storage.registerLateMiddleware(this.userEffectiveState);
|
|
37
|
+
this.storage.registerLateMiddleware(this.userInvitationList);
|
|
38
|
+
this.storage.registerLateMiddleware(this.deviceSessionsAppScope);
|
|
39
|
+
this.storage.registerLateMiddleware(this.deviceSessionsActive);
|
|
40
|
+
this.storage.registerLateMiddleware(this.deviceSessionsTokenRevoke);
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
exports.SecurityManagementEntityStorageBootstrap = SecurityManagementEntityStorageBootstrap;
|
|
44
|
+
exports.SecurityManagementEntityStorageBootstrap = SecurityManagementEntityStorageBootstrap = tslib_1.__decorate([
|
|
45
|
+
(0, common_1.Injectable)(),
|
|
46
|
+
tslib_1.__metadata("design:paramtypes", [core_1.EntityStorageMiddlewareService,
|
|
47
|
+
user_assigned_roles_middleware_1.UserAssignedRolesMiddleware,
|
|
48
|
+
user_profile_write_middleware_1.UserProfileWriteMiddleware,
|
|
49
|
+
user_effective_state_middleware_1.UserEffectiveStateMiddleware,
|
|
50
|
+
user_invitation_list_middleware_1.UserInvitationListMiddleware,
|
|
51
|
+
device_sessions_app_scope_middleware_1.DeviceSessionsAppScopeMiddleware,
|
|
52
|
+
device_sessions_active_middleware_1.DeviceSessionsActiveMiddleware,
|
|
53
|
+
device_sessions_token_revoke_middleware_1.DeviceSessionsTokenRevokeMiddleware])
|
|
54
|
+
], SecurityManagementEntityStorageBootstrap);
|
|
55
|
+
//#endregion
|
|
56
|
+
//# sourceMappingURL=security-management-entity-storage.bootstrap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"security-management-entity-storage.bootstrap.js","sourceRoot":"","sources":["../../../../../../libs/modules/security-management/server/src/lib/security-management-entity-storage.bootstrap.ts"],"names":[],"mappings":";AAAA,6BAA6B;;;;AAE7B,2CAA0D;AAC1D,iEAAwF;AAExF,iGAA2F;AAC3F,uGAAiG;AACjG,6GAAsG;AACtG,mHAA4G;AAC5G,mGAA6F;AAC7F,mGAA6F;AAC7F,+FAAyF;AAEzF,YAAY;AAEZ,yDAAyD;AAEzD;;;;GAIG;AAEI,IAAM,wCAAwC,GAA9C,MAAM,wCAAwC;IACnD,YACmB,OAAuC,EACvC,iBAA8C,EAC9C,gBAA4C,EAC5C,kBAAgD,EAChD,kBAAgD,EAChD,sBAAwD,EACxD,oBAAoD,EACpD,yBAA8D;QAP9D,YAAO,GAAP,OAAO,CAAgC;QACvC,sBAAiB,GAAjB,iBAAiB,CAA6B;QAC9C,qBAAgB,GAAhB,gBAAgB,CAA4B;QAC5C,uBAAkB,GAAlB,kBAAkB,CAA8B;QAChD,uBAAkB,GAAlB,kBAAkB,CAA8B;QAChD,2BAAsB,GAAtB,sBAAsB,CAAkC;QACxD,yBAAoB,GAApB,oBAAoB,CAAgC;QACpD,8BAAyB,GAAzB,yBAAyB,CAAqC;IAC9E,CAAC;IAEJ,YAAY;QACV,IAAI,CAAC,OAAO,CAAC,sBAAsB,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;QAC5D,IAAI,CAAC,OAAO,CAAC,sBAAsB,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;QAC3D,IAAI,CAAC,OAAO,CAAC,sBAAsB,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;QAC7D,IAAI,CAAC,OAAO,CAAC,sBAAsB,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;QAC7D,IAAI,CAAC,OAAO,CAAC,sBAAsB,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;QACjE,IAAI,CAAC,OAAO,CAAC,sBAAsB,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;QAC/D,IAAI,CAAC,OAAO,CAAC,sBAAsB,CAAC,IAAI,CAAC,yBAAyB,CAAC,CAAC;IACtE,CAAC;CACF,CAAA;AArBY,4FAAwC;mDAAxC,wCAAwC;IADpD,IAAA,mBAAU,GAAE;6CAGiB,qCAA8B;QACpB,4DAA2B;QAC5B,0DAA0B;QACxB,8DAA4B;QAC5B,8DAA4B;QACxB,uEAAgC;QAClC,kEAA8B;QACzB,6EAAmC;GATtE,wCAAwC,CAqBpD;AAED,YAAY"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { AXPContextDefinitionRegistry } from '@acorex-platform/framework-server/core';
|
|
2
|
+
import { type OnModuleInit } from '@nestjs/common';
|
|
3
|
+
export declare class SecurityManagementServerModule implements OnModuleInit {
|
|
4
|
+
private readonly contextDefinitions;
|
|
5
|
+
constructor(contextDefinitions: AXPContextDefinitionRegistry);
|
|
6
|
+
onModuleInit(): void;
|
|
7
|
+
}
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SecurityManagementServerModule = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const core_1 = require("@acorex-platform/framework-server/core");
|
|
6
|
+
const seed_1 = require("@acorex-platform/framework-server/domain/seed");
|
|
7
|
+
const security_1 = require("@acorex-platform/framework-server/security");
|
|
8
|
+
const module_security_management_contracts_1 = require("@acorex-platform/module-security-management-client/contracts");
|
|
9
|
+
const module_common_contracts_1 = require("@acorex-platform/module-common-client/contracts");
|
|
10
|
+
const module_settings_management_server_1 = require("@acorex-platform/module-settings-management-server");
|
|
11
|
+
const common_1 = require("@nestjs/common");
|
|
12
|
+
const effective_access_history_service_1 = require("./effective-access-history/effective-access-history.service");
|
|
13
|
+
const security_management_entity_catalog_1 = require("./entities/security-management.entity-catalog");
|
|
14
|
+
const security_report_handlers_1 = require("./handlers/security-report.handlers");
|
|
15
|
+
const auth_oauth_clients_constants_1 = require("./identity-provider/auth-oauth-clients.constants");
|
|
16
|
+
const identity_provider_catalog_service_1 = require("./identity-provider/identity-provider-catalog.service");
|
|
17
|
+
const identity_provider_stub_bootstrap_1 = require("./identity-provider/identity-provider-stub.bootstrap");
|
|
18
|
+
const security_management_entity_storage_bootstrap_1 = require("./security-management-entity-storage.bootstrap");
|
|
19
|
+
const user_assigned_roles_middleware_1 = require("./middlewares/user-assigned-roles.middleware");
|
|
20
|
+
const device_sessions_active_middleware_1 = require("./middlewares/device-sessions-active.middleware");
|
|
21
|
+
const device_sessions_app_scope_middleware_1 = require("./middlewares/device-sessions-app-scope.middleware");
|
|
22
|
+
const device_sessions_token_revoke_middleware_1 = require("./middlewares/device-sessions-token-revoke.middleware");
|
|
23
|
+
const user_effective_state_middleware_1 = require("./middlewares/user-effective-state.middleware");
|
|
24
|
+
const user_invitation_list_middleware_1 = require("./middlewares/user-invitation-list.middleware");
|
|
25
|
+
const user_profile_write_middleware_1 = require("./middlewares/user-profile-write.middleware");
|
|
26
|
+
const change_own_password_command_1 = require("./password-reset/change-own-password.command");
|
|
27
|
+
const get_own_password_status_command_1 = require("./password-reset/get-own-password-status.command");
|
|
28
|
+
const complete_password_reset_command_1 = require("./password-reset/complete-password-reset.command");
|
|
29
|
+
const send_password_reset_email_command_1 = require("./password-reset/send-password-reset-email.command");
|
|
30
|
+
const user_change_password_service_1 = require("./password-reset/user-change-password.service");
|
|
31
|
+
const user_password_reset_service_1 = require("./password-reset/user-password-reset.service");
|
|
32
|
+
const admin_reset_two_factor_command_1 = require("./two-factor/admin-reset-two-factor.command");
|
|
33
|
+
const confirm_two_factor_enrollment_command_1 = require("./two-factor/confirm-two-factor-enrollment.command");
|
|
34
|
+
const disable_two_factor_command_1 = require("./two-factor/disable-two-factor.command");
|
|
35
|
+
const generate_two_factor_recovery_codes_command_1 = require("./two-factor/generate-two-factor-recovery-codes.command");
|
|
36
|
+
const get_two_factor_status_command_1 = require("./two-factor/get-two-factor-status.command");
|
|
37
|
+
const start_two_factor_enrollment_command_1 = require("./two-factor/start-two-factor-enrollment.command");
|
|
38
|
+
const two_factor_gate_bootstrap_1 = require("./two-factor/two-factor-gate.bootstrap");
|
|
39
|
+
const two_factor_redis_store_1 = require("./two-factor/two-factor-redis.store");
|
|
40
|
+
const user_two_factor_service_1 = require("./two-factor/user-two-factor.service");
|
|
41
|
+
const verify_two_factor_login_command_1 = require("./two-factor/verify-two-factor-login.command");
|
|
42
|
+
const user_invitation_service_1 = require("./user-invitation/user-invitation.service");
|
|
43
|
+
const invite_user_command_1 = require("./user-invitation/invite-user.command");
|
|
44
|
+
const list_invite_assignable_roles_command_1 = require("./user-invitation/list-invite-assignable-roles.command");
|
|
45
|
+
const list_tenant_entitled_applications_command_1 = require("./user-invitation/list-tenant-entitled-applications.command");
|
|
46
|
+
const resend_invitation_command_1 = require("./user-invitation/resend-invitation.command");
|
|
47
|
+
const cancel_invitation_command_1 = require("./user-invitation/cancel-invitation.command");
|
|
48
|
+
const accept_invitation_command_1 = require("./user-invitation/accept-invitation.command");
|
|
49
|
+
const accept_my_invitation_command_1 = require("./user-invitation/accept-my-invitation.command");
|
|
50
|
+
const list_my_pending_invitations_command_1 = require("./user-invitation/list-my-pending-invitations.command");
|
|
51
|
+
const decline_invitation_command_1 = require("./user-invitation/decline-invitation.command");
|
|
52
|
+
const lookup_tenant_by_unique_name_command_1 = require("./user-invitation/lookup-tenant-by-unique-name.command");
|
|
53
|
+
const request_tenant_membership_command_1 = require("./user-invitation/request-tenant-membership.command");
|
|
54
|
+
const list_my_join_requests_command_1 = require("./user-invitation/list-my-join-requests.command");
|
|
55
|
+
const cancel_my_join_request_command_1 = require("./user-invitation/cancel-my-join-request.command");
|
|
56
|
+
const approve_join_request_command_1 = require("./user-invitation/approve-join-request.command");
|
|
57
|
+
const reject_join_request_command_1 = require("./user-invitation/reject-join-request.command");
|
|
58
|
+
const create_user_in_tenant_command_1 = require("./user-invitation/create-user-in-tenant.command");
|
|
59
|
+
const password_change_history_service_1 = require("./reports/password-change-history.service");
|
|
60
|
+
const security_report_definition_provider_1 = require("./reports/security-report-definition.provider");
|
|
61
|
+
//#region ---- Security management backend module ----
|
|
62
|
+
let SecurityManagementServerModule = class SecurityManagementServerModule {
|
|
63
|
+
constructor(contextDefinitions) {
|
|
64
|
+
this.contextDefinitions = contextDefinitions;
|
|
65
|
+
}
|
|
66
|
+
onModuleInit() {
|
|
67
|
+
this.contextDefinitions.registerAll(module_security_management_contracts_1.AXM_SECURITY_CONTEXT_DEFINITIONS);
|
|
68
|
+
// Conceptual permission keys → edition module names (Access/Setup = any-module).
|
|
69
|
+
(0, security_1.registerPermissionModulesResolver)(module_common_contracts_1.resolvePermissionModules);
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
exports.SecurityManagementServerModule = SecurityManagementServerModule;
|
|
73
|
+
exports.SecurityManagementServerModule = SecurityManagementServerModule = tslib_1.__decorate([
|
|
74
|
+
(0, common_1.Module)({
|
|
75
|
+
imports: [seed_1.DomainEntityModule.forFeature(security_management_entity_catalog_1.securityManagementEntityCatalog), core_1.EntityStorageModule, module_settings_management_server_1.SettingsManagementServerModule],
|
|
76
|
+
providers: [
|
|
77
|
+
user_effective_state_middleware_1.UserEffectiveStateMiddleware,
|
|
78
|
+
{
|
|
79
|
+
provide: core_1.ENTITY_STORAGE_MIDDLEWARE,
|
|
80
|
+
useExisting: user_effective_state_middleware_1.UserEffectiveStateMiddleware,
|
|
81
|
+
multi: true,
|
|
82
|
+
},
|
|
83
|
+
user_assigned_roles_middleware_1.UserAssignedRolesMiddleware,
|
|
84
|
+
{
|
|
85
|
+
provide: core_1.ENTITY_STORAGE_MIDDLEWARE,
|
|
86
|
+
useExisting: user_assigned_roles_middleware_1.UserAssignedRolesMiddleware,
|
|
87
|
+
multi: true,
|
|
88
|
+
},
|
|
89
|
+
user_invitation_list_middleware_1.UserInvitationListMiddleware,
|
|
90
|
+
{
|
|
91
|
+
provide: core_1.ENTITY_STORAGE_MIDDLEWARE,
|
|
92
|
+
useExisting: user_invitation_list_middleware_1.UserInvitationListMiddleware,
|
|
93
|
+
multi: true,
|
|
94
|
+
},
|
|
95
|
+
device_sessions_app_scope_middleware_1.DeviceSessionsAppScopeMiddleware,
|
|
96
|
+
{
|
|
97
|
+
provide: core_1.ENTITY_STORAGE_MIDDLEWARE,
|
|
98
|
+
useExisting: device_sessions_app_scope_middleware_1.DeviceSessionsAppScopeMiddleware,
|
|
99
|
+
multi: true,
|
|
100
|
+
},
|
|
101
|
+
device_sessions_active_middleware_1.DeviceSessionsActiveMiddleware,
|
|
102
|
+
{
|
|
103
|
+
provide: core_1.ENTITY_STORAGE_MIDDLEWARE,
|
|
104
|
+
useExisting: device_sessions_active_middleware_1.DeviceSessionsActiveMiddleware,
|
|
105
|
+
multi: true,
|
|
106
|
+
},
|
|
107
|
+
device_sessions_token_revoke_middleware_1.DeviceSessionsTokenRevokeMiddleware,
|
|
108
|
+
{
|
|
109
|
+
provide: core_1.ENTITY_STORAGE_MIDDLEWARE,
|
|
110
|
+
useExisting: device_sessions_token_revoke_middleware_1.DeviceSessionsTokenRevokeMiddleware,
|
|
111
|
+
multi: true,
|
|
112
|
+
},
|
|
113
|
+
security_management_entity_storage_bootstrap_1.SecurityManagementEntityStorageBootstrap,
|
|
114
|
+
user_profile_write_middleware_1.UserProfileWriteMiddleware,
|
|
115
|
+
{
|
|
116
|
+
provide: core_1.ENTITY_STORAGE_MIDDLEWARE,
|
|
117
|
+
useExisting: user_profile_write_middleware_1.UserProfileWriteMiddleware,
|
|
118
|
+
multi: true,
|
|
119
|
+
},
|
|
120
|
+
user_password_reset_service_1.UserPasswordResetService,
|
|
121
|
+
user_change_password_service_1.UserChangePasswordService,
|
|
122
|
+
send_password_reset_email_command_1.SendPasswordResetEmailCommand,
|
|
123
|
+
complete_password_reset_command_1.CompletePasswordResetCommand,
|
|
124
|
+
change_own_password_command_1.ChangeOwnPasswordCommand,
|
|
125
|
+
get_own_password_status_command_1.GetOwnPasswordStatusCommand,
|
|
126
|
+
two_factor_redis_store_1.TwoFactorRedisStore,
|
|
127
|
+
user_two_factor_service_1.UserTwoFactorService,
|
|
128
|
+
two_factor_gate_bootstrap_1.TwoFactorGateBootstrap,
|
|
129
|
+
start_two_factor_enrollment_command_1.StartTwoFactorEnrollmentCommand,
|
|
130
|
+
confirm_two_factor_enrollment_command_1.ConfirmTwoFactorEnrollmentCommand,
|
|
131
|
+
disable_two_factor_command_1.DisableTwoFactorCommand,
|
|
132
|
+
generate_two_factor_recovery_codes_command_1.GenerateTwoFactorRecoveryCodesCommand,
|
|
133
|
+
get_two_factor_status_command_1.GetTwoFactorStatusCommand,
|
|
134
|
+
admin_reset_two_factor_command_1.AdminResetTwoFactorCommand,
|
|
135
|
+
verify_two_factor_login_command_1.VerifyTwoFactorLoginCommand,
|
|
136
|
+
user_invitation_service_1.UserInvitationService,
|
|
137
|
+
invite_user_command_1.InviteUserCommand,
|
|
138
|
+
list_tenant_entitled_applications_command_1.ListTenantEntitledApplicationsCommand,
|
|
139
|
+
list_invite_assignable_roles_command_1.ListInviteAssignableRolesCommand,
|
|
140
|
+
resend_invitation_command_1.ResendInvitationCommand,
|
|
141
|
+
cancel_invitation_command_1.CancelInvitationCommand,
|
|
142
|
+
accept_invitation_command_1.AcceptInvitationCommand,
|
|
143
|
+
accept_my_invitation_command_1.AcceptMyInvitationCommand,
|
|
144
|
+
list_my_pending_invitations_command_1.ListMyPendingInvitationsCommand,
|
|
145
|
+
decline_invitation_command_1.DeclineInvitationCommand,
|
|
146
|
+
lookup_tenant_by_unique_name_command_1.LookupTenantByUniqueNameCommand,
|
|
147
|
+
request_tenant_membership_command_1.RequestTenantMembershipCommand,
|
|
148
|
+
list_my_join_requests_command_1.ListMyJoinRequestsCommand,
|
|
149
|
+
cancel_my_join_request_command_1.CancelMyJoinRequestCommand,
|
|
150
|
+
approve_join_request_command_1.ApproveJoinRequestCommand,
|
|
151
|
+
reject_join_request_command_1.RejectJoinRequestCommand,
|
|
152
|
+
create_user_in_tenant_command_1.CreateUserInTenantCommand,
|
|
153
|
+
identity_provider_catalog_service_1.IdentityProviderCatalogService,
|
|
154
|
+
(0, identity_provider_catalog_service_1.provideAuthIdentityProviderCatalog)(),
|
|
155
|
+
identity_provider_stub_bootstrap_1.IdentityProviderStubBootstrap,
|
|
156
|
+
{
|
|
157
|
+
provide: security_1.AUTH_OAUTH_ALLOWED_CLIENT_IDS,
|
|
158
|
+
useValue: [...auth_oauth_clients_constants_1.AUTH_OAUTH_SEEDED_CLIENT_IDS],
|
|
159
|
+
},
|
|
160
|
+
// AUTH_OAUTH_REGISTERED_CLIENTS — provided by host app (demo-api) from env/CORS origins.
|
|
161
|
+
effective_access_history_service_1.EffectiveAccessHistoryService,
|
|
162
|
+
password_change_history_service_1.PasswordChangeHistoryService,
|
|
163
|
+
security_report_handlers_1.GetUserEffectiveRolesHistoryQueryHandler,
|
|
164
|
+
security_report_handlers_1.GetUserEffectivePermissionsHistoryQueryHandler,
|
|
165
|
+
security_report_handlers_1.GetRoleHoldersHistoryQueryHandler,
|
|
166
|
+
security_report_handlers_1.GetPermissionHoldersHistoryQueryHandler,
|
|
167
|
+
security_report_handlers_1.GetUserPasswordChangeHistoryQueryHandler,
|
|
168
|
+
security_report_definition_provider_1.SecurityReportDefinitionProvider,
|
|
169
|
+
],
|
|
170
|
+
exports: [
|
|
171
|
+
user_effective_state_middleware_1.UserEffectiveStateMiddleware,
|
|
172
|
+
user_assigned_roles_middleware_1.UserAssignedRolesMiddleware,
|
|
173
|
+
user_profile_write_middleware_1.UserProfileWriteMiddleware,
|
|
174
|
+
user_invitation_list_middleware_1.UserInvitationListMiddleware,
|
|
175
|
+
device_sessions_active_middleware_1.DeviceSessionsActiveMiddleware,
|
|
176
|
+
device_sessions_token_revoke_middleware_1.DeviceSessionsTokenRevokeMiddleware,
|
|
177
|
+
core_1.ENTITY_STORAGE_MIDDLEWARE,
|
|
178
|
+
user_password_reset_service_1.UserPasswordResetService,
|
|
179
|
+
user_invitation_service_1.UserInvitationService,
|
|
180
|
+
user_two_factor_service_1.UserTwoFactorService,
|
|
181
|
+
identity_provider_catalog_service_1.IdentityProviderCatalogService,
|
|
182
|
+
security_1.AUTH_IDENTITY_PROVIDER_CATALOG,
|
|
183
|
+
security_1.AUTH_OAUTH_ALLOWED_CLIENT_IDS,
|
|
184
|
+
effective_access_history_service_1.EffectiveAccessHistoryService,
|
|
185
|
+
],
|
|
186
|
+
}),
|
|
187
|
+
tslib_1.__metadata("design:paramtypes", [core_1.AXPContextDefinitionRegistry])
|
|
188
|
+
], SecurityManagementServerModule);
|
|
189
|
+
//#endregion
|
|
190
|
+
//# sourceMappingURL=security-management-server.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"security-management-server.module.js","sourceRoot":"","sources":["../../../../../../libs/modules/security-management/server/src/lib/security-management-server.module.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { AXPCommand, AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';
|
|
2
|
+
import { type AXMAdminResetTwoFactorInput, type AXMAdminResetTwoFactorResult } from '@acorex-platform/module-security-management-client/contracts';
|
|
3
|
+
import { UserTwoFactorService } from './user-two-factor.service';
|
|
4
|
+
export declare class AdminResetTwoFactorCommand implements AXPCommand<AXMAdminResetTwoFactorInput, AXMAdminResetTwoFactorResult> {
|
|
5
|
+
private readonly twoFactor;
|
|
6
|
+
constructor(twoFactor: UserTwoFactorService);
|
|
7
|
+
execute(input?: AXMAdminResetTwoFactorInput): AXPCommandExecuteResultPromise<AXMAdminResetTwoFactorResult>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AdminResetTwoFactorCommand = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const common_1 = require("@nestjs/common");
|
|
6
|
+
const abstract_1 = require("@acorex-platform/framework-server/domain/abstract");
|
|
7
|
+
const module_security_management_contracts_1 = require("@acorex-platform/module-security-management-client/contracts");
|
|
8
|
+
const user_two_factor_service_1 = require("./user-two-factor.service");
|
|
9
|
+
//#region ----- Admin reset two-factor command -----
|
|
10
|
+
let AdminResetTwoFactorCommand = class AdminResetTwoFactorCommand {
|
|
11
|
+
constructor(twoFactor) {
|
|
12
|
+
this.twoFactor = twoFactor;
|
|
13
|
+
}
|
|
14
|
+
execute() {
|
|
15
|
+
return tslib_1.__awaiter(this, arguments, void 0, function* (input = { userId: '' }) {
|
|
16
|
+
const result = yield this.twoFactor.adminReset(input);
|
|
17
|
+
if (!result.success) {
|
|
18
|
+
return { success: false, message: { code: result.code } };
|
|
19
|
+
}
|
|
20
|
+
return { success: true, kind: 'object', data: result.data };
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
exports.AdminResetTwoFactorCommand = AdminResetTwoFactorCommand;
|
|
25
|
+
exports.AdminResetTwoFactorCommand = AdminResetTwoFactorCommand = tslib_1.__decorate([
|
|
26
|
+
(0, abstract_1.ServerHandler)({
|
|
27
|
+
key: module_security_management_contracts_1.AXMSecurityManagementServerCommands.AdminResetTwoFactor,
|
|
28
|
+
auth: 'session',
|
|
29
|
+
permissions: [module_security_management_contracts_1.AXPAdministrationPermissionKeys.MaintainUsersAndRoles],
|
|
30
|
+
}),
|
|
31
|
+
(0, common_1.Injectable)(),
|
|
32
|
+
tslib_1.__metadata("design:paramtypes", [user_two_factor_service_1.UserTwoFactorService])
|
|
33
|
+
], AdminResetTwoFactorCommand);
|
|
34
|
+
//#endregion
|
|
35
|
+
//# sourceMappingURL=admin-reset-two-factor.command.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admin-reset-two-factor.command.js","sourceRoot":"","sources":["../../../../../../../libs/modules/security-management/server/src/lib/two-factor/admin-reset-two-factor.command.ts"],"names":[],"mappings":";;;;AAAA,2CAA4C;AAE5C,gFAAkF;AAClF,gHAK+D;AAE/D,uEAAiE;AAEjE,oDAAoD;AAQ7C,IAAM,0BAA0B,GAAhC,MAAM,0BAA0B;IAGrC,YAA6B,SAA+B;QAA/B,cAAS,GAAT,SAAS,CAAsB;IAAG,CAAC;IAE1D,OAAO;qEACX,QAAqC,EAAE,MAAM,EAAE,EAAE,EAAE;YAEnD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;YACtD,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;gBACpB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC;YAC5D,CAAC;YACD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC;QAC9D,CAAC;KAAA;CACF,CAAA;AAdY,gEAA0B;qCAA1B,0BAA0B;IANtC,IAAA,wBAAa,EAAC;QACb,GAAG,EAAE,0EAAmC,CAAC,mBAAmB;QAC5D,IAAI,EAAE,SAAS;QACf,WAAW,EAAE,CAAC,sEAA+B,CAAC,qBAAqB,CAAC;KACrE,CAAC;IACD,IAAA,mBAAU,GAAE;6CAI6B,8CAAoB;GAHjD,0BAA0B,CActC;AAED,YAAY"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { AXPCommand, AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';
|
|
2
|
+
import { type AXMConfirmTwoFactorEnrollmentInput, type AXMConfirmTwoFactorEnrollmentResult } from '@acorex-platform/module-security-management-client/contracts';
|
|
3
|
+
import { UserTwoFactorService } from './user-two-factor.service';
|
|
4
|
+
export declare class ConfirmTwoFactorEnrollmentCommand implements AXPCommand<AXMConfirmTwoFactorEnrollmentInput, AXMConfirmTwoFactorEnrollmentResult> {
|
|
5
|
+
private readonly twoFactor;
|
|
6
|
+
constructor(twoFactor: UserTwoFactorService);
|
|
7
|
+
execute(input?: AXMConfirmTwoFactorEnrollmentInput): AXPCommandExecuteResultPromise<AXMConfirmTwoFactorEnrollmentResult>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ConfirmTwoFactorEnrollmentCommand = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const common_1 = require("@nestjs/common");
|
|
6
|
+
const abstract_1 = require("@acorex-platform/framework-server/domain/abstract");
|
|
7
|
+
const module_security_management_contracts_1 = require("@acorex-platform/module-security-management-client/contracts");
|
|
8
|
+
const user_two_factor_service_1 = require("./user-two-factor.service");
|
|
9
|
+
//#region ----- Confirm two-factor enrollment command -----
|
|
10
|
+
let ConfirmTwoFactorEnrollmentCommand = class ConfirmTwoFactorEnrollmentCommand {
|
|
11
|
+
constructor(twoFactor) {
|
|
12
|
+
this.twoFactor = twoFactor;
|
|
13
|
+
}
|
|
14
|
+
execute() {
|
|
15
|
+
return tslib_1.__awaiter(this, arguments, void 0, function* (input = { enrollmentId: '', code: '' }) {
|
|
16
|
+
const result = yield this.twoFactor.confirmEnrollment(input);
|
|
17
|
+
if (!result.success) {
|
|
18
|
+
return { success: false, message: { code: result.code } };
|
|
19
|
+
}
|
|
20
|
+
return { success: true, kind: 'object', data: result.data };
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
exports.ConfirmTwoFactorEnrollmentCommand = ConfirmTwoFactorEnrollmentCommand;
|
|
25
|
+
exports.ConfirmTwoFactorEnrollmentCommand = ConfirmTwoFactorEnrollmentCommand = tslib_1.__decorate([
|
|
26
|
+
(0, abstract_1.ServerHandler)({
|
|
27
|
+
key: module_security_management_contracts_1.AXMSecurityManagementServerCommands.ConfirmTwoFactorEnrollment,
|
|
28
|
+
auth: 'session',
|
|
29
|
+
}),
|
|
30
|
+
(0, common_1.Injectable)(),
|
|
31
|
+
tslib_1.__metadata("design:paramtypes", [user_two_factor_service_1.UserTwoFactorService])
|
|
32
|
+
], ConfirmTwoFactorEnrollmentCommand);
|
|
33
|
+
//#endregion
|
|
34
|
+
//# sourceMappingURL=confirm-two-factor-enrollment.command.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"confirm-two-factor-enrollment.command.js","sourceRoot":"","sources":["../../../../../../../libs/modules/security-management/server/src/lib/two-factor/confirm-two-factor-enrollment.command.ts"],"names":[],"mappings":";;;;AAAA,2CAA4C;AAE5C,gFAAkF;AAClF,gHAI+D;AAE/D,uEAAiE;AAEjE,2DAA2D;AAOpD,IAAM,iCAAiC,GAAvC,MAAM,iCAAiC;IAG5C,YAA6B,SAA+B;QAA/B,cAAS,GAAT,SAAS,CAAsB;IAAG,CAAC;IAE1D,OAAO;qEACX,QAA4C,EAAE,YAAY,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;YAE1E,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;YAC7D,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;gBACpB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC;YAC5D,CAAC;YACD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC;QAC9D,CAAC;KAAA;CACF,CAAA;AAdY,8EAAiC;4CAAjC,iCAAiC;IAL7C,IAAA,wBAAa,EAAC;QACb,GAAG,EAAE,0EAAmC,CAAC,0BAA0B;QACnE,IAAI,EAAE,SAAS;KAChB,CAAC;IACD,IAAA,mBAAU,GAAE;6CAI6B,8CAAoB;GAHjD,iCAAiC,CAc7C;AAED,YAAY"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { AXPCommand, AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';
|
|
2
|
+
import { type AXMDisableTwoFactorInput, type AXMDisableTwoFactorResult } from '@acorex-platform/module-security-management-client/contracts';
|
|
3
|
+
import { UserTwoFactorService } from './user-two-factor.service';
|
|
4
|
+
export declare class DisableTwoFactorCommand implements AXPCommand<AXMDisableTwoFactorInput, AXMDisableTwoFactorResult> {
|
|
5
|
+
private readonly twoFactor;
|
|
6
|
+
constructor(twoFactor: UserTwoFactorService);
|
|
7
|
+
execute(input?: AXMDisableTwoFactorInput): AXPCommandExecuteResultPromise<AXMDisableTwoFactorResult>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DisableTwoFactorCommand = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const common_1 = require("@nestjs/common");
|
|
6
|
+
const abstract_1 = require("@acorex-platform/framework-server/domain/abstract");
|
|
7
|
+
const module_security_management_contracts_1 = require("@acorex-platform/module-security-management-client/contracts");
|
|
8
|
+
const user_two_factor_service_1 = require("./user-two-factor.service");
|
|
9
|
+
//#region ----- Disable two-factor command -----
|
|
10
|
+
let DisableTwoFactorCommand = class DisableTwoFactorCommand {
|
|
11
|
+
constructor(twoFactor) {
|
|
12
|
+
this.twoFactor = twoFactor;
|
|
13
|
+
}
|
|
14
|
+
execute() {
|
|
15
|
+
return tslib_1.__awaiter(this, arguments, void 0, function* (input = {}) {
|
|
16
|
+
const result = yield this.twoFactor.disable(input);
|
|
17
|
+
if (!result.success) {
|
|
18
|
+
return { success: false, message: { code: result.code } };
|
|
19
|
+
}
|
|
20
|
+
return { success: true, kind: 'object', data: result.data };
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
exports.DisableTwoFactorCommand = DisableTwoFactorCommand;
|
|
25
|
+
exports.DisableTwoFactorCommand = DisableTwoFactorCommand = tslib_1.__decorate([
|
|
26
|
+
(0, abstract_1.ServerHandler)({ key: module_security_management_contracts_1.AXMSecurityManagementServerCommands.DisableTwoFactor, auth: 'session' }),
|
|
27
|
+
(0, common_1.Injectable)(),
|
|
28
|
+
tslib_1.__metadata("design:paramtypes", [user_two_factor_service_1.UserTwoFactorService])
|
|
29
|
+
], DisableTwoFactorCommand);
|
|
30
|
+
//#endregion
|
|
31
|
+
//# sourceMappingURL=disable-two-factor.command.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"disable-two-factor.command.js","sourceRoot":"","sources":["../../../../../../../libs/modules/security-management/server/src/lib/two-factor/disable-two-factor.command.ts"],"names":[],"mappings":";;;;AAAA,2CAA4C;AAE5C,gFAAkF;AAClF,gHAI+D;AAE/D,uEAAiE;AAEjE,gDAAgD;AAIzC,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;IAGlC,YAA6B,SAA+B;QAA/B,cAAS,GAAT,SAAS,CAAsB;IAAG,CAAC;IAE1D,OAAO;qEACX,QAAkC,EAAE;YAEpC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;YACnD,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;gBACpB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC;YAC5D,CAAC;YACD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC;QAC9D,CAAC;KAAA;CACF,CAAA;AAdY,0DAAuB;kCAAvB,uBAAuB;IAFnC,IAAA,wBAAa,EAAC,EAAE,GAAG,EAAE,0EAAmC,CAAC,gBAAgB,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;IAC7F,IAAA,mBAAU,GAAE;6CAI6B,8CAAoB;GAHjD,uBAAuB,CAcnC;AAED,YAAY"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { AXPCommand, AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';
|
|
2
|
+
import { type AXMGenerateTwoFactorRecoveryCodesInput, type AXMGenerateTwoFactorRecoveryCodesResult } from '@acorex-platform/module-security-management-client/contracts';
|
|
3
|
+
import { UserTwoFactorService } from './user-two-factor.service';
|
|
4
|
+
export declare class GenerateTwoFactorRecoveryCodesCommand implements AXPCommand<AXMGenerateTwoFactorRecoveryCodesInput, AXMGenerateTwoFactorRecoveryCodesResult> {
|
|
5
|
+
private readonly twoFactor;
|
|
6
|
+
constructor(twoFactor: UserTwoFactorService);
|
|
7
|
+
execute(input?: AXMGenerateTwoFactorRecoveryCodesInput): AXPCommandExecuteResultPromise<AXMGenerateTwoFactorRecoveryCodesResult>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GenerateTwoFactorRecoveryCodesCommand = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const common_1 = require("@nestjs/common");
|
|
6
|
+
const abstract_1 = require("@acorex-platform/framework-server/domain/abstract");
|
|
7
|
+
const module_security_management_contracts_1 = require("@acorex-platform/module-security-management-client/contracts");
|
|
8
|
+
const user_two_factor_service_1 = require("./user-two-factor.service");
|
|
9
|
+
//#region ----- Generate two-factor recovery codes command -----
|
|
10
|
+
let GenerateTwoFactorRecoveryCodesCommand = class GenerateTwoFactorRecoveryCodesCommand {
|
|
11
|
+
constructor(twoFactor) {
|
|
12
|
+
this.twoFactor = twoFactor;
|
|
13
|
+
}
|
|
14
|
+
execute() {
|
|
15
|
+
return tslib_1.__awaiter(this, arguments, void 0, function* (input = {}) {
|
|
16
|
+
const result = yield this.twoFactor.generateRecoveryCodes(input);
|
|
17
|
+
if (!result.success) {
|
|
18
|
+
return { success: false, message: { code: result.code } };
|
|
19
|
+
}
|
|
20
|
+
return { success: true, kind: 'object', data: result.data };
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
exports.GenerateTwoFactorRecoveryCodesCommand = GenerateTwoFactorRecoveryCodesCommand;
|
|
25
|
+
exports.GenerateTwoFactorRecoveryCodesCommand = GenerateTwoFactorRecoveryCodesCommand = tslib_1.__decorate([
|
|
26
|
+
(0, abstract_1.ServerHandler)({
|
|
27
|
+
key: module_security_management_contracts_1.AXMSecurityManagementServerCommands.GenerateTwoFactorRecoveryCodes,
|
|
28
|
+
auth: 'session',
|
|
29
|
+
}),
|
|
30
|
+
(0, common_1.Injectable)(),
|
|
31
|
+
tslib_1.__metadata("design:paramtypes", [user_two_factor_service_1.UserTwoFactorService])
|
|
32
|
+
], GenerateTwoFactorRecoveryCodesCommand);
|
|
33
|
+
//#endregion
|
|
34
|
+
//# sourceMappingURL=generate-two-factor-recovery-codes.command.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate-two-factor-recovery-codes.command.js","sourceRoot":"","sources":["../../../../../../../libs/modules/security-management/server/src/lib/two-factor/generate-two-factor-recovery-codes.command.ts"],"names":[],"mappings":";;;;AAAA,2CAA4C;AAE5C,gFAAkF;AAClF,gHAI+D;AAE/D,uEAAiE;AAEjE,gEAAgE;AAOzD,IAAM,qCAAqC,GAA3C,MAAM,qCAAqC;IAGhD,YAA6B,SAA+B;QAA/B,cAAS,GAAT,SAAS,CAAsB;IAAG,CAAC;IAE1D,OAAO;qEACX,QAAgD,EAAE;YAElD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,qBAAqB,CAAC,KAAK,CAAC,CAAC;YACjE,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;gBACpB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC;YAC5D,CAAC;YACD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC;QAC9D,CAAC;KAAA;CACF,CAAA;AAdY,sFAAqC;gDAArC,qCAAqC;IALjD,IAAA,wBAAa,EAAC;QACb,GAAG,EAAE,0EAAmC,CAAC,8BAA8B;QACvE,IAAI,EAAE,SAAS;KAChB,CAAC;IACD,IAAA,mBAAU,GAAE;6CAI6B,8CAAoB;GAHjD,qCAAqC,CAcjD;AAED,YAAY"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { AXPCommand, AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';
|
|
2
|
+
import { type AXMGetTwoFactorStatusResult } from '@acorex-platform/module-security-management-client/contracts';
|
|
3
|
+
import { UserTwoFactorService } from './user-two-factor.service';
|
|
4
|
+
export declare class GetTwoFactorStatusCommand implements AXPCommand<void, AXMGetTwoFactorStatusResult> {
|
|
5
|
+
private readonly twoFactor;
|
|
6
|
+
constructor(twoFactor: UserTwoFactorService);
|
|
7
|
+
execute(): AXPCommandExecuteResultPromise<AXMGetTwoFactorStatusResult>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetTwoFactorStatusCommand = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const common_1 = require("@nestjs/common");
|
|
6
|
+
const abstract_1 = require("@acorex-platform/framework-server/domain/abstract");
|
|
7
|
+
const module_security_management_contracts_1 = require("@acorex-platform/module-security-management-client/contracts");
|
|
8
|
+
const user_two_factor_service_1 = require("./user-two-factor.service");
|
|
9
|
+
//#region ----- Get two-factor status command -----
|
|
10
|
+
let GetTwoFactorStatusCommand = class GetTwoFactorStatusCommand {
|
|
11
|
+
constructor(twoFactor) {
|
|
12
|
+
this.twoFactor = twoFactor;
|
|
13
|
+
}
|
|
14
|
+
execute() {
|
|
15
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
16
|
+
const result = yield this.twoFactor.getStatus();
|
|
17
|
+
if (!result.success) {
|
|
18
|
+
return { success: false, message: { code: result.code } };
|
|
19
|
+
}
|
|
20
|
+
return { success: true, kind: 'object', data: result.data };
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
exports.GetTwoFactorStatusCommand = GetTwoFactorStatusCommand;
|
|
25
|
+
exports.GetTwoFactorStatusCommand = GetTwoFactorStatusCommand = tslib_1.__decorate([
|
|
26
|
+
(0, abstract_1.ServerHandler)({ key: module_security_management_contracts_1.AXMSecurityManagementServerCommands.GetTwoFactorStatus, auth: 'session' }),
|
|
27
|
+
(0, common_1.Injectable)(),
|
|
28
|
+
tslib_1.__metadata("design:paramtypes", [user_two_factor_service_1.UserTwoFactorService])
|
|
29
|
+
], GetTwoFactorStatusCommand);
|
|
30
|
+
//#endregion
|
|
31
|
+
//# sourceMappingURL=get-two-factor-status.command.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-two-factor-status.command.js","sourceRoot":"","sources":["../../../../../../../libs/modules/security-management/server/src/lib/two-factor/get-two-factor-status.command.ts"],"names":[],"mappings":";;;;AAAA,2CAA4C;AAE5C,gFAAkF;AAClF,gHAG+D;AAE/D,uEAAiE;AAEjE,mDAAmD;AAI5C,IAAM,yBAAyB,GAA/B,MAAM,yBAAyB;IACpC,YAA6B,SAA+B;QAA/B,cAAS,GAAT,SAAS,CAAsB;IAAG,CAAC;IAE1D,OAAO;;YACX,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE,CAAC;YAChD,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;gBACpB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC;YAC5D,CAAC;YACD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC;QAC9D,CAAC;KAAA;CACF,CAAA;AAVY,8DAAyB;oCAAzB,yBAAyB;IAFrC,IAAA,wBAAa,EAAC,EAAE,GAAG,EAAE,0EAAmC,CAAC,kBAAkB,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;IAC/F,IAAA,mBAAU,GAAE;6CAE6B,8CAAoB;GADjD,yBAAyB,CAUrC;AAED,YAAY"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { AXMUserTwoFactorRecoveryCode } from '@acorex-platform/module-security-management-client/contracts';
|
|
2
|
+
export declare function formatRecoveryCodeDisplay(code: string): string;
|
|
3
|
+
export declare function normalizeRecoveryCode(input: string): string;
|
|
4
|
+
export declare function generateRecoveryCodeSet(): Promise<{
|
|
5
|
+
plaintext: string[];
|
|
6
|
+
stored: AXMUserTwoFactorRecoveryCode[];
|
|
7
|
+
}>;
|
|
8
|
+
export declare function consumeRecoveryCode(codes: AXMUserTwoFactorRecoveryCode[] | undefined, input: string): Promise<{
|
|
9
|
+
matched: boolean;
|
|
10
|
+
next: AXMUserTwoFactorRecoveryCode[];
|
|
11
|
+
}>;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.formatRecoveryCodeDisplay = formatRecoveryCodeDisplay;
|
|
4
|
+
exports.normalizeRecoveryCode = normalizeRecoveryCode;
|
|
5
|
+
exports.generateRecoveryCodeSet = generateRecoveryCodeSet;
|
|
6
|
+
exports.consumeRecoveryCode = consumeRecoveryCode;
|
|
7
|
+
const tslib_1 = require("tslib");
|
|
8
|
+
const crypto_1 = require("crypto");
|
|
9
|
+
const core_1 = require("@acorex-platform/framework-shared/core");
|
|
10
|
+
//#region ----- Constants -----
|
|
11
|
+
const RECOVERY_CODE_COUNT = 10;
|
|
12
|
+
const RECOVERY_CODE_LENGTH = 8;
|
|
13
|
+
/** Ambiguous chars excluded: 0 O 1 I */
|
|
14
|
+
const RECOVERY_ALPHABET = 'ABCDEFGHJKLMNPQRSTUVWXYZ23456789';
|
|
15
|
+
//#endregion
|
|
16
|
+
//#region ----- Recovery codes -----
|
|
17
|
+
function randomRecoveryCode() {
|
|
18
|
+
const bytes = (0, crypto_1.randomBytes)(RECOVERY_CODE_LENGTH);
|
|
19
|
+
let out = '';
|
|
20
|
+
for (let i = 0; i < RECOVERY_CODE_LENGTH; i += 1) {
|
|
21
|
+
out += RECOVERY_ALPHABET[bytes[i] % RECOVERY_ALPHABET.length];
|
|
22
|
+
}
|
|
23
|
+
return out;
|
|
24
|
+
}
|
|
25
|
+
function formatRecoveryCodeDisplay(code) {
|
|
26
|
+
const cleaned = code.replace(/[^A-Za-z0-9]/g, '').toUpperCase();
|
|
27
|
+
if (cleaned.length !== RECOVERY_CODE_LENGTH) {
|
|
28
|
+
return cleaned;
|
|
29
|
+
}
|
|
30
|
+
return `${cleaned.slice(0, 4)}-${cleaned.slice(4)}`;
|
|
31
|
+
}
|
|
32
|
+
function normalizeRecoveryCode(input) {
|
|
33
|
+
return String(input !== null && input !== void 0 ? input : '')
|
|
34
|
+
.replace(/[^A-Za-z0-9]/g, '')
|
|
35
|
+
.toUpperCase();
|
|
36
|
+
}
|
|
37
|
+
function generateRecoveryCodeSet() {
|
|
38
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
39
|
+
const plaintext = [];
|
|
40
|
+
const stored = [];
|
|
41
|
+
for (let i = 0; i < RECOVERY_CODE_COUNT; i += 1) {
|
|
42
|
+
const code = randomRecoveryCode();
|
|
43
|
+
plaintext.push(formatRecoveryCodeDisplay(code));
|
|
44
|
+
stored.push({
|
|
45
|
+
hash: yield (0, core_1.hashPassword)(normalizeRecoveryCode(code)),
|
|
46
|
+
usedAt: null,
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
return { plaintext, stored };
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
function consumeRecoveryCode(codes, input) {
|
|
53
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
54
|
+
const normalized = normalizeRecoveryCode(input);
|
|
55
|
+
if (!normalized || !(codes === null || codes === void 0 ? void 0 : codes.length)) {
|
|
56
|
+
return { matched: false, next: codes !== null && codes !== void 0 ? codes : [] };
|
|
57
|
+
}
|
|
58
|
+
const next = codes.map((c) => (Object.assign({}, c)));
|
|
59
|
+
for (let i = 0; i < next.length; i += 1) {
|
|
60
|
+
const entry = next[i];
|
|
61
|
+
if (entry.usedAt) {
|
|
62
|
+
continue;
|
|
63
|
+
}
|
|
64
|
+
if (yield (0, core_1.verifyPassword)(normalized, entry.hash)) {
|
|
65
|
+
next[i] = Object.assign(Object.assign({}, entry), { usedAt: new Date().toISOString() });
|
|
66
|
+
return { matched: true, next };
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return { matched: false, next };
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
//#endregion
|
|
73
|
+
//# sourceMappingURL=recovery-codes.util.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recovery-codes.util.js","sourceRoot":"","sources":["../../../../../../../libs/modules/security-management/server/src/lib/two-factor/recovery-codes.util.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { AXPCommand, AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';
|
|
2
|
+
import { type AXMStartTwoFactorEnrollmentInput, type AXMStartTwoFactorEnrollmentResult } from '@acorex-platform/module-security-management-client/contracts';
|
|
3
|
+
import { UserTwoFactorService } from './user-two-factor.service';
|
|
4
|
+
export declare class StartTwoFactorEnrollmentCommand implements AXPCommand<AXMStartTwoFactorEnrollmentInput, AXMStartTwoFactorEnrollmentResult> {
|
|
5
|
+
private readonly twoFactor;
|
|
6
|
+
constructor(twoFactor: UserTwoFactorService);
|
|
7
|
+
execute(input?: AXMStartTwoFactorEnrollmentInput): AXPCommandExecuteResultPromise<AXMStartTwoFactorEnrollmentResult>;
|
|
8
|
+
}
|