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

Download certs from security plugin instead of storing local copy #3203

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ plugins {
id 'jacoco'
id 'java-library'
id 'com.diffplug.spotless' version '6.25.0'
id 'de.undercouch.download' version '5.3.0'
}

ext {
Expand All @@ -29,6 +30,20 @@ ext {
projectSubstitutions = [:]
licenseFile = rootProject.file('LICENSE.txt')
noticeFile = rootProject.file('NOTICE')

['sample.pem', 'test-kirk.jks'].forEach { file ->
File local = getLayout().getBuildDirectory().file(file).get().getAsFile()
download.run {
src "https://raw.githubusercontent.com/opensearch-project/security/refs/heads/main/bwc-test/src/test/resources/security/" + file
dest local
overwrite false
}
}

processTestResources {
from(getLayout().getBuildDirectory().file('sample.pem').get().getAsFile())
from(getLayout().getBuildDirectory().file('test-kirk.jks').get().getAsFile())
}
}

java {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ protected RestClient buildClient(Settings settings, HttpHost[] hosts) throws IOE
if (Objects.nonNull(keystore)) {
URI uri = null;
try {
uri = this.getClass().getClassLoader().getResource("security/sample.pem").toURI();
uri = this.getClass().getClassLoader().getResource("sample.pem").toURI();
} catch (URISyntaxException e) {
throw new RuntimeException(e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ protected RestClient buildClient(Settings settings, HttpHost[] hosts) throws IOE
if (Objects.nonNull(keystore)) {
URI uri = null;
try {
uri = this.getClass().getClassLoader().getResource("security/sample.pem").toURI();
uri = this.getClass().getClassLoader().getResource("sample.pem").toURI();
} catch (URISyntaxException e) {
throw new RuntimeException(e);
}
Expand Down
25 changes: 0 additions & 25 deletions plugin/src/test/resources/security/sample.pem

This file was deleted.

Binary file removed plugin/src/test/resources/security/test-kirk.jks
Binary file not shown.
Loading