Skip to content

Commit ea52a21

Browse files
committed
Update the index.html
1 parent 502d06b commit ea52a21

11 files changed

Lines changed: 575 additions & 21 deletions

File tree

README.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@ Welcome to the tinystruct framework documentation. This documentation provides c
66

77
欢迎查阅 tinystruct 框架文档。本文档为使用和开发 tinystruct 框架提供全面的指导。
88

9-
## What's New in v1.7.18
9+
## What's New in v1.7.29
1010

11-
- **Enhanced AI Integration**: Built-in support for AI integration and plugin-based architecture
12-
- **MCP Server Support**: Integration with Model Context Protocol (MCP) for advanced AI capabilities
13-
- **Improved Performance**: Handling over 86,000 requests per second with ultra-low latency (~17ms)
14-
- **HTTP Method-Specific Actions**: Support for HTTP method-specific routing (GET, POST, PUT, DELETE, etc.)
15-
- **Modern Architecture**: No `main()` method required - start applications directly with CLI commands
16-
- **Modular Design**: Plugin-based architecture for extensibility
17-
- **Multiple Server Options**: Support for Netty, Tomcat, and Undertow
18-
- **SSE Support**: Built-in Server-Sent Events support for real-time applications
11+
- **Asymmetric RSA & Configurable JWT Security**: RSA public/private key pairs and flexible configuration via `application.properties`
12+
- **Advanced HTTP Server Security**: Host header filtering (`server.name`), path traversal prevention, and secure cookies
13+
- **Decoupled Architecture**: Domain-independent `HttpServer` and `SSEPushManager` for seamless multi-domain deployments
14+
- **Enhanced MCP & AI Support**: Overloaded tool methods, schema merging, idle session watchdogs, and auto-cleanup
15+
- **ANSI Console Logging**: Modern color-coded console logs with Java 9+ `StackWalker` caller tracing
16+
- **Configurable HTTP Timeouts**: Custom connect and read timeouts on `URLRequest` and `HTTPHandler`
17+
- **High Performance**: Handling over 86,000 requests per second with ultra-low latency (~17ms)
18+
- **Detailed Release Notes**: See [What's New in 1.7.29](en/whats-new-1.7.29.md) ([中文版](zh/whats-new-1.7.29.md))
1919

2020
## Choose Your Language / 选择语言
2121

@@ -28,6 +28,7 @@ Welcome to the tinystruct framework documentation. This documentation provides c
2828
- [Database Integration](en/database.md)
2929
- [Advanced Features](en/advanced-features.md)
3030
- [Best Practices](en/best-practices.md)
31+
- [What's New in 1.7.29](en/whats-new-1.7.29.md)
3132
- API Reference
3233
- [Application API](en/api/application.md)
3334
- [Action API](en/api/action.md)
@@ -43,6 +44,7 @@ Welcome to the tinystruct framework documentation. This documentation provides c
4344
- [数据库集成](zh/database.md)
4445
- [高级特性](zh/advanced-features.md)
4546
- [最佳实践](zh/best-practices.md)
47+
- [1.7.29 新特性](zh/whats-new-1.7.29.md)
4648
- API参考
4749
- [应用程序 API](zh/api/application.md)
4850
- [动作 API](zh/api/action.md)
@@ -68,7 +70,7 @@ Add the dependency to your `pom.xml`:
6870
<dependency>
6971
<groupId>org.tinystruct</groupId>
7072
<artifactId>tinystruct</artifactId>
71-
<version>1.7.19</version>
73+
<version>1.7.29</version>
7274
<classifier>jar-with-dependencies</classifier>
7375
</dependency>
7476
```

assets/css/style.css

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,83 @@ img, video {
172172
border-top: 1px solid rgba(255, 255, 255, 0.1);
173173
}
174174

175+
/* Version / Release Notes nav group */
176+
.nav-group-toggle {
177+
width: 100%;
178+
background: none;
179+
border: none;
180+
cursor: pointer;
181+
text-align: left;
182+
/* inherits .nav-link styles */
183+
justify-content: flex-start;
184+
}
185+
186+
.nav-group-toggle .nav-chevron {
187+
margin-left: auto;
188+
margin-right: 0;
189+
width: 16px;
190+
height: 16px;
191+
font-size: 1rem;
192+
transition: transform 0.25s ease;
193+
flex-shrink: 0;
194+
}
195+
196+
.nav-group.open > .nav-group-toggle .nav-chevron {
197+
transform: rotate(90deg);
198+
}
199+
200+
.nav-submenu {
201+
list-style: none;
202+
padding: 0;
203+
margin: 0;
204+
overflow: hidden;
205+
max-height: 0;
206+
transition: max-height 0.3s ease, opacity 0.25s ease;
207+
opacity: 0;
208+
}
209+
210+
.nav-group.open > .nav-submenu {
211+
max-height: 300px;
212+
opacity: 1;
213+
}
214+
215+
.nav-sublink {
216+
display: flex;
217+
align-items: center;
218+
gap: 0.6rem;
219+
padding: 0.5rem 1rem 0.5rem 2.8rem;
220+
color: var(--sidebar-text);
221+
text-decoration: none;
222+
font-size: 0.85rem;
223+
font-weight: 500;
224+
border-radius: 0.4rem;
225+
transition: background 0.2s ease, color 0.2s ease;
226+
}
227+
228+
.nav-sublink:hover {
229+
background-color: rgba(255, 255, 255, 0.08);
230+
color: var(--sidebar-text-hover);
231+
}
232+
233+
.version-tag {
234+
display: inline-flex;
235+
align-items: center;
236+
padding: 0.15rem 0.45rem;
237+
border-radius: 4px;
238+
font-size: 0.72rem;
239+
font-weight: 700;
240+
letter-spacing: 0.03em;
241+
background: rgba(99, 102, 241, 0.3);
242+
color: #a5b4fc;
243+
white-space: nowrap;
244+
flex-shrink: 0;
245+
}
246+
247+
.version-tag.latest {
248+
background: rgba(16, 185, 129, 0.25);
249+
color: #6ee7b7;
250+
}
251+
175252
/* Main Content */
176253
.main-content {
177254
margin-left: var(--sidebar-width);
@@ -380,6 +457,51 @@ img, video {
380457
text-transform: uppercase;
381458
}
382459

460+
.code-actions {
461+
display: flex;
462+
align-items: center;
463+
gap: 0.5rem;
464+
}
465+
466+
.copy-btn {
467+
background: transparent;
468+
border: none;
469+
color: #94a3b8;
470+
cursor: pointer;
471+
padding: 4px;
472+
border-radius: 4px;
473+
display: inline-flex;
474+
align-items: center;
475+
justify-content: center;
476+
transition: color 0.2s ease, background-color 0.2s ease, opacity 0.2s ease, transform 0.15s ease;
477+
opacity: 0;
478+
line-height: 1;
479+
}
480+
481+
.code-block:hover .copy-btn,
482+
.code-block:focus-within .copy-btn {
483+
opacity: 1;
484+
}
485+
486+
.copy-btn:hover {
487+
color: #ffffff;
488+
background-color: rgba(255, 255, 255, 0.12);
489+
}
490+
491+
.copy-btn:active {
492+
transform: scale(0.92);
493+
}
494+
495+
.copy-btn.copied {
496+
color: #10b981;
497+
opacity: 1;
498+
}
499+
500+
.copy-btn ion-icon {
501+
font-size: 1.1rem;
502+
pointer-events: none;
503+
}
504+
383505
/* Performance Chart Placeholder */
384506
.perf-chart {
385507
height: 200px;

en/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Add the dependency to your pom.xml:
2828
<dependency>
2929
<groupId>org.tinystruct</groupId>
3030
<artifactId>tinystruct</artifactId>
31-
<version>1.7.28</version>
31+
<version>1.7.29</version>
3232
<classifier>jar-with-dependencies</classifier>
3333
</dependency>
3434
```

en/SUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* [Database Integration](database.md)
1010
* [Advanced Features](advanced-features.md)
1111
* [Best Practices](best-practices.md)
12+
* [What's New in 1.7.29](whats-new-1.7.29.md)
1213
* [What's New in 1.7.23](whats-new-1.7.23.md)
1314

1415
## API Reference

en/getting-started.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Add the tinystruct dependency to your project's `pom.xml` file:
2929
<dependency>
3030
<groupId>org.tinystruct</groupId>
3131
<artifactId>tinystruct</artifactId>
32-
<version>1.7.28</version>
32+
<version>1.7.29</version>
3333
<classifier>jar-with-dependencies</classifier>
3434
</dependency>
3535
```

en/whats-new-1.7.29.md

Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
# What's New in tinystruct 1.7.29
2+
3+
This document highlights the new features, security enhancements, performance improvements, and changes introduced in tinystruct version 1.7.29.
4+
5+
> See also: [What's New in 1.7.23](whats-new-1.7.23.md) for earlier features including automated POJO generation and native `LocalDateTime` support.
6+
7+
---
8+
9+
## Highlights of 1.7.29
10+
11+
- **Asymmetric RSA & Configurable JWT Security**: Support for RSA public/private key pairs and flexible configuration via `application.properties`.
12+
- **Advanced HTTP Server Security & Host Filtering**: Host header restriction via `server.name`, robust path traversal prevention, environment-based error masking, and secure cookie handling.
13+
- **Decoupled Architecture & Domain Independence**: Removed hardcoded server domain dependencies from `HttpServer` and `SSEPushManager` for seamless multi-domain, containerized, and local development.
14+
- **Model Context Protocol (MCP) & AI Enhancements**: Support for overloaded tool methods, schema merging, idle session watchdogs, automatic cleanup, and enhanced error resiliency.
15+
- **Modern ANSI Console Logging & StackWalker Caller Tracing**: Color-coded console log formatting with zero-overhead, precise caller location resolution.
16+
- **Configurable HTTP Client Timeouts**: Connect and read timeout configurations on `URLRequest` and `HTTPHandler`.
17+
- **Dependency Upgrades**: Latest minor/patch updates for SQLite JDBC (3.53.2.1), JUnit Jupiter (6.1.1), JNA (5.19.1), and Apache Kafka (4.3.1).
18+
19+
---
20+
21+
## Major New Features & Enhancements
22+
23+
### 1. Asymmetric RSA & Configurable JWT Security
24+
25+
The `JWTManager` now supports both symmetric HMAC keys and asymmetric RSA public/private key pairs, enabling enterprise-grade authentication topologies (e.g., signing tokens on an auth server with a private key and validating them on resource servers with a public key).
26+
27+
#### RSA Key Pair Support in `JWTManager`:
28+
```java
29+
JWTManager jwtManager = new JWTManager();
30+
31+
// Sign using RSA Private Key (Base64 PKCS#8)
32+
jwtManager.withPrivateKey(base64PrivateKey);
33+
String token = jwtManager.createToken(builder);
34+
35+
// Verify using RSA Public Key (Base64 X.509)
36+
jwtManager.withPublicKey(base64PublicKey);
37+
Map<String, Object> claims = jwtManager.verify(token);
38+
```
39+
40+
#### Declarative Configuration in `application.properties`:
41+
The built-in HTTP server automatically reads JWT configuration for Bearer token validation:
42+
43+
```properties
44+
# Verify with RSA Public Key (Base64 X.509 format)
45+
jwt.key.public=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQE...
46+
47+
# Or verify with HMAC Secret
48+
jwt.secret=your-256-bit-secret-key-here
49+
jwt.secret.format=plain # 'plain' or 'base64' (default)
50+
51+
# Optional JWT validation timezone
52+
jwt.timezone=UTC
53+
```
54+
55+
---
56+
57+
### 2. HTTP Server Security Controls & Host Filtering
58+
59+
#### Host Header Validation (`server.name`):
60+
Prevent HTTP Host header attacks by restricting incoming requests to configured domain names or hostnames.
61+
62+
```properties
63+
# Restrict requests to specified Host headers (comma-separated). Leave empty to allow all.
64+
server.name=localhost:8080, api.example.com, example.com
65+
```
66+
67+
#### Path Traversal Protection:
68+
Static resource resolution in `HttpServer` and `Dispatcher` has been fortified using `Path.normalize()` against base directory bounds checks to prevent unauthorized file access across all operating systems.
69+
70+
#### Secure Cookies & Environment-Aware Error Responses:
71+
- Automatic `Secure` cookie flag assignment for HTTPS requests.
72+
- Server error messages automatically mask internal exception details in `production` while providing diagnostic information when `system.environment=development`.
73+
74+
---
75+
76+
### 3. Model Context Protocol (MCP) & AI Integration Advancements
77+
78+
The Model Context Protocol (MCP) implementation received substantial upgrades for enterprise AI tool exposure:
79+
80+
- **Overloaded Tool Methods**: `MCPServer` now supports overloaded methods with identical action paths by merging input schemas and routing parameters dynamically.
81+
- **Session Watchdog & Idle Cleanup**: Integrated ping handler, keep-alive watchdog, and automatic session cleanup for disconnected AI clients.
82+
- **Direct POJO Registration**: Expose any POJO or service directly to AI models without having to inherit from `MCPTool`.
83+
84+
```java
85+
public class CustomMCPServer extends MCPServer {
86+
@Override
87+
public void init() {
88+
super.init();
89+
// Register any plain object directly
90+
this.registerTool(new CalculatorService());
91+
}
92+
}
93+
```
94+
95+
---
96+
97+
### 4. ANSI Console Logging with StackWalker Tracing
98+
99+
Logging has been upgraded with a high-performance programmatic formatter:
100+
- **ANSI Color Coding**: Distinct visual levels (INFO, WARNING, SEVERE, DEBUG).
101+
- **Precise Caller Tracing**: Utilizes Java 9+ `StackWalker` for zero-overhead, accurate source class, method name, and line number resolution.
102+
- **Default INFO Level**: Standard logging enabled by default with clean formatting.
103+
104+
---
105+
106+
### 5. Configurable HTTP Client Timeouts & Browser Automation
107+
108+
- **`URLRequest` & `HTTPHandler` Timeouts**: Added explicit `connectTimeout` and `readTimeout` methods.
109+
```java
110+
URLRequest request = new URLRequest(new URL("https://api.example.com/data"))
111+
.setConnectTimeout(5000) // 5 seconds
112+
.setReadTimeout(10000); // 10 seconds
113+
```
114+
- **Open-Browser Integration**: Configure the HTTP server to automatically open the default browser on launch via `server.openbrowser=true` and `server.openbrowser.command`.
115+
116+
---
117+
118+
### 6. Dependency Upgrades
119+
120+
| Library | Previous Version | New Version (1.7.29) |
121+
|---|---|---|
122+
| **SQLite JDBC** | 3.45.1.0 | `3.53.2.1` |
123+
| **JUnit Jupiter** | 5.10.2 | `6.1.1` |
124+
| **JNA** | 5.14.0 | `5.19.1` |
125+
| **Apache Kafka** | 3.7.0 | `4.3.1` |
126+
| **Maven Assembly Plugin** | 2.2-beta-5 | `3.7.1` |
127+
128+
---
129+
130+
## Migration Guide
131+
132+
### Updating to 1.7.29
133+
134+
Update your `pom.xml` dependency to version `1.7.29`:
135+
136+
```xml
137+
<dependency>
138+
<groupId>org.tinystruct</groupId>
139+
<artifactId>tinystruct</artifactId>
140+
<version>1.7.29</version>
141+
</dependency>
142+
```
143+
144+
#### JWT Secret Configuration
145+
If you use plain text secrets in `application.properties`, specify `jwt.secret.format=plain`:
146+
147+
```properties
148+
jwt.secret=my-plain-text-secret-key
149+
jwt.secret.format=plain
150+
```
151+
152+
---
153+
154+
## Community and Resources
155+
156+
- **GitHub Repository**: <https://github.com/tinystruct/tinystruct>
157+
- **Official Documentation**: <https://tinystruct.org>
158+
- **Examples**: <https://github.com/tinystruct/tinystruct-examples>
159+
- **Project Archetype**: <https://github.com/tinystruct/tinystruct-archetype>

0 commit comments

Comments
 (0)