light-4j

A fast, lightweight and more productive microservices framework

APACHE-2.0 License

Stars
3.6K
Committers
60

Bot releases are hidden (Show)

light-4j - 1.5.23

Published by stevehu almost 6 years ago

1.5.23 (2018-12-01)

Full Changelog

Closed issues:

  • light-4j benchmark #315
  • Need to allow server to be embedded #312

Upgrade Guidelines:

  • This is a release to fix defects and add features so it is backward compatible. Just update the version in your pom.xml should work.
light-4j - 1.5.22

Published by stevehu almost 6 years ago

1.5.22 (2018-11-10)

Full Changelog

Fixed bugs:

  • handle the situation that the alias is not server in the server.keystore #317

Closed issues:

  • add monad-result module to wrap success T and failure Status #325
  • add successful status code to status.yml #324
  • gzip and deflate encoding and decoding support in middleware handlers #323
  • add static CONFIG_NAME to serverConfig #320
  • add another default method in LightHttpHandler to bubble up the status #319
  • support default path in handler.yml for single page application #316
  • update status.yml ERR10016 to have only one parameter #314

Merged pull requests:

  • fixes #316 update resource and handler to support SPA from handler.yml #318 (stevehu)
  • Refactored code from main() to init() so server can be embedded. #311 (farrukhnajmi)

Upgrade Guidelines:

  • This is a release to fix defects and add features so it is backward compatible. Just update the version in your pom.xml should work.
light-4j - 1.5.21

Published by stevehu almost 6 years ago

1.5.21 (2018-10-26)

Full Changelog

Implemented enhancements:

  • Collect environment element in the Metrics Handler #310
  • Enhance logging in the AuditHandler #295
  • Environment config in client only applications #272

Fixed bugs:

  • Set correct status code if Method or URI from request could not be resolved in the handler chain #308

Upgrade Guidelines:

  • This is a release to fix defects and add features so it is backward compatible. Just update the version in your pom.xml should work.
  • If you access the service with a wrong path/method combination, an exception will show up in the log. This won't impact the functionality of the service and there is a workaround documented at https://github.com/networknt/light-4j/issues/314
light-4j - 1.5.20

Published by stevehu about 6 years ago

1.5.20 (2018-10-05)

Full Changelog

Fixed bugs:

  • MiddlewareHandler.register is called for each endpoint #305

Closed issues:

  • Handler needs to properly escape characters in the Status description #306
  • provide default security.yml and move providerId to jwt.yml #304
  • Indicate that the BufferSize is too small in client.yml if Body cannot be parsed #302
  • Intermittent issues with Consul API discovery #301
  • make bufferSize configurable for default buffer pool in Http2Client #299
  • Add more debug info during startup for the Kubernetes status.hostIP #297
  • Update the config module output to error only when config file not found #294
  • Update OAuthHelper to include new method to support SAML grant type flow #290
  • server does not create zip file from config server correctly #157

Upgrade Guidelines:

  • This is a release to fix defects and add features so it is backward compatible. Just update the version in your pom.xml should work.
  • The bufferSize has been added to the client.yml config file for Http2Client if the request body is bigger than 24KB which is the default if it is not set.
  • A default security.yml for JwtHelper is included in the security module. To enable or disable Jwt verification and scope verification can be done by both security.yml or framework specific security config like openapi-security.yml
light-4j - 1.5.19

Published by stevehu about 6 years ago

1.5.19 (2018-09-22)

Full Changelog

Fixed bugs:

  • Consul heartbeat stream limit being exceeded #279

Closed issues:

  • Update the config module output to error only when config file not found #294
  • move light-tokenization status codes to status.ym in light-4j #289
  • remove unused status code from status.yml #288
  • add status code for user-management in light-portal #287
  • fix a typo in HashUtil #286
  • BodyHandler Middleware to support configurable Content-Type #285
  • add pattern matching to differentiate email and userId in StringUtils #283
  • update EmailSender to trust the host from the email.yml #278
  • change email module name to email-sender #277
  • create http-url module for url related utility #276
  • create a new http-string module that depends on Undertow #275
  • add replaceOnce to StringUtil in utility module #274
  • set the right default port number for DirectRegistry #273
  • add error codes for light-config-server #271
  • rename datasource to data-source #269
  • rename deref to deref-token #268
  • rename limit to rate-limit #267
  • rename basic to basic-auth #266
  • update deregisterAfter from 90m to 2m #264
  • OpenAPI and GraphQL ValidatorHandlers conflict on config file names #252
  • add a handler for IP whitelisting #235

Merged pull requests:

  • Updated oauth helper files to handle SAMLBearer grant type #292 (dguncb)
  • Update Readme #284 (anilmuppalla)
  • Related to #249, adds an EndpointSource interface for injecting path,… #282 (logi)
  • fixes #279 Consul heartbeat stream limit being exceeded #281 (stevehu)
  • enhancement for light-oauth2 provider module #265 (stevehu)

Upgrade Guidelines:

This release added more features and fixed several bugs. It should be backward compatible for most existing services. Just update the pom.xml version should work from previous release 1.5.18. If you are in an older version, please follow the guideline to upgrade to 1.5.18 first or just regenerate your project with the latest light-codegen.

  • Several modules are renamed with two words and they are all optional modules. If you are using them, please update the pom.xml in the dependencies section. They are basic-auth, rate-limit, deref-token email-sender, and data-source.
  • A new module http-string is created with all the Undertow HTTP headers. This is extracted from the utility module to remove the dependency of Undertow from the utility. If you see some HTTP Header cannot be resolved, please add this into the dependencies.
  • A typo is fixed in the HashUtil and this utility used internally most of the case.
  • ip-whitelist is a new security middleware handler. It will be used for /health to ensure requests are from Consul cluster.
  • multiple chains defined in handler.yml is the recomended way to handle middleware handlers instead of service.yml file. For more info on how to config it, please see example at https://github.com/networknt/light-example-4j/tree/master/middleware-performance
light-4j - 1.5.18

Published by stevehu about 6 years ago

1.5.18 (2018-08-15)

Full Changelog

Implemented enhancements:

  • Support HandlerProvider definitions in handler.yml configuration definitions #258
  • When stopping the server, give 30 seconds grace period to let service discovery propagate to all clients #20

Fixed bugs:

  • Fix issue causing path variables not to show up in query params when using new handler config #250
  • Reproduce issue in handler chaining, ensure that the MiddlewareHandler interface is respected #247

Closed issues:

  • Re-starting Server no longer works #263
  • health endpoint with serviceId as path parameter #262
  • Address graceful server shutdown while encountering an exception during start-up #261
  • add a default consul.yml for consul client #260
  • flatten the config files into the same directory for k8s #257
  • add getJwtClaimsWithExpiresIn for digital signing only in light-oauth2 token service #256
  • remove description in the CorrelationHandler config file #255
  • enable http2 for consul client when TLS is enabled #246
  • catastrophic setExchangeStatus calls without args #244
  • upgrade to undertow 2.0.11.Final #243
  • several enhancements for Consul registration #242
  • networknt page is not working #238
  • extend Http2Client to OAuth 2.0 provider communication to support arbitrary number of parameters #181

Merged pull requests:

  • Adding HandlerProvider support to list of handlers. #259 (NicholasAzar)
  • Do not require ignored config #254 (logi)
  • Descriptive Exception on unknown chain or handler in handler.yml #253 (logi)
  • Fix issue causing query params to be missing from exchange. #251 (NicholasAzar)
  • Safer set exchange status #245 (logi)

Upgrade Guidelines:

  • There are two dependencies are upgraded in this release.
<version.undertow>2.0.11.Final</version.undertow>
<version.json-schema-validator>0.1.21</version.json-schema-validator>
  • A new consul.yml has been introduced to provide three options for health checks. httpCheck is recommended.
# Consul URL for accessing APIs
consulUrl: https://198.55.49.188:8500
# deregister the service after the amount of time after health check failed.
deregisterAfter: 2m
# health check interval for TCP or HTTP check. Or it will be the TTL for TTL check. Every 10 seconds,
# TCP or HTTP check request will be sent. Or if there is no heartbeat request from service after 10 seconds,
# then mark the service is critical.
checkInterval: 10s
# One of the following health check approach will be selected. Two passive (TCP and HTTP) and one active (TTL)
# enable health check TCP. Ping the IP/port to ensure that the service is up. This should be used for most of
# the services with simple dependencies. If the port is open on the address, it indicates that the service is up.
tcpCheck: false
# enable health check HTTP. An HTTP get request will be sent to the service to ensure that 200 response status is
# coming back. This is suitable for a service that depends on a database or other infrastructure services. You should
# implement a customized health check handler that checks dependencies. i.e. if DB is down, return status 400.
httpCheck: true
# enable health check TTL. When this is enabled, Consul won't actively check your service to ensure it is healthy,
# but your service will call check endpoint with a heartbeat to indicate it is alive. This requires that the service
# is built on top of light-4j and the above options are not available. For example, your service is behind NAT.
ttlCheck: false

Here is the document on how to use it.

https://doc.networknt.com/tutorial/common/discovery/http-health/

  • Consul client parameters are moved to consul.yml from service.yml
- com.networknt.consul.client.ConsulClient:
  - com.networknt.consul.client.ConsulClientImpl
  • A new handler.yml has been introduced to support multiple middleware handler chains. For more detail please refer to https://doc.networknt.com/concern/handler/

  • All config files in tls and oauth subfolders are moved to the parent config directory for Kubernetes and Openshift secrets creation. The following files have references to the files in sub folders before and need to be updated. server.yml, client.yml, security.yml and jwt.yml

light-4j - 1.5.17

Published by stevehu over 6 years ago

1.5.17 (2018-07-15)

Full Changelog

Closed issues:

  • update readme.md to fix the document links #239

Upgrade Guidelines:

This release contains only small enhancements and it is backward compatible.

light-4j - 1.5.16

Published by stevehu over 6 years ago

1.5.16 (2018-07-05)

Full Changelog

Implemented enhancements:

  • Add "severity" to Status #232
  • Extending handler chain configuration functionality #222

Closed issues:

  • move HandlerProvider interface to handler package from server #236
  • separate de-reference middleware handler to its own module #233
  • add error status for token dereference in light-oauth2 token service #230
  • add an error status code for light-oauth2 client registration #229
  • log the class, method, file and line number for status #228
  • move the basic authentication middleware handler from light-rest-4j #226
  • enhance client module to add de-reference token in OauthHelper #225
  • Add a middleware handler to de-reference opaque access token to JWT #224
  • log error if config file cannot be found in all possible locations #223

Merged pull requests:

Upgrade Guidelines:

Most changes in this release are backward compatible except the HandlerProvider package name change. If you have an existing project, you need to update two different places.

  • In service.yml config file
# HandlerProvider implementation
- com.networknt.server.HandlerProvider:
  - com.networknt.oauth.client.PathHandlerProvider

change to

# HandlerProvider implementation
- com.networknt.handler.HandlerProvider:
  - com.networknt.oauth.client.PathHandlerProvider
  • If you have any classes that import HandlerProvider, you need to change the package name after upgrade to 1.5.16 and your IDE will help you to resolve the issue.

If you have too many projects that need to be updated in a batch, please take a look at regex-replace at https://github.com/networknt/light-config-test/tree/master/light-bot/regex-replace/replace-all

Here is the section in the config file.

- glob: "{**/service.yml,**/service.yml.rocker.raw}"
  match: com.networknt.server.HandlerProvider
  old_value: "server"
  new_value: "handler"

- glob: "{**/*.java}"
  match: com.networknt.server.HandlerProvider
  old_value: "server"
  new_value: "handler"

light-4j - 1.5.15

Published by stevehu over 6 years ago

1.5.15 (2018-06-18)

Full Changelog

Implemented enhancements:

  • Dynamic server listener port configuration #210
  • Unexpected behavior when Status is created for non-existent status code #169

Closed issues:

  • add datasource module for most popular relational databases #220
  • create LightHttpHandler with default method to handle the error status #217
  • A default content-type is not set #216
  • add a new status code in status.yml for authenticate class not found #215
  • Add a Build Number to the server.yml #214
  • add constants to utility Constants for light-router #212
  • OAuthHelper needs to handle the error status from OAuth 2.0 provider #202

Merged pull requests:

Upgrade Guidelines:

All changes in this release are backward-compatible, so you can just update the version number in your pom.xml file. The following enhancements might be useful for you though:

  • A new property buildNumber has been added to the server.yml from light-codegen. This variable can be used for auditing in your API.

  • It is highly recommended to use LightHttpHandler interface instead of HttpHandler as it contains a default method to handle error status.

light-4j - 1.5.14

Published by stevehu over 6 years ago

1.5.14 (2018-05-19)

Full Changelog

Closed issues:

  • update client.yml and secret.yml in other modules #211
  • Rename resources module to resource for consistency #209
  • update client module to support refresh token flow for light-spa-4j #208
  • update verifyJwt with ignoreExpiry flag #207
  • add default method setExchangeStatus into MiddlewareHandler #206
  • move auth and csrf to light-spa-4j repository #205
  • add error code for light-spa-4j stateless-token handler #204
  • switch StatelessAuthHandler to middleware handler #203
  • add stateless auth and csrf handlers for SPA application #201
  • pass csrf token in oauth token request #200
  • add status code for light-proxy tableau authentication handler #199
  • move password in jwt.yml to secret.yml #198
  • share the connections to consul in ConsulClientImpl #196

Merged pull requests:

Upgrade Guidelines

There is no API change for this release; however, the following three config files have been updated:

  • Add refresh token client secret in secret.yml
# Fresh token client secret for OAuth2 server
refreshTokenClientSecret: f6h1FTI8Q3-7UScPZDzfXA
  • Remove oauthHttp2Support from security.yml to client.yml
# If OAuth2 provider support http2 protocol. If using light-oauth2, set this to true.
oauthHttp2Support: true

  • Add enableHttp2 and refresh token section in client.yml
    # set to true if the oauth2 provider supports HTTP/2
    enableHttp2: true
    refresh_token:
      # token endpoint for refresh token grant
      uri: "/oauth2/token"
      # client_id for refresh token grant flow. client_secret is in secret.yml
      client_id: f7d42348-c647-4efb-a52d-4c5787421e72
      # optional scope, default scope in the client registration will be used if not defined.
      scope:
      - petstore.r
      - petstore.w

For details, please refer to https://github.com/networknt/light-4j/blob/master/client/src/main/resources/config/client.yml

light-4j - 1.5.13

Published by stevehu over 6 years ago

1.5.13 (2018-04-20)

Full Changelog

Implemented enhancements:

  • create a middleware handler for Prometheus #150
  • Sanitizer mangles content #51

Closed issues:

  • light-codegen command line error handling #195
  • upgrade jackson library to 2.9.4 #187
  • put client credentials token into authorization header instead of X-Scope-Token header #185
  • name convention between metrics and prometheus #165
light-4j - 1.5.12

Published by stevehu over 6 years ago

1.5.12 (2018-04-08)

Full Changelog

Closed issues:

  • upgrade to prometheus 0.3.0 #192
  • rollback zkclient to 0.3 #191
  • remove consul client and update version for zkclient and curator #190
  • remove antlr4 from dependencies #189
  • upgrade jackson 2.9.5 remove swagger from light-4j dependencies #188
  • add two more test cases for Http2Client #186

Upgrade Guidelines:

There is no functional change in this release but only upgrade the versions of dependencies after black duck security scan. Here is the new version of each library.

        <version.jackson>2.9.5</version.jackson>
        <version.slf4j>1.7.25</version.slf4j>
        <version.jose4j>0.6.3</version.jose4j>
        <version.commons.codec>1.11</version.commons.codec>
        <version.encoder>1.2.1</version.encoder>
        <version.logback>1.2.3</version.logback>
        <version.junit>4.12</version.junit>
        <version.mockito>2.10.0</version.mockito>
        <version.undertow>1.4.23.Final</version.undertow>
        <version.swagger-parser>1.0.34</version.swagger-parser>
        <version.hamcrest>1.3</version.hamcrest>
        <version.assertj>3.8.0</version.assertj>
        <version.hdrhistogram>2.1.10</version.hdrhistogram>
        <version.jsr305>3.0.2</version.jsr305>
        <version.json-schema-validator>0.1.18</version.json-schema-validator>
        <version.zookeeper>3.5.3-beta</version.zookeeper>
        <version.zkclient>0.3</version.zkclient>
        <version.curator>4.0.1</version.curator>
        <version.snakeyaml>1.20</version.snakeyaml>
        <version.caffeine>2.6.2</version.caffeine>
        <version.prometheus>0.3.0</version.prometheus>
        <version.javamail>1.6.1</version.javamail>
light-4j - 1.5.11

Published by stevehu over 6 years ago

1.5.11 (2018-03-31)

Full Changelog

Fixed bugs:

  • JWT signing private key cannot be externalized #178
  • scope encoding changes space to plus sign in OAuthHelper #172

Closed issues:

  • add ERR11300 FAIL_TO_GET_TABLEAU_TOKEN error code in status.yml #184
  • check if trace is enabled in Http2Client logger #183
  • add isBlank to StringUtil in utility class #180
  • split JwtHelper to JwtHelper for token verification and JwtIssuer to issue token #179
  • remove Apache commons-lang dependency from mask #177
  • remove commons-io dependencies #176
  • refactor CorsHttpHandlerTest to use Http2Client #175
  • add status code ERR11202 for hybrid-4j get request #173
  • remove unused import in DecryptUtil #171

Merged pull requests:

  • feat(util): Add toByteBuffer overload util method to convert files. #174 (NicholasAzar)
light-4j - 1.5.10

Published by stevehu over 6 years ago

1.5.10 (2018-03-02)

Full Changelog

Closed issues:

  • add subject_claims and access_claims constants #170
  • Port enabling indicator #168
  • add prometheus to the module list in parent pom.xml #164

Merged pull requests:

light-4j - 1.5.9

Published by stevehu over 6 years ago

1.5.9 (2018-02-21)

Full Changelog

Closed issues:

  • Support dynamic port binding for Kubernetes hostNetwork #162
  • switch light-config-server connection to HTTP 2.0 #159

Merged pull requests:

Upgrade Guide:

  • To support Kubernetes cluster deployment and client side service discovery, the server cannot be started with both http and https. If both are enabled, then https will be used.

  • The server module has been enhanced to support dynamic port allocation and self registration on Kubernetes cluster. The following section has been added to the server.yml config file. If you are not using the feature, you don't need to include the block. This change is backward compatible. Example can be found at https://github.com/networknt/light-example-4j/blob/master/discovery/api_a/kubernetes/src/main/resources/config/server.yml

There is Kubernetes tutorial on how to use it as part of the service registry and discovery.

# Dynamic port is used in situation that multiple services will be deployed on the same host and normally
# you will have enableRegistry set to true so that other services can find the dynamic port service. When
# deployed to Kubernetes cluster, the Pod must be annotated as hostNetwork: true
dynamicPort: false

# Minimum port range. This define a range for the dynamic allocated ports so that it is easier to setup
# firewall rule to enable this range. Default 2400 to 2500 block has 100 port numbers and should be
# enough for most cases unless you are using a big bare metal box as Kubernetes node that can run 1000s pods
minPort: 2400

# Maximum port rang. The range can be customized to adopt your network security policy and can be increased or
# reduced to ease firewall rules.
maxPort: 2500

light-4j - 1.5.8

Published by stevehu over 6 years ago

1.5.8 (2018-02-03)

Full Changelog

Closed issues:

  • fix a typo in variable JwT_CLOCK_SKEW_IN_SECONDS #158
  • accept other optional fields in OAuth2 token response #156
  • handle a list of string instead of list of maps in BodyHandler #154
  • Add a status code ERR12042 SERVICE_ENDPOINT_NOT_FOUND #153

Merged pull requests:

** Upgrade guideline: **

This release contains small enhancements so no config file changes. Just change the pom.xml version number to 1.5.8 from 1.5.7 will do.

light-4j - 1.5.7

Published by stevehu almost 7 years ago

1.5.7 (2018-01-09)

Full Changelog

Implemented enhancements:

  • provide a utility to substitute environment variables in config #149

Closed issues:

  • change secret.yml loading from SecretConfig to Map for flexibility #151
  • Remove docs folder and repo specific document site once all contents are migrated #139
light-4j - 1.5.6

Published by stevehu almost 7 years ago

1.5.6 (2017-12-29)

Full Changelog

Fixed bugs:

  • Get token un Http2Client line 367 is hard coded using Http2 #146

Closed issues:

  • some compiler warnings #148
  • Add email sender module and update secret.yml #147
  • Add host header for getkey in oauthHelper for HTTP 1.1 #145

Upgrade Guide:
In this release, a new email module is added for sending emails and the emailPassword is added to the secret.yml file. Other than this, the release is backward compatible with 1.5.5

# EmailSender password default address is [email protected]
emailPassword: change-to-real-password

light-4j - 1.5.5

Published by stevehu almost 7 years ago

1.5.5 - 2017-12-15

Added

Changed

  • Fixes #144 Find a way to propagate callback exception to the caller thread in Http2Client
  • Fixes #143 Encrypt the values in secret.yml
  • Fixes #141 Adding java bean initializer and manual injection test cases for service module
  • Fixes #140 make it configurable to get jwt public certificates from cache or from oauth server
  • Fixes #138 Add support for two or more beans initialized by one initializer class and method
  • Fixes #137 Add an API to manipulate SingletonServiceFactory to add new entries programatically
  • Fixes #136 Loading Java bean with initializer class and method in service module
  • Upgrade to 1.5.5

Upgrade Guide

This release is backward compatible and you can just update your pom.xml version from 1.5.4 to 1.5.5 for
your current project. However, to take advantages of this release there are certain configuration files need
to be updated.

light-4j - 1.5.4

Published by stevehu almost 7 years ago

1.5.4 - 2017-11-20

Added

Changed

  • fixes #132 service lookup returns null if there is no entry defined in service.yml
  • fixes #131 class cast exception in service module if getting an array from one impl
  • fixes #130 Add a new constant OPENAPI_OPERATION_STRING for OpenAPI 3
  • fixes #129 Improve configurability for networknt.handler.MiddlewareHandler
  • fixes #127 Add support for interface with generic type in service module
  • fixes #126 Update serviceMap key to interface class name instead of class
  • fixes #125 Need to check certain section is empty for header.yml
  • Upgrade to 1.5.4

This release is an upgrade release from 1.5.1 and there are two major changes.

  • Switch startup hook, shutdown hook, middleware handler and routehandler to service.yml instead of Java SPI
  • Add OpenAPI 3.0 support for light-rest-4j

Upgrade Guide

For existing applications built with light-4j 1.5.1, there is no dependency change so you can just update the version number from 1.5.1 to 1.5.4 in your pom.xml. However, there are configuration change in this release to switch Java SPI to service.yml for server startup, shutdown, middleware handler and route handler. It requires you to manually modify your service.yml file (create a new one if there is no service.yml in src/main/resources/config folder) to add these entries. Example can be found at https://github.com/networknt/light-example-4j/blob/master/rest/swagger/petstore/src/main/resources/config/service.yml and the documentation can be found at https://doc.networknt.com/concern/server/

Package Rankings
Top 3.79% on Repo1.maven.org
Badges
Extracted from project README
Build Status codecov.io
Related Projects