Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Aug 20 19:09
    stevehu commented #603
  • Aug 20 19:08

    stevehu on 1.6.x

    fixes #603 add JwtVerifier to r… (compare)

  • Aug 20 19:07
    stevehu commented #603
  • Aug 20 19:07
    stevehu edited #603
  • Aug 20 19:06

    stevehu on issue603

    (compare)

  • Aug 20 19:06
    stevehu closed #603
  • Aug 20 19:06

    stevehu on master

    fixes #603 add JwtVerifier to r… (compare)

  • Aug 20 19:06
    stevehu closed #604
  • Aug 20 13:11
    stevehu commented #604
  • Aug 20 13:08
    stevehu commented #604
  • Aug 19 21:59
    stevehu commented #603
  • Aug 19 21:57
    stevehu commented #603
  • Aug 19 21:54
    stevehu commented #603
  • Aug 19 21:52
    stevehu commented #603
  • Aug 19 21:46
    stevehu commented #603
  • Aug 19 21:42
    stevehu review_requested #604
  • Aug 19 21:42
    stevehu review_requested #604
  • Aug 19 21:42
    stevehu review_requested #604
  • Aug 19 21:42
    stevehu review_requested #604
  • Aug 19 21:42
    stevehu opened #604
NicolasFco
@NicolasFCO
Also I don't know if it's normal but i get the following message when I do 'mvn clean install exec:exec" : "Unable to load config 'values' with extension yml, yaml and json from external config, application config and module config. Please ignore this message if you are sure that your application is not using this config file."
Steve Hu
@stevehu
@NicolasFCO Welcome to the community. Yes. You have found the option to not overwrite the handlers and handler's test cases in the config.json file. In most cases, changing the specification won't need to regenerate the code unless new endpoints are added. You just need to copy the new openapi.yaml into the config folder.
As you know, the light-4j is just like lego with too many pieces and each piece has its configuration file. These configuration files can be parameterized and then you can use one single values.yml to define the variables to overwrite the default values in vary config files. This is another option to allow users to only use one externalized config file to make the DevOps pipeline simpler. It is optional, so you see the warning message during the startup. It tries to load it but will ignore it if the values.yml cannot be found.
Steve Hu
@stevehu
BTW, the light-codegen is just one way to start a project. You can always scaffold a project and modify it. Once the specification is updated, you can generate another project in a different folder and compare it with the old version to see what has been changed.
NicolasFco
@NicolasFCO
Thanks for the help :)
I can generate a project and the apis but I cannot generate the database. Can you help me with that problem ?
I found out the database configuration in the config file but the database is not created. Do I have to manually create it before generate the project ?
@stevehu
Steve Hu
@stevehu
The generator can only add the database driver into the dependencies and it cannot create the database. You need to create the database before or after the project generation.
Steve Hu
@stevehu

We have released 1.6.6 for jdk8 and 2.0.3 for jdk11 as scheduled. Both releases are backward compatible with some defects addressed and some enhancements added.

For more all the PRs included in each release, please visit https://trello.com/b/189msq9S/release-schedule or individual release note.

Bastian Kuberek
@bkuberek
thank you!
I'm starting a new project and I want to have a hybrid of rest and graphql. Would it be best to start a graphql project and add rest to it or start with a rest project and add graphql to it?
Steve Hu
@stevehu
@bkuberek Both way should work depending on which part is more complicated. Once a new project is started, it is very easy to update dependencies and handler.yml to add another. In most of the cases, starting with REST is easier as GraphQL only has several endpoints.
Steve Hu
@stevehu
If you are unsure how to modify the dependency, you can generate both projects and merge them together into one.
Daemach
@Daemach
I need to add an oauth2 server to authenticate with Amazon Alexa and my local MSSQL-based application. I'm developing smarthome devices and Alexa needs an auth code grant to enable communication between my servers and the gateway. I've looked through the documentation but I am still unclear on whether and how I can go about doing this. How would the communication work between light and my normal login process? https://thcguard.com/main/login More info: https://developer.amazon.com/docs/account-linking/account-linking-for-sh-and-other.html and https://developer.amazon.com/docs/account-linking/add-account-linking-logic-smart-home.html
Steve Hu
@stevehu
I am not familiar with Amazon Gateway Authentication and Authorization but I guess it is OAuth 2.0 implementation. The following are several tutorials on how to set up a single page application on light-router and proxy through light-4j backend services with light-oauth2 for authentication/authorization.
They are all about single-page applications but the same concept can be used for mobile devices.
Daemach
@Daemach
Thank you. I'll read these and may have more questions. Thanks for responding
Steve Hu
@stevehu

We have released 1.6.7 for jdk8 and 2.0.4 for jdk11 as scheduled. Both releases are backward compatible with some defects addressed, and some enhancements added.

The most important feature added in these releases is the Http2Client Connection Pool to remove the burden from our users to handle the concurrent requests in HTTP/1.1 and reset/re-discover/re-balance connection for both HTTP/1.1 and HTTP/2.

For more all the PRs included in each release, please visit https://trello.com/b/189msq9S/release-schedule or individual release note.

Relivian
@Relivian
I just checkout out the 1.6.x branch of light-4j as well as the latest light-bot. When building light-4j the client build fails with
4:43:02.843 [main] INFO c.n.client.oauth.OauthHelperTest - starting server
[ERROR] Tests run: 23, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 44.964 s <<< FAILURE! - in com.networknt.client.Http2ClientTest
[ERROR] testMixed(com.networknt.client.Http2ClientTest) Time elapsed: 7.279 s <<< ERROR!
java.util.concurrent.ExecutionException: org.junit.ComparisonFailure: expected:<[{"message":"OK!"}]> but was:<[]>
at com.networknt.client.Http2ClientTest.callApiAsyncMultiThread(Http2ClientTest.java:681)
at com.networknt.client.Http2ClientTest.testMixed(Http2ClientTest.java:658)
Caused by: org.junit.ComparisonFailure: expected:<[{"message":"OK!"}]> but was:<[]>
at com.networknt.client.Http2ClientTest.callApiAsync(Http2ClientTest.java:567)
My Java is version "1.8.0_192"
Steve Hu
@stevehu
@Relivian which light-bot task are you invoking? develop-build?
Relivian
@Relivian
Steve Hu
@stevehu
The light-bot is a command-line tool and which is build by gradle. The above error seems coming from the light-4j build. Most likely, this is a timing issue in the multiple thread testing when you have a very fast computer. Try to rerun the task and see if the error is gone.
Relivian
@Relivian
Right, the error occurs when building light-4j. I'll try again
Steve Hu
@stevehu
The timing is adjusted based on our build machine and it takes a lot of time. I am thinking to move these jwt test cases to the integration so that most other developers won't suffer the slowness. Let me know if you still face the issue and I will take some actions. Thanks.
Relivian
@Relivian
Thanks to you. Your guess was dead on
Bastian Kuberek
@bkuberek
@stevehu re:rest + graphql
thanks for your answer
what about openapi validation? How do I add exception to graphql endpoints ?
at the moment openapi validator will 404 on non openapi endpoints
Steve Hu
@stevehu
in the handler.yml, you only need to wire in the openapi validator for REST endpoint.
you can define two chains: one for rest and the other for graphql
Bastian Kuberek
@bkuberek
so in exec I would write my chain instead of default?
    exec:
      - default
      - com.networknt.petstore.handler.PetsGetHandler
Bastian Kuberek
@bkuberek
I see. Thank you
Steve Hu
@stevehu
Np.
Bastian Kuberek
@bkuberek
I noticed that the graphql example doesn't use handler.yml
Steve Hu
@stevehu
Those examples are old and never get a chance to be updated.
We have added a lot more new features recently and it will take time to update all examples. Once you complete your application, I am wondering if you could create a small example to show other users how this can be done. A lot of people will be interested in what you are doing.
Bastian Kuberek
@bkuberek
So is there a way I can get this graphql servie.yml https://github.com/networknt/light-example-4j/blob/release/graphql/starwars/src/main/resources/config/service.yml and rewrite it to use handler.yml?
for sure
Steve Hu
@stevehu
Could you please open an issue in the light-codegen to convert graphql generator from service.yml to handler.yml? I can make the change and you can generate a project with your IDL. Or at least you can copy the template.
Bastian Kuberek
@bkuberek
Thanks :thumbsup: I noticed that the tests in the rest example are ignored. Do you have a working test example I can use?
Bastian Kuberek
@bkuberek
[WARNING] Tests run: 4, Failures: 0, Errors: 0, Skipped: 4
I'm running 2.0.4
Steve Hu
@stevehu
That repo is generated and all test cases are ignored by default. If you want to look at test cases for rest api, take a look at the light-oauth2 repo. https://github.com/networknt/light-oauth2/tree/master/client/src/test/java/com/networknt/oauth/client/handler