Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev Guide: Adding security management requirements for using in new Java #2062

Closed
1 task done
antares1470 opened this issue Jun 3, 2024 · 1 comment
Closed
1 task done
Assignees
Labels
bug Something isn't working documentation Improvements or additions to documentation
Milestone

Comments

@antares1470
Copy link
Collaborator

Prerequisites

Description

From Java 17, Java has updated security management which requires explicitly declaring access to classes outside their own module (through exports and opens). Constellation for v3 required a number of these additions to the main project properties in Core as well as project properties for any module suites sitting on top of Core order for it to work. This will include the TrainingExercises module suite which is created as the base for the developer guide.

Given the module suite is created from scratch by a developer going through the guide, the required security management declarations should be added to the guide, likely as an added step in Exercise 1.1 (probably at some point before current 1.1.4). It could be added a couple of ways (possibly others):

  1. added before current 1.1.3 (run the application), making it clear from the beginning that there will need to be things declared in properties
  2. modifying 1.1.3 to demonstrate what happens without the declarations and then steps afterwards declaring them and running again

Without these additions, the application won't run properly.

Steps to Reproduce

  1. Follow the guide as currently set out up until first run
  2. Run the application when first asked to
  3. Open a new graph

Expected behaviour: Can get a point in guide where applications doesn't throw issues. Guide clearly articulates need for explicit security management

Actual behaviour: App never seems to work as guide says it does. No mention of explicit security management

Reproduces how often: 100%

Additional Information

Copying the ones from Core appears to work. i.e. adding the following to project.properties in the TrainingExercises module suite:

run.args.extra=-J--add-opens=java.base/java.net\=ALL-UNNAMED \
               -J--add-opens=java.base/java.security\=ALL-UNNAMED \
               -J--add-opens=java.desktop/javax.swing\=ALL-UNNAMED \
               -J--add-opens=javafx.base/com.sun.javafx.event\=ALL-UNNAMED \
               -J--add-exports=java.base/java.net\=ALL-UNNAMED \
               -J--add-exports=java.base/java.security\=ALL-UNNAMED \
               -J--add-exports=java.base/java.lang\=ALL-UNNAMED \
               -J--add-exports=java.desktop/sun.awt\=ALL-UNNAMED \ 
               -J--add-exports=java.desktop/sun.java2d\=ALL-UNNAMED \
               -J--add-exports=javafx.base/com.sun.javafx.event\=ALL-UNNAMED

If someone figures out a simpler list to include though, then that should probably be what is used.

@antares1470 antares1470 added bug Something isn't working documentation Improvements or additions to documentation labels Jun 3, 2024
@antares1470 antares1470 added this to To do in Constellation via automation Jun 3, 2024
@antares1470 antares1470 added this to the v3.0.0 milestone Jun 4, 2024
@antares1470 antares1470 self-assigned this Jun 30, 2024
@antares1470 antares1470 moved this from To do to In progress in Constellation Jun 30, 2024
@antares1470 antares1470 moved this from In progress to PR Review in Constellation Jul 14, 2024
@antares1470 antares1470 moved this from PR Review to Testing in Constellation Jul 15, 2024
@HolandCrick
Copy link
Collaborator

@antares1470 - thanks for updating the dev guide. Looks better now.

Constellation automation moved this from Testing to Done Jul 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation
2 participants