Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
243c9aa
Update package-lock.json: Remove TypeORM dependencies, add Prisma
clintjeff2 Jun 4, 2025
a9ce87d
Update package.json: Replace TypeORM with Prisma dependencies
clintjeff2 Jun 4, 2025
7857f2f
Update Prisma service: Add proper connection lifecycle management
clintjeff2 Jun 4, 2025
6115921
Update Prisma schema: Add ShortenedAddress model with proper relation…
clintjeff2 Jun 4, 2025
12a6f66
Add Prisma migrations: Database schema migration from TypeORM to Prisma
clintjeff2 Jun 4, 2025
3ccff9c
Update Tools DTOs: Remove TypeORM decorators, keep validation
clintjeff2 Jun 4, 2025
2755223
Update Tools filter DTO: Migrate from TypeORM to Prisma compatible st…
clintjeff2 Jun 4, 2025
5a331ae
Update Tool DTO: Remove TypeORM entity references
clintjeff2 Jun 4, 2025
418d878
Remove TypeORM entities: Delete tool and tool-access-log entities
clintjeff2 Jun 4, 2025
df6be32
Migrate ToolAccessLog service: Replace TypeORM repository with Prisma…
clintjeff2 Jun 4, 2025
07dec7c
Update Tool controller: Adapt to Prisma service changes
clintjeff2 Jun 4, 2025
456f2e0
Update Tool module: Remove TypeORM imports, add Prisma dependencies
clintjeff2 Jun 4, 2025
643c9a2
Migrate Tool service: Replace TypeORM repository with Prisma client o…
clintjeff2 Jun 4, 2025
e8c1df3
Update AppModule: Remove TypeORM configuration, add ShortenerModule i…
clintjeff2 Jun 4, 2025
8629ff6
Remove old SmartContractModule: Replaced with ShortenerModule
clintjeff2 Jun 4, 2025
d23110f
Update shorten-address DTOs: Clean up imports and maintain validation
clintjeff2 Jun 4, 2025
8ea87e2
Add create-shortened-address DTO: New DTO for Prisma model structure
clintjeff2 Jun 4, 2025
c24bf7a
Add update-shortened-address DTO: Partial DTO for updates
clintjeff2 Jun 4, 2025
0fc67ea
Remove SmartContract entity: Replaced with Prisma ShortenedAddress model
clintjeff2 Jun 4, 2025
bccd45c
Update Shortener service: Migrate from TypeORM to Prisma with improve…
clintjeff2 Jun 4, 2025
d77cdc8
Add ShortenerModule: New module with Prisma dependencies and utilities
clintjeff2 Jun 4, 2025
ba55015
Update Auth module: Remove TypeORM imports, keep Prisma service
clintjeff2 Jun 4, 2025
14fd478
Update create-user DTO: Remove TypeORM decorators, maintain validation
clintjeff2 Jun 4, 2025
143d336
Update login DTO: Clean up imports and validation
clintjeff2 Jun 4, 2025
8c5a50d
Update refresh-token DTO: Remove TypeORM references
clintjeff2 Jun 4, 2025
3544c20
Update resend-otp DTO: Clean validation and imports
clintjeff2 Jun 4, 2025
22a0fc7
Update verify-otp DTO: Remove TypeORM dependencies
clintjeff2 Jun 4, 2025
1ea7a7e
Remove User entity: Replaced with Prisma User model
clintjeff2 Jun 4, 2025
9232771
Update OTP service: Migrate from TypeORM repository to Prisma client
clintjeff2 Jun 4, 2025
32495d9
Add git utility script: Helper for repository management
clintjeff2 Jun 4, 2025
780d558
Apply global middleware structure and bootstrap JWT auth guard for PD…
clintjeff2 Jun 4, 2025
2646cfc
Protect /pdf/generate endpoint with JWT Auth Guard (#15)
clintjeff2 Jun 4, 2025
c0bf1ea
Customize JWT Auth Guard logic to support token validation for protec…
clintjeff2 Jun 4, 2025
863c352
Implement JWT strategy for validating tokens in Authorization headers…
clintjeff2 Jun 4, 2025
d4e551d
Add custom exception filter to format auth-related errors for protect…
clintjeff2 Jun 4, 2025
c82faba
exported userAuthModule and imported it in pdf
clintjeff2 Jun 4, 2025
fcb82dc
commented out error causing module
clintjeff2 Jun 4, 2025
d4ff652
feat: add PDF generation logging model to database schema
clintjeff2 Jun 4, 2025
7fc66d0
feat: implement comprehensive PDF logging service
clintjeff2 Jun 4, 2025
175e694
feat: integrate comprehensive logging into PDF generation controller
clintjeff2 Jun 4, 2025
5dfb643
feat: integrate PDF logging service into module configuration
clintjeff2 Jun 4, 2025
b928c2e
Fixed error: imported request before creating authentication request …
clintjeff2 Jun 4, 2025
1be76cb
feat: add rate limiting environment variables
clintjeff2 Jun 5, 2025
42f6114
feat: update env example with rate limiting config
clintjeff2 Jun 5, 2025
8c78f90
feat: add RateLimitViolation model to schema
clintjeff2 Jun 5, 2025
ae6b3df
feat: implement rate limiting service with violation logging
clintjeff2 Jun 5, 2025
7cae191
feat: add PDF rate limiting guard
clintjeff2 Jun 5, 2025
c2d1e2a
feat: add rate limit cleanup task
clintjeff2 Jun 5, 2025
21ab41c
feat: integrate rate limiting into PDF controller
clintjeff2 Jun 5, 2025
37b6f44
feat: update PDF module with rate limiting dependencies
clintjeff2 Jun 5, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion backend/.env.development
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,11 @@ ENABLE_DETAILED_LOGGING=true

CONTRACT_ADDRESS=
CONTRACT_ABI=
ADMIN_SIGNER=
ADMIN_SIGNER=

# Rate Limiting Configuration
PDF_RATE_LIMIT_WINDOW_MS=60000
PDF_RATE_LIMIT_MAX_REQUESTS=20
PDF_RATE_LIMIT_TRACK_BY_USER=true

DATABASE_URL=postgresql://postgres:password@localhost:5432/scavtools
10 changes: 9 additions & 1 deletion backend/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,12 @@ ENABLE_DETAILED_LOGGING=true

CONTRACT_ADDRESS=
CONTRACT_ABI=
ADMIN_SIGNER=
ADMIN_SIGNER=


# Rate Limiting Configuration
PDF_RATE_LIMIT_WINDOW_MS=60000
PDF_RATE_LIMIT_MAX_REQUESTS=20
PDF_RATE_LIMIT_TRACK_BY_USER=true

DATABASE_URL=postgresql://postgres:password@localhost:5432/scavtools
23 changes: 23 additions & 0 deletions backend/common/filters/auth-exception.filter.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import {
ExceptionFilter,
Catch,
ArgumentsHost,
UnauthorizedException,
} from '@nestjs/common';
import { Response } from 'express';

@Catch(UnauthorizedException)
export class AuthExceptionFilter implements ExceptionFilter {
catch(exception: UnauthorizedException, host: ArgumentsHost) {
const ctx = host.switchToHttp();
const response = ctx.getResponse<Response>();
const status = exception.getStatus();

response.status(status).json({
statusCode: status,
message: exception.message,
error: 'Unauthorized',
timestamp: new Date().toISOString(),
});
}
}
Empty file added backend/git.sh
Empty file.
Loading