Skip to content

Commit

Permalink
Updates demo script to execute with bundled jdk (opensearch-project#3777
Browse files Browse the repository at this point in the history
)



Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
  • Loading branch information
DarshitChanpura authored and dlin2028 committed May 1, 2024
1 parent 84c16e6 commit 0e08c32
Show file tree
Hide file tree
Showing 7 changed files with 555 additions and 344 deletions.
4 changes: 4 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,8 @@ test {
jvmArgs += "-Xmx3072m"
if (JavaVersion.current() > JavaVersion.VERSION_1_8) {
jvmArgs += "--add-opens=java.base/java.io=ALL-UNNAMED"
// this is needed to reflect access system env map.
jvmArgs += "--add-opens=java.base/java.util=ALL-UNNAMED"
}
retry {
failOnPassedAfterRetry = false
Expand Down Expand Up @@ -303,6 +305,8 @@ def setCommonTestConfig(Test task) {
task.jvmArgs += "-Xmx3072m"
if (JavaVersion.current() > JavaVersion.VERSION_1_8) {
task.jvmArgs += "--add-opens=java.base/java.io=ALL-UNNAMED"
// this is needed to reflect access system env map.
task.jvmArgs += "--add-opens=java.base/java.util=ALL-UNNAMED"
}
task.retry {
failOnPassedAfterRetry = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,20 @@
/**
* This class creates demo certificate files
*/
public class CertificateGenerator extends Installer {
public class CertificateGenerator {

private final Installer installer;

public CertificateGenerator(Installer installer) {
this.installer = installer;
}

/**
* Creates demo super-admin, node and root certificates by iterating through Certificates enum
*/
public void createDemoCertificates() {
for (Certificates cert : Certificates.values()) {
String filePath = OPENSEARCH_CONF_DIR + File.separator + cert.getFileName();
String filePath = this.installer.OPENSEARCH_CONF_DIR + File.separator + cert.getFileName();
writeCertificateToFile(filePath, cert.getContent());
}
}
Expand Down
307 changes: 167 additions & 140 deletions src/main/java/org/opensearch/security/tools/democonfig/Certificates.java

Large diffs are not rendered by default.

Loading

0 comments on commit 0e08c32

Please sign in to comment.