-
Notifications
You must be signed in to change notification settings - Fork 0
Develop #14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Zaiidmo
wants to merge
95
commits into
master
Choose a base branch
from
develop
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Develop #14
Changes from all commits
Commits
Show all changes
95 commits
Select commit
Hold shift + click to select a range
9064224
refactor: create services files for further SoC
Zaiidmo 1c674fb
refactor: update authKit Module to not ever call any db, and delete c…
Zaiidmo 072c1b5
refactor: create repositories files for further SoC
Zaiidmo 7e26f30
refactor: create proper package json file #deleted unnecessary matters
Zaiidmo 0d4e691
refactor: update database models and packages configs
Zaiidmo cebc953
refactor: create DTOs files
Zaiidmo 466ed8f
refactor: update register dto
Zaiidmo 8d99d8d
refactor: remove business logic from auth controller
Zaiidmo a68656e
refactor: update user model
Zaiidmo 901b9bc
refactor: create an auth business logic service file
Zaiidmo 99356dd
refactor: create user repository file, for db interaction;
Zaiidmo fe24559
refactor: add alias paths to tsconfig
Zaiidmo 6dfb884
refactor: create mail service
Zaiidmo 80134e1
refactor: update authservice and remove all client references from th…
Zaiidmo b18bf55
refactor: Update the authentication guard, and wiring new implementat…
Zaiidmo afd7672
refactor: create admin user-management controller
Zaiidmo b71395b
refactor: delete duplicated auth middleware
Zaiidmo cf3fc2f
refactor: create user-management repository
Zaiidmo 3b3f684
refactor: create user-management admin servie
Zaiidmo b824734
refactor: create role-update dto
Zaiidmo 4c6289e
refactor: separating DTOs folder, create roles&permissions DTOs
Zaiidmo be490a7
refactor: create roles & permissions HTTP controllers
Zaiidmo 6fdc267
refactor: create roles & permissions Repositories
Zaiidmo 2ab5999
refactor: delete unnecessary unused files
Zaiidmo 0d243aa
refactor: create role middleware and admin decorator, alongside defau…
Zaiidmo bd13dfa
refactor: create roles & seed services, and update user roles
Zaiidmo 8d847fc
refactor: delete password reset controller, create roles & permission…
Zaiidmo 080db87
refactor: update role dto
Zaiidmo 87e9c7e
refactor: updated roles repository
Zaiidmo eecf66b
refactor: wiring updates in authkitModule and exporting needed export…
Zaiidmo 1e8f2e6
refactor: delete db config (unneded), and setting up default role ass…
Zaiidmo 91c58d0
refactor: create admin guard and update the service and decorator
Zaiidmo 09643dc
refactor: wiring and exporting new admin service & guard
Zaiidmo 91a465e
refactor: exporting admin providers in auth kit module, updated env v…
Zaiidmo 2a1fbd4
refactor: removing unnecessary types
Zaiidmo a974a67
refactor: created oAuth Service
Zaiidmo e53a1ee
refactor: added OAuth endpoints for all providers
Zaiidmo 7261bbb
refactor: updated passport strategy
Zaiidmo 6824de3
updated authentication middleware and auth controller with OAUth endp…
Zaiidmo 2167a1c
created oauth service and updated auth service
Zaiidmo d288018
wiring all new implementations into authkit module
Zaiidmo c680adb
doc: update readme file
Zaiidmo e938792
refactor: Secure auth routes
Zaiidmo d68c293
refactor: register oAuth Strategy once the module in init
Zaiidmo 73cc584
refactor: create a new .envexample
Zaiidmo b9bc533
refactor: fix build errors withing typescript stricts
Zaiidmo 5f15b10
refactor: fix dependencies misInstallation
Zaiidmo feaf388
refactor: update userModel to pass null PhoneNumberValues
Zaiidmo 5f82cd9
refactor: update user repository to have a proper password finding me…
Zaiidmo 8b486bb
refactor: enhance auth service for login paths
Zaiidmo 67cb444
refactor: fix peerDependencies issues
Zaiidmo 3009800
refactor: Update OAuth strategies
Zaiidmo df70473
refactor: adjust the auth controller and models for OAuth fix
Zaiidmo 2e74eee
DOC: Update Readme documentation#
Zaiidmo 391fcac
fixing merge conflicts from Master branch
Zaiidmo 7cd8cbb
refactor: update user model to contain new fields, and omitting usern…
Zaiidmo 78d9fac
refactor: update user model to contain new fields, and omitting usern…
Zaiidmo 3bea46f
feat: implement comprehensive error handling system
Zaiidmo a78c64c
Merge branch 'develop' of github.com:CISCODE-MA/AuthKit into develop
Zaiidmo d7dd80a
Fix merge conflicts
Zaiidmo 3bcb6cc
chore create new user service funcion to retrieve user data
Zaiidmo c4ab64e
chore: added users `me` end point
Zaiidmo a05eed2
docs: updated README doc for new endpoint implementation
Zaiidmo b11b921
Pull master remote branch
Zaiidmo a419adb
docs(workflow): add Git Flow and npm version requirements (#6)
Zaiidmo 550d890
docs: translate italian text to english and add comprehensive documen…
Zaiidmo 79e2cdf
1.5.1
Zaiidmo 2953c54
aligned branches
Zaiidmo affc471
chore: upgrade dependencies to latest versions
Zaiidmo 465f89c
1.5.3
Zaiidmo 87bcb44
chore(auth): add eslint 9 and jest configuration
Zaiidmo 4fb2998
fix(auth): resolve lint errors and code formatting
Zaiidmo 3cbb453
chore(auth): add standardized CI/CD workflows
Zaiidmo 342cc21
chore(auth): update dependencies
Zaiidmo 62de3b8
fix(security): address CodeQL alerts - add workflow permissions and s…
Zaiidmo ea47c29
fix(security): use inline CodeQL suppressions for Mongoose false posi…
Zaiidmo e1b3f8f
fixed merge conflicts
Zaiidmo f651c0f
chore: clean up merge conflict duplicates in dependencies
Zaiidmo 816a066
chore(fix) : format errors
Zaiidmo 4bd9994
fix(security): add CodeQL config to suppress Mongoose false positives
Zaiidmo 8c84841
chore(tests): lowered coverage threshold
Zaiidmo 21c40d1
chore: add .npmignore, dependabot, and npm audit to release workflow
Zaiidmo 91d652d
added dependabot config to workflows
Zaiidmo 44532a6
chore: added comprehensive changesets for release automation
Zaiidmo 2e9ad41
Operations (#10)
Zaiidmo 4bcce8d
merging remote
Zaiidmo 3e15d93
Refactor/module 001 align architecture csr (#11)
Zaiidmo 2cddd97
Refactor/module 001 align architecture csr (#12)
Zaiidmo 3a572ba
Refactor/module 001 align architecture csr (#13)
Zaiidmo 376ac53
ops: UPDATED publish workflow and dependabot PR limits
Zaiidmo 0efcb28
ops (ci): standardize publish validation and dependabot across all pa…
Zaiidmo ed7f768
security: added CODEOWNER file for branches security
Zaiidmo d30ee7f
ops: updated relese check workflow#
Zaiidmo 7368801
ci: update release check workflow
Zaiidmo 0b607e4
ops: updated release check jobs
Zaiidmo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| --- | ||
| '@ciscode/authentication-kit': minor | ||
| --- | ||
|
|
||
| # AuthKit v1.6.0 Release | ||
|
|
||
| ## 🏗️ Architecture Improvements | ||
|
|
||
| - **MODULE-001 Alignment**: Refactored codebase to align with Controller-Service-Repository (CSR) pattern | ||
| - **OAuth Refactoring**: Restructured OAuthService into modular provider architecture (Google, Facebook, GitHub) | ||
| - **Code Organization**: Reorganized test utilities and extracted common test helpers to reduce duplication | ||
|
|
||
| ## 🔒 Security Fixes | ||
|
|
||
| - **Fixed Hardcoded Passwords**: Eliminated all password literals from test files using dynamic constant generation | ||
| - Created centralized test password constants with dynamic generation pattern | ||
| - Replaced 20+ instances across 5 test files (auth.service, auth.controller, users.service, users.controller, user.repository) | ||
| - Addresses SonarQube S2068 rule violations | ||
| - **Improved Test Isolation**: All test passwords now generated via TEST_PASSWORDS constants | ||
|
|
||
| ## ✅ Quality Improvements | ||
|
|
||
| - **Test Coverage**: Added comprehensive unit and integration tests | ||
| - AuthService: 40 tests (100% coverage) | ||
| - AuthController: 25 tests | ||
| - Users and Permissions services: 22+ tests each | ||
| - Guards and RBAC integration: 5+ integration tests | ||
| - OAuth providers: Comprehensive provider tests with stability fixes | ||
| - **Code Quality**: Reduced code duplication by ~33 lines in guard tests | ||
| - **CI/CD**: Enhanced GitHub workflows with Dependabot configuration for automated security updates | ||
|
|
||
| ## 🐛 Bug Fixes | ||
|
|
||
| - Fixed race condition in FacebookOAuthProvider test mock chains | ||
| - Fixed configuration error handling in guard tests | ||
| - Resolved merge conflicts with develop branch | ||
|
|
||
| ## 📦 Dependencies | ||
|
|
||
| - No breaking changes | ||
| - All existing APIs remain compatible | ||
| - Security-focused improvements only affect test infrastructure | ||
|
|
||
| ## Migration Notes | ||
|
|
||
| No migration needed. This release is fully backward compatible - all security and quality improvements are internal to the package. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| { | ||
| "$schema": "https://unpkg.com/@changesets/config@3.0.0/schema.json", | ||
| "changelog": "@changesets/cli/changelog", | ||
| "commit": false, | ||
| "fixed": [], | ||
| "linked": [], | ||
| "access": "public", | ||
| "baseBranch": "develop", | ||
| "updateInternalDependencies": "patch", | ||
| "ignore": [], | ||
| "repo": "ciscode/nest-js-developer-kit", | ||
| "preState": null | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,144 @@ | ||
| # ============================================================================= | ||
| # Auth Kit - Environment Configuration Template | ||
| # Generated: 2026-02-04 | ||
| # | ||
| # ISTRUZIONI: | ||
| # 1. Copia questo file in .env | ||
| # 2. Compila i valori necessari | ||
| # 3. Vedi docs/CREDENTIALS_NEEDED.md per dettagli | ||
| # ============================================================================= | ||
|
|
||
| # ----------------------------------------------------------------------------- | ||
| # DATABASE (OBBLIGATORIO) | ||
| # ----------------------------------------------------------------------------- | ||
| # Opzione 1: MongoDB locale (per development/testing) | ||
| MONGO_URI=mongodb://127.0.0.1:27017/auth_kit_test | ||
|
|
||
| # Opzione 2: MongoDB Atlas (per staging/production) | ||
| # MONGO_URI=mongodb+srv://<username>:<password>@cluster0.xxxxx.mongodb.net/<database>?retryWrites=true&w=majority | ||
|
|
||
| # ----------------------------------------------------------------------------- | ||
| # JWT SECRETS (OBBLIGATORIO) | ||
| # | ||
| # GENERA AUTOMATICAMENTE CON: | ||
| # .\scripts\setup-env.ps1 -GenerateSecrets | ||
| # | ||
| # O MANUALMENTE (min 32 caratteri casuali ciascuno): | ||
| # ----------------------------------------------------------------------------- | ||
| JWT_SECRET=GENERA_CON_SCRIPT_O_FORNISCI_SECRET_SICURO_MIN_32_CHAR | ||
| JWT_ACCESS_TOKEN_EXPIRES_IN=15m | ||
|
|
||
| JWT_REFRESH_SECRET=GENERA_CON_SCRIPT_O_FORNISCI_SECRET_SICURO_MIN_32_CHAR | ||
| JWT_REFRESH_TOKEN_EXPIRES_IN=7d | ||
|
|
||
| JWT_EMAIL_SECRET=GENERA_CON_SCRIPT_O_FORNISCI_SECRET_SICURO_MIN_32_CHAR | ||
| JWT_EMAIL_TOKEN_EXPIRES_IN=1d | ||
|
|
||
| JWT_RESET_SECRET=GENERA_CON_SCRIPT_O_FORNISCI_SECRET_SICURO_MIN_32_CHAR | ||
| JWT_RESET_TOKEN_EXPIRES_IN=1h | ||
|
|
||
| # ----------------------------------------------------------------------------- | ||
| # EMAIL / SMTP (OBBLIGATORIO per email verification e password reset) | ||
| # | ||
| # RACCOMANDATO: Mailtrap (gratis per testing) | ||
| # https://mailtrap.io/ | ||
| # | ||
| # Copia credentials da: Dashboard → My Inbox → SMTP Settings | ||
| # ----------------------------------------------------------------------------- | ||
| SMTP_HOST=sandbox.smtp.mailtrap.io | ||
| SMTP_PORT=2525 | ||
| SMTP_USER=YOUR_MAILTRAP_USERNAME_HERE | ||
| SMTP_PASS=YOUR_MAILTRAP_PASSWORD_HERE | ||
| SMTP_SECURE=false | ||
| FROM_EMAIL=no-reply@test.com | ||
|
|
||
| # ----------------------------------------------------------------------------- | ||
| # Alternativa: Gmail (SCONSIGLIATO per testing, più complicato) | ||
| # Richiede: 2FA enabled + App Password generata | ||
| # ----------------------------------------------------------------------------- | ||
| # SMTP_HOST=smtp.gmail.com | ||
| # SMTP_PORT=587 | ||
| # SMTP_USER=your.email@gmail.com | ||
| # SMTP_PASS=your_16_char_app_password | ||
| # SMTP_SECURE=false | ||
| # FROM_EMAIL=your.email@gmail.com | ||
|
|
||
| # ----------------------------------------------------------------------------- | ||
| # APPLICATION URLS | ||
| # ----------------------------------------------------------------------------- | ||
| FRONTEND_URL=http://localhost:3000 | ||
| BACKEND_URL=http://localhost:3000 | ||
|
|
||
| # ----------------------------------------------------------------------------- | ||
| # GOOGLE OAUTH (OPZIONALE - per Google login) | ||
| # | ||
| # Setup: https://console.cloud.google.com/ | ||
| # Guida: docs/CREDENTIALS_NEEDED.md → Google OAuth | ||
| # | ||
| # Required: | ||
| # - Create project | ||
| # - Enable Google+ API | ||
| # - Create OAuth 2.0 Client ID (Web application) | ||
| # - Add redirect URI: http://localhost:3000/api/auth/google/callback | ||
| # ----------------------------------------------------------------------------- | ||
| GOOGLE_CLIENT_ID= | ||
| GOOGLE_CLIENT_SECRET= | ||
| GOOGLE_CALLBACK_URL=http://localhost:3000/api/auth/google/callback | ||
|
|
||
| # ----------------------------------------------------------------------------- | ||
| # MICROSOFT OAUTH (OPZIONALE - per Microsoft/Azure AD login) | ||
| # | ||
| # Setup: https://portal.azure.com/ | ||
| # Guida: docs/CREDENTIALS_NEEDED.md → Microsoft OAuth | ||
| # | ||
| # Required: | ||
| # - App registration (Entra ID) | ||
| # - Redirect URI: http://localhost:3000/api/auth/microsoft/callback | ||
| # - Client secret generato | ||
| # - API permissions: User.Read, openid, profile, email | ||
| # ----------------------------------------------------------------------------- | ||
| MICROSOFT_CLIENT_ID= | ||
| MICROSOFT_CLIENT_SECRET= | ||
| MICROSOFT_CALLBACK_URL=http://localhost:3000/api/auth/microsoft/callback | ||
| MICROSOFT_TENANT_ID=common | ||
|
|
||
| # ----------------------------------------------------------------------------- | ||
| # FACEBOOK OAUTH (OPZIONALE - per Facebook login) | ||
| # | ||
| # Setup: https://developers.facebook.com/ | ||
| # Guida: docs/CREDENTIALS_NEEDED.md → Facebook OAuth | ||
| # | ||
| # Required: | ||
| # - Create app (Consumer type) | ||
| # - Add Facebook Login product | ||
| # - Valid OAuth Redirect: http://localhost:3000/api/auth/facebook/callback | ||
| # ----------------------------------------------------------------------------- | ||
| FB_CLIENT_ID= | ||
| FB_CLIENT_SECRET= | ||
| FB_CALLBACK_URL=http://localhost:3000/api/auth/facebook/callback | ||
|
|
||
| # ----------------------------------------------------------------------------- | ||
| # ENVIRONMENT | ||
| # ----------------------------------------------------------------------------- | ||
| NODE_ENV=development | ||
|
|
||
| # ============================================================================= | ||
| # CHECKLIST: | ||
| # | ||
| # OBBLIGATORIO (per funzionare): | ||
| # [ ] JWT secrets generati (4 secrets) - usa script automatico | ||
| # [ ] MongoDB running e MONGO_URI configurato | ||
| # [ ] SMTP credentials (Mailtrap) - serve per email verification | ||
| # | ||
| # OPZIONALE (per OAuth providers): | ||
| # [ ] Google OAuth credentials (se vuoi Google login) | ||
| # [ ] Microsoft OAuth credentials (se vuoi Microsoft login) | ||
| # [ ] Facebook OAuth credentials (se vuoi Facebook login) | ||
| # | ||
| # NEXT STEPS: | ||
| # 1. Compila valori necessari | ||
| # 2. Rinomina in .env | ||
| # 3. Verifica con: .\scripts\setup-env.ps1 -Validate | ||
| # 4. Avvia backend: npm run start:dev | ||
| # 5. Test endpoints: docs/TESTING_GUIDE.md | ||
| # ============================================================================= |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| * @CISCODE-MA/devops |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| name: 'CodeQL Config for AuthKit' | ||
|
|
||
| # Suppress false positives for Mongoose queries | ||
| # Mongoose automatically sanitizes all query parameters | ||
| query-filters: | ||
| - exclude: | ||
| id: js/sql-injection | ||
| paths: | ||
| - src/repositories/user.repository.ts | ||
| - src/repositories/role.repository.ts | ||
| - src/repositories/permission.repository.ts |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| version: 2 | ||
| updates: | ||
| - package-ecosystem: npm | ||
| directory: "/" | ||
| schedule: | ||
| interval: monthly | ||
| open-pull-requests-limit: 1 | ||
| groups: | ||
| npm-dependencies: | ||
| patterns: | ||
| - "*" | ||
| assignees: | ||
| - CISCODE-MA/cloud-devops | ||
| labels: | ||
| - "dependencies" | ||
| - "npm" | ||
| commit-message: | ||
| prefix: "chore(deps)" | ||
| include: "scope" | ||
| rebase-strategy: auto |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Changesets
repofield appears to point to a different repository (ciscode/nest-js-developer-kit). This can produce incorrect links/metadata in generated changelogs/releases. Update it to the correct AuthKit repository identifier.