You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampipes.apache.org by ho...@apache.org on 2026/10/25 17:25:29 UTC
(streampipes) branch dev updated: feat(#5093): retention configuration for audit logs (#5097)
This is an automated email from the ASF dual-hosted git repository.
JHoelli pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/streampipes.git
The following commit(s) were added to refs/heads/dev by this push:
new 90f5ca2e7c feat(#5093): retention configuration for audit logs (#5097)
90f5ca2e7c is described below
commit 90f5ca2e7ccb009cc9f339676911e13700e8bc40
Author: Jacqueline Höllig <78...@users.noreply.github.com>
AuthorDate: Sun Oct 25 18:25:23 2026 +0100
feat(#5093): retention configuration for audit logs (#5097)
---
.../streampipes/audit/api/AuditEventStore.java | 8 +-
.../audit/influx/InfluxAuditEventStore.java | 16 +-
.../audit/influx/InfluxAuditEventStoreTest.java | 48 +++++
streampipes-audit-management/pom.xml | 15 ++
.../audit/management/AuditRetentionManager.java | 236 +++++++++++++++++++++
.../management/AuditRetentionManagerTest.java | 112 ++++++++++
.../apache/streampipes/commons/constants/Envs.java | 1 +
.../commons/environment/DefaultEnvironment.java | 5 +
.../commons/environment/Environment.java | 2 +
.../model/configuration/SpCoreConfiguration.java | 11 +
.../streampipes/rest/impl/admin/AuditResource.java | 30 +++
.../service/core/AuditConfiguration.java | 10 +
.../core/scheduler/AuditRetentionScheduler.java | 63 ++++++
.../service/core/AuditConfigurationTest.java | 28 ++-
ui/deployment/i18n/de.json | 4 +-
ui/deployment/i18n/en.json | 4 +-
ui/deployment/i18n/pl.json | 4 +-
.../src/lib/apis/audit.service.ts | 15 ++
.../audit-log/audit-log.component.html | 15 +-
.../audit-log/audit-log.component.scss | 8 +
.../audit-log/audit-log.component.spec.ts | 205 ++++++++++--------
.../configuration/audit-log/audit-log.component.ts | 24 +++
.../audit-retention-dialog.component.html | 57 +++++
.../audit-retention-dialog.component.scss | 15 +-
.../audit-retention-dialog.component.ts | 139 ++++++++++++
.../export/data-export-import.component.html | 14 +-
.../export/data-export-import.component.ts | 6 +-
.../export-provider-configuration.component.html | 163 ++++++++++++++
.../export-provider-configuration.component.scss | 15 +-
.../export-provider-configuration.component.ts | 176 +++++++++++++++
.../dataset-overview.component.html | 201 ------------------
.../dataset-overview/dataset-overview.component.ts | 95 ---------
32 files changed, 1312 insertions(+), 433 deletions(-)
diff --git a/streampipes-audit-api/src/main/java/org/apache/streampipes/audit/api/AuditEventStore.java b/streampipes-audit-api/src/main/java/org/apache/streampipes/audit/api/AuditEventStore.java
index 501f29799d..9eaee82feb 100644
--- a/streampipes-audit-api/src/main/java/org/apache/streampipes/audit/api/AuditEventStore.java
+++ b/streampipes-audit-api/src/main/java/org/apache/streampipes/audit/api/AuditEventStore.java
@@ -18,7 +18,9 @@
package org.apache.streampipes.audit.api;
-/** Append contract. Browsing is defined separately by AuditEventReader. */
+import java.time.Instant;
+
+/** Persistence contract. Browsing is defined separately by AuditEventReader. */
public interface AuditEventStore extends AutoCloseable {
/** Called on the audit worker at startup; implementations may provision storage idempotently. */
default void initialize() {
@@ -26,6 +28,10 @@ public interface AuditEventStore extends AutoCloseable {
void append(AuditEvent<?> event);
+ default void deleteEventsOlderThan(Instant cutoff) {
+ throw new IllegalStateException("Audit retention is unavailable");
+ }
+
@Override
default void close() {
}
diff --git a/streampipes-audit-influx/src/main/java/org/apache/streampipes/audit/influx/InfluxAuditEventStore.java b/streampipes-audit-influx/src/main/java/org/apache/streampipes/audit/influx/InfluxAuditEventStore.java
index ab13155d2d..104a777b32 100644
--- a/streampipes-audit-influx/src/main/java/org/apache/streampipes/audit/influx/InfluxAuditEventStore.java
+++ b/streampipes-audit-influx/src/main/java/org/apache/streampipes/audit/influx/InfluxAuditEventStore.java
@@ -46,7 +46,7 @@ import java.util.Optional;
import java.util.UUID;
import java.util.concurrent.TimeUnit;
-/** Single-writer append adapter with independent bounded reads. Retention is not implemented. */
+/** Single-writer append adapter with independent bounded reads. */
public final class InfluxAuditEventStore implements AuditEventStore, AuditEventReader {
private static final String DEFAULT_ORGANIZATION = "sp";
private static final String WATERMARK_QUERY = "SELECT LAST(\"%s\") FROM \"%s\""
@@ -182,6 +182,20 @@ public final class InfluxAuditEventStore implements AuditEventStore, AuditEventR
return new InfluxAuditEventReader(queries).find(eventId, locator);
}
+ @Override
+ public synchronized void deleteEventsOlderThan(Instant cutoff) {
+ if (cutoff == null) {
+ throw new IllegalArgumentException("Audit retention cutoff is required");
+ }
+ initialize();
+ var result = queries.execute(new Query("DELETE FROM \"%s\" WHERE time < %dms"
+ .formatted(InfluxAuditSchema.MEASUREMENT, cutoff.toEpochMilli())));
+ if (result.hasError() || result.getResults() != null
+ && result.getResults().stream().anyMatch(statement -> statement.hasError())) {
+ throw new IllegalStateException("Audit retention delete failed");
+ }
+ }
+
private void initializeWatermark() {
long maximum = 0;
// No current-time upper bound: clock rollback must not conceal a stored future watermark.
diff --git a/streampipes-audit-influx/src/test/java/org/apache/streampipes/audit/influx/InfluxAuditEventStoreTest.java b/streampipes-audit-influx/src/test/java/org/apache/streampipes/audit/influx/InfluxAuditEventStoreTest.java
index 08a4d50edc..4f24c83325 100644
--- a/streampipes-audit-influx/src/test/java/org/apache/streampipes/audit/influx/InfluxAuditEventStoreTest.java
+++ b/streampipes-audit-influx/src/test/java/org/apache/streampipes/audit/influx/InfluxAuditEventStoreTest.java
@@ -27,6 +27,7 @@ import com.sun.net.httpserver.HttpServer;
import org.junit.jupiter.api.Test;
import java.net.InetSocketAddress;
+import java.net.URLDecoder;
import java.nio.charset.StandardCharsets;
import java.time.Clock;
import java.time.Instant;
@@ -35,6 +36,7 @@ import java.util.ArrayList;
import java.util.UUID;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
+import java.util.concurrent.atomic.AtomicReference;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
@@ -127,6 +129,52 @@ class InfluxAuditEventStoreTest {
}
}
+ @Test
+ void deletesEventsBeforeTheConfiguredRetentionCutoff() throws Exception {
+ var statement = new AtomicReference<String>();
+ var server = HttpServer.create(new InetSocketAddress("127.0.0.1", 0), 0);
+ server.createContext("/query", exchange -> {
+ for (var parameter : exchange.getRequestURI().getRawQuery().split("&")) {
+ if (parameter.startsWith("q=")) {
+ statement.set(URLDecoder.decode(parameter.substring(2), StandardCharsets.UTF_8));
+ }
+ }
+ byte[] body = "{\"results\":[{}]}".getBytes(StandardCharsets.UTF_8);
+ exchange.sendResponseHeaders(200, body.length);
+ exchange.getResponseBody().write(body);
+ exchange.close();
+ });
+ InfluxAuditDatabaseProvisionerTest.existingDatabase(server);
+ server.start();
+ var cutoff = Instant.parse("2026-10-01T00:00:00Z");
+ try (var store = new InfluxAuditEventStore("http://127.0.0.1:" + server.getAddress().getPort(),
+ "audit-only", "audit-token")) {
+ store.deleteEventsOlderThan(cutoff);
+ assertEquals("DELETE FROM \"audit_events\" WHERE time < " + cutoff.toEpochMilli() + "ms", statement.get());
+ } finally {
+ server.stop(0);
+ }
+ }
+
+ @Test
+ void reportsInfluxDeleteErrors() throws Exception {
+ var server = HttpServer.create(new InetSocketAddress("127.0.0.1", 0), 0);
+ server.createContext("/query", exchange -> {
+ byte[] body = "{\"results\":[{\"error\":\"delete denied\"}]}".getBytes(StandardCharsets.UTF_8);
+ exchange.sendResponseHeaders(200, body.length);
+ exchange.getResponseBody().write(body);
+ exchange.close();
+ });
+ InfluxAuditDatabaseProvisionerTest.existingDatabase(server);
+ server.start();
+ try (var store = new InfluxAuditEventStore("http://127.0.0.1:" + server.getAddress().getPort(),
+ "audit-only", "audit-token")) {
+ assertThrows(IllegalStateException.class, () -> store.deleteEventsOlderThan(Instant.now()));
+ } finally {
+ server.stop(0);
+ }
+ }
+
private AuditEvent<AdapterCreatedDetails> event(Instant time) {
return new AuditEvent<>(UUID.randomUUID(), time, StandardAuditEvents.ADAPTER_CREATE,
AuditOutcome.SUCCEEDED, "user-1", "adapter", "1", new AdapterCreatedDetails("stream-1", null));
diff --git a/streampipes-audit-management/pom.xml b/streampipes-audit-management/pom.xml
index 482482e6d9..709e1daebd 100644
--- a/streampipes-audit-management/pom.xml
+++ b/streampipes-audit-management/pom.xml
@@ -37,6 +37,21 @@
<artifactId>streampipes-audit-api</artifactId>
<version>0.99.0-SNAPSHOT</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.streampipes</groupId>
+ <artifactId>streampipes-data-explorer-export</artifactId>
+ <version>0.99.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.streampipes</groupId>
+ <artifactId>streampipes-model</artifactId>
+ <version>0.99.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.streampipes</groupId>
+ <artifactId>streampipes-storage-api</artifactId>
+ <version>0.99.0-SNAPSHOT</version>
+ </dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
diff --git a/streampipes-audit-management/src/main/java/org/apache/streampipes/audit/management/AuditRetentionManager.java b/streampipes-audit-management/src/main/java/org/apache/streampipes/audit/management/AuditRetentionManager.java
new file mode 100644
index 0000000000..2a479a87d2
--- /dev/null
+++ b/streampipes-audit-management/src/main/java/org/apache/streampipes/audit/management/AuditRetentionManager.java
@@ -0,0 +1,236 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.streampipes.audit.management;
+
+import org.apache.streampipes.audit.api.AuditEntry;
+import org.apache.streampipes.audit.api.AuditEventReader;
+import org.apache.streampipes.audit.api.AuditEventStore;
+import org.apache.streampipes.audit.api.AuditQuery;
+import org.apache.streampipes.dataexplorer.export.ConfiguredOutputWriter;
+import org.apache.streampipes.dataexplorer.export.ConfiguredOutputWriterFactory;
+import org.apache.streampipes.dataexplorer.export.OutputFormat;
+import org.apache.streampipes.dataexplorer.export.objectstorage.ExportProviderFactory;
+import org.apache.streampipes.model.configuration.ExportProviderSettings;
+import org.apache.streampipes.model.dataset.ExportConfig;
+import org.apache.streampipes.model.dataset.RetentionAction;
+import org.apache.streampipes.model.dataset.RetentionExportConfig;
+import org.apache.streampipes.model.dataset.RetentionLog;
+import org.apache.streampipes.model.dataset.RetentionTimeConfig;
+import org.apache.streampipes.model.dataset.param.ProvidedRestQueryParams;
+import org.apache.streampipes.storage.api.system.IFileMetadataStorage;
+import org.apache.streampipes.storage.api.system.ISpCoreConfigurationStorage;
+
+import org.springframework.web.servlet.mvc.method.annotation.StreamingResponseBody;
+
+import java.time.Instant;
+import java.time.temporal.ChronoUnit;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Locale;
+import java.util.UUID;
+
+/** Exports audit events through configured providers before applying their retention action. */
+public final class AuditRetentionManager {
+ private static final String AUDIT_EXPORT_NAME = "audit-log";
+ private static final int QUERY_PAGE_SIZE = 200;
+ private static final int MAXIMUM_QUERY_RANGE_DAYS = 31;
+ private static final List<String> COLUMNS = List.of(
+ "recordedAt", "storedAt", "eventId", "eventType", "outcome", "actor", "resourceType", "resourceId", "details");
+
+ private final AuditEventStore store;
+ private final ISpCoreConfigurationStorage coreConfigurationStorage;
+ private final ConfiguredOutputWriterFactory outputWriterFactory;
+
+ public AuditRetentionManager(AuditEventStore store,
+ ISpCoreConfigurationStorage coreConfigurationStorage,
+ IFileMetadataStorage fileMetadataStorage) {
+ this.store = store;
+ this.coreConfigurationStorage = coreConfigurationStorage;
+ this.outputWriterFactory = new ConfiguredOutputWriterFactory(fileMetadataStorage, coreConfigurationStorage);
+ }
+
+ public void cleanup() {
+ var coreConfiguration = coreConfigurationStorage.get();
+ if (coreConfiguration == null) {
+ return;
+ }
+ var retention = coreConfiguration.getAuditRetentionConfiguration();
+ if (retention == null || retention.getDataRetentionConfig() == null) {
+ return;
+ }
+ var days = retention.getDataRetentionConfig().olderThanDays();
+ if (days < 1) {
+ throw new IllegalArgumentException("Audit retention must be at least one day");
+ }
+
+ var now = Instant.now();
+ var cutoff = now.minus(days, ChronoUnit.DAYS);
+ var action = retention.getDataRetentionConfig().action();
+ String exportPath = null;
+ try {
+ if (action != RetentionAction.DELETE) {
+ exportPath = export(retention, cutoff);
+ }
+ if (action != RetentionAction.SAVE) {
+ store.deleteEventsOlderThan(cutoff);
+ }
+ if (action != RetentionAction.DELETE) {
+ updateExportStatus(coreConfiguration, retention.getRetentionExportConfig(), now, true, exportPath, "-");
+ }
+ } catch (Exception e) {
+ if (action != RetentionAction.DELETE && retention.getRetentionExportConfig() != null) {
+ updateExportStatus(coreConfiguration, retention.getRetentionExportConfig(), now, false, exportPath, e.getMessage());
+ }
+ throw e instanceof RuntimeException runtimeException
+ ? runtimeException
+ : new IllegalStateException("Audit retention export failed", e);
+ }
+ }
+
+ private String export(RetentionTimeConfig retention, Instant cutoff) throws Exception {
+ var exportConfig = requireExportConfig(retention);
+ var exportProvider = findExportProvider(exportConfig.getExportProviderId());
+ var format = outputFormat(exportConfig);
+ var formatName = format.name().toLowerCase(Locale.ROOT);
+ var params = new HashMap<String, String>();
+ params.put("delimiter", exportConfig.getExportConfig().csvDelimiter());
+ params.put("format", formatName);
+ params.put("headerColumnName", exportConfig.getExportConfig().headerColumnName());
+ params.put("missingValueBehaviour", exportConfig.getExportConfig().missingValueBehaviour());
+ var writer = outputWriterFactory.getConfiguredWriter(null, format,
+ new ProvidedRestQueryParams(AUDIT_EXPORT_NAME, params), false);
+ var objectStorage = ExportProviderFactory.createExportProvider(exportProvider.getProviderType(), AUDIT_EXPORT_NAME,
+ exportProvider, formatName);
+ objectStorage.store(writeAuditEvents(writer, cutoff, exportConfig.getLastExport(),
+ retention.getDataRetentionConfig().olderThanDays()));
+ return objectStorage.getFileName();
+ }
+
+ private StreamingResponseBody writeAuditEvents(ConfiguredOutputWriter writer,
+ Instant cutoff,
+ String lastExport,
+ int olderThanDays) {
+ return output -> {
+ writer.beforeFirstItem(output);
+ boolean first = true;
+ var reader = reader();
+ for (var rangeStart = exportStart(lastExport, olderThanDays); rangeStart.isBefore(cutoff);
+ rangeStart = rangeEnd(rangeStart, cutoff)) {
+ var rangeEnd = rangeEnd(rangeStart, cutoff);
+ String cursor = null;
+ do {
+ var page = reader.query(new AuditQuery(rangeStart, rangeEnd, null, null, null, QUERY_PAGE_SIZE, cursor));
+ for (var entry : page.items()) {
+ writer.writeItem(output, row(reader, entry), COLUMNS, first);
+ first = false;
+ }
+ cursor = page.nextCursor();
+ } while (cursor != null);
+ }
+ writer.afterLastItem(output);
+ };
+ }
+
+ private List<Object> row(AuditEventReader reader, AuditEntry entry) {
+ var details = reader.find(UUID.fromString(entry.eventId()), entry.locator()).orElseThrow(
+ () -> new IllegalStateException("Audit event disappeared during retention export"));
+ var row = new ArrayList<Object>();
+ row.add(details.recordedAt());
+ row.add(entry.storedAt());
+ row.add(entry.eventId());
+ row.add(entry.eventType());
+ row.add(entry.outcome());
+ row.add(entry.actor());
+ row.add(entry.resourceType());
+ row.add(entry.resourceId());
+ row.add(details.details());
+ return row;
+ }
+
+ private AuditEventReader reader() {
+ if (store instanceof AuditEventReader reader) {
+ return reader;
+ }
+ throw new IllegalStateException("Audit export is unavailable");
+ }
+
+ static Instant exportStart(String lastExport, int olderThanDays) {
+ if (lastExport == null || lastExport.isBlank()) {
+ return Instant.EPOCH;
+ }
+ try {
+ var start = Instant.parse(lastExport).minus(olderThanDays, ChronoUnit.DAYS);
+ return start.isBefore(Instant.EPOCH) ? Instant.EPOCH : start;
+ } catch (RuntimeException e) {
+ return Instant.EPOCH;
+ }
+ }
+
+ private Instant rangeEnd(Instant start, Instant cutoff) {
+ var candidate = start.plus(MAXIMUM_QUERY_RANGE_DAYS, ChronoUnit.DAYS);
+ return candidate.isAfter(cutoff) ? cutoff : candidate;
+ }
+
+ private RetentionExportConfig requireExportConfig(RetentionTimeConfig retention) {
+ var exportConfig = retention.getRetentionExportConfig();
+ if (exportConfig == null || exportConfig.getExportConfig() == null
+ || exportConfig.getExportProviderId() == null || exportConfig.getExportProviderId().isBlank()) {
+ throw new IllegalArgumentException("Audit retention export configuration is required");
+ }
+ return exportConfig;
+ }
+
+ static OutputFormat outputFormat(RetentionExportConfig retentionExportConfig) {
+ var exportConfig = retentionExportConfig.getExportConfig();
+ if (exportConfig.format() == null || exportConfig.format().isBlank() || "string".equals(exportConfig.format())) {
+ retentionExportConfig.setExportConfig(new ExportConfig(
+ OutputFormat.CSV.name().toLowerCase(Locale.ROOT),
+ exportConfig.csvDelimiter() == null ? "comma" : exportConfig.csvDelimiter(),
+ exportConfig.missingValueBehaviour() == null ? "ignore" : exportConfig.missingValueBehaviour(),
+ exportConfig.headerColumnName() == null ? "key" : exportConfig.headerColumnName()));
+ return OutputFormat.CSV;
+ }
+ return OutputFormat.fromString(exportConfig.format());
+ }
+
+ private ExportProviderSettings findExportProvider(String providerId) {
+ var coreConfiguration = coreConfigurationStorage.get();
+ if (coreConfiguration == null || coreConfiguration.getExportProviderSettings() == null) {
+ throw new IllegalArgumentException("Audit retention export provider was not found");
+ }
+ return coreConfiguration.getExportProviderSettings().stream()
+ .filter(provider -> provider != null && providerId.equals(provider.getProviderId()))
+ .findFirst()
+ .orElseThrow(() -> new IllegalArgumentException("Audit retention export provider was not found"));
+ }
+
+ private void updateExportStatus(org.apache.streampipes.model.configuration.SpCoreConfiguration coreConfiguration,
+ RetentionExportConfig exportConfig,
+ Instant now,
+ boolean success,
+ String path,
+ String error) {
+ if (success) {
+ exportConfig.setLastExport(now.toString());
+ }
+ exportConfig.addRetentionLog(new RetentionLog(success, path, now.toString(), error));
+ coreConfigurationStorage.updateElement(coreConfiguration);
+ }
+}
diff --git a/streampipes-audit-management/src/test/java/org/apache/streampipes/audit/management/AuditRetentionManagerTest.java b/streampipes-audit-management/src/test/java/org/apache/streampipes/audit/management/AuditRetentionManagerTest.java
new file mode 100644
index 0000000000..21ecf8dba0
--- /dev/null
+++ b/streampipes-audit-management/src/test/java/org/apache/streampipes/audit/management/AuditRetentionManagerTest.java
@@ -0,0 +1,112 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.streampipes.audit.management;
+
+import org.apache.streampipes.audit.api.AuditEvent;
+import org.apache.streampipes.audit.api.AuditEventStore;
+import org.apache.streampipes.dataexplorer.export.OutputFormat;
+import org.apache.streampipes.model.configuration.SpCoreConfiguration;
+import org.apache.streampipes.model.dataset.DataRetentionConfig;
+import org.apache.streampipes.model.dataset.ExportConfig;
+import org.apache.streampipes.model.dataset.RetentionAction;
+import org.apache.streampipes.model.dataset.RetentionExportConfig;
+import org.apache.streampipes.model.dataset.RetentionInterval;
+import org.apache.streampipes.model.dataset.RetentionTimeConfig;
+import org.apache.streampipes.storage.api.system.ISpCoreConfigurationStorage;
+
+import org.junit.jupiter.api.Test;
+
+import java.time.Instant;
+import java.time.temporal.ChronoUnit;
+import java.util.concurrent.atomic.AtomicReference;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+class AuditRetentionManagerTest {
+
+ @Test
+ void deletesAuditEventsOlderThanTheConfiguredNumberOfDays() {
+ var coreConfiguration = new SpCoreConfiguration();
+ coreConfiguration.setAuditRetentionConfiguration(new RetentionTimeConfig(
+ new DataRetentionConfig(RetentionInterval.DAILY, 7, RetentionAction.DELETE), null));
+ var deletedBefore = new AtomicReference<Instant>();
+ var store = new AuditEventStore() {
+ @Override
+ public void append(AuditEvent<?> event) {
+ }
+
+ @Override
+ public void deleteEventsOlderThan(Instant cutoff) {
+ deletedBefore.set(cutoff);
+ }
+ };
+
+ new AuditRetentionManager(store, storage(coreConfiguration), null).cleanup();
+
+ assertTrue(deletedBefore.get().isAfter(Instant.now().minus(8, ChronoUnit.DAYS)));
+ assertTrue(deletedBefore.get().isBefore(Instant.now().minus(6, ChronoUnit.DAYS)));
+ }
+
+ @Test
+ void startsTheNextExportAtThePreviousRetentionCutoff() {
+ var lastExport = Instant.parse("2026-10-16T12:00:00Z");
+
+ assertEquals(lastExport.minus(7, ChronoUnit.DAYS),
+ AuditRetentionManager.exportStart(lastExport.toString(), 7));
+ }
+
+ @Test
+ void defaultsStringExportFormatToCsv() {
+ var exportConfig = new RetentionExportConfig(new ExportConfig("string", null, null, null), "provider", null, null);
+
+ assertEquals(OutputFormat.CSV, AuditRetentionManager.outputFormat(exportConfig));
+ assertEquals("csv", exportConfig.getExportConfig().format());
+ assertEquals("comma", exportConfig.getExportConfig().csvDelimiter());
+ }
+
+ private ISpCoreConfigurationStorage storage(SpCoreConfiguration configuration) {
+ return new ISpCoreConfigurationStorage() {
+ @Override
+ public boolean exists() {
+ return true;
+ }
+
+ @Override
+ public void createElement(SpCoreConfiguration element) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public SpCoreConfiguration get() {
+ return configuration;
+ }
+
+ @Override
+ public SpCoreConfiguration updateElement(SpCoreConfiguration element) {
+ return element;
+ }
+
+ @Override
+ public void deleteElement() {
+ throw new UnsupportedOperationException();
+ }
+ };
+ }
+}
diff --git a/streampipes-commons/src/main/java/org/apache/streampipes/commons/constants/Envs.java b/streampipes-commons/src/main/java/org/apache/streampipes/commons/constants/Envs.java
index 00cd4daf35..491a2146f5 100644
--- a/streampipes-commons/src/main/java/org/apache/streampipes/commons/constants/Envs.java
+++ b/streampipes-commons/src/main/java/org/apache/streampipes/commons/constants/Envs.java
@@ -63,6 +63,7 @@ public enum Envs {
SP_AUDIT_INFLUX_ORG("SP_AUDIT_INFLUX_ORG", "sp"),
SP_AUDIT_ENABLED("SP_AUDIT_ENABLED", "false"),
SP_AUDIT_QUEUE_CAPACITY("SP_AUDIT_QUEUE_CAPACITY", "1024"),
+ SP_AUDIT_RETENTION_SCHEDULER_CRON("SP_AUDIT_RETENTION_SCHEDULER_CRON", "0 1 0 * * 6"),
SP_AUDIT_SHUTDOWN_TIMEOUT_SECONDS("SP_AUDIT_SHUTDOWN_TIMEOUT_SECONDS", "10"),
SP_AUDIT_STORAGE_PROVIDER("SP_AUDIT_STORAGE_PROVIDER", "influx"),
SP_AUDIT_INFLUX_URL("SP_AUDIT_INFLUX_URL", ""),
diff --git a/streampipes-commons/src/main/java/org/apache/streampipes/commons/environment/DefaultEnvironment.java b/streampipes-commons/src/main/java/org/apache/streampipes/commons/environment/DefaultEnvironment.java
index bab40a1e87..410d724bea 100644
--- a/streampipes-commons/src/main/java/org/apache/streampipes/commons/environment/DefaultEnvironment.java
+++ b/streampipes-commons/src/main/java/org/apache/streampipes/commons/environment/DefaultEnvironment.java
@@ -688,6 +688,11 @@ public class DefaultEnvironment implements Environment {
return new IntEnvironmentVariable(Envs.SP_AUDIT_QUEUE_CAPACITY);
}
+ @Override
+ public StringEnvironmentVariable getAuditRetentionSchedulerCron() {
+ return new StringEnvironmentVariable(Envs.SP_AUDIT_RETENTION_SCHEDULER_CRON);
+ }
+
@Override
public IntEnvironmentVariable getAuditShutdownTimeoutSeconds() {
return new IntEnvironmentVariable(Envs.SP_AUDIT_SHUTDOWN_TIMEOUT_SECONDS);
diff --git a/streampipes-commons/src/main/java/org/apache/streampipes/commons/environment/Environment.java b/streampipes-commons/src/main/java/org/apache/streampipes/commons/environment/Environment.java
index e5ccf3674b..a49129b62d 100644
--- a/streampipes-commons/src/main/java/org/apache/streampipes/commons/environment/Environment.java
+++ b/streampipes-commons/src/main/java/org/apache/streampipes/commons/environment/Environment.java
@@ -296,6 +296,8 @@ public interface Environment {
IntEnvironmentVariable getAuditQueueCapacity();
+ StringEnvironmentVariable getAuditRetentionSchedulerCron();
+
IntEnvironmentVariable getAuditShutdownTimeoutSeconds();
StringEnvironmentVariable getAuditInfluxOrg();
diff --git a/streampipes-model/src/main/java/org/apache/streampipes/model/configuration/SpCoreConfiguration.java b/streampipes-model/src/main/java/org/apache/streampipes/model/configuration/SpCoreConfiguration.java
index 4d3bc3a5e1..260510e679 100644
--- a/streampipes-model/src/main/java/org/apache/streampipes/model/configuration/SpCoreConfiguration.java
+++ b/streampipes-model/src/main/java/org/apache/streampipes/model/configuration/SpCoreConfiguration.java
@@ -18,6 +18,8 @@
package org.apache.streampipes.model.configuration;
+import org.apache.streampipes.model.dataset.RetentionTimeConfig;
+
import com.google.gson.annotations.SerializedName;
import java.util.List;
@@ -33,6 +35,7 @@ public class SpCoreConfiguration {
private EmailConfig emailConfig;
private EmailTemplateConfig emailTemplateConfig;
private GeneralConfig generalConfig;
+ private RetentionTimeConfig auditRetentionConfiguration;
private LocationConfig locationConfig;
private boolean isConfigured;
@@ -87,6 +90,14 @@ public class SpCoreConfiguration {
this.generalConfig = generalConfig;
}
+ public RetentionTimeConfig getAuditRetentionConfiguration() {
+ return auditRetentionConfiguration;
+ }
+
+ public void setAuditRetentionConfiguration(RetentionTimeConfig auditRetentionConfiguration) {
+ this.auditRetentionConfiguration = auditRetentionConfiguration;
+ }
+
public boolean isConfigured() {
return isConfigured;
}
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/admin/AuditResource.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/admin/AuditResource.java
index 0312e7d439..4f70a3c3f7 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/admin/AuditResource.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/admin/AuditResource.java
@@ -25,6 +25,7 @@ import org.apache.streampipes.audit.api.AuditExportFormat;
import org.apache.streampipes.audit.api.AuditPage;
import org.apache.streampipes.audit.api.AuditQuery;
import org.apache.streampipes.audit.api.AuditStatus;
+import org.apache.streampipes.model.dataset.RetentionTimeConfig;
import org.apache.streampipes.resource.management.SpResourceManager;
import org.apache.streampipes.rest.core.base.impl.AbstractAuthGuardedRestResource;
import org.apache.streampipes.rest.security.AuthConstants;
@@ -35,8 +36,11 @@ import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@@ -62,6 +66,32 @@ public class AuditResource extends AbstractAuthGuardedRestResource {
public AuditStatus status() {
return resourceManager.getAuditService().status();
}
+
+ @GetMapping(path = "/retention", produces = MediaType.APPLICATION_JSON_VALUE)
+ @PreAuthorize(AuthConstants.IS_ADMIN_ROLE)
+ @Operation(summary = "Inspect audit retention configuration", tags = {"Audit"})
+ public RetentionTimeConfig retention() {
+ return resourceManager.getCoreConfigurationStorage().get().getAuditRetentionConfiguration();
+ }
+
+ @PutMapping(path = "/retention", consumes = MediaType.APPLICATION_JSON_VALUE)
+ @PreAuthorize(AuthConstants.IS_ADMIN_ROLE)
+ @Operation(summary = "Configure audit retention", tags = {"Audit"})
+ public void configureRetention(@RequestBody RetentionTimeConfig config) {
+ var coreConfiguration = resourceManager.getCoreConfigurationStorage().get();
+ coreConfiguration.setAuditRetentionConfiguration(config);
+ resourceManager.getCoreConfigurationStorage().updateElement(coreConfiguration);
+ }
+
+ @DeleteMapping(path = "/retention")
+ @PreAuthorize(AuthConstants.IS_ADMIN_ROLE)
+ @Operation(summary = "Delete audit retention configuration", tags = {"Audit"})
+ public void deleteRetention() {
+ var coreConfiguration = resourceManager.getCoreConfigurationStorage().get();
+ coreConfiguration.setAuditRetentionConfiguration(null);
+ resourceManager.getCoreConfigurationStorage().updateElement(coreConfiguration);
+ }
+
@GetMapping(path = "/events", produces = MediaType.APPLICATION_JSON_VALUE)
@PreAuthorize(AuthConstants.IS_ADMIN_ROLE)
@Operation(summary = "Fetch a bounded page of audit events", tags = {"Audit"})
diff --git a/streampipes-service-core/src/main/java/org/apache/streampipes/service/core/AuditConfiguration.java b/streampipes-service-core/src/main/java/org/apache/streampipes/service/core/AuditConfiguration.java
index 92c9d1f4ea..fb44153518 100644
--- a/streampipes-service-core/src/main/java/org/apache/streampipes/service/core/AuditConfiguration.java
+++ b/streampipes-service-core/src/main/java/org/apache/streampipes/service/core/AuditConfiguration.java
@@ -24,8 +24,11 @@ import org.apache.streampipes.audit.api.AuditService;
import org.apache.streampipes.audit.events.StandardAuditEvents;
import org.apache.streampipes.audit.events.authentication.AuthenticationAuditRecorder;
import org.apache.streampipes.audit.influx.InfluxAuditEventStore;
+import org.apache.streampipes.audit.management.AuditRetentionManager;
import org.apache.streampipes.audit.management.DefaultAuditService;
import org.apache.streampipes.commons.environment.Environments;
+import org.apache.streampipes.storage.api.system.IFileMetadataStorage;
+import org.apache.streampipes.storage.api.system.ISpCoreConfigurationStorage;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@@ -83,4 +86,11 @@ public class AuditConfiguration {
environment.getAuditQueueCapacity().getValueOrDefault(),
Duration.ofSeconds(environment.getAuditShutdownTimeoutSeconds().getValueOrDefault()));
}
+
+ @Bean
+ public AuditRetentionManager auditRetentionManager(AuditEventStore auditEventStore,
+ ISpCoreConfigurationStorage coreConfigurationStorage,
+ IFileMetadataStorage fileMetadataStorage) {
+ return new AuditRetentionManager(auditEventStore, coreConfigurationStorage, fileMetadataStorage);
+ }
}
diff --git a/streampipes-service-core/src/main/java/org/apache/streampipes/service/core/scheduler/AuditRetentionScheduler.java b/streampipes-service-core/src/main/java/org/apache/streampipes/service/core/scheduler/AuditRetentionScheduler.java
new file mode 100644
index 0000000000..f745e24a9e
--- /dev/null
+++ b/streampipes-service-core/src/main/java/org/apache/streampipes/service/core/scheduler/AuditRetentionScheduler.java
@@ -0,0 +1,63 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.streampipes.service.core.scheduler;
+
+import org.apache.streampipes.audit.management.AuditRetentionManager;
+import org.apache.streampipes.commons.environment.Environments;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.scheduling.annotation.SchedulingConfigurer;
+import org.springframework.scheduling.config.ScheduledTaskRegistrar;
+import org.springframework.scheduling.support.CronTrigger;
+
+@Configuration
+public class AuditRetentionScheduler implements SchedulingConfigurer {
+
+ private static final Logger LOG = LoggerFactory.getLogger(AuditRetentionScheduler.class);
+ private final AuditRetentionManager auditRetentionManager;
+
+ public AuditRetentionScheduler(AuditRetentionManager auditRetentionManager) {
+ this.auditRetentionManager = auditRetentionManager;
+ }
+
+ public void cleanupAuditEvents() {
+ try {
+ if (!Environments.getEnvironment().getAuditEnabled().getValueOrDefault()) {
+ return;
+ }
+ auditRetentionManager.cleanup();
+ } catch (RuntimeException e) {
+ LOG.error("Audit retention cleanup failed", e);
+ }
+ LOG.info("Audit CRON Job finished.");
+ }
+
+ @Override
+ public void configureTasks(ScheduledTaskRegistrar taskRegistrar) {
+ var environment = Environments.getEnvironment();
+ if (!environment.getAuditEnabled().getValueOrDefault()) {
+ return;
+ }
+ taskRegistrar.addTriggerTask(this::cleanupAuditEvents,
+ triggerContext -> new CronTrigger(environment.getAuditRetentionSchedulerCron().getValueOrDefault())
+ .nextExecution(triggerContext));
+ }
+}
diff --git a/streampipes-service-core/src/test/java/org/apache/streampipes/service/core/AuditConfigurationTest.java b/streampipes-service-core/src/test/java/org/apache/streampipes/service/core/AuditConfigurationTest.java
index 2fde7d7f13..38fe9642b7 100644
--- a/streampipes-service-core/src/test/java/org/apache/streampipes/service/core/AuditConfigurationTest.java
+++ b/streampipes-service-core/src/test/java/org/apache/streampipes/service/core/AuditConfigurationTest.java
@@ -26,6 +26,8 @@ import org.apache.streampipes.audit.influx.InfluxAuditEventStore;
import org.apache.streampipes.commons.constants.CustomEnvs;
import org.apache.streampipes.resource.management.SpResourceManager;
import org.apache.streampipes.rest.impl.admin.AuditResource;
+import org.apache.streampipes.storage.api.system.IFileMetadataStorage;
+import org.apache.streampipes.storage.api.system.ISpCoreConfigurationStorage;
import org.junit.jupiter.api.Test;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
@@ -59,7 +61,11 @@ class AuditConfigurationTest {
@Test
void defaultsToDisabledWithoutConnectingToStorage() {
try (var envs = mockStatic(CustomEnvs.class);
- var context = new AnnotationConfigApplicationContext(AuditConfiguration.class)) {
+ var context = new AnnotationConfigApplicationContext()) {
+ registerRetentionStorage(context);
+ context.register(AuditConfiguration.class);
+ context.refresh();
+
assertFalse(context.getBean(AuditService.class).status().enabled());
}
}
@@ -70,6 +76,7 @@ class AuditConfigurationTest {
var context = new AnnotationConfigApplicationContext()) {
envs.when(() -> CustomEnvs.exists("SP_AUDIT_ENABLED")).thenReturn(true);
envs.when(() -> CustomEnvs.getEnv("SP_AUDIT_ENABLED")).thenReturn("true");
+ registerRetentionStorage(context);
context.register(AuditConfiguration.class);
context.refresh();
var service = context.getBean(AuditService.class);
@@ -96,6 +103,7 @@ class AuditConfigurationTest {
envs.when(() -> CustomEnvs.exists(key)).thenReturn(true);
envs.when(() -> CustomEnvs.getEnv(key)).thenReturn(value);
});
+ registerRetentionStorage(context);
context.register(AuditConfiguration.class);
context.refresh();
assertInstanceOf(InfluxAuditEventStore.class, context.getBean(AuditEventStore.class));
@@ -104,6 +112,24 @@ class AuditConfigurationTest {
}
}
+ @Test
+ void createsRetentionManagerWhenRetentionStorageIsAvailable() {
+ try (var context = new AnnotationConfigApplicationContext()) {
+ registerRetentionStorage(context);
+ context.register(AuditConfiguration.class);
+ context.refresh();
+
+ assertTrue(context.containsBean("auditRetentionManager"));
+ }
+ }
+
+ private void registerRetentionStorage(AnnotationConfigApplicationContext context) {
+ context.registerBean(ISpCoreConfigurationStorage.class,
+ () -> mock(ISpCoreConfigurationStorage.class));
+ context.registerBean(IFileMetadataStorage.class,
+ () -> mock(IFileMetadataStorage.class));
+ }
+
@Test
void statusRequiresAdministratorRole() {
try (var context = new AnnotationConfigApplicationContext()) {
diff --git a/ui/deployment/i18n/de.json b/ui/deployment/i18n/de.json
index 1c0d06d375..5ef9a32716 100644
--- a/ui/deployment/i18n/de.json
+++ b/ui/deployment/i18n/de.json
@@ -84,7 +84,7 @@
"Add the current dashboard to an existing asset": "Das aktuelle Dashboard zu einem bestehenden Asset hinzufügen",
"Add to Asset": "Zu Asset hinzufügen",
"Add user": "Benutzer hinzufügen",
- "Add, Edit, and Delete export providers used for backing up data lakes.": "Hinzufügen, Bearbeiten und Löschen von Exportanbietern, die für die Sicherung von Data Lakes verwendet werden.",
+ "Add, Edit, and Delete export providers used for backing up datasets and audit logs.": "Hinzufügen, Bearbeiten und Löschen von Exportanbietern, die für die Sicherung von Datansätzen und Audit-Protokolle verwendet werden.",
"Additional documents from generic storage": "Zusätzliche Dokumente aus dem Generic Storage",
"Additional exports": "Zusätzliche Exporte",
"Advanced Filter": "Erweiterter Filter",
@@ -114,6 +114,8 @@
"Anywhere": "Überall",
"App Name": "App Name",
"Appearance": "Darstellung",
+ "Application Data": "Anwendungsdaten",
+ "Application configuration files": "Konfigurationsdateien der Anwendung",
"Apply": "Anwenden",
"Apply filters": "Filter anwenden",
"Are you sure you want to delete chart \"{{chartTitle}}\"?": "Sind Sie sicher, dass Sie das Diagramm \"{{chartTitle}}\" löschen wollen?",
diff --git a/ui/deployment/i18n/en.json b/ui/deployment/i18n/en.json
index 5681083c41..5202967aef 100644
--- a/ui/deployment/i18n/en.json
+++ b/ui/deployment/i18n/en.json
@@ -84,7 +84,7 @@
"Add the current dashboard to an existing asset": null,
"Add to Asset": null,
"Add user": null,
- "Add, Edit, and Delete export providers used for backing up data lakes.": null,
+ "Add, Edit, and Delete export providers used for backing up datasets and audit logs.": null,
"Additional documents from generic storage": null,
"Additional exports": null,
"Advanced Filter": null,
@@ -114,6 +114,8 @@
"Anywhere": "Anywhere",
"App Name": null,
"Appearance": null,
+ "Application Data": null,
+ "Application configuration files": null,
"Apply": null,
"Apply filters": "Apply filters",
"Are you sure you want to delete chart \"{{chartTitle}}\"?": "Are you sure you want to delete chart \"{{chartTitle}}\"?",
diff --git a/ui/deployment/i18n/pl.json b/ui/deployment/i18n/pl.json
index 9903c3a0f3..d75406abbc 100644
--- a/ui/deployment/i18n/pl.json
+++ b/ui/deployment/i18n/pl.json
@@ -84,7 +84,7 @@
"Add the current dashboard to an existing asset": "Dodaj bieżący pulpit do istniejącego zasobu",
"Add to Asset": "Dodaj do zasobu",
"Add user": "Dodaj użytkownika",
- "Add, Edit, and Delete export providers used for backing up data lakes.": "Dodawaj, edytuj i usuwaj exporterów używanych do tworzenia kopii zapasowych Data Lake.",
+ "Add, Edit, and Delete export providers used for backing up datasets and audit logs.": "Dodawaj, edytuj i usuwaj exporterów używanych do tworzenia kopii zapasowych Data Lake.",
"Additional documents from generic storage": "Dodatkowe dokumenty z ogólnego magazynu",
"Additional exports": "Dodatkowe eksporty",
"Advanced Filter": "Filtr zaawansowany",
@@ -114,6 +114,8 @@
"Anywhere": "Wszędzie",
"App Name": "Nazwa aplikacji",
"Appearance": "Wygląd",
+ "Application Data": "Dane aplikacji",
+ "Application configuration files": "Pliki konfiguracyjne aplikacji",
"Apply": "Zastosuj",
"Apply filters": "Zastosuj filtry",
"Are you sure you want to delete chart \"{{chartTitle}}\"?": "Czy na pewno chcesz usunąć wykres \"{{chartTitle}}\"?",
diff --git a/ui/projects/streampipes/platform-services/src/lib/apis/audit.service.ts b/ui/projects/streampipes/platform-services/src/lib/apis/audit.service.ts
index f0f8177930..f406f84736 100644
--- a/ui/projects/streampipes/platform-services/src/lib/apis/audit.service.ts
+++ b/ui/projects/streampipes/platform-services/src/lib/apis/audit.service.ts
@@ -27,6 +27,7 @@ import {
AuditQuery,
AuditStatus,
} from '../model/audit/audit.model';
+import { RetentionTimeConfig } from '../model/gen/streampipes-model';
@Injectable({ providedIn: 'root' })
export class AuditService {
@@ -37,6 +38,20 @@ export class AuditService {
return this.http.get<AuditStatus>(`${this.baseUrl}/status`);
}
+ getRetention(): Observable<RetentionTimeConfig | null> {
+ return this.http.get<RetentionTimeConfig | null>(
+ `${this.baseUrl}/retention`,
+ );
+ }
+
+ setRetention(config: RetentionTimeConfig): Observable<void> {
+ return this.http.put<void>(`${this.baseUrl}/retention`, config);
+ }
+
+ deleteRetention(): Observable<void> {
+ return this.http.delete<void>(`${this.baseUrl}/retention`);
+ }
+
getEventTypes(): Observable<string[]> {
return this.http.get<string[]>(`${this.baseUrl}/event-types`);
}
diff --git a/ui/src/app/configuration/audit-log/audit-log.component.html b/ui/src/app/configuration/audit-log/audit-log.component.html
index 3e42c42fb4..079c663690 100644
--- a/ui/src/app/configuration/audit-log/audit-log.component.html
+++ b/ui/src/app/configuration/audit-log/audit-log.component.html
@@ -23,12 +23,19 @@
<button
section-actions
mat-icon-button
- data-cy="audit-log-download-button"
- [attr.aria-label]="'Download audit log' | translate"
- [matTooltip]="'Download audit log' | translate"
- (click)="openDownloadDialog()"
+ [attr.aria-label]="'Set retention rate' | translate"
+ [matTooltip]="'Set retention rate' | translate"
+ (click)="showRetention()"
[disabled]="!status?.enabled"
>
+ <mat-icon
+ [class.audit-retention-configured]="retention"
+ [class.audit-retention-unconfigured]="!retention"
+ >history</mat-icon
+ >
+ data-cy="audit-log-download-button" [attr.aria-label]="'Download audit
+ log' | translate" [matTooltip]="'Download audit log' | translate"
+ (click)="openDownloadDialog()" [disabled]="!status?.enabled" >
<mat-icon>download</mat-icon>
</button>
<button
diff --git a/ui/src/app/configuration/audit-log/audit-log.component.scss b/ui/src/app/configuration/audit-log/audit-log.component.scss
index 47f0eca684..a3b57e67d8 100644
--- a/ui/src/app/configuration/audit-log/audit-log.component.scss
+++ b/ui/src/app/configuration/audit-log/audit-log.component.scss
@@ -34,6 +34,14 @@ mat-form-field {
width: 100%;
}
+.audit-retention-configured {
+ color: var(--color-success);
+}
+
+.audit-retention-unconfigured {
+ color: var(--color-neutral);
+}
+
.audit-filters {
margin-bottom: var(--space-lg);
}
diff --git a/ui/src/app/configuration/audit-log/audit-log.component.spec.ts b/ui/src/app/configuration/audit-log/audit-log.component.spec.ts
index 05cd1e0532..a868501231 100644
--- a/ui/src/app/configuration/audit-log/audit-log.component.spec.ts
+++ b/ui/src/app/configuration/audit-log/audit-log.component.spec.ts
@@ -17,6 +17,7 @@
*/
import { TranslateService } from '@ngx-translate/core';
+import { AuditRetentionDialogComponent } from '../dialog/audit-retention/audit-retention-dialog.component';
import { AuditDialogComponent } from '../dialog/audit-log/audit-dialog.component';
import { AuditDownloadDialogComponent } from '../dialog/audit-log-download/audit-download-dialog.component';
import { TestBed } from '@angular/core/testing';
@@ -47,6 +48,7 @@ describe('AuditLogComponent', () => {
};
const api = {
getStatus: vi.fn(),
+ getRetention: vi.fn(),
getEventTypes: vi.fn(),
getEvents: vi.fn(),
getDetails: vi.fn(),
@@ -64,6 +66,7 @@ describe('AuditLogComponent', () => {
type => type === 'adapter',
);
api.getStatus.mockReturnValue(of({ enabled: true }));
+ api.getRetention.mockReturnValue(of(null));
api.getEventTypes.mockReturnValue(of(['sp.adapter.create']));
api.getEvents.mockReturnValue(
of({ items: [event], nextCursor: 'next' }),
@@ -190,109 +193,125 @@ describe('AuditLogComponent', () => {
);
});
- it('opens a download dialog with the active audit filters', () => {
- component.ngOnInit();
- component.openDownloadDialog();
+ it('opens the retention configuration panel and refreshes its icon state after saving', () => {
+ dialogs.open.mockReturnValue({ afterClosed: () => of(true) });
+ component.showRetention();
expect(dialogs.open).toHaveBeenCalledWith(
- AuditDownloadDialogComponent,
- expect.objectContaining({
- data: expect.objectContaining({
- query: expect.objectContaining({
- from: expect.any(String),
- to: expect.any(String),
+ AuditRetentionDialogComponent,
+ expect.objectContaining({ title: 'Retention' }),
+ );
+ expect(api.getRetention).toHaveBeenCalled();
+ it('opens a download dialog with the active audit filters', () => {
+ component.ngOnInit();
+ component.openDownloadDialog();
+ expect(dialogs.open).toHaveBeenCalledWith(
+ AuditDownloadDialogComponent,
+ expect.objectContaining({
+ data: expect.objectContaining({
+ query: expect.objectContaining({
+ from: expect.any(String),
+ to: expect.any(String),
+ }),
}),
}),
- }),
- );
- });
+ );
+ });
- it('distinguishes storage failure from empty results and allows retry', () => {
- api.getEvents.mockReturnValueOnce(throwError(() => ({ status: 503 })));
- component.ngOnInit();
- expect(component.failed).toBe(true);
- expect(component.loading).toBe(false);
- component.retry();
- expect(component.failed).toBe(false);
- expect(component.dataSource.data).toEqual([event]);
- });
+ it('distinguishes storage failure from empty results and allows retry', () => {
+ api.getEvents.mockReturnValueOnce(
+ throwError(() => ({ status: 503 })),
+ );
+ component.ngOnInit();
+ expect(component.failed).toBe(true);
+ expect(component.loading).toBe(false);
+ component.retry();
+ expect(component.failed).toBe(false);
+ expect(component.dataSource.data).toEqual([event]);
+ });
- it('does not query storage when auditing is disabled', () => {
- api.getStatus.mockReturnValue(of({ enabled: false }));
- component.ngOnInit();
- expect(api.getEvents).not.toHaveBeenCalled();
- });
- it('loads usernames once per refresh and reuses them across pages and dialogs', () => {
- component.ngOnInit();
- expect(component.usernames.get(event.actor)).toBe('operator');
- component.next();
- component.previous();
- expect(users.listUsers).toHaveBeenCalledExactlyOnceWith(true);
- component.showDetails(event);
- expect(dialogs.open.mock.calls.at(-1)[1].data).toEqual({
- event,
- username: 'operator',
+ it('does not query storage when auditing is disabled', () => {
+ api.getStatus.mockReturnValue(of({ enabled: false }));
+ component.ngOnInit();
+ expect(api.getEvents).not.toHaveBeenCalled();
+ });
+ it('loads usernames once per refresh and reuses them across pages and dialogs', () => {
+ component.ngOnInit();
+ expect(component.usernames.get(event.actor)).toBe('operator');
+ component.next();
+ component.previous();
+ expect(users.listUsers).toHaveBeenCalledExactlyOnceWith(true);
+ component.showDetails(event);
+ expect(dialogs.open.mock.calls.at(-1)[1].data).toEqual({
+ event,
+ username: 'operator',
+ });
+ expect(event.actor).toBe('user-1');
});
- expect(event.actor).toBe('user-1');
- });
- it('refreshes renamed users and removes deleted usernames', () => {
- component.refresh();
- users.listUsers.mockReturnValue(
- of([{ principalId: 'user-1', email: 'renamed' }]),
- );
- component.refresh();
- expect(component.usernames.get(event.actor)).toBe('renamed');
- users.listUsers.mockReturnValue(of([]));
- component.refresh();
- expect(component.usernames.get(event.actor)).toBeUndefined();
- });
+ it('refreshes renamed users and removes deleted usernames', () => {
+ component.refresh();
+ users.listUsers.mockReturnValue(
+ of([{ principalId: 'user-1', email: 'renamed' }]),
+ );
+ component.refresh();
+ expect(component.usernames.get(event.actor)).toBe('renamed');
+ users.listUsers.mockReturnValue(of([]));
+ component.refresh();
+ expect(component.usernames.get(event.actor)).toBeUndefined();
+ });
- it('keeps audit events available when username lookup fails', () => {
- users.listUsers.mockReturnValue(
- throwError(() => new Error('unavailable')),
- );
- component.refresh();
- expect(component.usernames.size).toBe(0);
- expect(component.dataSource.data).toEqual([event]);
- expect(component.failed).toBe(false);
- });
- it('resolves typed usernames and selected users to principal IDs', () => {
- component.refresh();
- component.actor = 'OPERATOR';
- component.apply();
- expect(api.getEvents.mock.calls.at(-1)[0].actor).toBe('user-1');
- component.onActorChange(component.actorFromText('operator'));
- expect(component.actor).toBe('user-1');
- component.onActorChange(component.actorFromText('deleted-user'));
- component.apply();
- expect(api.getEvents.mock.calls.at(-1)[0].actor).toBe('deleted-user');
- component.onActorChange(undefined);
- component.apply();
- expect(api.getEvents.mock.calls.at(-1)[0].actor).toBe('');
- });
- it('selects and clears event and outcome filters using their stored IDs', () => {
- component.refresh();
- component.onEventTypeChange('sp.adapter.start');
- component.onOutcomeChange({ id: 'succeeded', label: 'Erfolgreich' });
- component.apply();
- expect(api.getEvents.mock.calls.at(-1)[0]).toMatchObject({
- eventType: 'sp.adapter.start',
- outcome: 'succeeded',
+ it('keeps audit events available when username lookup fails', () => {
+ users.listUsers.mockReturnValue(
+ throwError(() => new Error('unavailable')),
+ );
+ component.refresh();
+ expect(component.usernames.size).toBe(0);
+ expect(component.dataSource.data).toEqual([event]);
+ expect(component.failed).toBe(false);
});
- component.onEventTypeChange(undefined);
- component.onOutcomeChange(undefined);
- component.apply();
- expect(api.getEvents.mock.calls.at(-1)[0]).toMatchObject({
- eventType: '',
- outcome: '',
+ it('resolves typed usernames and selected users to principal IDs', () => {
+ component.refresh();
+ component.actor = 'OPERATOR';
+ component.apply();
+ expect(api.getEvents.mock.calls.at(-1)[0].actor).toBe('user-1');
+ component.onActorChange(component.actorFromText('operator'));
+ expect(component.actor).toBe('user-1');
+ component.onActorChange(component.actorFromText('deleted-user'));
+ component.apply();
+ expect(api.getEvents.mock.calls.at(-1)[0].actor).toBe(
+ 'deleted-user',
+ );
+ component.onActorChange(undefined);
+ component.apply();
+ expect(api.getEvents.mock.calls.at(-1)[0].actor).toBe('');
+ });
+ it('selects and clears event and outcome filters using their stored IDs', () => {
+ component.refresh();
+ component.onEventTypeChange('sp.adapter.start');
+ component.onOutcomeChange({
+ id: 'succeeded',
+ label: 'Erfolgreich',
+ });
+ component.apply();
+ expect(api.getEvents.mock.calls.at(-1)[0]).toMatchObject({
+ eventType: 'sp.adapter.start',
+ outcome: 'succeeded',
+ });
+ component.onEventTypeChange(undefined);
+ component.onOutcomeChange(undefined);
+ component.apply();
+ expect(api.getEvents.mock.calls.at(-1)[0]).toMatchObject({
+ eventType: '',
+ outcome: '',
+ });
});
- });
- it('displays only usernames while keeping IDs searchable', () => {
- component.refresh();
- expect(component.actorOptions[0].label).toBe('operator');
- expect(component.actorSearchText(component.actorOptions[0])).toBe(
- 'operator user-1',
- );
+ it('displays only usernames while keeping IDs searchable', () => {
+ component.refresh();
+ expect(component.actorOptions[0].label).toBe('operator');
+ expect(component.actorSearchText(component.actorOptions[0])).toBe(
+ 'operator user-1',
+ );
+ });
});
});
diff --git a/ui/src/app/configuration/audit-log/audit-log.component.ts b/ui/src/app/configuration/audit-log/audit-log.component.ts
index 370f735f1d..1ab48befb0 100644
--- a/ui/src/app/configuration/audit-log/audit-log.component.ts
+++ b/ui/src/app/configuration/audit-log/audit-log.component.ts
@@ -43,6 +43,7 @@ import {
AuditEntry,
AuditQuery,
AuditStatus,
+ RetentionTimeConfig,
UserService,
} from '@streampipes/platform-services';
import {
@@ -69,6 +70,7 @@ import {
import { SpConfigurationRoutes } from '../configuration.breadcrumb';
import { auditOutcomeTone } from './audit-outcome';
+import { AuditRetentionDialogComponent } from '../dialog/audit-retention/audit-retention-dialog.component';
@Component({
selector: 'sp-audit-log',
@@ -111,6 +113,7 @@ export class AuditLogComponent implements OnInit {
private featureCards = inject(FeatureCardService);
private listRequest?: Subscription;
status?: AuditStatus;
+ retention?: RetentionTimeConfig | null;
statusError = false;
types: string[] = [];
days = 1;
@@ -245,6 +248,7 @@ export class AuditLogComponent implements OnInit {
next: status => {
this.status = status;
if (status.enabled) {
+ this.loadRetention();
this.apply();
}
},
@@ -340,6 +344,26 @@ export class AuditLogComponent implements OnInit {
});
}
+ showRetention(): void {
+ const dialogRef = this.dialogs.open(AuditRetentionDialogComponent, {
+ panelType: PanelType.SLIDE_IN_PANEL,
+ width: '32rem',
+ title: this.translate.instant('Retention'),
+ });
+ dialogRef.afterClosed().subscribe(changed => {
+ if (changed) {
+ this.loadRetention();
+ }
+ });
+ }
+
+ private loadRetention(): void {
+ this.api
+ .getRetention()
+ .pipe(takeUntilDestroyed(this.destroyRef))
+ .subscribe({ next: retention => (this.retention = retention) });
+ }
+
openDownloadDialog(): void {
if (!this.query) {
return;
diff --git a/ui/src/app/configuration/dialog/audit-retention/audit-retention-dialog.component.html b/ui/src/app/configuration/dialog/audit-retention/audit-retention-dialog.component.html
new file mode 100644
index 0000000000..3573be9725
--- /dev/null
+++ b/ui/src/app/configuration/dialog/audit-retention/audit-retention-dialog.component.html
@@ -0,0 +1,57 @@
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one or more
+ ~ contributor license agreements. See the NOTICE file distributed with
+ ~ this work for additional information regarding copyright ownership.
+ ~ The ASF licenses this file to You under the Apache License, Version 2.0
+ ~ (the "License"); you may not use this file except in compliance with
+ ~ the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ ~
+ -->
+
+<div class="sp-dialog-container">
+ <div class="sp-dialog-content p-15">
+ @if (!loading) {
+ <sp-select-data [dataRetentionConfig]="retentionConfig">
+ </sp-select-data>
+ @if (requiresExportValidation()) {
+ <sp-data-export [dataRetentionConfig]="retentionConfig">
+ </sp-data-export>
+ }
+ }
+ </div>
+ <mat-divider />
+ <div class="sp-dialog-actions">
+ <button
+ mat-flat-button
+ color="accent"
+ [disabled]="
+ loading ||
+ saving ||
+ retentionConfig.dataRetentionConfig.olderThanDays < 1 ||
+ (requiresExportValidation() && !isExportValid())
+ "
+ (click)="save()"
+ >
+ {{ 'Save' | translate }}
+ </button>
+ <button
+ mat-flat-button
+ color="accent"
+ [disabled]="loading || saving || !configured"
+ (click)="delete()"
+ >
+ {{ 'Delete' | translate }}
+ </button>
+ <button mat-flat-button class="mat-basic" (click)="close()">
+ {{ 'Close' | translate }}
+ </button>
+ </div>
+</div>
diff --git a/streampipes-audit-api/src/main/java/org/apache/streampipes/audit/api/AuditEventStore.java b/ui/src/app/configuration/dialog/audit-retention/audit-retention-dialog.component.scss
similarity index 67%
copy from streampipes-audit-api/src/main/java/org/apache/streampipes/audit/api/AuditEventStore.java
copy to ui/src/app/configuration/dialog/audit-retention/audit-retention-dialog.component.scss
index 501f29799d..ebf788e5e3 100644
--- a/streampipes-audit-api/src/main/java/org/apache/streampipes/audit/api/AuditEventStore.java
+++ b/ui/src/app/configuration/dialog/audit-retention/audit-retention-dialog.component.scss
@@ -16,17 +16,6 @@
*
*/
-package org.apache.streampipes.audit.api;
-
-/** Append contract. Browsing is defined separately by AuditEventReader. */
-public interface AuditEventStore extends AutoCloseable {
- /** Called on the audit worker at startup; implementations may provision storage idempotently. */
- default void initialize() {
- }
-
- void append(AuditEvent<?> event);
-
- @Override
- default void close() {
- }
+.sp-dialog-actions {
+ gap: var(--space-sm);
}
diff --git a/ui/src/app/configuration/dialog/audit-retention/audit-retention-dialog.component.ts b/ui/src/app/configuration/dialog/audit-retention/audit-retention-dialog.component.ts
new file mode 100644
index 0000000000..192b23da94
--- /dev/null
+++ b/ui/src/app/configuration/dialog/audit-retention/audit-retention-dialog.component.ts
@@ -0,0 +1,139 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+import {
+ ChangeDetectionStrategy,
+ Component,
+ inject,
+ OnInit,
+} from '@angular/core';
+import { FormsModule } from '@angular/forms';
+import { MatButtonModule } from '@angular/material/button';
+import { MatDividerModule } from '@angular/material/divider';
+import { TranslatePipe } from '@ngx-translate/core';
+import {
+ AuditService,
+ RetentionTimeConfig,
+} from '@streampipes/platform-services';
+import { DialogRef } from '@streampipes/shared-ui';
+import { SelectDataExportComponent } from '../../../dataset/dialog/data-retention-dialog/components/select-export/select-format.component';
+import { SelectDataComponent } from '../../../dataset/dialog/data-retention-dialog/components/select-retention/select-data.component';
+
+@Component({
+ selector: 'sp-audit-retention-dialog',
+ templateUrl: './audit-retention-dialog.component.html',
+ styleUrls: ['./audit-retention-dialog.component.scss'],
+ changeDetection: ChangeDetectionStrategy.Eager,
+ imports: [
+ FormsModule,
+ MatButtonModule,
+ MatDividerModule,
+ TranslatePipe,
+ SelectDataComponent,
+ SelectDataExportComponent,
+ ],
+})
+export class AuditRetentionDialogComponent implements OnInit {
+ private api = inject(AuditService);
+ private dialogRef = inject(DialogRef<AuditRetentionDialogComponent>);
+
+ retentionConfig!: RetentionTimeConfig;
+ configured = false;
+ loading = true;
+ saving = false;
+
+ ngOnInit(): void {
+ this.api.getRetention().subscribe({
+ next: config => {
+ this.configured = config !== null;
+ this.retentionConfig = config ?? this.defaultConfig();
+ this.loading = false;
+ },
+ error: () => {
+ this.configured = false;
+ this.retentionConfig = this.defaultConfig();
+ this.loading = false;
+ },
+ });
+ }
+
+ save(): void {
+ if (
+ this.retentionConfig.dataRetentionConfig.olderThanDays < 1 ||
+ this.saving
+ ) {
+ return;
+ }
+ this.saving = true;
+ this.api.setRetention(this.retentionConfig).subscribe({
+ next: () => this.dialogRef.close(true),
+ error: () => (this.saving = false),
+ });
+ }
+
+ delete(): void {
+ if (!this.configured || this.saving) {
+ return;
+ }
+ this.saving = true;
+ this.api.deleteRetention().subscribe({
+ next: () => this.dialogRef.close(true),
+ error: () => (this.saving = false),
+ });
+ }
+
+ close(): void {
+ this.dialogRef.close(false);
+ }
+
+ requiresExportValidation(): boolean {
+ const action = this.retentionConfig?.dataRetentionConfig?.action;
+ return action === 'SAVE' || action === 'SAVEDELETE';
+ }
+
+ isExportValid(): boolean {
+ const exportConfig =
+ this.retentionConfig?.retentionExportConfig?.exportConfig;
+ const providerId =
+ this.retentionConfig?.retentionExportConfig?.exportProviderId;
+ return (
+ !!exportConfig?.format &&
+ (exportConfig.format !== 'csv' || !!exportConfig.csvDelimiter) &&
+ !!providerId
+ );
+ }
+
+ private defaultConfig(): RetentionTimeConfig {
+ return RetentionTimeConfig.fromData({
+ dataRetentionConfig: {
+ olderThanDays: 30,
+ interval: 'DAILY',
+ action: 'DELETE',
+ },
+ retentionExportConfig: {
+ exportConfig: {
+ format: 'csv',
+ csvDelimiter: 'comma',
+ missingValueBehaviour: 'ignore',
+ headerColumnName: 'key',
+ },
+ exportProviderId: '',
+ },
+ } as RetentionTimeConfig);
+ }
+}
diff --git a/ui/src/app/configuration/export/data-export-import.component.html b/ui/src/app/configuration/export/data-export-import.component.html
index 19edc84413..004381d4ad 100644
--- a/ui/src/app/configuration/export/data-export-import.component.html
+++ b/ui/src/app/configuration/export/data-export-import.component.html
@@ -17,8 +17,12 @@
-->
<div fxLayout="column">
- <div fxFlex="100" fxLayout="column" fxLayoutAlign="start start">
+ <sp-split-section
+ [title]="'Application Data' | translate"
+ [subtitle]="'Application configuration files' | translate"
+ >
<sp-split-section
+ [level]="3"
[title]="'Export' | translate"
[subtitle]="'Export assets and all linked resources' | translate"
>
@@ -66,9 +70,9 @@
</button>
</div>
</sp-split-section>
- </div>
- <div fxFlex="100" fxLayout="column" fxLayoutAlign="start start">
+
<sp-split-section
+ [level]="3"
[title]="'Import' | translate"
[subtitle]="'Import from application package' | translate"
>
@@ -85,5 +89,7 @@
</button>
</div>
</sp-split-section>
- </div>
+ </sp-split-section>
+
+ <sp-export-provider-configuration></sp-export-provider-configuration>
</div>
diff --git a/ui/src/app/configuration/export/data-export-import.component.ts b/ui/src/app/configuration/export/data-export-import.component.ts
index 2c433e9cf5..ddaaae54a4 100644
--- a/ui/src/app/configuration/export/data-export-import.component.ts
+++ b/ui/src/app/configuration/export/data-export-import.component.ts
@@ -43,11 +43,10 @@ import {
} from '@streampipes/platform-services';
import { MatCheckbox, MatCheckboxChange } from '@angular/material/checkbox';
import { SpDataExportDialogComponent } from './export-dialog/data-export-dialog.component';
+import { ExportProviderConfigurationComponent } from './export-provider-configuration/export-provider-configuration.component';
import { SpDataImportDialogComponent } from './import-dialog/data-import-dialog.component';
import { TranslatePipe, TranslateService } from '@ngx-translate/core';
import {
- FlexDirective,
- LayoutAlignDirective,
LayoutDirective,
LayoutGapDirective,
} from '@ngbracket/ngx-layout/flex';
@@ -68,14 +67,13 @@ interface AssetReferenceExportItems {
changeDetection: ChangeDetectionStrategy.Eager,
imports: [
LayoutDirective,
- FlexDirective,
- LayoutAlignDirective,
LayoutGapDirective,
SplitSectionComponent,
MatCheckbox,
MatButton,
TranslatePipe,
MatIcon,
+ ExportProviderConfigurationComponent,
],
})
export class SpDataExportImportComponent implements OnInit {
diff --git a/ui/src/app/configuration/export/export-provider-configuration/export-provider-configuration.component.html b/ui/src/app/configuration/export/export-provider-configuration/export-provider-configuration.component.html
new file mode 100644
index 0000000000..bc7b761828
--- /dev/null
+++ b/ui/src/app/configuration/export/export-provider-configuration/export-provider-configuration.component.html
@@ -0,0 +1,163 @@
+<!--
+~ Licensed to the Apache Software Foundation (ASF) under one or more
+~ contributor license agreements. See the NOTICE file distributed with
+~ this work for additional information regarding copyright ownership.
+~ The ASF licenses this file to You under the Apache License, Version 2.0
+~ (the "License"); you may not use this file except in compliance with
+~ the License. You may obtain a copy of the License at
+~
+~ http://www.apache.org/licenses/LICENSE-2.0
+~
+~ Unless required by applicable law or agreed to in writing, software
+~ distributed under the License is distributed on an "AS IS" BASIS,
+~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+~ See the License for the specific language governing permissions and
+~ limitations under the License.
+~
+-->
+
+@if (isAdmin) {
+ <sp-split-section
+ class="mt-xl"
+ [level]="2"
+ [title]="'Export Providers' | translate"
+ [subtitle]="
+ 'Add, Edit, and Delete export providers used for backing up datasets and audit logs.'
+ | translate
+ "
+ >
+ <div section-actions fxLayoutAlign="end center" fxLayoutGap="10px">
+ <button
+ mat-flat-button
+ [matTooltip]="'New' | translate"
+ data-cy="new-export-providers"
+ (click)="createExportProvider(null)"
+ >
+ <mat-icon>add</mat-icon>
+ <span>{{ 'New' | translate }}</span>
+ </button>
+ <button
+ mat-icon-button
+ [matTooltip]="'Refresh' | translate"
+ data-cy="refresh-export-providers-measures"
+ (click)="loadExportProviders()"
+ >
+ <mat-icon>refresh</mat-icon>
+ </button>
+ </div>
+
+ <table
+ fxFlex="100"
+ mat-table
+ data-cy="exportproviders-settings"
+ [dataSource]="dataSource"
+ class="export-provider-table"
+ matSort
+ >
+ <ng-container matColumnDef="providertype">
+ <th mat-header-cell mat-sort-header *matHeaderCellDef>
+ {{ 'Provider Type' | translate }}
+ </th>
+ <td mat-cell *matCellDef="let configurationEntry">
+ {{ configurationEntry.providerType }}
+ </td>
+ </ng-container>
+
+ <ng-container matColumnDef="endpoint">
+ <th mat-header-cell mat-sort-header *matHeaderCellDef>
+ {{ 'Endpoint' | translate }}
+ </th>
+ <td mat-cell *matCellDef="let configurationEntry">
+ {{ configurationEntry.endPoint }}
+ </td>
+ </ng-container>
+
+ <ng-container matColumnDef="bucket">
+ <th mat-header-cell mat-sort-header *matHeaderCellDef>
+ {{ 'Bucket' | translate }}
+ </th>
+ <td mat-cell *matCellDef="let configurationEntry">
+ {{ configurationEntry.bucketName }}
+ </td>
+ </ng-container>
+
+ <ng-container matColumnDef="editExportProvider">
+ <th mat-header-cell *matHeaderCellDef>
+ {{ 'Edit' | translate }}
+ </th>
+ <td mat-cell *matCellDef="let configurationEntry">
+ @if (configurationEntry.providerId !== 'FOLDER') {
+ <button
+ color="accent"
+ mat-icon-button
+ [matTooltip]="'Edit Export Provider' | translate"
+ matTooltipPosition="above"
+ data-cy="exportProvider-edit-btn"
+ (click)="createExportProvider(configurationEntry)"
+ >
+ <mat-icon>edit</mat-icon>
+ </button>
+ }
+ </td>
+ </ng-container>
+
+ <ng-container matColumnDef="delete">
+ <th mat-header-cell *matHeaderCellDef>
+ {{ 'Remove' | translate }}
+ </th>
+ <td mat-cell *matCellDef="let configurationEntry">
+ @if (configurationEntry.providerId !== 'FOLDER') {
+ <button
+ color="accent"
+ mat-icon-button
+ [matTooltip]="
+ 'Remove export provider configuration'
+ | translate
+ "
+ matTooltipPosition="above"
+ data-cy="exportProvider-delete-btn"
+ (click)="
+ deleteExportProvider(
+ configurationEntry.providerId
+ )
+ "
+ >
+ <mat-icon>delete</mat-icon>
+ </button>
+ }
+ </td>
+ </ng-container>
+
+ <ng-container matColumnDef="test">
+ <th mat-header-cell *matHeaderCellDef>
+ {{ 'Test' | translate }}
+ </th>
+ <td mat-cell *matCellDef="let configurationEntry">
+ <button
+ color="accent"
+ mat-icon-button
+ [matTooltip]="
+ 'Test export provider configuration' | translate
+ "
+ matTooltipPosition="above"
+ data-cy="exportProvider-test-btn"
+ (click)="
+ testExportProvider(configurationEntry.providerId)
+ "
+ >
+ <mat-icon>bug_report</mat-icon>
+ </button>
+ </td>
+ </ng-container>
+
+ <tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
+ <tr mat-row *matRowDef="let row; columns: displayedColumns"></tr>
+ </table>
+
+ @if (availableExportProviders.length === 0) {
+ <div>
+ <h5>{{ 'no stored export providers' | translate }}</h5>
+ </div>
+ }
+ </sp-split-section>
+}
diff --git a/streampipes-audit-api/src/main/java/org/apache/streampipes/audit/api/AuditEventStore.java b/ui/src/app/configuration/export/export-provider-configuration/export-provider-configuration.component.scss
similarity index 67%
copy from streampipes-audit-api/src/main/java/org/apache/streampipes/audit/api/AuditEventStore.java
copy to ui/src/app/configuration/export/export-provider-configuration/export-provider-configuration.component.scss
index 501f29799d..fd0c56b20c 100644
--- a/streampipes-audit-api/src/main/java/org/apache/streampipes/audit/api/AuditEventStore.java
+++ b/ui/src/app/configuration/export/export-provider-configuration/export-provider-configuration.component.scss
@@ -16,17 +16,6 @@
*
*/
-package org.apache.streampipes.audit.api;
-
-/** Append contract. Browsing is defined separately by AuditEventReader. */
-public interface AuditEventStore extends AutoCloseable {
- /** Called on the audit worker at startup; implementations may provision storage idempotently. */
- default void initialize() {
- }
-
- void append(AuditEvent<?> event);
-
- @Override
- default void close() {
- }
+.export-provider-table {
+ width: 100%;
}
diff --git a/ui/src/app/configuration/export/export-provider-configuration/export-provider-configuration.component.ts b/ui/src/app/configuration/export/export-provider-configuration/export-provider-configuration.component.ts
new file mode 100644
index 0000000000..94aff60697
--- /dev/null
+++ b/ui/src/app/configuration/export/export-provider-configuration/export-provider-configuration.component.ts
@@ -0,0 +1,176 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+import {
+ ChangeDetectionStrategy,
+ Component,
+ inject,
+ OnInit,
+} from '@angular/core';
+import { MatButton, MatIconButton } from '@angular/material/button';
+import { MatIcon } from '@angular/material/icon';
+import { MatSort, MatSortHeader } from '@angular/material/sort';
+import {
+ MatCell,
+ MatCellDef,
+ MatColumnDef,
+ MatHeaderCell,
+ MatHeaderCellDef,
+ MatHeaderRow,
+ MatHeaderRowDef,
+ MatRow,
+ MatRowDef,
+ MatTable,
+ MatTableDataSource,
+} from '@angular/material/table';
+import { MatTooltip } from '@angular/material/tooltip';
+import { TranslatePipe, TranslateService } from '@ngx-translate/core';
+import {
+ FlexDirective,
+ LayoutAlignDirective,
+ LayoutGapDirective,
+} from '@ngbracket/ngx-layout/flex';
+import {
+ ExportProviderService,
+ ExportProviderSettings,
+} from '@streampipes/platform-services';
+import {
+ CurrentUserService,
+ DialogRef,
+ DialogService,
+ PanelType,
+ SplitSectionComponent,
+} from '@streampipes/shared-ui';
+import { UserRole } from '../../../core/auth/user-role.enum';
+import { DeleteExportProviderComponent } from '../../../dataset/dialog/delete-export-provider/delete-export-provider-dialog.component';
+import { ExportProviderConnectionTestComponent } from '../../../dataset/dialog/export-provider-connection-test/export-provider-connection-test.component';
+import { ExportProviderComponent } from '../../../dataset/dialog/export-provider-dialog/export-provider-dialog.component';
+
+@Component({
+ selector: 'sp-export-provider-configuration',
+ templateUrl: './export-provider-configuration.component.html',
+ styleUrls: ['./export-provider-configuration.component.scss'],
+ changeDetection: ChangeDetectionStrategy.Eager,
+ imports: [
+ FlexDirective,
+ LayoutAlignDirective,
+ LayoutGapDirective,
+ MatButton,
+ MatCell,
+ MatCellDef,
+ MatColumnDef,
+ MatHeaderCell,
+ MatHeaderCellDef,
+ MatHeaderRow,
+ MatHeaderRowDef,
+ MatIcon,
+ MatIconButton,
+ MatRow,
+ MatRowDef,
+ MatSort,
+ MatSortHeader,
+ MatTable,
+ MatTooltip,
+ SplitSectionComponent,
+ TranslatePipe,
+ ],
+})
+export class ExportProviderConfigurationComponent implements OnInit {
+ private currentUserService = inject(CurrentUserService);
+ private dialogService = inject(DialogService);
+ private exportProviderService = inject(ExportProviderService);
+ private translateService = inject(TranslateService);
+
+ availableExportProviders: ExportProviderSettings[] = [];
+ dataSource = new MatTableDataSource<ExportProviderSettings>([]);
+ displayedColumns: string[] = [
+ 'providertype',
+ 'endpoint',
+ 'bucket',
+ 'editExportProvider',
+ 'delete',
+ 'test',
+ ];
+ isAdmin = false;
+
+ ngOnInit(): void {
+ this.isAdmin = this.currentUserService
+ .getCurrentUser()
+ .roles.includes(UserRole.ROLE_ADMIN);
+
+ if (this.isAdmin) {
+ this.loadExportProviders();
+ }
+ }
+
+ loadExportProviders(): void {
+ this.availableExportProviders = [];
+ this.exportProviderService
+ .getAllExportProviders()
+ .subscribe(exportProviders => {
+ this.availableExportProviders = exportProviders;
+ this.dataSource.data = exportProviders;
+ });
+ }
+
+ createExportProvider(provider: ExportProviderSettings | null): void {
+ const dialogRef: DialogRef<ExportProviderComponent> =
+ this.dialogService.open(ExportProviderComponent, {
+ panelType: PanelType.SLIDE_IN_PANEL,
+ title: this.translateService.instant('New Export Provider'),
+ width: '50vw',
+ data: { provider },
+ });
+
+ dialogRef.afterClosed().subscribe(() => this.loadExportProviders());
+ }
+
+ deleteExportProvider(providerId: string): void {
+ const dialogRef: DialogRef<DeleteExportProviderComponent> =
+ this.dialogService.open(DeleteExportProviderComponent, {
+ panelType: PanelType.STANDARD_PANEL,
+ title: this.translateService.instant('Delete Export Provider'),
+ width: '70vw',
+ data: { providerId },
+ });
+
+ dialogRef.afterClosed().subscribe(changed => {
+ if (changed) {
+ this.loadExportProviders();
+ }
+ });
+ }
+
+ testExportProvider(providerId: string): void {
+ const dialogRef: DialogRef<ExportProviderConnectionTestComponent> =
+ this.dialogService.open(ExportProviderConnectionTestComponent, {
+ panelType: PanelType.STANDARD_PANEL,
+ title: this.translateService.instant(
+ 'Test Export Provider Connection',
+ ),
+ width: '70vw',
+ data: { providerId },
+ });
+
+ dialogRef.afterClosed().subscribe(changed => {
+ if (changed) {
+ this.loadExportProviders();
+ }
+ });
+ }
+}
diff --git a/ui/src/app/dataset/components/dataset-overview/dataset-overview.component.html b/ui/src/app/dataset/components/dataset-overview/dataset-overview.component.html
index 42c64feddf..e2c50c9434 100644
--- a/ui/src/app/dataset/components/dataset-overview/dataset-overview.component.html
+++ b/ui/src/app/dataset/components/dataset-overview/dataset-overview.component.html
@@ -262,206 +262,5 @@
</ng-template>
</sp-table>
</div>
- @if (isAdmin) {
- <sp-split-section
- class="mt-xl"
- [level]="2"
- [title]="'Export Providers' | translate"
- [subtitle]="
- 'Add, Edit, and Delete export providers used for backing up data lakes.'
- | translate
- "
- >
- <div
- section-actions
- fxLayoutAlign="end center"
- fxLayoutGap="10px"
- >
- <button
- mat-flat-button
- matTooltip="{{ 'New' | translate }}"
- data-cy="new-export-providers"
- (click)="createExportProvider(null)"
- >
- <mat-icon>add</mat-icon>
- <span>{{ 'New' | translate }}</span>
- </button>
- <button
- mat-icon-button
- matTooltip="{{ 'Refresh' | translate }}"
- data-cy="refresh-export-providers-measures"
- (click)="loadAvailableExportProvider()"
- >
- <mat-icon>refresh</mat-icon>
- </button>
- </div>
-
- <table
- fxFlex="100"
- mat-table
- data-cy="exportproviders-settings"
- [dataSource]="dataSourceExport"
- style="width: 100%"
- matSort
- >
- <ng-container matColumnDef="providertype">
- <th mat-header-cell mat-sort-header *matHeaderCellDef>
- {{ 'Provider Type' | translate }}
- </th>
- <td mat-cell *matCellDef="let configurationEntry">
- {{ configurationEntry.providerType }}
- </td>
- </ng-container>
-
- <ng-container matColumnDef="endpoint">
- <th mat-header-cell mat-sort-header *matHeaderCellDef>
- {{ 'Endpoint' | translate }}
- </th>
- <td mat-cell *matCellDef="let configurationEntry">
- {{ configurationEntry.endPoint }}
- </td>
- </ng-container>
-
- <ng-container matColumnDef="bucket">
- <th mat-header-cell mat-sort-header *matHeaderCellDef>
- {{ 'Bucket' | translate }}
- </th>
- <td mat-cell *matCellDef="let configurationEntry">
- {{ configurationEntry.bucketName }}
- </td>
- </ng-container>
-
- <ng-container matColumnDef="editExportProvider">
- <th mat-header-cell *matHeaderCellDef>
- {{ 'Edit' | translate }}
- </th>
- <td mat-cell *matCellDef="let configurationEntry">
- @if (configurationEntry.providerId !== 'FOLDER') {
- <div>
- <div fxLayout="row">
- <span
- fxFlex
- fxFlexOrder="3"
- fxLayout="row"
- fxLayoutAlign="start center"
- >
- <button
- color="accent"
- mat-icon-button
- matTooltip="{{
- 'Edit Export Provider'
- | translate
- }}"
- matTooltipPosition="above"
- data-cy="exportProvider-edit-btn"
- (click)="
- createExportProvider(
- configurationEntry
- )
- "
- >
- <mat-icon>edit</mat-icon>
- </button>
- </span>
- </div>
- </div>
- }
- </td>
- </ng-container>
-
- <ng-container matColumnDef="delete">
- <th mat-header-cell *matHeaderCellDef>
- {{ 'Remove' | translate }}
- </th>
- <td mat-cell *matCellDef="let configurationEntry">
- @if (configurationEntry.providerId !== 'FOLDER') {
- <div>
- <div fxLayout="row">
- <span
- fxFlex
- fxFlexOrder="3"
- fxLayout="row"
- fxLayoutAlign="start center"
- >
- <button
- color="accent"
- mat-icon-button
- matTooltip="{{
- 'Remove export provider configuration'
- | translate
- }}"
- data-cy="exportProvider-delete-btn"
- matTooltipPosition="above"
- (click)="
- deleteExportProvider(
- configurationEntry.providerId
- )
- "
- >
- <mat-icon>delete</mat-icon>
- </button>
- </span>
- </div>
- </div>
- }
- </td>
- </ng-container>
-
- <ng-container matColumnDef="test">
- <th mat-header-cell *matHeaderCellDef>
- {{ 'Test' | translate }}
- </th>
- <td mat-cell *matCellDef="let configurationEntry">
- <div>
- <div fxLayout="row">
- <span
- fxFlex
- fxFlexOrder="3"
- fxLayout="row"
- fxLayoutAlign="start center"
- >
- <button
- color="accent"
- mat-icon-button
- matTooltip="{{
- 'Test export provider configuration'
- | translate
- }}"
- data-cy="exportProvider-test-btn"
- matTooltipPosition="above"
- (click)="
- testExportProvider(
- configurationEntry.providerId
- )
- "
- >
- <mat-icon>bug_report</mat-icon>
- </button>
- </span>
- </div>
- </div>
- </td>
- </ng-container>
-
- <tr
- mat-header-row
- *matHeaderRowDef="displayedColumnsExport"
- ></tr>
- <tr
- mat-row
- *matRowDef="let row; columns: displayedColumnsExport"
- ></tr>
- </table>
-
- @if (
- !availableExportProvider ||
- availableExportProvider.length === 0
- ) {
- <div>
- <h5>{{ 'no stored export providers' | translate }}</h5>
- </div>
- }
- </sp-split-section>
- }
</div>
</sp-basic-view>
diff --git a/ui/src/app/dataset/components/dataset-overview/dataset-overview.component.ts b/ui/src/app/dataset/components/dataset-overview/dataset-overview.component.ts
index 97fb19c464..3087ffc792 100644
--- a/ui/src/app/dataset/components/dataset-overview/dataset-overview.component.ts
+++ b/ui/src/app/dataset/components/dataset-overview/dataset-overview.component.ts
@@ -33,11 +33,6 @@ import {
MatColumnDef,
MatHeaderCell,
MatHeaderCellDef,
- MatHeaderRow,
- MatHeaderRowDef,
- MatRow,
- MatRowDef,
- MatTable,
MatTableDataSource,
} from '@angular/material/table';
import { DatasetOverviewEntry } from './dataset-overview-entry';
@@ -45,8 +40,6 @@ import {
DatasetMetadata,
DatalakeRestService,
DatasetSummaryDto,
- ExportProviderService,
- ExportProviderSettings,
} from '@streampipes/platform-services';
import { MatPaginator } from '@angular/material/paginator';
import { MatSort, MatSortHeader } from '@angular/material/sort';
@@ -62,7 +55,6 @@ import {
SpAssetBrowserService,
SpBasicViewComponent,
SpBreadcrumbService,
- SplitSectionComponent,
SpPageHeaderComponent,
SpSpinnerComponent,
SpTableActionsDirective,
@@ -74,10 +66,7 @@ import {
import { DeleteDatasetDialogComponent } from '../../dialog/delete-dataset/delete-dataset-dialog.component';
import { SpConfigurationRoutes } from '../../../configuration/configuration.breadcrumb';
import { DataRetentionDialogComponent } from '../../dialog/data-retention-dialog/data-retention-dialog.component';
-import { ExportProviderComponent } from '../../dialog/export-provider-dialog/export-provider-dialog.component';
-import { DeleteExportProviderComponent } from '../../dialog/delete-export-provider/delete-export-provider-dialog.component';
import { TranslatePipe, TranslateService } from '@ngx-translate/core';
-import { ExportProviderConnectionTestComponent } from '../../dialog/export-provider-connection-test/export-provider-connection-test.component';
import { DataRetentionLogDialogComponent } from '../../dialog/data-retention-log-dialog/data-retention-log-dialog.component';
import { UserPrivilege } from '../../../core/auth/user-privilege.enum';
import { UserRole } from '../../../core/auth/user-role.enum';
@@ -125,11 +114,6 @@ import { DatasetLastEventLabelComponent } from './dataset-last-event-label/datas
StyleDirective,
MatMenuItem,
MatButton,
- MatTable,
- MatHeaderRowDef,
- MatHeaderRow,
- MatRowDef,
- MatRow,
TranslatePipe,
SpTableComponent,
SpBasicViewComponent,
@@ -137,7 +121,6 @@ import { DatasetLastEventLabelComponent } from './dataset-last-event-label/datas
SpTableActionsDirective,
DatasetLastEventLabelComponent,
AsyncPipe,
- SplitSectionComponent,
],
})
export class DatasetOverviewComponent
@@ -151,7 +134,6 @@ export class DatasetOverviewComponent
private datasetRestService = inject(DatalakeRestService);
private dialogService = inject(DialogService);
private breadcrumbService = inject(SpBreadcrumbService);
- private exportProviderRestService = inject(ExportProviderService);
private translateService = inject(TranslateService);
private currentUserService = inject(CurrentUserService);
private assetFilterService = inject(SpAssetBrowserService);
@@ -163,15 +145,11 @@ export class DatasetOverviewComponent
new MatTableDataSource([]);
availableDatasets: DatasetOverviewEntry[] = [];
filteredDatasets: DatasetOverviewEntry[] = [];
- availableExportProvider: ExportProviderSettings[] = [];
readonly assetContextConfig: SpTableAssetContextConfig = {
resourceLinkType: 'dataset',
resourceIdKey: 'elementId',
};
- dataSourceExport: MatTableDataSource<ExportProviderSettings> =
- new MatTableDataSource([]);
-
readonly bulkDatasetActionOptions: SpTableMultiActionOption[] = [
{
value: 'truncate',
@@ -234,15 +212,6 @@ export class DatasetOverviewComponent
'actions',
];
- displayedColumnsExport: string[] = [
- 'providertype',
- 'endpoint',
- 'bucket',
- 'editExportProvider',
- 'delete',
- 'test',
- ];
-
private localStorageService = inject(LocalStorageService);
pageSize = this.localStorageService.get('paginator-page-size', 10);
@@ -277,7 +246,6 @@ export class DatasetOverviewComponent
{ label: 'Datasets' },
]);
this.loadAvailableDatasets();
- this.loadAvailableExportProvider();
const currentUser = this.currentUserService.getCurrentUser();
this.isAdmin = currentUser.roles.indexOf(UserRole.ROLE_ADMIN) > -1;
this.writeAccess =
@@ -300,16 +268,6 @@ export class DatasetOverviewComponent
this.assetFilter$?.unsubscribe();
}
- loadAvailableExportProvider(): void {
- this.availableExportProvider = [];
- this.exportProviderRestService
- .getAllExportProviders()
- .subscribe(allExportProviders => {
- this.availableExportProvider = allExportProviders;
- this.dataSourceExport.data = this.availableExportProvider;
- });
- }
-
loadAvailableDatasets(): void {
this.availableDatasets = [];
this.datasetRestService
@@ -363,22 +321,6 @@ export class DatasetOverviewComponent
}
}
- createExportProvider(provider: ExportProviderSettings | null): void {
- const dialogRef: DialogRef<ExportProviderComponent> =
- this.dialogService.open(ExportProviderComponent, {
- panelType: PanelType.SLIDE_IN_PANEL,
- title: this.translateService.instant('New Export Provider'),
- width: '50vw',
- data: {
- provider: provider,
- },
- });
-
- dialogRef.afterClosed().subscribe(() => {
- this.loadAvailableExportProvider();
- });
- }
-
truncateDataset(datasetName: string): void {
const dialogRef: DialogRef<DeleteDatasetDialogComponent> =
this.dialogService.open(DeleteDatasetDialogComponent, {
@@ -417,43 +359,6 @@ export class DatasetOverviewComponent
});
}
- deleteExportProvider(providerId: string): void {
- const dialogRef: DialogRef<DeleteExportProviderComponent> =
- this.dialogService.open(DeleteExportProviderComponent, {
- panelType: PanelType.STANDARD_PANEL,
- title: this.translateService.instant('Delete Export Provider'),
- width: '70vw',
- data: {
- providerId: providerId,
- },
- });
-
- dialogRef.afterClosed().subscribe(data => {
- if (data) {
- this.loadAvailableExportProvider();
- }
- });
- }
- testExportProvider(providerId: string): void {
- const dialogRef: DialogRef<ExportProviderConnectionTestComponent> =
- this.dialogService.open(ExportProviderConnectionTestComponent, {
- panelType: PanelType.STANDARD_PANEL,
- title: this.translateService.instant(
- 'Test Export Provider Connection',
- ),
- width: '70vw',
- data: {
- providerId: providerId,
- },
- });
-
- dialogRef.afterClosed().subscribe(data => {
- if (data) {
- this.loadAvailableExportProvider();
- }
- });
- }
-
openDownloadDialog(datasetName: string): void {
this.dialogService.open(DataDownloadDialogComponent, {
panelType: PanelType.SLIDE_IN_PANEL,