PromptBase
Upgrade
Close icon
General
Home
Marketplace
Create
Hire
Login
Chat
Sell
Explore

Prompt Details

Model
Chat - (gpt-5.5)
Token size
336
Example input
[PROGRAMMING LANGUAGE]: Python with FastAPI, SQLAlchemy, and PostgreSQL [CODE CHANGE OR PULL REQUEST DETAILS]: Implemented a customer authentication system with JWT-based login, password hashing, user registration, and role-based permissions [PROJECT CONTEXT]: A cloud-based SaaS platform that helps small businesses manage customer accounts, subscriptions, and billing workflows [REVIEW FOCUS AREAS]: Security vulnerabilities, API architecture, database performance, authentication best practices, testing coverage, and production scalability
Example output
Senior Engineering Code Review Report Pull Request Review Summary Project: Cloud-based SaaS Customer Management Platform Technology Stack: Python, FastAPI, SQLAlchemy, PostgreSQL Feature Reviewed: Customer authentication system with JWT login, password hashing, user registration, and role-based permissions Overall Assessment: The implementation demonstrates a solid foundation for a modern authentication system. The selected technologies are appropriate for a scalable SaaS platform, and the feature set covers essential identity management requirements. However, before production deployment, several areas require improvement, particularly around security hardening, token management, database design, testing depth, and long-term maintainability. Review Decision: ⚠️ Request Changes Before Approval The feature is architecturally sound but requires additional security controls and production-readiness improvements. --- Positive Findings 1. Appropriate Technology Selection Comment: FastAPI combined with SQLAlchemy and PostgreSQL is a strong choice for building a scalable API-driven SaaS platform. Why it works well: FastAPI provides excellent performance and automatic API documentation. SQLAlchemy provides flexible database abstraction. PostgreSQL supports reliable transactional workloads. Recommendation: Continue with this architecture while introducing stronger application-layer security patterns. --- 2. Secure Password Handling Approach Comment: Using password hashing instead of storing plain-text credentials is the correct security approach. Recommended Improvements: Use modern hashing algorithms such as: Argon2id bcrypt Add configurable password strength requirements. Implement protection against repeated failed login attempts. Example improvement: PasswordPolicy: - Minimum 12 characters - Require complexity checks - Prevent commonly leaked passwords --- 3. Role-Based Access Control Implementation Comment: Introducing role-based permissions is valuable for a SaaS environment where different users require different access levels. Potential roles: ADMIN MANAGER CUSTOMER_SUPPORT CUSTOMER Recommendation: Avoid hardcoding permissions directly inside route handlers. Instead, create a permission layer: User | Role | Permissions | API Access Rules This will make future expansion easier. --- Critical Issues Requiring Attention 1. JWT Security Management Risk Level: High JWT implementation requires careful handling to avoid authentication vulnerabilities. Potential concerns: Long-lived access tokens Missing token rotation Weak signing secrets Poor refresh token management Recommended Approach: Implement: Access Token: - Short expiration time - Example: 15 minutes Refresh Token: - Longer expiration - Stored securely - Rotated after usage Additional security: Store refresh tokens in the database. Revoke compromised sessions. Track device sessions. --- 2. Missing Account Security Features Risk Level: High A production SaaS authentication system should include additional protections. Recommended additions: Login Protection Implement: Rate limiting Temporary account lockout Suspicious login detection Example: 5 failed attempts ↓ 15-minute account lock ↓ Security notification --- Multi-Factor Authentication For business accounts, consider adding: TOTP authentication Email verification Backup recovery codes --- 3. Database Design Review Risk Level: Medium The authentication database schema should be carefully designed. Recommended structure: Users Table users ----- id email password_hash is_active created_at updated_at Roles Table roles ----- id name User Roles Table user_roles ----------- user_id role_id This provides flexibility compared with storing roles directly in the users table. --- 4. API Architecture Improvements Risk Level: Medium Authentication logic should be separated from business logic. Recommended structure: app/ ├── api/ │ └── routes/ │ ├── services/ │ └── auth_service.py │ ├── models/ │ ├── schemas/ │ ├── security/ │ └── jwt.py │ └── database/ Benefits: Easier testing Cleaner maintenance Better scalability --- 5. Error Handling Improvements Risk Level: Medium Avoid exposing sensitive authentication details. Avoid: { "error": "User does not exist" } Better: { "error": "Invalid email or password" } This prevents user enumeration attacks. --- Performance Review Database Optimization Recommended improvements: Add indexes: CREATE INDEX idx_users_email ON users(email); Benefits: Faster authentication queries Better scalability with large user databases --- Connection Management Ensure PostgreSQL connections use pooling. Recommended: SQLAlchemy Connection Pool + Production Database Configuration Avoid creating a new database connection per request. --- Testing Recommendations Required Test Coverage Authentication Tests Include: ✅ Successful login ✅ Invalid password ✅ Expired token ✅ Refresh token rotation ✅ Disabled account access ✅ Permission denial --- Security Tests Add: Brute-force simulation Token manipulation tests SQL injection testing Permission bypass testing --- Code Quality Recommendations Add Type Validation Use Pydantic models: Example: class UserCreate(BaseModel): email: EmailStr password: str Benefits: Cleaner validation Better API documentation Reduced runtime errors --- Suggested Refactoring Plan Phase 1 — Security Hardening Priority: Critical Implement: Refresh token system Rate limiting Strong password policies Security logging --- Phase 2 — Architecture Improvement Priority: High Implement: Authentication service layer Permission management system Better database abstraction --- Phase 3 — Production Optimization Priority: Medium Implement: Monitoring Performance tracking Automated security testing --- Final Senior Engineer Recommendation The authentication system has a strong technical foundation and uses an appropriate technology stack for a SaaS platform. The main improvements required are not fundamental architectural changes but production-grade security enhancements and better separation of responsibilities. Final Status: ⚠️ Request Changes Approval Conditions: ✅ Implement secure JWT lifecycle management ✅ Add authentication security protections ✅ Improve testing coverage ✅ Introduce scalable permission architecture ✅ Add production monitoring and logging After these improvements, the feature would be suitable for deployment in a professional SaaS environment.
🤖 GPT

Aureon Code Intelligence

Add to Cart
Instant accessInstant access
Usage rightsCommercial use
Money-back guaranteeMoney‑back
By purchasing this prompt, you agree to our terms of service
GPT-5.5
Tested icon
Guide icon
4 examples icon
Free credits icon
Upgrade your software development workflow with an AI-powered senior code reviewer that delivers expert pull request feedback, identifies hidden issues, improves code quality, and teaches better engineering practices. This advanced system helps developers and teams receive actionable reviews, architectural insights, security considerations, and optimization recommendations—bringing experienced engineering judgment directly into every coding process.
...more
Added 1 week ago
Report
Browse Marketplace