feat(identity): redesign identity module and introduce RBAC foundation

- Redesign the Identity module with a richer domain model.
- Extend the User entity to support username, Authentik integration, activity tracking, and storage information.
- Add Role and Permission domain models with many-to-many relationships.
- Implement RBAC foundation using UserRole, RolePermission, and UserPermission mappings.
- Add user storage quota and usage fields with default values.
- Introduce Authentik identifiers and synchronization metadata.
- Refactor user domain logic for role and permission management.
- Update Prisma schema to support the new identity architecture.
- Improve JWT authentication and permission guard integration.
- Update repositories, handlers, controllers, mappers, DTOs, and Swagger configuration.
- Refresh environment configuration and project dependencies.
This commit is contained in:
Rayyan
2026-08-02 00:25:36 +07:00
parent fdbfb34842
commit 7ce0de4e91
132 changed files with 7754 additions and 2037 deletions
+6 -1
View File
@@ -11,6 +11,7 @@
"scripts": {
"start": "node dist/main.js",
"start:dev": "ts-node-dev --respawn --pretty --transpile-only src/main.ts",
"start:debug": "nest start --debug --watch",
"build": "tsc -p tsconfig.json",
"lint": "eslint \"src/**/*.ts\"",
"format": "prettier --write \"src/**/*.ts\" \"tests/**/*.ts\"",
@@ -37,6 +38,8 @@
"class-transformer": "^0.5.1",
"class-validator": "^0.14.2",
"dotenv": "^16.6.1",
"jose": "^6.2.6",
"openid-client": "^6.5.0",
"jsonwebtoken": "^9.0.2",
"passport": "^0.7.0",
"passport-jwt": "^4.0.1",
@@ -47,6 +50,9 @@
"uuid": "^11.1.0"
},
"devDependencies": {
"@eslint/js": "^9.21.0",
"@nestjs/testing": "^10.4.22",
"@playwright/test": "^1.62.1",
"@types/bcrypt": "^5.0.2",
"@types/jest": "^29.5.14",
"@types/node": "^22.13.10",
@@ -56,7 +62,6 @@
"@typescript-eslint/eslint-plugin": "^8.25.0",
"@typescript-eslint/parser": "^8.25.0",
"eslint": "^9.21.0",
"@eslint/js": "^9.21.0",
"globals": "^16.0.0",
"jest": "^29.7.0",
"prettier": "^3.5.3",