-
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
Zaiidmoumni
wants to merge
96
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
96 commits
Select commit
Hold shift + click to select a range
9064224
refactor: create services files for further SoC
Zaiidmoumni 1c674fb
refactor: update authKit Module to not ever call any db, and delete c…
Zaiidmoumni 072c1b5
refactor: create repositories files for further SoC
Zaiidmoumni 7e26f30
refactor: create proper package json file #deleted unnecessary matters
Zaiidmoumni 0d4e691
refactor: update database models and packages configs
Zaiidmoumni cebc953
refactor: create DTOs files
Zaiidmoumni 466ed8f
refactor: update register dto
Zaiidmoumni 8d99d8d
refactor: remove business logic from auth controller
Zaiidmoumni a68656e
refactor: update user model
Zaiidmoumni 901b9bc
refactor: create an auth business logic service file
Zaiidmoumni 99356dd
refactor: create user repository file, for db interaction;
Zaiidmoumni fe24559
refactor: add alias paths to tsconfig
Zaiidmoumni 6dfb884
refactor: create mail service
Zaiidmoumni 80134e1
refactor: update authservice and remove all client references from th…
Zaiidmoumni b18bf55
refactor: Update the authentication guard, and wiring new implementat…
Zaiidmoumni afd7672
refactor: create admin user-management controller
Zaiidmoumni b71395b
refactor: delete duplicated auth middleware
Zaiidmoumni cf3fc2f
refactor: create user-management repository
Zaiidmoumni 3b3f684
refactor: create user-management admin servie
Zaiidmoumni b824734
refactor: create role-update dto
Zaiidmoumni 4c6289e
refactor: separating DTOs folder, create roles&permissions DTOs
Zaiidmoumni be490a7
refactor: create roles & permissions HTTP controllers
Zaiidmoumni 6fdc267
refactor: create roles & permissions Repositories
Zaiidmoumni 2ab5999
refactor: delete unnecessary unused files
Zaiidmoumni 0d243aa
refactor: create role middleware and admin decorator, alongside defau…
Zaiidmoumni bd13dfa
refactor: create roles & seed services, and update user roles
Zaiidmoumni 8d847fc
refactor: delete password reset controller, create roles & permission…
Zaiidmoumni 080db87
refactor: update role dto
Zaiidmoumni 87e9c7e
refactor: updated roles repository
Zaiidmoumni eecf66b
refactor: wiring updates in authkitModule and exporting needed export…
Zaiidmoumni 1e8f2e6
refactor: delete db config (unneded), and setting up default role ass…
Zaiidmoumni 91c58d0
refactor: create admin guard and update the service and decorator
Zaiidmoumni 09643dc
refactor: wiring and exporting new admin service & guard
Zaiidmoumni 91a465e
refactor: exporting admin providers in auth kit module, updated env v…
Zaiidmoumni 2a1fbd4
refactor: removing unnecessary types
Zaiidmoumni a974a67
refactor: created oAuth Service
Zaiidmoumni e53a1ee
refactor: added OAuth endpoints for all providers
Zaiidmoumni 7261bbb
refactor: updated passport strategy
Zaiidmoumni 6824de3
updated authentication middleware and auth controller with OAUth endp…
Zaiidmoumni 2167a1c
created oauth service and updated auth service
Zaiidmoumni d288018
wiring all new implementations into authkit module
Zaiidmoumni c680adb
doc: update readme file
Zaiidmoumni e938792
refactor: Secure auth routes
Zaiidmoumni d68c293
refactor: register oAuth Strategy once the module in init
Zaiidmoumni 73cc584
refactor: create a new .envexample
Zaiidmoumni b9bc533
refactor: fix build errors withing typescript stricts
Zaiidmoumni 5f15b10
refactor: fix dependencies misInstallation
Zaiidmoumni feaf388
refactor: update userModel to pass null PhoneNumberValues
Zaiidmoumni 5f82cd9
refactor: update user repository to have a proper password finding me…
Zaiidmoumni 8b486bb
refactor: enhance auth service for login paths
Zaiidmoumni 67cb444
refactor: fix peerDependencies issues
Zaiidmoumni 3009800
refactor: Update OAuth strategies
Zaiidmoumni df70473
refactor: adjust the auth controller and models for OAuth fix
Zaiidmoumni 2e74eee
DOC: Update Readme documentation#
Zaiidmoumni 391fcac
fixing merge conflicts from Master branch
Zaiidmoumni 7cd8cbb
refactor: update user model to contain new fields, and omitting usern…
Zaiidmoumni 78d9fac
refactor: update user model to contain new fields, and omitting usern…
Zaiidmoumni 3bea46f
feat: implement comprehensive error handling system
Zaiidmoumni a78c64c
Merge branch 'develop' of github.com:CISCODE-MA/AuthKit into develop
Zaiidmoumni d7dd80a
Fix merge conflicts
Zaiidmoumni 3bcb6cc
chore create new user service funcion to retrieve user data
Zaiidmoumni c4ab64e
chore: added users `me` end point
Zaiidmoumni a05eed2
docs: updated README doc for new endpoint implementation
Zaiidmoumni b11b921
Pull master remote branch
Zaiidmoumni a419adb
docs(workflow): add Git Flow and npm version requirements (#6)
Zaiidmoumni 550d890
docs: translate italian text to english and add comprehensive documen…
Zaiidmoumni 79e2cdf
1.5.1
Zaiidmoumni 2953c54
aligned branches
Zaiidmoumni affc471
chore: upgrade dependencies to latest versions
Zaiidmoumni 465f89c
1.5.3
Zaiidmoumni 87bcb44
chore(auth): add eslint 9 and jest configuration
Zaiidmoumni 4fb2998
fix(auth): resolve lint errors and code formatting
Zaiidmoumni 3cbb453
chore(auth): add standardized CI/CD workflows
Zaiidmoumni 342cc21
chore(auth): update dependencies
Zaiidmoumni 62de3b8
fix(security): address CodeQL alerts - add workflow permissions and s…
Zaiidmoumni ea47c29
fix(security): use inline CodeQL suppressions for Mongoose false posi…
Zaiidmoumni e1b3f8f
fixed merge conflicts
Zaiidmoumni f651c0f
chore: clean up merge conflict duplicates in dependencies
Zaiidmoumni 816a066
chore(fix) : format errors
Zaiidmoumni 4bd9994
fix(security): add CodeQL config to suppress Mongoose false positives
Zaiidmoumni 8c84841
chore(tests): lowered coverage threshold
Zaiidmoumni 21c40d1
chore: add .npmignore, dependabot, and npm audit to release workflow
Zaiidmoumni 91d652d
added dependabot config to workflows
Zaiidmoumni 44532a6
chore: added comprehensive changesets for release automation
Zaiidmoumni 2e9ad41
Operations (#10)
Zaiidmoumni 4bcce8d
merging remote
Zaiidmoumni 3e15d93
Refactor/module 001 align architecture csr (#11)
Zaiidmoumni 2cddd97
Refactor/module 001 align architecture csr (#12)
Zaiidmoumni 3a572ba
Refactor/module 001 align architecture csr (#13)
Zaiidmoumni 376ac53
ops: UPDATED publish workflow and dependabot PR limits
Zaiidmoumni 0efcb28
ops (ci): standardize publish validation and dependabot across all pa…
Zaiidmoumni ed7f768
security: added CODEOWNER file for branches security
Zaiidmoumni d30ee7f
ops: updated relese check workflow#
Zaiidmoumni 7368801
ci: update release check workflow
Zaiidmoumni 0b607e4
ops: updated release check jobs
Zaiidmoumni 8de264d
chore: disable publish/release workflows and clear CODEOWNERS for OSS…
Zaiidmoumni 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 | ||
| # ============================================================================= |
Empty file.
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.
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.