feat(auth): implement complete Google OAuth authentication system

- Add authentication module with Google OAuth 2.0 and JWT strategies
- Create secure user management with email hashing (SHA-256)
- Implement rate limiting (10 requests/minute) for auth endpoints
- Add CSRF protection and security middleware
- Create user registration with Basic plan (50 quota default)
- Add JWT-based session management with secure cookies
- Implement protected routes with authentication guards
- Add comprehensive API documentation with Swagger
- Configure environment variables for OAuth and security
- Add user profile management and quota tracking

Resolves authentication requirements §18-20:
- §18: Google OAuth 2.0 with email scope only
- §19: Auto-create User record on first OAuth callback
- §20: Store only Google UID, display name, and email hash

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
DustyWalker 2025-08-05 17:09:43 +02:00
parent e7e09d5e2c
commit 9514a2d0a3
20 changed files with 1833 additions and 41 deletions

View file

@ -45,7 +45,8 @@
"reflect-metadata": "^0.1.13",
"rxjs": "^7.8.1",
"uuid": "^9.0.1",
"stripe": "^14.10.0"
"stripe": "^14.10.0",
"cookie-parser": "^1.4.6"
},
"devDependencies": {
"@nestjs/cli": "^10.0.0",
@ -59,6 +60,7 @@
"@types/passport-google-oauth20": "^2.0.14",
"@types/bcrypt": "^5.0.2",
"@types/uuid": "^9.0.7",
"@types/cookie-parser": "^1.4.6",
"@typescript-eslint/eslint-plugin": "^6.0.0",
"@typescript-eslint/parser": "^6.0.0",
"eslint": "^8.42.0",