This document highlights the new features, security enhancements, performance improvements, and changes introduced in tinystruct version 1.7.29.
See also: What’s New in 1.7.23 for earlier features including automated POJO generation and native
LocalDateTimesupport.
application.properties.server.name, robust path traversal prevention, environment-based error masking, and secure cookie handling.HttpServer and SSEPushManager for seamless multi-domain, containerized, and local development.URLRequest and HTTPHandler.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).
JWTManager:JWTManager jwtManager = new JWTManager();
// Sign using RSA Private Key (Base64 PKCS#8)
jwtManager.withPrivateKey(base64PrivateKey);
String token = jwtManager.createToken(builder);
// Verify using RSA Public Key (Base64 X.509)
jwtManager.withPublicKey(base64PublicKey);
Map<String, Object> claims = jwtManager.verify(token);
application.properties:The built-in HTTP server automatically reads JWT configuration for Bearer token validation:
# Verify with RSA Public Key (Base64 X.509 format)
jwt.key.public=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQE...
# Or verify with HMAC Secret
jwt.secret=your-256-bit-secret-key-here
jwt.secret.format=plain # 'plain' or 'base64' (default)
# Optional JWT validation timezone
jwt.timezone=UTC
server.name):Prevent HTTP Host header attacks by restricting incoming requests to configured domain names or hostnames.
# Restrict requests to specified Host headers (comma-separated). Leave empty to allow all.
server.name=localhost:8080, api.example.com, example.com
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.
Secure cookie flag assignment for HTTPS requests.production while providing diagnostic information when system.environment=development.The Model Context Protocol (MCP) implementation received substantial upgrades for enterprise AI tool exposure:
MCPServer now supports overloaded methods with identical action paths by merging input schemas and routing parameters dynamically.MCPTool.public class CustomMCPServer extends MCPServer {
@Override
public void init() {
super.init();
// Register any plain object directly
this.registerTool(new CalculatorService());
}
}
Logging has been upgraded with a high-performance programmatic formatter:
StackWalker for zero-overhead, accurate source class, method name, and line number resolution.URLRequest & HTTPHandler Timeouts: Added explicit connectTimeout and readTimeout methods.
URLRequest request = new URLRequest(new URL("https://api.example.com/data"))
.setConnectTimeout(5000) // 5 seconds
.setReadTimeout(10000); // 10 seconds
server.openbrowser=true and server.openbrowser.command.| Library | Previous Version | New Version (1.7.29) |
|---|---|---|
| SQLite JDBC | 3.45.1.0 | 3.53.2.1 |
| JUnit Jupiter | 5.10.2 | 6.1.1 |
| JNA | 5.14.0 | 5.19.1 |
| Apache Kafka | 3.7.0 | 4.3.1 |
| Maven Assembly Plugin | 2.2-beta-5 | 3.7.1 |
Update your pom.xml dependency to version 1.7.29:
<dependency>
<groupId>org.tinystruct</groupId>
<artifactId>tinystruct</artifactId>
<version>1.7.29</version>
</dependency>
If you use plain text secrets in application.properties, specify jwt.secret.format=plain:
jwt.secret=my-plain-text-secret-key
jwt.secret.format=plain