9945 java17 nashorn#11322
Conversation
|
@stianst @pedroigor @douglaspalmer This is first draft of having script providers working on Java 17. Works for both KC on Wildfly and Quarkus. HowThe nashorn script engine, which was available automatically in Java earlier than 15, is not available anymore with the Java 15 or newer. (Will need to doublecheck the exact version before writing the docs). Nashorn can be still used in Java 17, but just when it is explicitly added to classpath. The idea we discussed is, that users will need to attach script engine themselves, so that we don't need to do productization of nashorn (or other script engine). So that's the approach I use in this draft. WildflyOn Wildfly, people will need to add jboss module "org.openjdk.nashorn.nashorn-core" with the nashorn-core-5.3.jar and the corresponding module.xml file. There is an alternative to add different script engine provider (EG. graal js) by adding different module. Script module is configurable with the SPI with something like this: QuarkusOn Quarkus, people will need to add 3 JAR files to the
The last 2 are dependencies of nashorn (In Wildfly, asm is available automatically, so it is just sufficient to have it declared as dependency in nashorn module.xml). I guess I can make it somehow more user-friendly on Quarkus, so guys does not need to copy 3 jars, but rather something like 1. WDYT? |
7989ea4 to
372a0b0
Compare
|
@stianst @DGuhr @pedroigor I've sent draft PR to the quickstarts with some additional utilities and instructions on how to have script providers running on Keycloak server Wildfly and Quarkus keycloak/keycloak-quickstarts#316 . This PR is aligned with that quickstart PR. Please let me know if you agree with the approach. I can then continue with the testsuite, documentation and polishing of the quickstart PR. |
|
@pedroigor @DGuhr Thanks guys! Will move forward with the testsuite update for this PR and then will "undraft" it and ask you for re-review. So there will be some additional changes, but possibly just in the testsuite part. |
372a0b0 to
2e8af58
Compare
|
@pedroigor @DGuhr @kami619 I've removed the "draft" flag from this PR and I've updated testsuite part. Now the script tests should be working on JDK 17 on both Wildfly and Quarkus. Do you please have a chance to re-review this PR? I've added testsuite changes in the latest commit for the easier re-review, but I am planning to squash the commits before merge. I am also planning to follow with the PRs for the quickstarts and documentation. @kami619 In order to have tests passing on JDK 17, there is also need to prepare the servers with JDK 17 to have the necessary nashorn bits available on the servers. I've used this for my testing on local machine with Java 17: Same should work also for |
|
@mposolda thank you for the detailed instructions, I shall pick this up and test it on my local. |
|
@pedroigor Thanks Pedro! @kami619 Ok, Thanks. I will wait for you to confirm if your tests are ok before merging this. |
|
@mposolda After some discussion with @kami619, I was trying to execute the EDIT: I'll try to rebuild the whole project again. -> Still not working Log: For JDK11, the script engine is created. For JDK17 and Quarkus auth server, the engine is created as well. So, it's only related to WF. |
|
@mabartos Hmm.... This is strange. I've just checked again in this branch. I've rebuild it with Java 11 (from the top codebase directory): And then executed this with Java 17: Last command works fine also with Do you see different results with the command sequence like this? If not, can you check if in the ZIP file |
mabartos
left a comment
There was a problem hiding this comment.
@mposolda Oh, sorry, I tried to repeat those steps again and it seems everything's fine even for the WF. Sorry for the confusion. The module is present there.
Manually tested with Open JDK11 and Open JDK17 and everything works as expected.
|
For those looking for the jar files, here are the corresponding maven links: I am uncertain if all dependencies of seems like Just a small side-note: A Default (javascript) policy is generated, when you enable fine grained permissions for a client, even if the javascript dependency is missing. If you try to evaluate permissions with the default policy, there happens just nothing in the gui (no error, just a 500 response from the server in the developer tools). You have to look up server logs to find the root cause. However, once you add the missing jar files to the provider folder and run |
No description provided.