Skip to content

Commit

Permalink
Merge pull request #4663 from gchq/gh-4661_apache_http_client
Browse files Browse the repository at this point in the history
Gh 4661 apache http client
  • Loading branch information
stroomdev66 authored Jan 7, 2025
2 parents a88fd39 + ffd0a78 commit 7f409b9
Show file tree
Hide file tree
Showing 288 changed files with 10,133 additions and 16,695 deletions.
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,25 @@ DO NOT ADD CHANGES HERE - ADD THEM USING log_change.sh

* Add Visualisations to the Query help and editor completions. Visualisation completion inserts a snippet containing all the data fields in the Visualisation, e.g. `TextValue(field = Field, gridSeries = Grid Series)`.


## [v7.5-proxy-beta.2] - 2024-09-16

* Issue **#4436** : Change the way API Keys are verified. Stroom now finds all valid api keys matching the api key prefix and compares the hash of the api key against the hash from each of the matching records. Support has also been added for using different hash algorithms.


## [v7.5-beta.12] - 2024-09-06

* Issue **#4424** : Fix alignment of _Current Tasks_ heading on the Jobs screen.

* Issue **#4422** : Don't show _Edit Schedule_ in actions menu on Jobs screen for Distributed jobs.

* Issue **#4418** : Fix missing css for `/stroom/sessionList`.

* Issue **#4435** : Fix for progress spinner getting stuck on.


## [v7.5-proxy-beta.1] - 2024-09-06

* Issue **#4424** : Fix alignment of _Current Tasks_ heading on the Jobs screen.

* Issue **#4422** : Don't show _Edit Schedule_ in actions menu on Jobs screen for Distributed jobs.
Expand Down Expand Up @@ -839,6 +858,11 @@ DO NOT ADD CHANGES HERE - ADD THEM USING log_change.sh
* Issue **#4055** : Fix parsing/formatting of durations in query/dashboard expressions.


## [v7.3-proxy-beta.1] - 2024-01-29

* Issue **#2201** : New proxy implementation.


## [v7.3-beta.7] - 2024-01-24

* Issue **#4029** : Remove the need to specify node name for query and dashboard API.
Expand Down
4 changes: 0 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@ ext.versions = [
jooq : "${jooqVer}", // Defined at the top of this file
junit_jupiter : '5.10.1',
kafka : '3.6.0',
okhttp : '4.12.0',
poi : '5.2.4',
scylladb : '4.17.0.1',
simple_java_mail : '8.8.0',
Expand Down Expand Up @@ -329,8 +328,6 @@ ext.libs = [
mockito_core : "org.mockito:mockito-core", // version controlled by dropwizard-dependencies
mockito_junit_jupiter : "org.mockito:mockito-junit-jupiter", // version controlled by dropwizard-dependencies
mysql_connector_java : "mysql:mysql-connector-java:8.0.33",
okhttp : "com.squareup.okhttp3:okhttp:${versions.okhttp}",
okhttp_logging_interceptor : "com.squareup.okhttp3:logging-interceptor:${versions.okhttp}",
poi : "org.apache.poi:poi:${versions.poi}",
poi_ooxml : "org.apache.poi:poi-ooxml:${versions.poi}",
quartz : "org.quartz-scheduler:quartz:2.5.0-rc1",
Expand All @@ -346,7 +343,6 @@ ext.libs = [
slf4j_api : "org.slf4j:slf4j-api", // version controlled by dropwizard-dependencies
snake_yaml : "org.yaml:snakeyaml:2.3",
solrj : "org.apache.solr:solr-solrj:8.2.0",
sqlite : "org.xerial:sqlite-jdbc:3.43.2.2",
stax_api : "stax:stax-api:1.0.1",
swagger_annotations : "io.swagger.core.v3:swagger-annotations-jakarta:$versions.swagger",
swagger_core : "io.swagger.core.v3:swagger-core-jakarta:$versions.swagger",
Expand Down
6 changes: 0 additions & 6 deletions generate-jooq.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ cd -
cd stroom-security/stroom-security-impl-db-jooq
../../gradlew generateJooq
cd -
cd stroom-proxy/stroom-proxy-repo-db-jooq
../../gradlew generateJooq
cd -
cd stroom-annotation/stroom-annotation-impl-db-jooq
../../gradlew generateJooq
cd -
Expand Down Expand Up @@ -52,9 +49,6 @@ cd -
cd stroom-job/stroom-job-impl-db-jooq
../../gradlew generateJooq
cd -
cd stroom-proxy/stroom-proxy-repo-db-jooq
../../gradlew generateJooq
cd -
cd stroom-analytics/stroom-analytics-impl-db-jooq
../../gradlew generateJooq
cd -
Expand Down
1 change: 0 additions & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,6 @@ include 'stroom-processor:stroom-processor-mock'
// Proxy
include 'stroom-proxy:stroom-proxy-app'
include 'stroom-proxy:stroom-proxy-repo'
include 'stroom-proxy:stroom-proxy-repo-db-jooq'
include 'stroom-proxy:stroom-proxy-remote-api'

// Query
Expand Down
6 changes: 5 additions & 1 deletion stroom-app/src/main/resources/ui/images/locate.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 12 additions & 12 deletions stroom-app/src/main/resources/ui/raw-images/locate.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class TestImportExportServiceImpl2 extends AbstractCoreIntegrationTest {
void testImportZip() throws IOException {
final Path rootTestDir = StroomCoreServerTestFileUtil.getTestResourcesDir();
final Path importDir = rootTestDir.resolve("samples/config");
final Path zipFile = getCurrentTestDir().resolve(UUID.randomUUID().toString() + ".zip");
final Path zipFile = getCurrentTestDir().resolve(UUID.randomUUID() + ".zip");

ZipUtil.zip(zipFile, importDir, Pattern.compile(".*DATA_SPLITTER.*"), null);
assertThat(Files.isRegularFile(zipFile)).isTrue();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ void testTaskContext() {
taskManager.terminate(taskContext.getTaskId());
consumptionStartLatch.countDown();

final CompletableFuture<Void>[] consumers = new CompletableFuture[threads];
final CompletableFuture<?>[] consumers = new CompletableFuture[threads];

for (int i = 0; i < threads; i++) {
final CompletableFuture<Void> future = CompletableFuture.runAsync(() -> {
Expand Down Expand Up @@ -118,7 +118,7 @@ void testTaskContext() {
"producers",
TerminateHandlerFactory.NOOP_FACTORY,
tc -> {
final CompletableFuture<Void>[] producers = new CompletableFuture[threads];
final CompletableFuture<?>[] producers = new CompletableFuture[threads];

for (int i = 0; i < threads; i++) {
final CompletableFuture<Void> future = CompletableFuture.runAsync(() -> {
Expand Down
18 changes: 14 additions & 4 deletions stroom-app/src/test/java/stroom/test/DownloadStroomContentApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
import stroom.test.common.util.test.ContentPackZipDownloader;
import stroom.util.io.FileUtil;

import org.apache.hc.client5.http.impl.classic.CloseableHttpClient;
import org.apache.hc.client5.http.impl.classic.HttpClients;

import java.io.IOException;
import java.io.UncheckedIOException;
import java.nio.file.Paths;

public class DownloadStroomContentApp {
Expand All @@ -14,9 +19,14 @@ public static void main(final String[] args) {
final String contentPacksDefinition = args[0];
final String contentPackDownload = args[1];
final String contentPackImport = args[2];
ContentPackZipDownloader.downloadZipPacks(
Paths.get(FileUtil.replaceHome(contentPacksDefinition)),
Paths.get(FileUtil.replaceHome(contentPackDownload)),
Paths.get(FileUtil.replaceHome(contentPackImport)));
try (final CloseableHttpClient httpClient = HttpClients.createDefault()) {
ContentPackZipDownloader.downloadZipPacks(
Paths.get(FileUtil.replaceHome(contentPacksDefinition)),
Paths.get(FileUtil.replaceHome(contentPackDownload)),
Paths.get(FileUtil.replaceHome(contentPackImport)),
httpClient);
} catch (final IOException e) {
throw new UncheckedIOException(e);
}
}
}
3 changes: 3 additions & 0 deletions stroom-app/src/test/java/stroom/test/MockServiceModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
import stroom.statistics.mock.MockInternalStatisticsModule;
import stroom.task.impl.MockTaskModule;
import stroom.util.entityevent.EntityEventBus;
import stroom.util.http.BasicHttpClientFactory;
import stroom.util.http.HttpClientFactory;
import stroom.util.io.HomeDirProvider;
import stroom.util.io.TempDirProvider;
import stroom.util.jersey.MockJerseyModule;
Expand Down Expand Up @@ -91,6 +93,7 @@ protected void configure() {
install(new MockStateModule());

bind(ContentPackUserService.class).to(MockSecurityContext.class);
bind(HttpClientFactory.class).to(BasicHttpClientFactory.class);

final UserService mockUserService = mock(UserService.class);
when(mockUserService.loadByUuid(any())).then((Answer<User>) invocation -> {
Expand Down
7 changes: 5 additions & 2 deletions stroom-app/src/test/java/stroom/test/SetupSampleData.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

import com.google.inject.Guice;
import com.google.inject.Injector;
import org.apache.hc.client5.http.classic.HttpClient;

import java.io.IOException;
import java.nio.file.Files;
Expand Down Expand Up @@ -90,7 +91,8 @@ public static void main(final String[] args) {

private static void downloadContent(final Path contentPacksDefinition,
final PathCreator pathCreator,
final ContentPackImportConfig contentPackImportConfig) {
final ContentPackImportConfig contentPackImportConfig,
final HttpClient httpClient) {
try {
final Path downloadDir =
pathCreator.toAppPath(ContentPackZipDownloader.CONTENT_PACK_DOWNLOAD_DIR);
Expand All @@ -103,7 +105,8 @@ private static void downloadContent(final Path contentPacksDefinition,
ContentPackZipDownloader.downloadZipPacks(
contentPacksDefinition,
downloadDir,
importDir);
importDir,
httpClient);
} catch (final IOException e) {
throw new RuntimeException(e.getMessage(), e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -778,6 +778,7 @@ appConfig:
clientSecret: null
expectedSignerPrefixes: []
formTokenRequest: true
httpClient: null
identityProviderType: "INTERNAL_IDP"
issuer: null
jwksUri: null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,9 @@ private synchronized AbstractConfig rebuildObjectInstance(
final Map<Class<?>, AbstractConfig> newInstanceMap) {

final ObjectInfo<? extends AbstractConfig> objectInfo = objectInfoMap.get(propertyPath);
if (objectInfo == null) {
return null;
}

AbstractConfig instance = objectInfo.createInstance(argPropName -> {
final PropertyPath childPropertyPath = propertyPath.merge(argPropName);
Expand Down
1 change: 1 addition & 0 deletions stroom-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ dependencies {
implementation libs.commons_compress
implementation libs.commons_io
implementation libs.commons_lang
implementation libs.dropwizard_client
implementation libs.dropwizard_lifecycle
implementation libs.dropwizard_metrics_annotation
implementation libs.eventLogging
Expand Down
Loading

0 comments on commit 7f409b9

Please sign in to comment.