Skip to content

Commit 00cf2d9

Browse files
committed
docs: Release version 0.5.0 with comprehensive security documentation and updated navigation
1 parent 40758af commit 00cf2d9

File tree

5 files changed

+774
-14
lines changed

5 files changed

+774
-14
lines changed

CHANGELOG.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,60 @@ All notable changes to Jazzy Framework will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [0.5.0] - 2025-01-27
9+
10+
### Added
11+
- **🔐 Comprehensive Security & Authentication System**
12+
- `@EnableJazzyAuth` annotation for one-line authentication setup
13+
- JWT token system with secure generation and validation
14+
- `SecurityConfig` abstract class for declarative URL-based security rules
15+
- Built-in authentication endpoints: `/register`, `/login`, `/me`
16+
- Role-based access control with USER and ADMIN roles
17+
- `SecurityInterceptor` for automatic request validation and protection
18+
19+
- **🎟️ JWT Token Management**
20+
- Configurable JWT secrets and expiration times
21+
- Secure token generation with BCrypt password hashing
22+
- Automatic token validation in protected endpoints
23+
- Token structure with user ID, email, roles, and timestamps
24+
25+
- **🛡️ SecurityConfig System**
26+
- Wildcard pattern support (`*`, `**`) for endpoint matching
27+
- Three security levels: public, secure (JWT required), admin (JWT + ADMIN role)
28+
- Flexible configuration with method-based security rules
29+
- Integration with existing DI container and routing system
30+
31+
- **🚦 Authentication Endpoints**
32+
- `POST /api/auth/register` - User registration with automatic password hashing
33+
- `POST /api/auth/login` - Authentication with JWT token response
34+
- `GET /api/auth/me` - Current user information retrieval
35+
- Standardized JSON responses with success/error handling
36+
37+
- **👤 User Entity Validation**
38+
- `UserEntityValidator` for automatic entity field validation
39+
- Support for EMAIL and USERNAME login methods
40+
- Required field checking and entity structure validation
41+
- Integration with existing repository pattern
42+
43+
- **🔄 Framework Integration**
44+
- `AuthProcessor` for automatic authentication configuration
45+
- Enhanced `RequestHandler` with SecurityInterceptor support
46+
- Enhanced `Server` with AuthProcessor integration
47+
- Enhanced `DIContainer` with component scanning methods
48+
49+
### Changed
50+
- Updated framework version to 0.5.0
51+
- Enhanced README.md with comprehensive security documentation
52+
- Updated project structure documentation with security components
53+
- Enhanced documentation site with authentication guide
54+
55+
### Technical Details
56+
- Added 9 new security-related classes in `jazzyframework.security` package
57+
- Automatic password hashing using BCrypt with secure salts
58+
- JWT implementation without external dependencies for minimal footprint
59+
- Pattern-based URL matching with efficient wildcard support
60+
- Seamless integration with existing CRUD and DI systems
61+
862
## [0.3.1] - 2025-01-27
963

1064
### Fixed

README.md

Lines changed: 122 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,26 @@
22

33
Jazzy is a lightweight web framework for Java. It provides a minimal and easy-to-understand API for developing fast web applications with a structure inspired by Laravel and Spring Boot.
44

5-
## 🚀 Latest Updates (v0.4.0)
5+
## 🚀 Latest Updates (v0.5.0)
66

7-
**NEW: Auto-CRUD System with Zero Boilerplate!**
7+
**NEW: Security & Authentication System!**
88

9-
Jazzy Framework 0.4 introduces revolutionary auto-CRUD capabilities that generate complete REST APIs with just annotations:
9+
Jazzy Framework 0.5 introduces a comprehensive security system with JWT-based authentication:
1010

11-
- 🎯 **@Crud Annotation**: Automatically generates all CRUD endpoints (GET, POST, PUT, DELETE)
12-
- 🔍 **Smart Search**: Built-in search functionality with configurable fields
13-
- 📊 **Pagination Support**: Automatic pagination with customizable page sizes
14-
- 🔄 **Batch Operations**: Support for bulk create, update, delete operations
15-
- 🎨 **Method Override**: Custom logic with @CrudOverride annotation
16-
- 📝 **Standardized Responses**: Consistent API response format with ApiResponse
17-
-**Zero Configuration**: Complete REST API with 3 lines of code
18-
- 🔧 **Highly Configurable**: Fine-tune behavior with comprehensive options
11+
- 🔐 **@EnableJazzyAuth Annotation**: One-line authentication setup for your applications
12+
- 🎟️ **JWT Token System**: Secure token generation and validation with configurable expiration
13+
- 🛡️ **SecurityConfig**: URL-based security rules with wildcard pattern support
14+
- 👤 **Built-in Auth Endpoints**: Automatic /register, /login, /me endpoints
15+
- 🔒 **Role-based Access Control**: ADMIN role support with extensible architecture
16+
- 🚦 **SecurityInterceptor**: Automatic request validation and protection
17+
-**Zero Boilerplate**: Complete authentication system with just annotations
18+
- 🔄 **Seamless Integration**: Works perfectly with existing DI and CRUD systems
1919

2020
## Version History
2121

2222
| Version | Release Date | Key Features |
2323
|---------|-------------|--------------|
24+
| **0.5.0** | 2025 | 🆕 **Security & Authentication** - JWT authentication, @EnableJazzyAuth annotation, role-based access control, SecurityConfig |
2425
| **0.4.0** | 2025 | 🆕 **Auto-CRUD System** - @Crud annotation, zero-boilerplate REST APIs, automatic endpoint generation, search & pagination |
2526
| **0.3.0** | 2025 | 🆕 **Database Integration** - Hibernate/JPA, Spring Data JPA-like repositories, automatic query generation, transaction management |
2627
| **0.2.0** | 2025 | 🆕 **Dependency Injection System**, Spring-like annotations, automatic component discovery, lifecycle management |
@@ -30,7 +31,7 @@ Jazzy Framework 0.4 introduces revolutionary auto-CRUD capabilities that generat
3031

3132
| Planned Version | Features |
3233
|----------------|----------|
33-
| **0.5.0** | 🔐 **Security & Authentication** - JWT support, role-based access control, security filters |
34+
| **0.6.0** | 🌐 **WebSocket Support** - Real-time communication, WebSocket controllers, broadcasting |
3435

3536
## Features
3637

@@ -72,8 +73,117 @@ Jazzy Framework 0.4 introduces revolutionary auto-CRUD capabilities that generat
7273
- **Validation Integration**: Built-in input validation for create/update operations
7374
- **Audit Logging**: Optional audit trail for all CRUD operations
7475

76+
### Security & Authentication (v0.5+)
77+
- **@EnableJazzyAuth Annotation**: One-annotation authentication setup with automatic endpoint registration
78+
- **JWT Token System**: Secure token generation, validation, and configurable expiration times
79+
- **SecurityConfig**: Declarative URL-based security rules with wildcard pattern support (*, **)
80+
- **Built-in Auth Endpoints**: Automatic /register, /login, /me endpoints with standardized responses
81+
- **Role-based Access Control**: ADMIN role support with extensible role system
82+
- **SecurityInterceptor**: Automatic request interception and security validation
83+
- **Password Security**: Built-in BCrypt password hashing and validation
84+
- **Seamless Integration**: Works with DI container, repositories, and existing framework components
85+
- **Flexible Configuration**: Support for custom JWT secrets, expiration times, and base paths
86+
7587
## Quick Start
7688

89+
### Secure Application with Authentication (v0.5 style) - Latest & Recommended
90+
91+
```java
92+
// 1. User Entity
93+
@Entity
94+
@Table(name = "users")
95+
public class User {
96+
@Id
97+
@GeneratedValue(strategy = GenerationType.IDENTITY)
98+
private Long id;
99+
100+
@Column(unique = true)
101+
private String email;
102+
103+
private String username;
104+
private String password;
105+
private String role = "USER"; // USER or ADMIN
106+
107+
// getters and setters...
108+
}
109+
110+
// 2. User Repository
111+
@Component
112+
public interface UserRepository extends BaseRepository<User, Long> {
113+
Optional<User> findByEmail(String email);
114+
Optional<User> findByUsername(String username);
115+
}
116+
117+
// 3. Security Configuration
118+
@Component
119+
public class AppSecurityConfig extends SecurityConfig {
120+
@Override
121+
public void configure() {
122+
// Public endpoints (no auth needed)
123+
publicEndpoints("/", "/api/auth/**");
124+
125+
// Secure endpoints (JWT required)
126+
requireAuth("/api/user/**", "/api/protected");
127+
128+
// Admin endpoints (JWT + ADMIN role required)
129+
requireRole("ADMIN", "/api/admin/**");
130+
}
131+
}
132+
133+
// 4. Main Application - That's it! Full authentication system with 1 annotation!
134+
@EnableJazzyAuth(
135+
userClass = User.class,
136+
repositoryClass = UserRepository.class,
137+
loginMethod = LoginMethod.EMAIL,
138+
jwtSecret = "your-secret-key",
139+
jwtExpirationHours = 24,
140+
authBasePath = "/api/auth"
141+
)
142+
public class AuthApp {
143+
public static void main(String[] args) {
144+
Config config = new Config();
145+
Router router = new Router();
146+
147+
// Security is automatically configured!
148+
// Available endpoints:
149+
// POST /api/auth/register - User registration
150+
// POST /api/auth/login - User login
151+
// GET /api/auth/me - Current user info
152+
153+
Server server = new Server(router, config);
154+
server.start(8080);
155+
}
156+
}
157+
```
158+
159+
**🎉 Result**: You now have a complete authentication system with JWT tokens, role-based access control, and protected endpoints!
160+
161+
### Complete Secure CRUD Application (v0.5 + v0.4)
162+
163+
```java
164+
// Combine authentication with auto-CRUD for the ultimate experience
165+
@EnableJazzyAuth(
166+
userClass = User.class,
167+
repositoryClass = UserRepository.class,
168+
loginMethod = LoginMethod.EMAIL
169+
)
170+
public class SecureCrudApp {
171+
public static void main(String[] args) {
172+
Config config = new Config();
173+
Router router = new Router();
174+
175+
Server server = new Server(router, config);
176+
server.start(8080);
177+
178+
// You now have:
179+
// - Complete authentication system (/api/auth/*)
180+
// - Role-based security on all endpoints
181+
// - JWT token protection
182+
// - Auto-CRUD endpoints (if using @Crud controllers)
183+
}
184+
}
185+
```
186+
77187
### Auto-CRUD Application (v0.4 style) - Recommended
78188

79189
```java

0 commit comments

Comments
 (0)