Firefly v4.9.1 is released

15 Oct 2018, Alvin Qiu

Firefly v4.9.1 adds OAuth2 APIs for HTTP server and client, CLI code generator, CORSHandler, AsyncWebJarHandler and fixes some bugs.

CLI code generator

The CLI tool can help us to create a Kotlin web project easily. Run command:

fireflyCli -g com.test.abc -a abc-haha -p com.test.abc -d www.abc.com -j www.abc.com

This command creates a firefly Kotlin web project in the current path. Import abc-haha project in your IDE. The CLI detail please see CLI generator document

OAuths APIs

The firefly framework provides APIs to support the four grant types, such as Authorization Code Grant, Implicit Grant, Resource Owner Password Credentials Grant, and Client Credentials Grant. The OAuth2 API details please see the OAuth2 server/client document

CORS handler

The CORSHandler can allow resources to be requested from one domain and served from another. Here is an example:

CORSConfiguration config = new CORSConfiguration();
config.setAllowOrigins(new HashSet<>(Arrays.asList("http://foo.com", "http://bar.com")));
config.setExposeHeaders(Arrays.asList("a1", "a2"));
config.setAllowHeaders(new HashSet<>(Arrays.asList("a1", "a2", "a3", "a4")));
CORSHandler corsHandler = new CORSHandler();
corsHandler.setConfiguration(config);

HTTP2ServerBuilder s = $.httpServer();

s.router().path("/cors/*").handler(corsHandler)
 .router().path("/cors/foo").handler(ctx -> ctx.end("foo"))
 .router().path("/cors/bar").handler(ctx -> {
    JsonObject jsonObject = ctx.getJsonObjectBody();
    Map<String, Object> map = new HashMap<>(jsonObject);
    map.put("bar", "x1");
    ctx.writeJson(map).end();
})
 .listen(host, port);

Update log:

  1. Add CLI code generator.
  2. Add OAuth2 APIs for HTTP server and client.
  3. Add AsyncWebJarHandler.
  4. Add JsonProperty Annotation that maps JSON key to the object field.
  5. Add timeout parameter for HTTP, WebSocket, and DB Kotlin asynchronous APIs.
  6. Add CORSHandler.
  7. Add createSession method for RoutingContext.
  8. Add asyncNext suspend method for RoutingContext.
  9. Add image processing components.
  10. Fix the data disorder when the net framework writes the big data.
  11. Fix the JsonStringReader.readLong() method reads the blank string exception.