0.7.0 Release
Upgrade the whole zero framework to the latest version:
Environment Upgrade
- JDK: 11+
- jooq: From 3.10.x to 3.15.3 ( The latest )
- vertx: From 3.9.9 to 4.1.x ( The latest )
- vertx-jooq: From 2.4.1 to 6.3.0 ( The latest )
Feature Upgrade
- Class scanner has been changed to google guava instead of the old one.
- JSR330/JSR299 dependency injection feature has been implemented based on google guice, remove the old
@Qualifier
annotation, use@Named
annotation instead. - Add standard authorization/authenticate feature support ( Basic, Jwt, OAuth2, Digest ) based on vert.x 4.x, the jwt token feature has been replaced by new version.
- Add new annotation that has replaced the old
@Wall
( Please refer following example to check details ).- For 401:
@Authenticate
- For 403:
@Authorized, @AuthorizedResource, @AuthorizedUser
- For 401:
- Add sync channel to implement Jooq Sync API instead of async API only ( 3.15.3 ) for old system, it means that you could still write
Ux.Jooq
to call sync/async both although vertx-jooq has been upgraded to6.3.0
. - Add AOP aspectJ for Redis cache instead of memory cache only, you wan set Redis as session store component.
- Add health checking feature on
/zero/health*
path, you can write your own extension to check the system status for DevOps usage.
This release is big upgrade version, I have modified the whole system structure to apply new requirement in future, I'll write the upgrade guide on my wechat official account:
The @Wall
code changes, you can refer following example
package cn.vertxup.secure;
import io.vertx.core.Future;
import io.vertx.core.json.JsonObject;
import io.vertx.ext.auth.User;
import io.vertx.up.annotations.Authenticate;
import io.vertx.up.annotations.Authorized;
import io.vertx.up.annotations.AuthorizedResource;
import io.vertx.up.annotations.Wall;
import io.vertx.up.eon.em.AuthWord;
import java.util.HashSet;
import java.util.Set;
/**
* @author <a href="http://www.origin-x.cn">Lang</a>
*/
@Wall(path = "/api/jwt/*", value = "jwt")
public class JwtWall {
@Authenticate
public Future<Boolean> verify(final JsonObject data) {
System.out.println(data.encodePrettily());
return Future.succeededFuture(Boolean.TRUE);
}
@Authorized
public Future<Set<String>> authorize(final User user) {
final Set<String> item = new HashSet<>();
item.add("p1");
item.add("p2");
return Future.succeededFuture(item);
}
@AuthorizedResource(AuthWord.OR)
public Future<Set<String>> resource(final JsonObject params) {
final Set<String> item = new HashSet<>();
item.add("p1");
item.add("p3");
return Future.succeededFuture(item);
}
}
Because of my project requirement, there are some spec change points that have not been validated, but our system is running in production environment:
- Add Finance Management Module ( zero-fm ) in zero extension.
- Add LBS Management Module ( zero-lbs ) in zero extension.
- Create the script to build k8s environment, the old
zero-iproxy
micro module has been re-design and modified, in future I'll support more features on k8s and connected to istio. - The CRUD engine ( zero-crud ) has been upgraded to support following features:
- Support crossing table CRUD, you can configure more than one table.
- Support Global view/Personal view feature on list page, there will be a new feature View Management for most system usage.
- Support Tenant feature when you do some data loading/exporting and others.
zero-crud
is critical feature in zero extension because you will be no need to write any code ( Zero Code ) about basic CRUD operations, zero provide 15 normalized api for your system, the only configured file that you provided is as following:
{
"name": "x-category",
"table": "X_CATEGORY",
"daoCls": "cn.vertxup.ambient.domain.tables.daos.XCategoryDao",
"pojoCls": "cn.vertxup.ambient.domain.tables.pojos.XCategory",
"field": {
"unique": [
[
"code",
"type",
"sigma"
]
]
},
"transform": {
"initial": {
"type": "`${module}`",
"identifier": "`${module}`"
},
"tree": {
"in": "code"
}
},
"connect": {
"targetIndent": "identifier",
"target": {
"fm.term": {
"crud": "fm.term",
"keyJoin": "category",
"synonym": {
"type": "termType"
}
},
"fm.subject": {
"crud": "fm.subject",
"keyJoin": "category"
},
"hotel.commodity": {
"crud": "hotel.commodity",
"keyJoin": "categoryId"
},
"hotel.compensation": {
"crud": "hotel.compensation",
"keyJoin": "categoryId"
}
},
"source": {
"keyJoin": "key"
}
}
}
zero maven dependency graph is as following: